@@ -70,6 +70,14 @@ export
7070isNot : Char -> Lexer
7171isNot x = Pred (/=x)
7272
73+||| Recognise a specific string
74+export
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)
80+
7381||| Recognise a lexer or recognise no input. This is not guaranteed
7482||| to consume input
7583export
@@ -190,14 +198,6 @@ export
190198digits : Lexer
191199digits = some digit
192200
193−||| Recognise a specific string
194−export
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)
200−
201201||| Recognise a single hexidecimal digit
202202export
203203hexDigit : Lexer