Skip to content
This repository was archived by the owner on Nov 12, 2024. It is now read-only.

Commit 53485a8

Browse files
committed
removed_auto_semicolon and more
1 parent aa71c4e commit 53485a8

File tree

5 files changed

+73629
-75105
lines changed

5 files changed

+73629
-75105
lines changed

grammar.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ module.exports = grammar({
5858
name: 'dart',
5959

6060
externals: $ => [
61-
$._automatic_semicolon,
6261
$._template_chars_double,
6362
$._template_chars_single,
6463
$._template_chars_double_single,
@@ -92,7 +91,6 @@ module.exports = grammar({
9291
],
9392

9493
conflicts: $ => [
95-
[$.string_literal],
9694
[$.block, $.set_or_map_literal],
9795
[$._primary, $.function_signature],
9896
[$._type_name, $._primary, $.function_signature],
@@ -165,7 +163,6 @@ module.exports = grammar({
165163
[$._type_not_void_not_function],
166164
[$.super_formal_parameter, $.unconditional_assignable_selector],
167165
[$.function_signature],
168-
[$._semicolon]
169166
],
170167

171168
word: $ => $.identifier,
@@ -183,9 +180,7 @@ module.exports = grammar({
183180
repeat(prec.dynamic(22, seq(optional($._metadata), $._top_level_definition))),
184181
//for testing:
185182
repeat($._statement),
186-
// repeat(
187-
// seq($._expression, $._automatic_semicolon)
188-
// )
183+
optional($._expression),
189184
),
190185

191186
// Page 187 topLevelDefinition

src/grammar.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,18 @@
8484
"type": "SYMBOL",
8585
"name": "_statement"
8686
}
87+
},
88+
{
89+
"type": "CHOICE",
90+
"members": [
91+
{
92+
"type": "SYMBOL",
93+
"name": "_expression"
94+
},
95+
{
96+
"type": "BLANK"
97+
}
98+
]
8799
}
88100
]
89101
},
@@ -10154,9 +10166,6 @@
1015410166
}
1015510167
],
1015610168
"conflicts": [
10157-
[
10158-
"string_literal"
10159-
],
1016010169
[
1016110170
"block",
1016210171
"set_or_map_literal"
@@ -10407,17 +10416,10 @@
1040710416
],
1040810417
[
1040910418
"function_signature"
10410-
],
10411-
[
10412-
"_semicolon"
1041310419
]
1041410420
],
1041510421
"precedences": [],
1041610422
"externals": [
10417-
{
10418-
"type": "SYMBOL",
10419-
"name": "_automatic_semicolon"
10420-
},
1042110423
{
1042210424
"type": "SYMBOL",
1042310425
"name": "_template_chars_double"

src/node-types.json

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7426,26 +7426,66 @@
74267426
"multiple": true,
74277427
"required": false,
74287428
"types": [
7429+
{
7430+
"type": "_literal",
7431+
"named": true
7432+
},
74297433
{
74307434
"type": "_statement",
74317435
"named": true
74327436
},
7437+
{
7438+
"type": "additive_expression",
7439+
"named": true
7440+
},
74337441
{
74347442
"type": "annotation",
74357443
"named": true
74367444
},
7445+
{
7446+
"type": "assignment_expression",
7447+
"named": true
7448+
},
7449+
{
7450+
"type": "bitwise_and_expression",
7451+
"named": true
7452+
},
7453+
{
7454+
"type": "bitwise_or_expression",
7455+
"named": true
7456+
},
7457+
{
7458+
"type": "bitwise_xor_expression",
7459+
"named": true
7460+
},
7461+
{
7462+
"type": "cascade_section",
7463+
"named": true
7464+
},
74377465
{
74387466
"type": "class_definition",
74397467
"named": true
74407468
},
7469+
{
7470+
"type": "conditional_expression",
7471+
"named": true
7472+
},
74417473
{
74427474
"type": "const_builtin",
74437475
"named": true
74447476
},
7477+
{
7478+
"type": "const_object_expression",
7479+
"named": true
7480+
},
74457481
{
74467482
"type": "enum_declaration",
74477483
"named": true
74487484
},
7485+
{
7486+
"type": "equality_expression",
7487+
"named": true
7488+
},
74497489
{
74507490
"type": "extension_declaration",
74517491
"named": true
@@ -7458,6 +7498,10 @@
74587498
"type": "function_body",
74597499
"named": true
74607500
},
7501+
{
7502+
"type": "function_expression",
7503+
"named": true
7504+
},
74617505
{
74627506
"type": "function_signature",
74637507
"named": true
@@ -7470,6 +7514,14 @@
74707514
"type": "getter_signature",
74717515
"named": true
74727516
},
7517+
{
7518+
"type": "identifier",
7519+
"named": true
7520+
},
7521+
{
7522+
"type": "if_null_expression",
7523+
"named": true
7524+
},
74737525
{
74747526
"type": "import_or_export",
74757527
"named": true
@@ -7486,6 +7538,14 @@
74867538
"type": "library_name",
74877539
"named": true
74887540
},
7541+
{
7542+
"type": "logical_and_expression",
7543+
"named": true
7544+
},
7545+
{
7546+
"type": "logical_or_expression",
7547+
"named": true
7548+
},
74897549
{
74907550
"type": "marker_annotation",
74917551
"named": true
@@ -7494,6 +7554,18 @@
74947554
"type": "mixin_declaration",
74957555
"named": true
74967556
},
7557+
{
7558+
"type": "multiplicative_expression",
7559+
"named": true
7560+
},
7561+
{
7562+
"type": "new_expression",
7563+
"named": true
7564+
},
7565+
{
7566+
"type": "parenthesized_expression",
7567+
"named": true
7568+
},
74977569
{
74987570
"type": "part_directive",
74997571
"named": true
@@ -7502,18 +7574,46 @@
75027574
"type": "part_of_directive",
75037575
"named": true
75047576
},
7577+
{
7578+
"type": "postfix_expression",
7579+
"named": true
7580+
},
7581+
{
7582+
"type": "relational_expression",
7583+
"named": true
7584+
},
75057585
{
75067586
"type": "script_tag",
75077587
"named": true
75087588
},
7589+
{
7590+
"type": "selector",
7591+
"named": true
7592+
},
75097593
{
75107594
"type": "setter_signature",
75117595
"named": true
75127596
},
7597+
{
7598+
"type": "shift_expression",
7599+
"named": true
7600+
},
75137601
{
75147602
"type": "static_final_declaration_list",
75157603
"named": true
75167604
},
7605+
{
7606+
"type": "super",
7607+
"named": true
7608+
},
7609+
{
7610+
"type": "this",
7611+
"named": true
7612+
},
7613+
{
7614+
"type": "throw_expression",
7615+
"named": true
7616+
},
75177617
{
75187618
"type": "type_alias",
75197619
"named": true
@@ -7522,10 +7622,26 @@
75227622
"type": "type_arguments",
75237623
"named": true
75247624
},
7625+
{
7626+
"type": "type_cast_expression",
7627+
"named": true
7628+
},
75257629
{
75267630
"type": "type_identifier",
75277631
"named": true
75287632
},
7633+
{
7634+
"type": "type_test_expression",
7635+
"named": true
7636+
},
7637+
{
7638+
"type": "unary_expression",
7639+
"named": true
7640+
},
7641+
{
7642+
"type": "unconditional_assignable_selector",
7643+
"named": true
7644+
},
75297645
{
75307646
"type": "void_type",
75317647
"named": true

0 commit comments

Comments
 (0)