Skip to content

[5.9][Parse] Accept 'self' after 'each' #67232

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

Merged

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Jul 11, 2023

Cherry-pick #67206 and #67264 into release/5.9
swift-syntax repo change swiftlang/swift-syntax#1898

  • Explanation: Since SE-0398, sub expression of 'each' can be property of self, so if the parse see each self token sequence, the parser should parse it as a PackElementExpr. Also, move repeat, each, and any expression parsing logic to parseExprSequenceElement because all other <keyword> <subexpr> parsing are there.
  • Scope: Expression parsing
  • Risk: Low-Mid. This changes how 'each' expression are parsed. But since it's a new feature, breakage should be minimal (if exist)
  • Testing: Added each self. test case. Passed compatibility test suite
  • Issue: rdar://107450487
  • Reviewer: Alex Hoppen (@ahoppen)

Also move 'repeat', 'each', and 'any' expression parsing to
'parseExprSequenceElement'

rdar://107450487
(cherry picked from commit ababa1e)
@rintaro rintaro requested a review from a team as a code owner July 11, 2023 22:20
@rintaro rintaro changed the title [Parse] Accept 'self' after 'each' [5.9][Parse] Accept 'self' after 'each' Jul 11, 2023
@rintaro
Copy link
Member Author

rintaro commented Jul 11, 2023

swiftlang/swift-syntax#1898
@swift-ci Please test

'a * each b + c' should be parsed and operator-folded as like
'(a * (each b)) + c'.

(cherry picked from commit fb651bd)
@rintaro
Copy link
Member Author

rintaro commented Jul 12, 2023

swiftlang/swift-syntax#1898
@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented Jul 12, 2023

swiftlang/swift-syntax#1898
@swift-ci Please test macOS

@rintaro rintaro merged commit 3b2fdd1 into swiftlang:release/5.9 Jul 13, 2023
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.

2 participants