on master help sign in
BREAKING Text.Lexer: rename symbol and space
0488d1eMichael Morgan
libs/contrib/Text/Lexer.idr+14−4
@@ -212,15 +212,25 @@ export
212alphaNums : Lexer
212alphaNums : Lexer
213alphaNums = some alphaNum
213alphaNums = some alphaNum
214
214
215−||| Recognise a whitespace character
215+||| Recognise a single whitespace character
216export
216export
217space : Lexer
217space : Lexer
218−space = some (pred isSpace)
218+space = pred isSpace
219
219
220+||| Recognise one or more whitespace characters
221+export
222+spaces : Lexer
223+spaces = some space
224+
220−||| Recognise a non-alphanumeric, non-whitespace character
225+||| Recognise a single non-whitespace, non-alphanumeric character
221export
226export
222symbol : Lexer
227symbol : Lexer
223−symbol = some (pred (\x => not (isAlphaNum x) && not (isSpace x)))
228+symbol = pred (\x => not (isSpace x || isAlphaNum x))
229+
230+||| Recognise one or more non-whitespace, non-alphanumeric characters
231+export
232+symbols : Lexer
233+symbols = some symbol
224
234
225||| Recognise zero or more occurrences of a sub-lexer between
235||| Recognise zero or more occurrences of a sub-lexer between
226||| delimiting lexers
236||| delimiting lexers