Skip to content

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

@ahoppen

Description

@ahoppen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SwiftParserBugs in the (new) Parser written in SwiftbugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions