Class: SyntaxTree::RegexpContent
- Inherits:
-
Object
- Object
- SyntaxTree::RegexpContent
- 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
-
#beginning ⇒ Object
readonly
- String
-
the opening of the regular expression.
-
#location ⇒ Object
readonly
- Location
-
the location of this node.
-
#parts ⇒ Object
readonly
- Array[ StringDVar | StringEmbExpr | TStringContent ]
-
the parts of the regular expression.
Instance Method Summary collapse
-
#initialize(beginning:, parts:, location:) ⇒ RegexpContent
constructor
A new instance of RegexpContent.
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
#beginning ⇒ Object (readonly)
- String
-
the opening of the regular expression
9848 9849 9850 |
# File 'lib/syntax_tree.rb', line 9848 def beginning @beginning end |
#location ⇒ Object (readonly)
- Location
-
the location of this node
9855 9856 9857 |
# File 'lib/syntax_tree.rb', line 9855 def location @location end |
#parts ⇒ Object (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 |