Repository navigation
fix(parser): reject bare binary comprehension bodies that need parentheses - #101
Merged
Merged
Conversation
…heses Bare calls, signed expressions, maps, records and record indexes now produce a compile error with a parentheses hint. The formatter leaves rejected forms as written and keeps required parentheses in valid code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Nera accepted bare binary comprehension bodies that the Erlang compiler rejects.
What changed
Before and after
Before: Nera built all six rejected examples, and formatting inserted parentheses that made the code acceptable to the Erlang compiler.
After: Nera rejects all six examples without writing an executable, and seven valid controls compile and keep their result.
The change appears in compiler diagnostics and formatted source text; the terminal transcripts record both.
Checked
Live validation: Demonstrated for this version. 2 of 2 scenarios driven live in the product.
How it was checked
The three changed regressions failed against the original parser. Both focused test files passed ten runs at the final version.
The native suite ran before the formatter-only review change. The final workspace run and formatter comparison included that change.
The original workspace run with a group-writable file creation mask hit a storage fixture failure also reproduced on unchanged main.
Risk
Risk: low in every dimension.
Full risk assessment