on master help sign in
Text.Lexer: refactoring
commit0482a74fe08c7cd7e1f63abbd012e133e1e62cc5 authorMichael Morgan <morgan.michael@me.com> dateWed 6 Sep 2017, 17:45 (9 years ago) parentf925538
1 file changed+2−2
libs/contrib/Text/Lexer.idr+2−2
libs/contrib/Text/Lexer.idr+2−2
@@ -220,7 +220,7 @@ digits = some digit
220220||| Recognise a single hexidecimal digit
221221export
222222hexDigit : Lexer
223−hexDigit = digit <|> oneOf "abcdefABCDEF"
223+hexDigit = pred isHexDigit
224224
225225||| Recognise one or more hexidecimal digits
226226export
@@ -325,7 +325,7 @@ intLit = opt (is '-') <+> digits
325325||| Recognise a hexidecimal literal, prefixed by "0x" or "0X"
326326export
327327hexLit : Lexer
328−hexLit = is '0' <+> oneOf "xX" <+> hexDigits
328+hexLit = approx "0x" <+> hexDigits
329329
330330||| A mapping from lexers to the tokens they produce.
331331||| This is a list of pairs `(Lexer, String -> tokenType)`