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.
10065 10066 10067 10068 10069 |
# File 'lib/syntax_tree.rb', line 10065 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
10056 10057 10058 |
# File 'lib/syntax_tree.rb', line 10056 def beginning @beginning end |
#location ⇒ Object (readonly)
- Location
-
the location of this node
10063 10064 10065 |
# File 'lib/syntax_tree.rb', line 10063 def location @location end |
#parts ⇒ Object (readonly)
- Array[ StringDVar | StringEmbExpr | TStringContent ]
-
the parts of the
regular expression
10060 10061 10062 |
# File 'lib/syntax_tree.rb', line 10060 def parts @parts end |