This combinator fills a fresh register with the this value.
This combinator fills a fresh register with the this value.
This allows for a more controlled way of creating registers during a parse,
without explicitly creating them with Reg.make[A] and using put. These
registers are intended to be fresh every time they are "created", in other
words, a recursive call with a makeReg call inside will modify a different
register.
Attributes
body
a function to generate a parser that can interact with the freshly created register.
See also:
fillReg for a version that uses the result of a parser to fill the register instead.