packages feed

skylighting-core 0.8.1.2 → 0.8.2

raw patch · 4 files changed

+14/−3 lines, 4 files

Files

changelog.md view
@@ -1,5 +1,11 @@ # Revision history for skylighting and skylighting-core +## 0.8.2 -- 2019-07-14++  * Change matchRegex so it gives "no match" on a regex error+    instead of raising an exception. This seems to be how Kate+    works.  Fixes an error on long integer literals (#81).+ ## 0.8.1.2 -- 2019-07-14    * Fix HlCChar for one-character octal escapes like '\0' (#82).
skylighting-core.cabal view
@@ -1,5 +1,5 @@ name:                skylighting-core-version:             0.8.1.2+version:             0.8.2 synopsis:            syntax highlighting library description:         Skylighting is a syntax highlighting library.                      It derives its tokenizers from XML syntax
src/Skylighting/Regex.hs view
@@ -94,8 +94,9 @@ matchRegex r s = case unsafePerformIO (regexec r s) of                       Right (Just (_, mat, _ , capts)) ->                                        Just (mat : capts)-                      Right Nothing -> Nothing-                      Left (_rc, msg) -> E.throw $ RegexException msg+                      Right Nothing    -> Nothing+                      -- treat match error as no match, like Kate: #81+                      Left (_rc, _msg) -> Nothing  -- functions to marshall bytestrings to text 
test/test-skylighting.hs view
@@ -152,6 +152,10 @@       , testCase "c '\\0' (#82)" $ Right            [ [ (CharTok,"'\\0'") ]            ] @=? tokenize defConfig c "'\\0'"++      , testCase "c very long integer (#81)" $ Right+           [ [ (DecValTok, "1111111111111111111111") ]+           ] @=? tokenize defConfig c "1111111111111111111111"       ]     ]