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
-
#value ⇒ Object
readonly
[String] the end of the regular expression.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(_keys) ⇒ Object
-
#initialize(value:, location:) ⇒ RegexpEnd
constructor
A new instance of RegexpEnd.
Methods inherited from Node
#construct_keys, #format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ RegexpEnd
Returns a new instance of RegexpEnd.
7434 7435 7436 7437 |
# File 'lib/syntax_tree/node.rb', line 7434 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
[String] the end of the regular expression
7432 7433 7434 |
# File 'lib/syntax_tree/node.rb', line 7432 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
7439 7440 7441 |
# File 'lib/syntax_tree/node.rb', line 7439 def accept(visitor) visitor.visit_regexp_end(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
7443 7444 7445 |
# File 'lib/syntax_tree/node.rb', line 7443 def child_nodes [] end |
#deconstruct_keys(_keys) ⇒ Object
7449 7450 7451 |
# File 'lib/syntax_tree/node.rb', line 7449 def deconstruct_keys(_keys) { value: value, location: location } end |