return font doesn't overwrite invalidAssignment stub now

This commit is contained in:
Armin Friedl 2016-08-28 21:14:27 +02:00
parent ea7d2dff2c
commit ff7506927b

View file

@ -70,9 +70,10 @@ fontMap = [ (attrName "assignment" , fg Vty.blue)
]
fontify :: CheckString -> Fontifications
fontify = concatApply [ assignments, invalidAccess
, strings, returns, guards
, comments, mismatchedBrackets
fontify = concatApply [ assignments, strings
, returns, guards, comments
, invalidAccess
, mismatchedBrackets
, mismatchedQuotes]
concatApply :: [Fontifier] -> CheckString -> Fontifications
@ -97,11 +98,13 @@ guards = slicesToFT §: "guard" §. matchGrpStripCmts 1 §~ "\\[([^
mismatchedBrackets s = concatMap (mismatched §: "err_brackets" $ s) [('(',')'),('[',']'),('{','}')]
invalidAccess s = (slicesToFT §: "err_read" $ invalidReads s) ++
(slicesToFT §: "err_write" $ invalidWrites s)
invalidAccess s = let strip = prune $ (comments s) ++ (strings s) in -- removes strings and comments from fontification
(slicesToFT §: "err_read" $ strip $ invalidReads s) ++
(slicesToFT §: "err_write" $ strip $ invalidWrites s)
-- (alternative if easier than invalid read/invalid write separated)
-- invalidAccess = slicesToFT §: "err_access" $ invAcc
-- invalidAccess s = let strip = prune $ (comments s) ++ (strings s) in
-- slicesToFT §: "err_access" $ strip $ invAcc s
{--- Utility Functions ---}