eclipse-langium / langium-website

Source of langium.org
https://langium.org/
MIT License
15 stars 35 forks source link

[Documentation] Samples for String Parsing #173

Open NigelWSewell opened 1 year ago

NigelWSewell commented 1 year ago

The Documentation for String Parsing is not extensive. It is easy enough to use the until token for simple tasks like:

terminal ID: '"' -> '"' ; to match "foo"

However when your input string has the need for escapes in it like "f\"oo!"

Then the documentation is not providing obvious clues as to how to match "f\"oo" instead of "f\" + error.

What would also be good is examples of how to match and extract the following:

An input of "bar" to match bar instead of "bar" (including the ").

This would help with designing & translating languages with string processing capabilities.