on master help sign in
Text.Lexer: fix bug in charLit
5d46db6Michael Morgan
libs/contrib/Text/Lexer.idr+2−1
@@ -177,7 +177,8 @@ stringLit = is '"' <+> many strChar <+> is '"'
177||| (Note: doesn't yet handle escape sequences such as \123)
177||| (Note: doesn't yet handle escape sequences such as \123)
178export
178export
179charLit : Lexer
179charLit : Lexer
180−charLit = is '\'' <+> strChar <+> is '\''
180+charLit = let q = '\'' in
181+ is q <+> ((is '\\' <+> any) <|> isNot q) <+> is q
181
182
182||| Recognise an integer literal (possibly with a '-' prefix)
183||| Recognise an integer literal (possibly with a '-' prefix)
183export
184export