-
Notifications
You must be signed in to change notification settings - Fork 464
Closed
Labels
SwiftParserBugs in the (new) Parser written in SwiftBugs in the (new) Parser written in SwiftbugSomething isn't workingSomething isn't working
Description
Issue Kind
Parse of Valid Source Produced Invalid Syntax Tree
Source Code
struct S {
#if swift(>=2.2)
let x: Int
#else
// There should be no error here.
let x: @#$()%&*)@#$(%&*
#endif
}Description
The above code is from the swift project, and can be found here.
Instead of parsing x as a constant declaration, with @#$()%&*)@#$(%&* as its type, the above code only parses let x: @ as a variableDecl. The rest of the type is parsed in a wrong way, and the following #$() sequence is parsed as a macroExpansionDecl.
The following test fails:
func testIfConfigExpr36() {
AssertParse(
"""
struct S {
#if swift(>=2.2)
let x: Int
#else
// There should be no error here.
let x: @#$()%&*)@#$(%&*
#endif
}
"""
)
}Metadata
Metadata
Assignees
Labels
SwiftParserBugs in the (new) Parser written in SwiftBugs in the (new) Parser written in SwiftbugSomething isn't workingSomething isn't working