Class: SyntaxTree::RegexpBeg
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.
Methods inherited from Node
#child_nodes, #deconstruct, #deconstruct_keys, #format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ RegexpBeg
Returns a new instance of RegexpBeg.
8597 8598 8599 8600 |
# File 'lib/syntax_tree/node.rb', line 8597 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
- Location
-
the location of this node
8595 8596 8597 |
# File 'lib/syntax_tree/node.rb', line 8595 def location @location end |
#value ⇒ Object (readonly)
- String
-
the beginning of the regular expression
8592 8593 8594 |
# File 'lib/syntax_tree/node.rb', line 8592 def value @value end |