on master help sign in
Text.Lexer: fix bug in charLit

Previously, it would recognise `'''` as valid but not `'"'`, due to its use of strChar.

commit5d46db6d5b30da3391c47778b7ccf659f8a4d4e2 authorMichael Morgan <morgan.michael@me.com> dateSun 27 Aug 2017, 21:58 (9 years ago) parentde2dfc2
1 file changed+2−1
libs/contrib/Text/Lexer.idr+2−1
libs/contrib/Text/Lexer.idr+2−1
@@ -177,7 +177,8 @@ stringLit = is '"' <+> many strChar <+> is '"'
177177||| (Note: doesn't yet handle escape sequences such as \123)
178178export
179179charLit : Lexer
180−charLit = is '\'' <+> strChar <+> is '\''
180+charLit = let q = '\'' in
181+ is q <+> ((is '\\' <+> any) <|> isNot q) <+> is q
181182
182183||| Recognise an integer literal (possibly with a '-' prefix)
183184export