This commit is contained in:
Johannes Winklehner 2016-08-28 21:38:23 +02:00
commit ac8b6c282d

View file

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