Skip to content

Commit 509f005

Browse files
committed
Resolve issue where standalone return statemente incorrectly expected an expression
1 parent ce30583 commit 509f005

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/SwiftParser/Statements.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ extension Parser {
865865
let expr: RawExprSyntax?
866866
if
867867
!self.at(any: [
868-
RawTokenKind.rightBrace, .semicolon, .eof,
868+
.rightBrace, .caseKeyword, .semicolon, .eof,
869869
.poundIfKeyword, .poundErrorKeyword, .poundWarningKeyword,
870870
.poundEndifKeyword, .poundElseKeyword, .poundElseifKeyword
871871
])

Tests/SwiftParserTest/Statements.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ final class StatementTests: XCTestCase {
251251
]
252252
)
253253
}
254-
254+
255255
func testIfHasSymbol() {
256256
AssertParse(
257257
"""

0 commit comments

Comments
 (0)