Skip to content

Don't treat a # as starting a declaration. #987

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 2 commits into from
Oct 19, 2022

Conversation

DougGregor
Copy link
Member

The recent change to rely on the general macro-expansion expression nodes for #line et al broke return statements because we were classifying the expression as a declaration.

The recent change to rely on the general macro-expansion expression nodes
for `#line` et al broke return statements because we were classifying the
expression as a declaration.
@DougGregor DougGregor requested a review from ahoppen as a code owner October 19, 2022 16:36
@DougGregor
Copy link
Member Author

@swift-ci please test

@CodaFi
Copy link
Contributor

CodaFi commented Oct 19, 2022

Some lookahead-related tests flipped polarity here

Test Case '-[SwiftParserTest.RawStringErrorsTests testRawStringErrors3]' failed (0.007 seconds).
Test Case '-[SwiftParserTest.RawStringErrorsTests testRawStringErrors4]' started.
Test Case '-[SwiftParserTest.RawStringErrorsTests testRawStringErrors4]' passed (0.000 seconds).
Test Case '-[SwiftParserTest.RawStringErrorsTests testRawStringErrors5]' started.
/Users/ec2-user/jenkins/workspace/swift-syntax-PR-macOS/branch-main/swift-syntax/Tests/SwiftParserTest/translated/RawStringErrorsTests.swift:73: error: -[SwiftParserTest.RawStringErrorsTests testRawStringErrors5] : failed - Actual output (+) differed from expected output (-):
–expected identifier in pound literal declaration
+expected identifier in pound literal expression
/Users/ec2-user/jenkins/workspace/swift-syntax-PR-macOS/branch-main/swift-syntax/Tests/SwiftParserTest/translated/RawStringErrorsTests.swift:74: error: -[SwiftParserTest.RawStringErrorsTests testRawStringErrors5] : failed - Actual output (+) differed from expected output (-):
–expected identifier in pound literal declaration
+expected identifier in pound literal expression
/Users/ec2-user/jenkins/workspace/swift-syntax-PR-macOS/branch-main/swift-syntax/Tests/SwiftParserTest/translated/RawStringErrorsTests.swift:75: error: -[SwiftParserTest.RawStringErrorsTests testRawStringErrors5] : failed - Actual output (+) differed from expected output (-):
–expected identifier in pound literal declaration
+expected identifier in pound literal expression

@DougGregor
Copy link
Member Author

Some lookahead-related tests flipped polarity here

This is a Good Thing, because it's actually valuable for these to be expressions in these contexts, but it's a Bad Thing that I missed these and have to restart PR testing.

@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor merged commit f3c525f into swiftlang:main Oct 19, 2022
@DougGregor DougGregor deleted the pound-literal-not-as-decl branch October 19, 2022 17:49
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