Class: SyntaxTree::RegexpContent

Inherits:
Object
  • Object
show all
Defined in:
lib/syntax_tree.rb

Overview

RegexpContent represents the body of a regular expression.

/.+ #{pattern} .+/

In the example above, a RegexpContent node represents everything contained within the forward slashes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(beginning:, parts:, location:) ⇒ RegexpContent

Returns a new instance of RegexpContent.



9857
9858
9859
9860
9861
# File 'lib/syntax_tree.rb', line 9857

def initialize(beginning:, parts:, location:)
  @beginning = beginning
  @parts = parts
  @location = location
end

Instance Attribute Details

#beginningObject (readonly)

String

the opening of the regular expression



9848
9849
9850
# File 'lib/syntax_tree.rb', line 9848

def beginning
  @beginning
end

#locationObject (readonly)

Location

the location of this node



9855
9856
9857
# File 'lib/syntax_tree.rb', line 9855

def location
  @location
end

#partsObject (readonly)

Array[ StringDVar | StringEmbExpr | TStringContent ]

the parts of the

regular expression



9852
9853
9854
# File 'lib/syntax_tree.rb', line 9852

def parts
  @parts
end