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

Made grammar object optional #381

Merged
merged 5 commits into from
Jan 20, 2022
Merged

Conversation

jbicker
Copy link
Contributor

@jbicker jbicker commented Jan 20, 2022

Grammar top level object is optional now.
However if it is missing in grammar which is configured in langium-config.json then langium generator fails.

Fixes #299

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.

The changes look good at first glance. I'll take a closer look at it later.

On another note, do you mind running the langium generator on the arithmetics and statemachine example as well? Their grammar.ts should be updated before merging this PR.

Copy link
Contributor

@spoenemann spoenemann left a comment

Choose a reason for hiding this comment

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

Please add a validation check to langium-grammar-validator.ts: A rule marked as entry is illegal if the containing grammar is not declared.

packages/langium-cli/src/generate.ts Outdated Show resolved Hide resolved
@jbicker jbicker force-pushed the jbicker/make-grammar-object-optional-299 branch from 771ef75 to a2a0417 Compare January 20, 2022 15:08
@jbicker jbicker merged commit 5fc873d into main Jan 20, 2022
@jbicker jbicker deleted the jbicker/make-grammar-object-optional-299 branch January 20, 2022 15:40
@spoenemann spoenemann added this to the v0.3.0 milestone Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make grammar object optional
3 participants