Class: CodeTools::AST::Match3
- Defined in:
- lib/rubinius/code/ast/control_flow.rb
Instance Attribute Summary collapse
-
#pattern ⇒ Object
Returns the value of attribute pattern.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Node
Instance Method Summary collapse
- #bytecode(g) ⇒ Object
-
#initialize(line, pattern, value) ⇒ Match3
constructor
A new instance of Match3.
- #to_sexp ⇒ Object
Methods inherited from Node
#ascii_graph, #attributes, #children, #defined, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, #or_bytecode, #pos, #set_child, #transform, transform, transform_comment, transform_kind, transform_kind=, transform_name, #value_defined, #visit, #walk
Constructor Details
#initialize(line, pattern, value) ⇒ Match3
Returns a new instance of Match3.
521 522 523 524 525 |
# File 'lib/rubinius/code/ast/control_flow.rb', line 521 def initialize(line, pattern, value) @line = line @pattern = pattern @value = value end |
Instance Attribute Details
#pattern ⇒ Object
Returns the value of attribute pattern.
519 520 521 |
# File 'lib/rubinius/code/ast/control_flow.rb', line 519 def pattern @pattern end |
#value ⇒ Object
Returns the value of attribute value.
519 520 521 |
# File 'lib/rubinius/code/ast/control_flow.rb', line 519 def value @value end |
Instance Method Details
#bytecode(g) ⇒ Object
527 528 529 530 531 532 533 |
# File 'lib/rubinius/code/ast/control_flow.rb', line 527 def bytecode(g) pos(g) @value.bytecode(g) @pattern.bytecode(g) g.send :=~, 1 end |
#to_sexp ⇒ Object
535 536 537 |
# File 'lib/rubinius/code/ast/control_flow.rb', line 535 def to_sexp [:match3, @pattern.to_sexp, @value.to_sexp] end |