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

Prevent usage of reserved words in grammars #749

Merged
merged 3 commits into from
Nov 7, 2022
Merged

Conversation

msujew
Copy link
Member

@msujew msujew commented Nov 1, 2022

Closes #529

Validates all AST instances which are generated as part of types (i.e. parser rules, inferred types, interfaces, etc). Anything that is either a keyword of TS/JS or a globally available object/function/constant will result in a validation error.

@msujew msujew added validation Validation related issue types Types related issue labels Nov 1, 2022
Copy link
Contributor

@pluralia pluralia left a comment

Choose a reason for hiding this comment

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

Property arguments gives a validation error:
Screenshot 2022-11-01 at 23 23 34

packages/langium/src/grammar/langium-grammar-validator.ts Outdated Show resolved Hide resolved
@msujew msujew added this to the v1.0.0 milestone Nov 7, 2022
@msujew msujew merged commit 62c127c into main Nov 7, 2022
@msujew msujew deleted the msujew/reserved-words branch November 7, 2022 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types Types related issue validation Validation related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Langium grammar can declare AST elements with conflicting names
2 participants