read assignments no longer marked

This commit is contained in:
Johannes Winklehner 2016-08-29 12:43:44 +02:00
parent 57f262554b
commit 1585965801

View file

@ -202,11 +202,11 @@ invAcc a i s@(c:t) = let writeAcc = getWrite i s
in if isNothing writeAcc in if isNothing writeAcc
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 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+1+readLen) (drop readLen t))
else invAcc (markRead (fromJust readAcc) a) (i+1+readLen) (drop readLen t) -- no assignment in rest str TODO check for reads here else invAcc (markRead (fromJust readAcc) a) (i+1+readLen) (drop readLen t)
else invAcc (a ++ [fromJust writeAcc]) (i+1+matchLen) (drop matchLen t) -- assignment in accumStr, advance offset to end else invAcc (a ++ [fromJust writeAcc]) (i+1+matchLen) (drop matchLen t) -- assignment in accumStr, advance offset to end
invAcc a _ _ = map (\(_,s,_) -> s) a invAcc a _ _ = []
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
@ -238,7 +238,7 @@ leaveBlock = map (\(v,s,b) -> (tail v,s,b)) . filter (\(v,_,_) -> head v == '*')
getUnread :: [(String,Slice,Bool)] -> Slices getUnread :: [(String,Slice,Bool)] -> Slices
getUnread [] = [] getUnread [] = []
getUnread ((v,s,b):ss) getUnread ((v,s,b):ss)
| b = getUnread ss | b || head v == '*' = getUnread ss
| otherwise = s:getUnread ss | otherwise = s:getUnread ss
{- General Fontification Utilities -} {- General Fontification Utilities -}