Class: CodeTools::AST::Match
- Defined in:
- lib/rubinius/ast/control_flow.rb
Instance Attribute Summary collapse
-
#pattern ⇒ Object
Returns the value of attribute pattern.
Attributes inherited from Node
Instance Method Summary collapse
- #bytecode(g) ⇒ Object
-
#initialize(line, pattern, flags) ⇒ Match
constructor
A new instance of Match.
- #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, flags) ⇒ Match
Returns a new instance of Match.
441 442 443 444 |
# File 'lib/rubinius/ast/control_flow.rb', line 441 def initialize(line, pattern, flags) @line = line @pattern = RegexLiteral.new line, pattern, flags end |
Instance Attribute Details
#pattern ⇒ Object
Returns the value of attribute pattern.
439 440 441 |
# File 'lib/rubinius/ast/control_flow.rb', line 439 def pattern @pattern end |
Instance Method Details
#bytecode(g) ⇒ Object
446 447 448 449 450 451 452 453 454 455 456 457 |
# File 'lib/rubinius/ast/control_flow.rb', line 446 def bytecode(g) pos(g) g.push_rubinius g.find_const :Globals g.push_literal :$_ g.send :[], 1 @pattern.bytecode(g) g.send :=~, 1 end |
#to_sexp ⇒ Object
459 460 461 |
# File 'lib/rubinius/ast/control_flow.rb', line 459 def to_sexp [:match, @pattern.to_sexp] end |