File tree Expand file tree Collapse file tree 2 files changed +9
-27
lines changed Expand file tree Collapse file tree 2 files changed +9
-27
lines changed Original file line number Diff line number Diff line change @@ -38,16 +38,16 @@ enum TokenPrecedence: Comparable {
38
38
case mediumPunctuator
39
39
/// The closing delimiter of `weakBracketed`
40
40
case weakBracketClose
41
- /// Keywords that start a new statement.
42
- case stmtKeyword
43
41
/// The '{' token because it typically marks the body of a declaration.
44
42
/// `closingDelimiter` must have type `strongPunctuator`
45
43
case openingBrace( closingDelimiter: RawTokenKind )
46
44
/// A punctuator that is a strong indicator that it separates two distinct parts of the source code, like two statements
47
45
case strongPunctuator
48
46
/// The closing delimiter of `strongBracketed`
49
47
case closingBrace
50
- /// Tokens that start a new declaration
48
+ /// Keywords that start a new statement.
49
+ case stmtKeyword
50
+ /// Keywords that start a new declaration
51
51
case declKeyword
52
52
case openingPoundIf
53
53
case closingPoundIf
@@ -85,17 +85,17 @@ enum TokenPrecedence: Comparable {
85
85
case . weakBracketClose:
86
86
return 6
87
87
case . strongPunctuator:
88
- return 8
88
+ return 7
89
89
case . openingBrace:
90
- return 9
90
+ return 8
91
91
case . declKeyword, . stmtKeyword:
92
- return 10
92
+ return 9
93
93
case . closingBrace:
94
- return 11
94
+ return 10
95
95
case . openingPoundIf:
96
- return 12
96
+ return 11
97
97
case . closingPoundIf:
98
- return 13
98
+ return 12
99
99
}
100
100
}
101
101
Original file line number Diff line number Diff line change @@ -133,24 +133,6 @@ extension Parser {
133
133
)
134
134
}
135
135
136
- mutating func fixWithSemi( codeBlockItem item: RawCodeBlockItemSyntax . Item ) -> RawCodeBlockItemSyntax ? {
137
- let semi = self . consume ( if: . semicolon)
138
- var trailingSemis : [ RawTokenSyntax ] = [ ]
139
- while let trailingSemi = self . consume ( if: . semicolon) {
140
- trailingSemis. append ( trailingSemi)
141
- }
142
-
143
- if item. raw. isEmpty && semi == nil && trailingSemis. isEmpty {
144
- return nil
145
- }
146
- return RawCodeBlockItemSyntax (
147
- item: item,
148
- semicolon: semi,
149
- RawUnexpectedNodesSyntax ( trailingSemis, arena: self . arena) ,
150
- arena: self . arena
151
- )
152
- }
153
-
154
136
/// Parse an individual item - either in a code block or at the top level.
155
137
///
156
138
/// Returns `nil` if the parser did not consume any tokens while trying to
You can’t perform that action at this time.
0 commit comments