Module: CodeMiner::VariableProcessor
- Included in:
- Parser
- Defined in:
- lib/codeminer/processors/variable_processor.rb
Instance Method Summary collapse
- #on_backref(value) ⇒ Object
- #on_const_path_ref(const, token) ⇒ Object (also: #on_const_path_field)
- #on_cvar(value) ⇒ Object
- #on_field(receiver, delimiter, token) ⇒ Object
- #on_gvar(value) ⇒ Object
- #on_ivar(value) ⇒ Object
- #on_top_const_ref(token) ⇒ Object (also: #on_top_const_field)
- #on_var_ref(exp) ⇒ Object (also: #on_var_field)
Instance Method Details
#on_backref(value) ⇒ Object
27 28 29 |
# File 'lib/codeminer/processors/variable_processor.rb', line 27 def on_backref(value) BackrefVariableExpression.new(value.slice(1..-1), extract_src_by_value(value)) end |
#on_const_path_ref(const, token) ⇒ Object Also known as: on_const_path_field
35 36 37 |
# File 'lib/codeminer/processors/variable_processor.rb', line 35 def on_const_path_ref(const, token) Colon2Expression.new(token, const, extract_src_by_tokens(const, token)) end |
#on_cvar(value) ⇒ Object
23 24 25 |
# File 'lib/codeminer/processors/variable_processor.rb', line 23 def on_cvar(value) ClassVariableExpression.new(value, extract_src_by_value(value)) end |
#on_field(receiver, delimiter, token) ⇒ Object
31 32 33 |
# File 'lib/codeminer/processors/variable_processor.rb', line 31 def on_field(receiver, delimiter, token) FieldExpression.new(receiver, token, extract_src_by_tokens(receiver, token)) end |
#on_gvar(value) ⇒ Object
15 16 17 |
# File 'lib/codeminer/processors/variable_processor.rb', line 15 def on_gvar(value) GlobalVariableExpression.new(value, extract_src_by_value(value)) end |
#on_ivar(value) ⇒ Object
19 20 21 |
# File 'lib/codeminer/processors/variable_processor.rb', line 19 def on_ivar(value) InstanceVariableExpression.new(value, extract_src_by_value(value)) end |
#on_top_const_ref(token) ⇒ Object Also known as: on_top_const_field
41 42 43 |
# File 'lib/codeminer/processors/variable_processor.rb', line 41 def on_top_const_ref(token) Colon3Expression.new(token, extract_src(token.line, token.column - 2, token.end_line, token.end_column)) end |
#on_var_ref(exp) ⇒ Object Also known as: on_var_field
5 6 7 8 9 10 11 |
# File 'lib/codeminer/processors/variable_processor.rb', line 5 def on_var_ref(exp) if exp.kind_of?(Token) cast_variable_to_type(exp) else exp end end |