Return a parser that takes a key and a value. The parser
consumes no input and always succeeds, and returns
null as the result. It also returns a captures
object with that key-value pair set. This is useful when you
need to inject a key-value pair into captures for a
seq.
Return a parser that takes a key and a value. The parser consumes no input and always succeeds, and returns
null
as the result. It also returns a captures object with that key-value pair set. This is useful when you need to inject a key-value pair into captures for aseq
.For example, here is a Markdown heading parser.
This parser returns
but the type of heading is actually
The
type
key is missing. You can useset
to inject thetype
key-value pair into captures: