diff --git a/src/App/Fontifier.hs b/src/App/Fontifier.hs index ce24ada..81d1b1d 100644 --- a/src/App/Fontifier.hs +++ b/src/App/Fontifier.hs @@ -212,6 +212,13 @@ getWrite offset accumStr = ((Tdfa.matchOnceText §~ "(\\**[[:word:]]+)[[:blank:] let m = match ! 1 -- extract the match group (0 = the whole match) in Just (fst m, (offset+(fst (snd m)), offset+(fst (snd m))+(snd (snd m))), False) +getWrites :: CheckString -> [(String, Slice, Bool)] +getWrites s = matchToAs $ (Tdfa.matchAllText §~ "(\\**[[:word:]]+)[[:blank:]]*=") s + where matchToAs (match: mts) = + let m = match ! 1 -- extract the match group (0 = the whole match) + in (fst m, (fst (snd m), (fst (snd m))+(snd (snd m))), False): matchToAs mts + matchToAs _ = [] + enterBlock :: [(String,Slice,Bool)] -> [(String,Slice,Bool)] enterBlock = map (\(v,s,b) -> ('*':v,s,b))