Can I create a Lezer Tree from plain text?

It’s easy to get a Tree from a CodeMirror editor state, but what about when I only have the saved text? I see Tree has a “build” method which might be what I’m looking for, but it’s complicated and I don’t understand it. Are there any examples of using Lezer outside of CodeMirror?

Thank you for the fantastic libraries.

If you have a Lezer parser, you can call its parse method to create a tree from a string.

1 Like

Oh right, perfect, thank you!