lib/ripper-plus/transformer.rb in ripper-plus-1.2.2 vs lib/ripper-plus/transformer.rb in ripper-plus-1.3.0
- old
+ new
@@ -5,11 +5,11 @@
class DynamicConstantError < SyntaxError; end
class InvalidArgumentError < SyntaxError; end
class DuplicateArgumentError < SyntaxError; end
# Transforms a 1.9.2 Ripper AST into a RipperPlus AST. The only
# change as a result of this transformation is that the nodes for
- # local variable references and zcalls (bareword calls to self)
+ # local variable references and vcalls (bareword calls to self)
# have different node types:
#
# def foo(x)
# y
# y = x
@@ -19,11 +19,11 @@
#
# [:def,
# [:@ident, "foo", [1, 4]],
# [:paren, [:params, [[:@ident, "x", [1, 8]]], nil, nil, nil, nil]],
# [:bodystmt,
- # [[:zcall, [:@ident, "y", [2, 2]]],
+ # [[:vcall, [:@ident, "y", [2, 2]]],
# [:assign,
# [:var_field, [:@ident, "y", [3, 2]]],
# [:var_ref, [:@ident, "x", [3, 6]]]]],
# nil, nil, nil]]
#
@@ -75,12 +75,12 @@
add_variables_from_node(vars, scope_stack)
transform_tree(iterated, scope_stack)
transform_tree(body, scope_stack)
when :var_ref
# When we reach a :var_ref, we should know everything we need to know
- # in order to tell if it should be transformed into a :zcall.
+ # in order to tell if it should be transformed into a :vcall.
if tree[1][0] == :@ident && !scope_stack.has_variable?(tree[1][1])
- tree[0] = :zcall
+ tree[0] = :vcall
end
when :class
name, superclass, body = tree[1..3]
if name[1][0] == :class_name_error || scope_stack.in_method?
wrap_node_with_error(tree)
\ No newline at end of file