File tree 3 files changed +37
-14
lines changed
3 files changed +37
-14
lines changed Original file line number Diff line number Diff line change @@ -215,8 +215,27 @@ impl<'a> SeparatedList<'a> for SequenceExpressionList<'a> {
215
215
// read everything as expression and map to it to either
216
216
// ParenthesizedExpression or ArrowFormalParameters later
217
217
fn parse_element ( & mut self , p : & mut ParserImpl < ' a > ) -> Result < ( ) > {
218
- let element = p. parse_assignment_expression_or_higher ( ) ?;
219
- self . elements . push ( element) ;
218
+ let element = p. parse_assignment_expression_or_higher ( ) ;
219
+ self . elements . push ( element?) ;
220
+ Ok ( ( ) )
221
+ }
222
+
223
+ fn parse_list ( & mut self , p : & mut ParserImpl < ' a > ) -> Result < ( ) > {
224
+ p. expect ( self . open ( ) ) ?;
225
+
226
+ let mut first = true ;
227
+
228
+ while !p. at ( self . close ( ) ) && !p. at ( Kind :: Eof ) {
229
+ if first {
230
+ first = false ;
231
+ } else {
232
+ p. expect ( self . separator ( ) ) ?;
233
+ }
234
+
235
+ self . parse_element ( p) ?;
236
+ }
237
+
238
+ p. expect ( self . close ( ) ) ?;
220
239
Ok ( ( ) )
221
240
}
222
241
}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ commit: 12619ffe
3
3
parser_babel Summary:
4
4
AST Parsed : 2095/2101 (99.71%)
5
5
Positive Passed: 2087/2101 (99.33%)
6
- Negative Passed: 1364 /1501 (90.87 %)
6
+ Negative Passed: 1365 /1501 (90.94 %)
7
7
Expect Syntax Error: "annex-b/disabled/1.1-html-comments-close/input.js"
8
8
Expect Syntax Error: "annex-b/disabled/3.1-sloppy-labeled-functions/input.js"
9
9
Expect Syntax Error: "annex-b/disabled/3.1-sloppy-labeled-functions-if-body/input.js"
@@ -27,7 +27,6 @@ Expect Syntax Error: "es2015/uncategorised/297/input.js"
27
27
Expect Syntax Error: "es2015/uncategorised/335/input.js"
28
28
Expect Syntax Error: "es2017/async-functions/async-await-as-arrow-binding-identifier/input.js"
29
29
Expect Syntax Error: "es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/input.js"
30
- Expect Syntax Error: "es2017/trailing-function-commas/7/input.js"
31
30
Expect Syntax Error: "es2018/object-rest-spread/24/input.js"
32
31
Expect Syntax Error: "es2018/object-rest-spread/comma-after-rest/input.js"
33
32
Expect Syntax Error: "es2018/object-rest-spread/comma-after-spread-for-in/input.js"
@@ -5154,6 +5153,12 @@ Expect to Parse: "typescript/types/const-type-parameters-babel-7/input.ts"
5154
5153
· ─
5155
5154
╰────
5156
5155
5156
+ × Unexpected token
5157
+ ╭─[es2017/trailing-function-commas/7/input.js:1:8]
5158
+ 1 │ ('foo',)
5159
+ · ─
5160
+ ╰────
5161
+
5157
5162
× Expected `(` but found `await`
5158
5163
╭─[es2018/async-generators/for-await-async-context/input.js:2:7]
5159
5164
1 │ function f() {
Original file line number Diff line number Diff line change @@ -15431,11 +15431,11 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
15431
15431
╰────
15432
15432
15433
15433
× Unexpected token
15434
- ╭─[conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts:16:2 ]
15435
- 15 │ // Missing the first operand
15436
- 16 │ (, ANY );
15437
- · ─
15438
- 17 │ (, BOOLEAN );
15434
+ ╭─[conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts:9:7 ]
15435
+ 8 │ // Missing the second operand
15436
+ 9 │ (ANY, );
15437
+ · ─
15438
+ 10 │ (BOOLEAN, );
15439
15439
╰────
15440
15440
15441
15441
× 'with' statements are not allowed
@@ -15952,13 +15952,12 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
15952
15952
· ─
15953
15953
╰────
15954
15954
15955
- × Expected `>` but found `,`
15956
- ╭─[conformance/externalModules/topLevelAwaitErrors.1.ts:5:14]
15955
+ × Unexpected token
15956
+ ╭─[conformance/externalModules/topLevelAwaitErrors.1.ts:4:10]
15957
+ 3 │ // reparse call as invalid await should error
15957
15958
4 │ await (1,);
15959
+ · ─
15958
15960
5 │ await <number, string>(1);
15959
- · ┬
15960
- · ╰── `>` expected
15961
- 6 │
15962
15961
╰────
15963
15962
15964
15963
× Cannot use `await` as an identifier in an async context
You can’t perform that action at this time.
0 commit comments