Class: Parser::AST::Processor

Inherits:
AST::Processor
  • Object
show all
Defined in:
lib/parser/ast/processor.rb

Direct Known Subclasses

Rewriter

Instance Method Summary (collapse)

Instance Method Details

- (Object) on_argument(node)



87
88
89
90
91
92
93
# File 'lib/parser/ast/processor.rb', line 87

def on_argument(node)
  arg_name, value_node = *node

  node.updated(nil, [
    arg_name, process(value_node)
  ])
end

- (Object) on_casgn(node)



77
78
79
80
81
82
83
# File 'lib/parser/ast/processor.rb', line 77

def on_casgn(node)
  scope_node, name, value_node = *node

  node.updated(nil, [
    process(scope_node), name, process(value_node)
  ])
end

- (Object) on_const(node)



69
70
71
72
73
74
75
# File 'lib/parser/ast/processor.rb', line 69

def on_const(node)
  scope_node, name = *node

  node.updated(nil, [
    process(scope_node), name
  ])
end

- (Object) on_def(node)



116
117
118
119
120
121
122
123
# File 'lib/parser/ast/processor.rb', line 116

def on_def(node)
  name, args_node, body_node = *node

  node.updated(nil, [
    name,
    process(args_node), process(body_node)
  ])
end

- (Object) on_defs(node)



125
126
127
128
129
130
131
132
# File 'lib/parser/ast/processor.rb', line 125

def on_defs(node)
  definee_node, name, args_node, body_node = *node

  node.updated(nil, [
    process(definee_node), name,
    process(args_node), process(body_node)
  ])
end

- (Object) on_op_asgn(node)



58
59
60
61
62
63
64
# File 'lib/parser/ast/processor.rb', line 58

def on_op_asgn(node)
  var_node, method_name, value_node = *node

  node.updated(nil, [
    process(var_node), method_name, process(value_node)
  ])
end

- (Object) on_send(node)



137
138
139
140
141
142
143
144
# File 'lib/parser/ast/processor.rb', line 137

def on_send(node)
  receiver_node, method_name, *arg_nodes = *node

  receiver_node = process(receiver_node) if receiver_node
  node.updated(nil, [
    receiver_node, method_name, *process_all(arg_nodes)
  ])
end

- (Object) on_var(node)



23
24
25
# File 'lib/parser/ast/processor.rb', line 23

def on_var(node)
  node
end

- (Object) on_vasgn(node)



38
39
40
41
42
43
44
# File 'lib/parser/ast/processor.rb', line 38

def on_vasgn(node)
  name, value_node = *node

  node.updated(nil, [
    name, process(value_node)
  ])
end

- (Object) process_argument_node(node) Also known as: on_arg, on_optarg, on_restarg, on_blockarg, on_shadowarg, on_kwarg, on_kwoptarg, on_kwrestarg



95
96
97
# File 'lib/parser/ast/processor.rb', line 95

def process_argument_node(node)
  on_argument(node)
end

- (Object) process_regular_node(node) Also known as: on_dstr, on_dsym, on_regexp, on_xstr, on_splat, on_array, on_pair, on_hash, on_irange, on_erange, on_and_asgn, on_or_asgn, on_mlhs, on_masgn, on_args, on_arg_expr, on_restarg_expr, on_blockarg_expr, on_module, on_class, on_sclass, on_undef, on_alias, on_block, on_while, on_while_post, on_until, on_until_post, on_for, on_return, on_break, on_next, on_redo, on_retry, on_super, on_yield, on_defined?, on_not, on_and, on_or, on_if, on_when, on_case, on_iflipflop, on_eflipflop, on_match_current_line, on_match_with_lvasgn, on_resbody, on_rescue, on_ensure, on_begin, on_kwbegin, on_preexe, on_postexe



8
9
10
# File 'lib/parser/ast/processor.rb', line 8

def process_regular_node(node)
  node.updated(nil, process_all(node))
end

- (Object) process_var_asgn_node(node) Also known as: on_lvasgn, on_ivasgn, on_gvasgn, on_cvasgn



46
47
48
# File 'lib/parser/ast/processor.rb', line 46

def process_var_asgn_node(node)
  on_vasgn(node)
end

- (Object) process_variable_node(node) Also known as: on_lvar, on_ivar, on_gvar, on_cvar, on_back_ref, on_nth_ref



27
28
29
# File 'lib/parser/ast/processor.rb', line 27

def process_variable_node(node)
  on_var(node)
end