Merge branch 'master' of https://bitbucket.org/prosa16/ass3
This commit is contained in:
commit
ac8b6c282d
1 changed files with 6 additions and 3 deletions
|
@ -74,6 +74,7 @@ fontMap = [ (attrName "assignment" , fg Vty.blue)
|
|||
fontify :: CheckString -> Fontifications
|
||||
fontify = concatApply [ assignments, strings
|
||||
, returns, guards, comments
|
||||
, invalidAccess
|
||||
, mismatchedBrackets
|
||||
, mismatchedQuotes]
|
||||
|
||||
|
@ -99,11 +100,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 ---}
|
||||
|
||||
|
|
Loading…
Reference in a new issue