Class: SyntaxTree::RegexpEnd

Inherits:
Node
  • Object
show all
Defined in:
lib/syntax_tree/node.rb

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

Instance Method Summary collapse

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

#locationObject (readonly)

[Location] the location of this node



8618
8619
8620
# File 'lib/syntax_tree/node.rb', line 8618

def location
  @location
end

#valueObject (readonly)

[String] the end of the regular expression



8615
8616
8617
# File 'lib/syntax_tree/node.rb', line 8615

def value
  @value
end