class SyntaxTree::RegexpEnd

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

Attributes

value[R]
String

the end of the regular expression

Public Class Methods

new(value:, location:) click to toggle source
# File lib/syntax_tree/node.rb, line 9165
def initialize(value:, location:)
  @value = value
  @location = location
end

Public Instance Methods

===(other) click to toggle source
# File lib/syntax_tree/node.rb, line 9191
def ===(other)
  other.is_a?(RegexpEnd) && value === other.value
end
accept(visitor) click to toggle source
# File lib/syntax_tree/node.rb, line 9170
def accept(visitor)
  visitor.visit_regexp_end(self)
end
child_nodes() click to toggle source
# File lib/syntax_tree/node.rb, line 9174
def child_nodes
  []
end
Also aliased as: deconstruct
copy(value: nil, location: nil) click to toggle source
# File lib/syntax_tree/node.rb, line 9178
def copy(value: nil, location: nil)
  RegexpEnd.new(
    value: value || self.value,
    location: location || self.location
  )
end
deconstruct()
Alias for: child_nodes
deconstruct_keys(_keys) click to toggle source
# File lib/syntax_tree/node.rb, line 9187
def deconstruct_keys(_keys)
  { value: value, location: location }
end