simplified aToSlices
This commit is contained in:
parent
c82c4dc85d
commit
9dbe6c7a79
1 changed files with 3 additions and 3 deletions
|
@ -199,12 +199,12 @@ invAcc a accumStr i (c:t) = let writeAcc = getWrite i accumStr
|
||||||
in if isNothing writeAcc
|
in if isNothing writeAcc
|
||||||
then invAcc a (accumStr ++ [c]) i t -- no assignment in accumStr, don't advance offset
|
then invAcc a (accumStr ++ [c]) i t -- no assignment in accumStr, don't advance offset
|
||||||
else invAcc (a ++ [fromJust writeAcc]) [c] (i+(length accumStr)) t -- assignment in accumStr, advance offset to end
|
else invAcc (a ++ [fromJust writeAcc]) [c] (i+(length accumStr)) t -- assignment in accumStr, advance offset to end
|
||||||
invAcc a _ _ _ = aToSlices a []
|
invAcc a _ _ _ = map (\(_,s,_) -> s) a
|
||||||
where aToSlices (a:as) slices = let a2 = (\(v,s,b) -> (s,b)) a
|
{-where aToSlices (a:as) slices = let a2 = (\(v,s,b) -> (s,b)) a
|
||||||
in if snd a2
|
in if snd a2
|
||||||
then aToSlices as slices
|
then aToSlices as slices
|
||||||
else aToSlices as ((fst a2):slices)
|
else aToSlices as ((fst a2):slices)
|
||||||
aToSlices _ slices = slices
|
aToSlices _ slices = slices-}
|
||||||
|
|
||||||
getWrite :: Int -> String -> Maybe (String, Slice, Bool)
|
getWrite :: Int -> String -> Maybe (String, Slice, Bool)
|
||||||
getWrite offset accumStr = ((Tdfa.matchOnceText §~ "(\\**[[:word:]]+)[[:blank:]]*=") accumStr) >>= matchToA
|
getWrite offset accumStr = ((Tdfa.matchOnceText §~ "(\\**[[:word:]]+)[[:blank:]]*=") accumStr) >>= matchToA
|
||||||
|
|
Loading…
Reference in a new issue