#### Perceived Problem We can't define them at the lexer level because code may contain non-standard begin/end markers. #### Ideas / Proposed Solution(s) These two `moo.Lexer` methods should be used: ```ts save(): LexerState; reset(chunk?: string, state?: LexerState): this; ``` The idea: - Stop normal processing: call `lexer.save()` once HEREDOC start is encountered - Process HEREDOC fragment using custom code or sub-lexer and return single string token as result - Continue normal processing: call `lexer.reset(input, state)` with the the `input` and `state` values corresponding the position immediately after HEREDOC
Perceived Problem
We can't define them at the lexer level because code may contain non-standard begin/end markers.
Ideas / Proposed Solution(s)
These two
moo.Lexermethods should be used:The idea:
lexer.save()once HEREDOC start is encounteredlexer.reset(input, state)with the theinputandstatevalues corresponding the position immediately after HEREDOC