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.



9933
9934
9935
9936
9937
# File 'lib/syntax_tree.rb', line 9933

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

Instance Attribute Details

#beginningObject (readonly)

String

the opening of the regular expression



9924
9925
9926
# File 'lib/syntax_tree.rb', line 9924

def beginning
  @beginning
end

#locationObject (readonly)

Location

the location of this node



9931
9932
9933
# File 'lib/syntax_tree.rb', line 9931

def location
  @location
end

#partsObject (readonly)

Array[ StringDVar | StringEmbExpr | TStringContent ]

the parts of the

regular expression



9928
9929
9930
# File 'lib/syntax_tree.rb', line 9928

def parts
  @parts
end