Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support string escaping #888

Merged
merged 2 commits into from
Jan 30, 2023
Merged

Conversation

spoenemann
Copy link
Contributor

Closes #885:

  • Add \ escaping to the STRING rule in langium-grammar.langium
  • Process escaped characters in the convertString method of DefaultValueConverter
  • Adapt the syntax highlighting config of the grammar language to support escaped characters

@spoenemann spoenemann added this to the v1.1.0 milestone Jan 27, 2023
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we apply the changes also to the examples and the generator-langium template?

packages/langium-vscode/data/langium.tmLanguage.json Outdated Show resolved Hide resolved
@spoenemann spoenemann force-pushed the spoenemann/support-string-escaping-885 branch from f2fd822 to 75184b1 Compare January 30, 2023 10:22
@spoenemann
Copy link
Contributor Author

The TextMate generator doesn't handle the new string regexp correctly. The function getTerminalParts creates a too large end value. I'm not sure how to solve that (probably in CommentRegexVisitor) – @msujew could you look into that?

@spoenemann
Copy link
Contributor Author

I forgot to fix the tests, I'll look into those.

@spoenemann spoenemann force-pushed the spoenemann/support-string-escaping-885 branch from 75184b1 to d50ac18 Compare January 30, 2023 10:30
@msujew msujew added polish Some feature needs improvement grammar Grammar language related issue labels Jan 30, 2023
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@spoenemann spoenemann merged commit c7e15ee into main Jan 30, 2023
@spoenemann spoenemann deleted the spoenemann/support-string-escaping-885 branch January 30, 2023 12:29
@spoenemann spoenemann mentioned this pull request Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grammar Grammar language related issue polish Some feature needs improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support string escaping
2 participants