If defined, called separately with the start position of
each new line (in parse()
, including the start of input).
If true, space and sequence indicators count as indentation
If true, next token is a scalar value
Current indentation level
Current offset since the start of parsing
On the same line with a block map key
The source of the current token, set in parse()
Top indicates the node that's currently being built
The type of the current token, set in parse()
Call at end of input to push out any remaining constructions
Advance the parser by the source
of one lexical token.
Parse source
as a YAML stream.
If incomplete
, a part of the last line may be left as a buffer for the next call.
Errors are not thrown, but yielded as { type: 'error', message }
tokens.
A generator of tokens representing each directive, document, and other structure.
Generated using TypeDoc
A YAML concrete syntax tree (CST) parser
To use the parser with a user-provided lexer: