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

docs: Enforce at least one statement in blocks #20

Merged
merged 2 commits into from
Sep 15, 2022
Merged

Conversation

juliaogris
Copy link
Member

Update grammar to enforce at least one statement in blocks. This means
each function declaration, if statement, while statement etc. need to
have at least one statement in the inner block. Like in Go's "variable
declared but not used" error message we want to catch accidental
omissions and limit the set of "valid programs" to provide more guide
rails.

The parser will be updated in a follow up PR.

While at it, reorder the production rules in the grammar to flow more
naturally from higher order constructs, to single line statements,
expressions and TERMINALS.

@github-actions
Copy link

github-actions bot commented Sep 15, 2022

Visit the preview URL for this PR (updated for commit f42c5d6):

https://evy-lang--pr20-grammar-update-hbhbu1sx.web.app

(expires Thu, 22 Sep 2022 06:13:46 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Reorder productions from higher level: program, function declaration, if
statement, to single line statement and eventually expression, term and
TERMINAL. Reviewing the grammar again this seemed like the more natural
flow.

This is a non-functional change.
Update grammar to enforce at least one statement in blocks. This means
each function declaration, if statement, while statement etc. need to
have at least one statement in the inner block. Like in Go's "variable
declared but not used" error message we want to catch accidental
omissions and limit the set of "valid programs" to provide more guide
rails.

The parser will be updated in a follow up PR.
Copy link
Contributor

@camh- camh- left a comment

Choose a reason for hiding this comment

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

📗

@juliaogris juliaogris changed the title docs: Enforce at least statement in blocks docs: Enforce at least one statement in blocks Sep 15, 2022
@juliaogris juliaogris merged commit 62b281b into master Sep 15, 2022
@juliaogris juliaogris deleted the grammar-update branch September 15, 2022 06:22
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.

None yet

2 participants