Text.Lexer: add alpha, alphas, alphaNum, and alphaNums
commit611c709d92a9eefed8a54e380ba7671a32149e6e
authorMichael Morgan <morgan.michael@me.com>
dateSun 27 Aug 2017, 22:29 (9 years ago)
parentd1482fe
libs/contrib/Text/Lexer.idr+20
@@ -162,6 +162,26 @@ exact str with (unpack str)
162162 exact str | (x :: xs)
163163 = foldl SeqEmpty (is x) (map is xs)
164164
165+||| Recognise an alpha character
166+export
167+alpha : Lexer
168+alpha = pred isAlpha
169+
170+||| Recognise one or more alpha characters
171+export
172+alphas : Lexer
173+alphas = some alpha
174+
175+||| Recognise an alphanumeric character
176+export
177+alphaNum : Lexer
178+alphaNum = pred isAlphaNum
179+
180+||| Recognise one or more alphanumeric characters
181+export
182+alphaNums : Lexer
183+alphaNums = some alphaNum
184+
165185||| Recognise a whitespace character
166186export
167187space : Lexer