Read and emit token(s). Returns undefined if not matched.
Read and emit token(s). Returns undefined if not matched.
Read and emit token only if not stripping types. Can also wrap a function call to strip its output when stripping types.
Read and emit token only if not stripping types. Can also wrap a function call to strip its output when stripping types.
Clear the target position used for source mapping. Called after header parsing to ensure next token gets correct position.
Emit output text. Automatically handles source mapping based on last read position.
Numbers are treated as explicit position markers.
false means the next arg should not have an automatic position emitted.
true means the next arg should have an automatic position emitted, but it should not be used for source mapping, and
the next token will get the same automatic position again.
Format the output tokens into a final string with proper whitespace.
Check if more input remains to be parsed
Check if we're at the start of a new line (for breaking operator processing).
Check if the character before current position is not a space. Used to distinguish function calls foo(x) from spaced expressions foo (x).
Check if the last emitted output ends with the given string. Useful for conditionally emitting closing tokens.
Parse a group with optional delimiters and separators.
Peek at token(s) without consuming them.
Read token(s) from input, consuming them. Returns undefined if not matched. RegExp arguments must have the /y (sticky) flag.
Read token(s) from input, consuming them. Returns undefined if not matched. RegExp arguments must have the /y (sticky) flag.
Read a newline token (including handling indent changes). This is public because the Main parser loop needs it.
Attempt to recover from errors during parsing.
Create a snapshot of current state that can be reverted later.
Current input line number