Pre parsing

Hi,

I am writing a new language.
I would like to make some modifications on editor text before parsing (without changing the content of editor text).

Example:

  • in editor, user can see “Lorem ipsum dolor sit amet”
  • my pre-parser changes the text to “Lorem [ipsum dolor] sit amet”
  • then lezer parses the modified text
  • but the text of the editor remains unchanged

The reason behind is I have runtime keywords with spaces and it is easier to write a language without managing whitespaces.

Thanks a lot.

That’s not something Lezer supports. But it seems like an external tokenizer that can recognize the keywords with spaces would be a more reasonable way to do something like that anyway.

1 Like

Thanks for your answer and advice!