RegisterMaker

parsley.registers$.RegisterMaker
final implicit class RegisterMaker[A](x: A)

This class, when in scope, enables a method to create and fill a register with a given value.

Attributes

x

the value to initialise a register with.

Constructor:

This constructor should not be called manually, it is designed to be used via Scala's implicit resolution.

Source:
registers.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

def makeReg[B](body: Reg[A] => Parsley[B]): Parsley[B]

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.

Since:

4.0.0

Source:
registers.scala