File tree 2 files changed +32
-0
lines changed
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ module.exports = grammar({
64
64
[ $ . primary_expression , $ . statement_block , 'object' ] ,
65
65
[ $ . import_statement , $ . import ] ,
66
66
[ $ . export_statement , $ . primary_expression ] ,
67
+ [ $ . primary_expression , $ . await_expression ] ,
67
68
] ,
68
69
69
70
conflicts : $ => [
@@ -1143,6 +1144,7 @@ module.exports = grammar({
1143
1144
'get' ,
1144
1145
'set' ,
1145
1146
'async' ,
1147
+ 'await' ,
1146
1148
'static' ,
1147
1149
'export'
1148
1150
) ,
Original file line number Diff line number Diff line change @@ -319,6 +319,7 @@ Objects with reserved words for keys
319
319
set: function () {},
320
320
static: true,
321
321
async: true,
322
+ await: true,
322
323
};
323
324
324
325
---
@@ -340,6 +341,7 @@ Objects with reserved words for keys
340
341
(property_identifier)
341
342
(function (formal_parameters) (statement_block)))
342
343
(pair (property_identifier) (true))
344
+ (pair (property_identifier) (true))
343
345
(pair (property_identifier) (true)))))
344
346
345
347
============================================
@@ -422,6 +424,7 @@ Classes with reserved words as methods
422
424
class Foo {
423
425
catch() {}
424
426
finally() {}
427
+ await() {}
425
428
}
426
429
427
430
---
@@ -434,6 +437,10 @@ class Foo {
434
437
(property_identifier)
435
438
(formal_parameters)
436
439
(statement_block))
440
+ (method_definition
441
+ (property_identifier)
442
+ (formal_parameters)
443
+ (statement_block))
437
444
(method_definition
438
445
(property_identifier)
439
446
(formal_parameters)
@@ -1358,6 +1365,29 @@ yield db.users.where('[endpoint+email]')
1358
1365
(property_identifier))
1359
1366
(arguments (string (string_fragment)))))))
1360
1367
1368
+ ============================================
1369
+ Reserved words as identifiers
1370
+ ============================================
1371
+
1372
+ function await(await) { await: await (await + await (0)); }
1373
+
1374
+ ---
1375
+
1376
+ (program
1377
+ (function_declaration
1378
+ (identifier)
1379
+ (formal_parameters (identifier))
1380
+ (statement_block
1381
+ (labeled_statement
1382
+ (statement_identifier)
1383
+ (expression_statement
1384
+ (call_expression
1385
+ (identifier)
1386
+ (arguments
1387
+ (binary_expression
1388
+ (identifier)
1389
+ (call_expression (identifier) (arguments (number)))))))))))
1390
+
1361
1391
============================================
1362
1392
JSX
1363
1393
============================================
You can’t perform that action at this time.
0 commit comments