Skip to content

Commit

Permalink
removed grammar conflict, using precedence instead
Browse files Browse the repository at this point in the history
  • Loading branch information
urbit-pilled committed Mar 29, 2024
1 parent c469d93 commit 6fedda7
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const PREC = {
CAST: -1,
LOGICAL_OR_2: 1,
LOGICAL_XOR: 2,
NAMED_TYPE: 2,
LOGICAL_AND_2: 3,
ASSIGNMENT: 4,
TERNARY: 5,
Expand Down Expand Up @@ -92,9 +93,7 @@ const PREC = {

[$.namespace_name_as_prefix],
[$.namespace_use_declaration, $.namespace_name_as_prefix],

[$._modifier, $.named_type],
],
],

inline: $ => [
$._statement,
Expand Down Expand Up @@ -537,7 +536,7 @@ const PREC = {
$.primitive_type,
),

named_type: $ => choice($.name, $.qualified_name, $.grit_metavariable),
named_type: $ => prec(PREC.NAMED_TYPE, choice($.name, $.qualified_name, $.grit_metavariable)),

optional_type: $ => seq(
'?',
Expand Down

0 comments on commit 6fedda7

Please sign in to comment.