on master help sign in
Text.Lexer: add `control` and `controls` lexers
905b7fcMichael Morgan
libs/contrib/Text/Lexer.idr+8
@@ -197,6 +197,14 @@ symbol = pred (\x => not (isSpace x || isAlphaNum x))
197symbols : Lexer
197symbols : Lexer
198symbols = some symbol
198symbols = some symbol
199
199
200+||| Recognise a single control character
201+control : Lexer
202+control = pred isControl
203+
204+||| Recognise one or more control characters
205+controls : Lexer
206+controls = some control
207+
200||| Recognise zero or more occurrences of a sub-lexer between
208||| Recognise zero or more occurrences of a sub-lexer between
201||| delimiting lexers
209||| delimiting lexers
202surround : (start : Lexer) -> (end : Lexer) -> (l : Lexer) -> Lexer
210surround : (start : Lexer) -> (end : Lexer) -> (l : Lexer) -> Lexer