Skip to content

[6.1][Parser] Include all AST nodes from every #if region in ParserUnit #79123

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

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Feb 3, 2025

Cherry-pick #79120 into release/6.1

  • Explanation: ParserUnit is used for analyzing syntax structures mainly in SourceKit. Since we removed IfConfigDecl from AST, ParserUnit didn't include any AST in #if ... #endif regions even for active region because it used to consider all inactive. Instead, consider every region "active" and include all the AST nodes.
  • Socpe: SourceKit
  • Risk: Low. This only affects ParserUnit which is used in SourceKit (for syntactic analysis), -define-availability argument parsing (never accept #if), and in lldb for checking if the statement is incomplete or not.
  • Tests: Recovered most test cases before IfConfigDecl removal.
  • Issues: rdar://117387631
  • Reviewers: Ben Barham (@bnbarham)

@rintaro rintaro requested a review from a team as a code owner February 3, 2025 22:55
@rintaro
Copy link
Member Author

rintaro commented Feb 3, 2025

@swift-ci Please test

@rintaro rintaro force-pushed the 6.1-parser-unit-ifconfig-allactive-rdar117387631 branch from 79b95ce to f63e52b Compare February 3, 2025 23:56
@rintaro
Copy link
Member Author

rintaro commented Feb 3, 2025

@swift-ci Please test

'ParserUnit' is used for analyzing syntax structures _mainly_ in
SourceKit.

Since we removed IfConfigDecl from AST, ParserUnit didn't
inclue any AST in #if ... #endif regions even for active region because
it used to consider all inactive. Instead, consider every region
"active" and include all the AST nodes.

rdar://117387631
(cherry picked from commit 694e815)
@rintaro rintaro force-pushed the 6.1-parser-unit-ifconfig-allactive-rdar117387631 branch from f63e52b to 3af9ba8 Compare February 4, 2025 00:23
@rintaro
Copy link
Member Author

rintaro commented Feb 4, 2025

@swift-ci Please test

1 similar comment
@rintaro
Copy link
Member Author

rintaro commented Feb 4, 2025

@swift-ci Please test

@rintaro rintaro merged commit ea69594 into swiftlang:release/6.1 Feb 4, 2025
5 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.

2 participants