Class: SyntaxTree::RegexpBeg
- Inherits:
-
Object
- Object
- SyntaxTree::RegexpBeg
- Defined in:
- lib/syntax_tree.rb
Overview
RegexpBeg represents the start of a regular expression literal.
/.+/
In the example above, RegexpBeg represents the first / token. Regular expression literals can also be declared using the %r syntax, as in:
%r{.+}
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
- Location
-
the location of this node.
-
#value ⇒ Object
readonly
- String
-
the beginning of the regular expression.
Instance Method Summary collapse
-
#initialize(value:, location:) ⇒ RegexpBeg
constructor
A new instance of RegexpBeg.
Constructor Details
#initialize(value:, location:) ⇒ RegexpBeg
Returns a new instance of RegexpBeg.
9969 9970 9971 9972 |
# File 'lib/syntax_tree.rb', line 9969 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
- Location
-
the location of this node
9967 9968 9969 |
# File 'lib/syntax_tree.rb', line 9967 def location @location end |
#value ⇒ Object (readonly)
- String
-
the beginning of the regular expression
9964 9965 9966 |
# File 'lib/syntax_tree.rb', line 9964 def value @value end |