on master help sign in
Text.Lexer: deprecate `manyTill`

There is no exact replacement, but the behavior of `manyTill` is inconsistent with what's expected from a lexer library that supports lookahead. It consumes its terminator, but it's okay if it never sees its terminator and the input ends instead.

commit828de62b7a6a5d2ef2aa5e74faa11c5b53202d21 authorMichael Morgan <morgan.michael@me.com> dateSat 2 Sep 2017, 21:00 (9 years ago) parent7c2148d
1 file changed+2
libs/contrib/Text/Lexer.idr+2
libs/contrib/Text/Lexer.idr+2
@@ -140,6 +140,8 @@ manyThen stopAfter l = manyUntil stopAfter l <+> stopAfter
140140export
141141manyTill : (l : Lexer) -> (end : Lexer) -> Recognise False
142142manyTill l end = end <|> opt (l <+> manyTill l end)
143+%deprecate manyTill
144+ "Prefer `lineComment`, or `manyUntil`/`manyThen` (argument order is flipped)."
143145
144146||| Recognise any character
145147export