createPatBuffer insensitive
= _casm_ ``%r = (int)sizeof(struct re_pattern_buffer);'' >>= \ sz ->
- stToIO (newCharArray (0,sz)) >>= \ (MutableByteArray _ pbuf#) ->
+ stToIO (newCharArray (0::Int,sz)) >>= \ (MutableByteArray _ pbuf#) ->
let
pbuf = PatBuffer# pbuf#
in
(lengthPS str)
start
regs >>= \ match_res ->
- if match_res == (-2) then
+ if match_res == ((-2)::Int) then
error "re_match: Internal error"
else if match_res < 0 then
_casm_ ``free((struct re_registers *)%0); '' regs >>
start
regs
stop >>= \ match_res ->
- if match_res == (-2) then
+ if match_res == ((-2)::Int) then
error "re_match2: Internal error"
else if match_res < 0 then
_casm_ ``free((struct re_registers *)%0); '' regs >>
start
range
regs >>= \ match_res ->
- if match_res== (-1) then
+ if match_res== ((-1)::Int) then
_casm_ `` free((struct re_registers *)%0); '' regs >>
return Nothing
else
range
regs
stop >>= \ match_res ->
- if match_res== (-1) then
+ if match_res== ((-1)::Int) then
_casm_ `` free((struct re_registers *)%0); '' regs >>
return Nothing
else
aft
lst)
where
- match_reg_to_array regs len
- = trundleIO regs (0,[]) len >>= \ (no,ls) ->
+ match_reg_to_array rs len
+ = trundleIO rs (0,[]) len >>= \ (no,ls) ->
let
(st,end,ls')
= case ls of
-> Int
-> IO (Int,[(Int,Int)])
- trundleIO regs (i,acc) len
+ trundleIO rs (i,acc) len
| i==len = return (i,reverse acc)
| otherwise
- = _casm_ ``%r = (int)(((struct re_registers *)%0)->start)[(int)%1];'' regs i >>= \ start ->
- _casm_ ``%r = (int)(((struct re_registers *)%0)->end)[(int)%1];'' regs i >>= \ end ->
+ = _casm_ ``%r = (int)(((struct re_registers *)%0)->start)[(int)%1];'' rs i >>= \ start ->
+ _casm_ ``%r = (int)(((struct re_registers *)%0)->end)[(int)%1];'' rs i >>= \ end ->
let
acc' = (start,end):acc
in
if (start == (-1)) && (end == (-1)) then
return (i,reverse acc)
else
- trundleIO regs (i+1,acc') len
+ trundleIO rs (i+1,acc') len
\end{code}