Class: Melbourne::AST::Match

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

Overview

A regular expression match statement as in:

x =~ /x/

Instance Attribute Summary collapse

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Node

#ascii_graph

Constructor Details

#initialize(line, pattern, flags) ⇒ Match

Returns a new instance of Match.



233
234
235
236
# File 'lib/melbourne/ast/control_flow.rb', line 233

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

Instance Attribute Details

#patternObject

the regex pattern used for the match



231
232
233
# File 'lib/melbourne/ast/control_flow.rb', line 231

def pattern
  @pattern
end