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
- String
-
the beginning of the regular expression
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 9135 def initialize(value:, location:) @value = value @location = location end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 9161 def ===(other) other.is_a?(RegexpBeg) && value === other.value end
Source
# File lib/syntax_tree/node.rb, line 9140 def accept(visitor) visitor.visit_regexp_beg(self) end
Source
# File lib/syntax_tree/node.rb, line 9144 def child_nodes [] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 9148 def copy(value: nil, location: nil) RegexpBeg.new( value: value || self.value, location: location || self.location ) end
Source
# File lib/syntax_tree/node.rb, line 9157 def deconstruct_keys(_keys) { value: value, location: location } end