on master help sign in
Text.Lexer: fix behavior of `surround`
82a82abMichael Morgan
libs/contrib/Text/Lexer.idr+1−1
@@ -291,7 +291,7 @@ symbols = some symbol
291||| delimiting lexers
291||| delimiting lexers
292export
292export
293surround : (start : Lexer) -> (end : Lexer) -> (l : Lexer) -> Lexer
293surround : (start : Lexer) -> (end : Lexer) -> (l : Lexer) -> Lexer
294−surround start end l = start <+> manyTill l end
294+surround start end l = start <+> many (reject end <+> l) <+> end
295
295
296||| Recognise zero or more occurrences of a sub-lexer surrounded
296||| Recognise zero or more occurrences of a sub-lexer surrounded
297||| by the same quote lexer on both sides (useful for strings)
297||| by the same quote lexer on both sides (useful for strings)