@@ -70,6 +70,14 @@ export
70isNot : Char -> Lexer
70isNot : Char -> Lexer
71isNot x = Pred (/=x)
71isNot x = Pred (/=x)
73+||| Recognise a specific string
75+exact : String -> Lexer
76+exact str with (unpack str)
77+ exact str | [] = Fail -- Not allowed, Lexer has to consume
78+ exact str | (x :: xs)
79+ = foldl SeqEmpty (is x) (map is xs)
73||| Recognise a lexer or recognise no input. This is not guaranteed
81||| Recognise a lexer or recognise no input. This is not guaranteed
74||| to consume input
82||| to consume input
@@ -190,14 +198,6 @@ export
190digits : Lexer
198digits : Lexer
191digits = some digit
199digits = some digit
193−||| Recognise a specific string
195−exact : String -> Lexer
196−exact str with (unpack str)
197− exact str | [] = Fail -- Not allowed, Lexer has to consume
198− exact str | (x :: xs)
199− = foldl SeqEmpty (is x) (map is xs)
201||| Recognise a single hexidecimal digit
201||| Recognise a single hexidecimal digit
203hexDigit : Lexer
203hexDigit : Lexer