find another potential precedence issue with non null assertions, also added some more null aware syntax

pull/185/head
Tim Whiting 2020-07-14 22:28:09 +07:00
parent 245ef1215a
commit a3376f9880
5 changed files with 94932 additions and 92402 deletions

@ -157,7 +157,6 @@ module.exports = grammar({
[$.assignable_expression],
[$.assignable_selector_part, $.selector],
[$.postfix_expression],
[$._top_level_definition, $._final_const_var_or_type],
[$.assignable_expression, $._primary],
[$._declared_identifier],
[$.equality_expression],
@ -174,6 +173,7 @@ module.exports = grammar({
[$._postfix_expression, $.assignable_expression],
[$._postfix_expression],
[$._top_level_definition, $.lambda_expression],
[$._top_level_definition, $._final_const_var_or_type],
[$._top_level_definition, $.const_object_expression, $._final_const_var_or_type],
[$._final_const_var_or_type, $.const_object_expression],
[$._final_const_var_or_type],
@ -1843,12 +1843,13 @@ module.exports = grammar({
$.static_final_declaration_list
),
seq(
$._final_builtin,
optional($._late_builtin), $._final_builtin,
optional($._type),
$.initialized_identifier_list
),
seq(
optional($._static_or_covariant),
optional($._late_builtin),
choice(
$._type,
$.inferred_type
@ -2173,6 +2174,7 @@ module.exports = grammar({
_final_const_var_or_type: $ => choice(
seq($._final_builtin, optional($._type)),
seq($._const_builtin, optional($._type)),
seq($._late_builtin, optional($._final_builtin), optional($._type)),
$.inferred_type,
$._type
),
@ -2195,7 +2197,9 @@ module.exports = grammar({
choice(
seq(
$._type_name,
optional($.type_arguments)
optional($._nullable_type),
optional($.type_arguments),
optional($._nullable_type)
),
$._function_builtin_identifier
)
@ -2758,6 +2762,10 @@ module.exports = grammar({
DART_PREC.BUILTIN,
'final',
),
_late_builtin: $ => prec(
DART_PREC.BUILTIN,
'late',
),
_external_builtin: $ => prec(
DART_PREC.BUILTIN,
'external',

@ -6905,6 +6905,18 @@
{
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_late_builtin"
},
{
"type": "BLANK"
}
]
},
{
"type": "SYMBOL",
"name": "_final_builtin"
@ -6942,6 +6954,18 @@
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_late_builtin"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
@ -7933,6 +7957,39 @@
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_late_builtin"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_final_builtin"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_type"
},
{
"type": "BLANK"
}
]
}
]
},
{
"type": "SYMBOL",
"name": "inferred_type"
@ -7995,6 +8052,18 @@
"type": "SYMBOL",
"name": "_type_name"
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_nullable_type"
},
{
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
@ -8006,6 +8075,18 @@
"type": "BLANK"
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "_nullable_type"
},
{
"type": "BLANK"
}
]
}
]
},
@ -9699,6 +9780,14 @@
"value": "final"
}
},
"_late_builtin": {
"type": "PREC",
"value": 0,
"content": {
"type": "STRING",
"value": "late"
}
},
"_external_builtin": {
"type": "PREC",
"value": 0,
@ -9878,10 +9967,6 @@
[
"postfix_expression"
],
[
"_top_level_definition",
"_final_const_var_or_type"
],
[
"assignable_expression",
"_primary"
@ -9939,6 +10024,10 @@
"_top_level_definition",
"lambda_expression"
],
[
"_top_level_definition",
"_final_const_var_or_type"
],
[
"_top_level_definition",
"const_object_expression",

@ -10712,6 +10712,10 @@
"type": "is",
"named": false
},
{
"type": "late",
"named": false
},
{
"type": "library",
"named": false

File diff suppressed because it is too large Load Diff

@ -370,3 +370,14 @@ if (data['frame_count'] as int < 5) {
}
---
(program )
==========================
Simple non-null assertion
==========================
my!.size = 1;
---