fixed offset after matches
This commit is contained in:
parent
1e62767b87
commit
380ed86ccf
1 changed files with 4 additions and 4 deletions
|
@ -205,10 +205,10 @@ invAcc a i s@(c:t) = let writeAcc = getWrite i s
|
||||||
then if isNothing readAcc
|
then if isNothing readAcc
|
||||||
then invAcc a (i+1) t
|
then invAcc a (i+1) t
|
||||||
else if isUnassigned (fromJust readAcc) a -- no assignment in rest str
|
else if isUnassigned (fromJust readAcc) a -- no assignment in rest str
|
||||||
then (snd (fromJust readAcc)) : (invAcc a (i+1+readLen) (drop readLen t))
|
then (snd (fromJust readAcc)) : (invAcc a (i+readLen) (drop readLen s))
|
||||||
else invAcc (markRead (fromJust readAcc) a) (i+1+readLen) (drop readLen t)
|
else invAcc (markRead (fromJust readAcc) a) (i+readLen) (drop readLen s)
|
||||||
else invAcc (a ++ [fromJust writeAcc]) (i+1+matchLen) (drop matchLen t) -- assignment in accumStr, advance offset to end
|
else invAcc (a ++ [fromJust writeAcc]) (i+matchLen) (drop matchLen s) -- assignment in accumStr, advance offset to end
|
||||||
invAcc a _ _ = []
|
invAcc _ _ _ = []
|
||||||
|
|
||||||
getWrite :: Int -> String -> Maybe (String, Slice, Bool)
|
getWrite :: Int -> String -> Maybe (String, Slice, Bool)
|
||||||
getWrite offset s = ((Tdfa.matchOnceText §~ "^(\\**[[:word:]]+)[[:blank:]]*=") s) >>= matchToA
|
getWrite offset s = ((Tdfa.matchOnceText §~ "^(\\**[[:word:]]+)[[:blank:]]*=") s) >>= matchToA
|
||||||
|
|
Loading…
Reference in a new issue