Skip to content

Macro expansions allow a space (or even newline) between # and macro name, as well as @ and attribute name #1395

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

Closed
ahoppen opened this issue Mar 9, 2023 · 5 comments
Labels
bug Something isn't working good first issue Good for newcomers SwiftParser Bugs in the (new) Parser written in Swift

Comments

@ahoppen
Copy link
Member

ahoppen commented Mar 9, 2023

Issue Kind

Other

Source Code

# myMacroName
#
myMacroName
@ MyAttribute
func foo() {}
@
MyAttribute 
func foo() {}

Description

The above examples parse as macro expansion or attribute but shouldn’t be valid. We need to check that the # or @ doesn’t contain trailing trivia and the identifier doesn’t contain leading trivia to parse a macro expansion/attribute.

@ahoppen ahoppen added bug Something isn't working good first issue Good for newcomers SwiftParser Bugs in the (new) Parser written in Swift labels Mar 9, 2023
@ahoppen
Copy link
Member Author

ahoppen commented Mar 9, 2023

rdar://106464071

@TiagoMaiaL
Copy link
Contributor

@ahoppen Is it possible to assign this issue to me? I'm already working on it on my free time.

@Matejkob
Copy link
Contributor

Matejkob commented Apr 5, 2024

Is this still an issue?
Screenshot 2024-04-05 at 1 01 48 PM

@Matejkob
Copy link
Contributor

Matejkob commented Apr 5, 2024

Screenshot 2024-04-05 at 1 08 09 PM

@ahoppen
Copy link
Member Author

ahoppen commented Apr 5, 2024

No, this was fixed by #2466. Thanks for noticing 👍🏽

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

No branches or pull requests

3 participants