from-m-to-n ( parser m n -- parser' )


Vocabulary
peg.parsers

Inputs
parsera parser
man integer
nan integer


Outputs
parser'a parser


Word description
Returns a parser that matches between and including m to n repetitions of the input parser.

Examples
USING: peg peg.parsers prettyprint ; "aaa" "a" token 3 4 from-m-to-n parse .
V{ "a" "a" "a" }

USING: peg peg.parsers prettyprint ; "aaaa" "a" token 3 4 from-m-to-n parse .
V{ "a" "a" "a" "a" }

USING: peg peg.parsers prettyprint ; "aaaaa" "a" token 3 4 from-m-to-n parse .
V{ "a" "a" "a" "a" }


See also
exactly-n, at-most-n, at-least-n

Definition