(Changed in version 2.9.0) The call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.
(Changed in version 2.9.0) The call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.
(Changed in version 2.9.0) The call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.
Creates and returns a new parser that consumes at most the specified maximum number of characters.
Creates and returns a new parser that consumes at most the specified maximum number of characters. Always succeeds, unless a minimum number of matches is also specified.
Creates and returns a new parser that fails if it does not consume the specified minimum number of characters.
Creates and returns a new parser that fails if it does not consume the specified minimum number of characters. It may still consume more characters in case of further matches.
Creates and returns a new parser that consumes exactly the specified numer of characters.
Creates and returns a new parser that consumes exactly the specified numer of characters.
Fails if there are less matches, but succeeds in case there are more matches, simply ignoring them.
Calling take 3
for example is equivalent to calling min 3 max 3
.
(Changed in version 2.9.0) The call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.
(Changed in version 2.9.0) The call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.
(Changed in version 2.9.0) The call-by-name argument is evaluated at most once per constructed Parser object, instead of on every need that arises during parsing.
API for specifying further constraints on the parsers provided by this base trait.
For reading 3 or more
'*'
or'+'
characters for example the constraint could be specified as follows: