diff --git a/grammar.js b/grammar.js index 347dc01..c036d02 100644 --- a/grammar.js +++ b/grammar.js @@ -28,6 +28,7 @@ const PRECS = { infix_operations: 9, nil_coalescing: 8, check: 7, + prefix_operations: 7, comparison: 6, postfix_operations: 6, equality: 5, @@ -54,7 +55,6 @@ const PRECS = { range_suffix: -2, ternary_binary_suffix: -2, await: -2, - prefix_operations: -2, assignment: -3, comment: -3, lambda: -3, @@ -512,7 +512,7 @@ module.exports = grammar({ ) ), navigation_expression: ($) => - prec.right( + prec.left( PRECS.navigation, seq( field("target", choice($._navigable_type_expression, $._expression)), diff --git a/test/corpus/expressions.txt b/test/corpus/expressions.txt index 571a05b..a77aa17 100755 --- a/test/corpus/expressions.txt +++ b/test/corpus/expressions.txt @@ -1217,24 +1217,3 @@ foo() (call_suffix (value_arguments))) (fully_open_range)) - -================================================================================ -Negated prefix expressions -================================================================================ -let test = !Enum.case.variable - --------------------------------------------------------------------------------- - -(source_file - (property_declaration - (pattern - (simple_identifier)) - (prefix_expression - (bang) - (navigation_expression - (navigation_expression - (simple_identifier) - (navigation_suffix - (simple_identifier))) - (navigation_suffix - (simple_identifier))))))