Skip to content

[Parse] Adjust assertions for ParsingFlags::PoundIfAllActive mode #79192

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 1 commit into from
Feb 8, 2025

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Feb 6, 2025

In this mode, multiple #if clauses are active. For now, just use the first clause as the result.

@rintaro
Copy link
Member Author

rintaro commented Feb 6, 2025

@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented Feb 6, 2025

Another (probably more correct) option is to use all clauses like

foo
#if FLAG
  .bar
#else
  .baz
#end

would be parsed as foo.bar.baz. But that would be a little more risky change.

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

This looks like a reasonable approach, no need to make it complicated

In this mode, multiple #if clauses are active. For now, just use the
first clause as the result.
@rintaro rintaro force-pushed the ifconfig-allactive-postfixexpr branch from a16a0b9 to 635494d Compare February 6, 2025 20:07
@rintaro
Copy link
Member Author

rintaro commented Feb 6, 2025

@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented Feb 6, 2025

@swift-ci Please smoke test Linux

@rintaro rintaro enabled auto-merge February 6, 2025 23:42
@rintaro
Copy link
Member Author

rintaro commented Feb 7, 2025

@swift-ci Please smoke test Linux

@rintaro rintaro merged commit 333a1eb into swiftlang:main Feb 8, 2025
3 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