Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Scala: allow ellipsis in for loop headers #539

Merged
merged 1 commit into from
Jun 30, 2022

Conversation

mmcqd
Copy link
Member

@mmcqd mmcqd commented Jun 29, 2022

See semgrep/semgrep#5661

Security

  • Change has no security implications (otherwise, ping the security team)

@mmcqd mmcqd requested a review from a team June 29, 2022 23:57
@linear
Copy link

linear bot commented Jun 29, 2022

PA-1579 Scala for loops parse error

I expected that for($EXPR2; $IDENT <- $GEN; $EXPR) {yield ... }
Or for(...; $IDENT <- $GEN; ...) {yield ... }

would parse as patterns but they don't as of 0.100: https://semgrep.dev/s/NoNx
From semgrep/semgrep#5650
Originally opened by ievans

@@ -340,7 +340,7 @@ and for_header = enumerators bracket
and enumerators = enumerator list
and enumerator =
| G of generator
| GIf of guard list
| GEllipsis of tok
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would have added a (* semgrep-ext: *) comment, to indicate this is actually not part of Scala but
an AST extension useful for semgrep only.

@aryx aryx merged commit d636ec7 into develop Jun 30, 2022
@aryx aryx deleted the matthew/pa-1579-scala-for-loops-parse-error branch June 30, 2022 09:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants