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 :: 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 ---}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue