Class: Rubinius::AST::Match

Inherits:
Node
  • Object
show all
Defined in:
lib/compiler/ast/control_flow.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#line

Instance Method Summary collapse

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, pattern, flags) ⇒ Match

Returns a new instance of Match.



179
180
181
182
# File 'lib/compiler/ast/control_flow.rb', line 179

def initialize(line, pattern, flags)
  @line = line
  @pattern = RegexLiteral.new line, pattern, flags
end

Instance Attribute Details

#patternObject

Returns the value of attribute pattern.



177
178
179
# File 'lib/compiler/ast/control_flow.rb', line 177

def pattern
  @pattern
end

Instance Method Details

#to_sexpObject



184
185
186
# File 'lib/compiler/ast/control_flow.rb', line 184

def to_sexp
  [:match, @pattern.to_sexp]
end