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

Disallow trailing junk in generators #497

Merged
merged 1 commit into from
Aug 18, 2024

Conversation

c42f
Copy link
Member

@c42f c42f commented Aug 18, 2024

Disallow generator syntax with trailing non-delimited expressions

(y for x in xs a)
(y for x in xs a, b)

Allow parameter syntax such as

f(y for x in xs; a)

because the flisp parser allowed this it's used in Base in at least one location.

Disallow the almost-equivalent block syntax for now:

(y for x in xs; a)

because the flisp parser disallowed it and users can always get the same thing with some extra parentheses.

Fixes #407

Disallow generator syntax with trailing non-delimited expressions

    (y for x in xs a)
    (y for x in xs a, b)

Allow parameter syntax such as

    f(y for x in xs; a)

because the flisp parser allowed this it's used in Base in at least one
location.

Disallow the almost-equivalent block syntax for now:

    (y for x in xs; a)

because the flisp parser disallowed it and users can always get the same
thing with some extra parentheses.
Copy link

codecov bot commented Aug 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.18%. Comparing base (6532515) to head (a74fb9c).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #497      +/-   ##
==========================================
- Coverage   96.21%   96.18%   -0.04%     
==========================================
  Files          13       13              
  Lines        4171     4033     -138     
==========================================
- Hits         4013     3879     -134     
+ Misses        158      154       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@c42f c42f merged commit 30109d4 into main Aug 18, 2024
37 of 38 checks passed
@c42f c42f deleted the caf/disallow-trailing-generator-junk branch August 18, 2024 10:49
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.

Parsing of generators allows skipping a comma
1 participant