Class: SyntaxTree::RegexpEnd
Overview
RegexpEnd represents the end of a regular expression literal.
/.+/m
In the example above, the RegexpEnd event represents the /m at the end of the regular expression literal. You can also declare regular expression literals using %r, as in:
%r{.+}m
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
[Location] the location of this node.
-
#value ⇒ Object
readonly
[String] the end of the regular expression.
Instance Method Summary collapse
-
#initialize(value:, location:) ⇒ RegexpEnd
constructor
A new instance of RegexpEnd.
Methods inherited from Node
#child_nodes, #deconstruct, #deconstruct_keys, #format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ RegexpEnd
Returns a new instance of RegexpEnd.
8620 8621 8622 8623 |
# File 'lib/syntax_tree/node.rb', line 8620 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
[Location] the location of this node
8618 8619 8620 |
# File 'lib/syntax_tree/node.rb', line 8618 def location @location end |
#value ⇒ Object (readonly)
[String] the end of the regular expression
8615 8616 8617 |
# File 'lib/syntax_tree/node.rb', line 8615 def value @value end |