return font doesn't overwrite invalidAssignment stub now
This commit is contained in:
parent
ea7d2dff2c
commit
ff7506927b
1 changed files with 9 additions and 6 deletions
|
@ -70,9 +70,10 @@ fontMap = [ (attrName "assignment" , fg Vty.blue)
|
||||||
]
|
]
|
||||||
|
|
||||||
fontify :: CheckString -> Fontifications
|
fontify :: CheckString -> Fontifications
|
||||||
fontify = concatApply [ assignments, invalidAccess
|
fontify = concatApply [ assignments, strings
|
||||||
, strings, returns, guards
|
, returns, guards, comments
|
||||||
, comments, mismatchedBrackets
|
, invalidAccess
|
||||||
|
, mismatchedBrackets
|
||||||
, mismatchedQuotes]
|
, mismatchedQuotes]
|
||||||
|
|
||||||
concatApply :: [Fontifier] -> CheckString -> Fontifications
|
concatApply :: [Fontifier] -> CheckString -> Fontifications
|
||||||
|
@ -97,11 +98,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 ---}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue