From 158596580104232ee48288c2dfac2ab554e1d1db Mon Sep 17 00:00:00 2001 From: Johannes Winklehner Date: Mon, 29 Aug 2016 12:43:44 +0200 Subject: [PATCH] read assignments no longer marked --- src/App/Fontifier.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/App/Fontifier.hs b/src/App/Fontifier.hs index b984c77..aec75e2 100644 --- a/src/App/Fontifier.hs +++ b/src/App/Fontifier.hs @@ -202,11 +202,11 @@ invAcc a i s@(c:t) = let writeAcc = getWrite i s in if isNothing writeAcc then if isNothing readAcc 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)) - 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 -invAcc a _ _ = map (\(_,s,_) -> s) a +invAcc a _ _ = [] getWrite :: Int -> String -> Maybe (String, Slice, Bool) 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 [] = [] getUnread ((v,s,b):ss) - | b = getUnread ss + | b || head v == '*' = getUnread ss | otherwise = s:getUnread ss {- General Fontification Utilities -}