Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Fix precedence of prefix expressions vs nav expressions" #279

Merged
merged 1 commit into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const PRECS = {
infix_operations: 9,
nil_coalescing: 8,
check: 7,
prefix_operations: 7,
comparison: 6,
postfix_operations: 6,
equality: 5,
Expand All @@ -54,7 +55,6 @@ const PRECS = {
range_suffix: -2,
ternary_binary_suffix: -2,
await: -2,
prefix_operations: -2,
assignment: -3,
comment: -3,
lambda: -3,
Expand Down Expand Up @@ -512,7 +512,7 @@ module.exports = grammar({
)
),
navigation_expression: ($) =>
prec.right(
prec.left(
PRECS.navigation,
seq(
field("target", choice($._navigable_type_expression, $._expression)),
Expand Down
21 changes: 0 additions & 21 deletions test/corpus/expressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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))))))