Skip to content
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

[SR-8800] Enhancing swift-syntax to allow #sourcelocation to appear in any location #427

Closed
johnno1962 opened this issue Sep 19, 2018 · 5 comments
Labels
bug Something isn't working SwiftParser Bugs in the (new) Parser written in Swift

Comments

@johnno1962
Copy link

Previous ID SR-8800
Radar None
Original Reporter @johnno1962
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler, SwiftSyntax
Labels Bug, LanguageFeatureRequest
Assignee None
Priority Medium

md5: 1857afa8697bcd58bd807f0a45bdf324

Issue Description:

This arose out of the discussion on apple/swift#19347 which allows #sourceLocation directives to occur in collections. Rather than have Syntax accept #sourceLocation as an alternative for an array/dictionary element it was suggested perhaps Syntax should treat #sourceLocation as trivia going forward.
See apple/swift#19347 (comment)

@nkcsgexi
Copy link
Member

We probably need a trivia kind for #sourcelocation. What do you guys think? @rintaro @harlanhaskins @ahoppen

@harlanhaskins
Copy link
Contributor

The parser currently ignores it, right? If so, it should be trivia, otherwise we cannot round-trip.

@belkadan
Copy link

No, it's currently parsed like a declaration. See Parser::parseLineDirective.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 9, 2022
@ahoppen
Copy link
Collaborator

ahoppen commented Jun 21, 2022

rdar://95638396

@ahoppen ahoppen added SwiftParser Bugs in the (new) Parser written in Swift and removed SwiftSyntaxParser labels Jan 26, 2023
@ahoppen
Copy link
Collaborator

ahoppen commented Jan 26, 2023

Allowing #sourceLocation in more locations would require a Swift Evolution proposal. Closing this issue because SwiftSyntax behaves as expected.

@ahoppen ahoppen closed this as completed Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SwiftParser Bugs in the (new) Parser written in Swift
Projects
None yet
Development

No branches or pull requests

6 participants