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.
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
#beginning ⇒ Object (readonly)
- String
-
the opening of the regular expression
9924 9925 9926 |
# File 'lib/syntax_tree.rb', line 9924 def beginning @beginning end |
#location ⇒ Object (readonly)
- Location
-
the location of this node
9931 9932 9933 |
# File 'lib/syntax_tree.rb', line 9931 def location @location end |
#parts ⇒ Object (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 |