Skip to content

Commit 64e8190

Browse files
committed
Fix up symbols that look like cvar/ivar/gvar in ripper translation
1 parent 6088ca1 commit 64e8190

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/prism/translation/ripper.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2721,6 +2721,12 @@ def visit_token(token)
27212721
on_ident(token)
27222722
when /^[[:upper:]]/
27232723
on_const(token)
2724+
when /^@@/
2725+
on_cvar(token)
2726+
when /^@/
2727+
on_ivar(token)
2728+
when /^\$/
2729+
on_gvar(token)
27242730
when /^[[:punct:]]/
27252731
on_op(token)
27262732
else

test/prism/ripper_test.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class RipperTest < TestCase
2525
dos_endings.txt
2626
embdoc_no_newline_at_end.txt
2727
endless_methods.txt
28-
global_variables.txt
2928
hashes.txt
3029
heredocs_leading_whitespace.txt
3130
heredocs_nested.txt
@@ -89,7 +88,6 @@ class RipperTest < TestCase
8988
single_method_call_with_bang.txt
9089
spanning_heredoc.txt
9190
strings.txt
92-
symbols.txt
9391
ternary_operator.txt
9492
tilde_heredocs.txt
9593
unless.txt

0 commit comments

Comments
 (0)