endIndex simplified

This commit is contained in:
Armin Friedl 2016-08-29 11:31:43 +02:00
parent ebf4dafaf3
commit 55d002a4e7

View file

@ -206,7 +206,7 @@ getWrite :: Int -> String -> Maybe (String, Slice, Bool)
getWrite offset s = ((Tdfa.matchOnceText §~ "^(\\**[[:word:]]+)[[:blank:]]*=") s) >>= matchToA
where matchToA (before, match, after) =
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)
in Just (fst m, (offset+(fst (snd m)), offset+(length (fst m))), False)
enterBlock :: [(String,Slice,Bool)] -> [(String,Slice,Bool)]
enterBlock = map (\(v,s,b) -> ('*':v,s,b))