Skip to content

Commit

Permalink
Merge pull request #71 from clason/fix/regex
Browse files Browse the repository at this point in the history
fix(grammar): adapt to upstream regex change
  • Loading branch information
TimWhiting authored Apr 28, 2024
2 parents 4e10105 + 597f6d4 commit ac0bb84
Show file tree
Hide file tree
Showing 6 changed files with 3,043 additions and 2,763 deletions.
34 changes: 1 addition & 33 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,30 +95,21 @@ module.exports = grammar({
conflicts: $ => [
[$._record_literal_no_const, $.record_field],
[$.block, $.set_or_map_literal],
[$._primary, $.function_signature],
[$._type_name, $._primary, $.function_signature],
[$._primary, $._type_name],
[$.variable_declaration, $.initialized_variable_definition,],
[$._final_const_var_or_type, $.function_signature,],
[$._primary, $._function_formal_parameter],
[$._primary, $._simple_formal_parameter],
[$._primary, $.labeled_statement],
[$._primary, $._type_name, $._function_formal_parameter],
[$._final_const_var_or_type, $._function_formal_parameter],
[$._primary, $.constructor_param],
[$._normal_formal_parameters],
[$._declared_identifier],
[$.equality_expression],
[$._primary, $._type_name, $._simple_formal_parameter],
[$.record_type_field, $._function_formal_parameter, $._var_or_type],
[$.typed_identifier, $._var_or_type, $._function_formal_parameter],
[$._type_name, $._simple_formal_parameter],
[$._type_not_function, $._type_not_void],
[$.switch_statement_case],
// [$._argument_list],
[$.variable_declaration, $.initialized_identifier,],
[$.declaration, $._external_and_static],
[$.method_signature, $._static_or_covariant],
[$.constructor_signature, $._formal_parameter_part],
// [$._type_not_function, $._type_not_void],
[$._cascade_subsection],
Expand All @@ -130,11 +121,8 @@ module.exports = grammar({
[$.type_arguments, $.relational_operator],
[$.prefix_operator, $.constant_pattern],
[$._primary, $.constant_pattern, $._type_name],
[$.parenthesized_expression, $.if_statement],
[$._top_level_definition, $.lambda_expression],
[$._literal, $.constant_pattern],
[$._primary, $.constant_pattern],
[$._type_not_void_not_function, $.qualified],
[$._final_var_or_type],
[$._primary, $.constant_pattern, $._type_name, $._simple_formal_parameter],
[$._parenthesized_pattern, $._pattern_field],
Expand All @@ -146,62 +134,42 @@ module.exports = grammar({
[$._var_or_type, $._final_var_or_type, $._function_formal_parameter],
[$.set_or_map_literal, $.map_pattern],
[$.list_literal, $.list_pattern],
[$._real_expression, $._pattern],
[$.constant_pattern, $._type_name],
[$._pattern_field, $.label],
[$._pattern],
[$.constructor_tearoff, $._identifier_or_new],
[$._primary, $.constant_pattern, $._simple_formal_parameter],
[$.record_type_field, $._final_var_or_type],
[$._var_or_type, $._final_var_or_type, $.function_signature],
[$._top_level_definition, $._var_or_type, $.function_signature],
[$.set_or_map_literal, $.constant_pattern],
[$.list_literal, $.constant_pattern],
[$.set_or_map_literal, $.block, $.map_pattern],
[$._var_or_type, $.function_signature],
[$._var_or_type, $._function_formal_parameter],
[$.relational_operator, $.type_arguments, $.type_parameters],
[$._var_or_type],
[$._top_level_definition, $._var_or_type],
[$._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],
[$.type_parameter, $._type_name],
[$._normal_formal_parameter],
[$.library_name, $.dotted_identifier_list],
[$._top_level_definition, $.inferred_type],
[$._final_const_var_or_type, $._top_level_definition, $.function_signature],
[$._assignable_selector_part, $.selector],
[$._assignable_selector_part, $._postfix_expression],
[$._assignable_selector_part, $.postfix_expression],
[$._primary, $.assignable_expression],
[$._simple_formal_parameter, $.assignable_expression],
// [$._type_name, $._primary, $.assignable_expression],
[$.assignable_expression, $.postfix_expression],
[$.assignable_expression, $._postfix_expression],
// [$._type_name, $.assignable_expression],
// [$._type_name, $.function_signature],
[$._type_name, $._function_formal_parameter],
[$._type_name],
// [$.assignment_expression, $._expression],
[$.assignable_expression],
[$.method_signature, $.declaration, $._static_or_covariant],
[$.type_arguments],
[$._primary, $._type_name, $.assignable_expression],
[$._primary, $._type_name, $.assignable_expression, $.function_signature],
[$._primary, $._type_name, $.assignable_expression, $._function_formal_parameter],
[$._type_name, $.function_signature],
// [$.relational_operator, $._shift_operator],
[$.declaration, $._external],
[$.relational_expression],
[$.factory_constructor_signature, $.redirecting_factory_constructor_signature],
[$._function_type_tail],
[$._type_not_void_not_function, $._function_type_tail],
[$._type_not_void],
[$._type_not_void_not_function],
[$.super_formal_parameter, $.unconditional_assignable_selector],
[$.function_signature],
],

word: $ => $.identifier,
Expand Down Expand Up @@ -508,7 +476,7 @@ module.exports = grammar({
/[0-7]{1,3}/,
/x[0-9a-fA-F]{2}/,
/u[0-9a-fA-F]{4}/,
/u{[0-9a-fA-F]+}/
/u\{[0-9a-fA-F]+\}/
)
)),
escape_sequence: $ => $._unused_escape_sequence,
Expand Down
Loading

0 comments on commit ac0bb84

Please sign in to comment.