Skip to content

[Parser] Add 'atContextualKeywordPrefixedSyntax' method #3023

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
merged 3 commits into from
Mar 21, 2025

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Mar 19, 2025

Unified disambiguation method for contextual-keyword prefixed syntax.

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Thank you. Much cleaner than the old rules

$0.consumeAnyToken()
return $0.atValidTrailingClosure(flavor: exprFlavor)
}
return isClosure && acceptClosure
Copy link
Member

Choose a reason for hiding this comment

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

Can we avoid the isClosure check if acceptClosure is false?

Unified disambiguation method for contextual-keyword prefixed syntax.
@rintaro rintaro force-pushed the parser-contetual-keyword-prefixed branch 2 times, most recently from 725db10 to 3c00ba6 Compare March 20, 2025 11:59
@rintaro rintaro force-pushed the parser-contetual-keyword-prefixed branch from 3c00ba6 to 5bf4217 Compare March 20, 2025 16:39
@rintaro
Copy link
Member Author

rintaro commented Mar 20, 2025

@swift-ci Please test

@rintaro rintaro force-pushed the parser-contetual-keyword-prefixed branch from 2f77f68 to 2a45ef7 Compare March 21, 2025 17:03
Just like 'return', 'then' statement should accept operand on the next
line.
@rintaro rintaro force-pushed the parser-contetual-keyword-prefixed branch from 2a45ef7 to ebf79c3 Compare March 21, 2025 17:12
@rintaro
Copy link
Member Author

rintaro commented Mar 21, 2025

@swift-ci Please test

@rintaro rintaro marked this pull request as ready for review March 21, 2025 17:17
@rintaro rintaro requested a review from bnbarham as a code owner March 21, 2025 17:17
Copy link
Contributor

@hamishknight hamishknight left a comment

Choose a reason for hiding this comment

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

Thanks!

@rintaro
Copy link
Member Author

rintaro commented Mar 21, 2025

@swift-ci Please test Windows

@rintaro rintaro merged commit 5aa5558 into swiftlang:main Mar 21, 2025
24 checks passed
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.

3 participants