We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 787d866 + b4de758 commit ee58c89Copy full SHA for ee58c89
lib/syntax_tree/node.rb
@@ -8677,7 +8677,11 @@ def deconstruct_keys(keys)
8677
end
8678
8679
def format(q)
8680
- q.format(value) if value
+ if value == :nil
8681
+ q.text("nil")
8682
+ elsif value
8683
+ q.format(value)
8684
+ end
8685
8686
8687
lib/syntax_tree/parser.rb
@@ -2991,7 +2991,7 @@ def on_var_alias(left, right)
2991
# ) -> VarField
2992
def on_var_field(value)
2993
location =
2994
- if value
+ if value && value != :nil
2995
value.location
2996
else
2997
# You can hit this pattern if you're assigning to a splat using
test/fixtures/hshptn.rb
@@ -48,3 +48,7 @@
48
case foo
49
in {}
50
51
+%
52
+case foo
53
+in **nil
54
+end
0 commit comments