class SyntaxTree::RegexpBeg

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{.+}

Attributes

value[R]
String

the beginning of the regular expression

Public Class Methods

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

Public Instance Methods

===(other) click to toggle source
# File lib/syntax_tree/node.rb, line 9146
def ===(other)
  other.is_a?(RegexpBeg) && value === other.value
end
accept(visitor) click to toggle source
# File lib/syntax_tree/node.rb, line 9125
def accept(visitor)
  visitor.visit_regexp_beg(self)
end
child_nodes() click to toggle source
# File lib/syntax_tree/node.rb, line 9129
def child_nodes
  []
end
Also aliased as: deconstruct
copy(value: nil, location: nil) click to toggle source
# File lib/syntax_tree/node.rb, line 9133
def copy(value: nil, location: nil)
  RegexpBeg.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 9142
def deconstruct_keys(_keys)
  { value: value, location: location }
end