Skip to content
This repository was archived by the owner on Jul 29, 2022. It is now read-only.
This repository was archived by the owner on Jul 29, 2022. It is now read-only.

Support for HEREDOC strings #78

Description

@zharinov

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Priority

    None yet

    Datasource

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions