Closed abhin4v closed 3 years ago
Haskell code highlighting with version 0.8.5:
Haskell code highlighting with version 0.10.4.1:
I suspect it has something to do with the way Haskell characters are detected.
Code snippet in the image for testing purpose:
jsonChar :: Parser String Char jsonChar = string "\\\"" $> '"' <|> string "\\\\" $> '\\' <|> string "\\/" $> '/' <|> string "\\b" $> '\b' <|> string "\\f" $> '\f' <|> string "\\n" $> '\n' <|> string "\\r" $> '\r' <|> string "\\t" $> '\t' <|> unicodeChar <|> satisfy (\c -> not (c == '\"' || c == '\\' || isControl c)) where unicodeChar = chr . fromIntegral . digitsToNumber 16 0 <$> (string "\\u" *> replicateM 4 hexDigit) hexDigit = digitToInt <$> satisfy isHexDigit digitsToNumber :: Int -> Integer -> [Int] -> Integer digitsToNumber base = foldl (\num d -> num * fromIntegral base + fromIntegral d)
Simpler case:
c = '"' -- this fails
Here the comment is parsed as a StringTok.
I see the problem. I made a mistake when reimplementing PR #40 (DetectChar instead of RegExpr). Should have a fix shortly.
Haskell code highlighting with version 0.8.5:
Haskell code highlighting with version 0.10.4.1:
I suspect it has something to do with the way Haskell characters are detected.
Code snippet in the image for testing purpose: