Class: Rubinius::AST::BackRef
- Defined in:
- lib/compiler/ast/variables.rb
Constant Summary collapse
- Kinds =
{ :~ => 0, :& => 1, :"`" => 2, :"'" => 3, :+ => 4 }
Instance Attribute Summary collapse
-
#kind ⇒ Object
Returns the value of attribute kind.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(line, ref) ⇒ BackRef
constructor
A new instance of BackRef.
- #mode ⇒ Object
- #to_sexp ⇒ Object
Methods inherited from Node
#ascii_graph, #attributes, #children, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, node_name, #pos, #set_child, transform, #transform, transform_comment, transform_kind, transform_kind=, transform_name, #visit, #walk
Constructor Details
#initialize(line, ref) ⇒ BackRef
Returns a new instance of BackRef.
8 9 10 11 |
# File 'lib/compiler/ast/variables.rb', line 8 def initialize(line, ref) @line = line @kind = ref end |
Instance Attribute Details
#kind ⇒ Object
Returns the value of attribute kind.
6 7 8 |
# File 'lib/compiler/ast/variables.rb', line 6 def kind @kind end |
Instance Method Details
#mode ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/compiler/ast/variables.rb', line 21 def mode unless mode = Kinds[@kind] raise "Unknown backref: #{@kind}" end mode end |
#to_sexp ⇒ Object
29 30 31 |
# File 'lib/compiler/ast/variables.rb', line 29 def to_sexp [:back_ref, @kind] end |