class SyntaxTree::RegexpContent
RegexpContent
represents the body of a regular expression.
/.+ #{pattern} .+/
In
the example above, a RegexpContent
node represents everything contained within the forward slashes.
Attributes
- String
-
the opening of the regular expression
- Array[
StringDVar
|StringEmbExpr
|TStringContent
] -
the parts of the
regular expression
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 9088 def initialize(beginning:, parts:, location:) @beginning = beginning @parts = parts @location = location end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 9116 def ===(other) other.is_a?(RegexpContent) && beginning === other.beginning && parts === other.parts end
Source
# File lib/syntax_tree/node.rb, line 9094 def accept(visitor) visitor.visit_regexp_content(self) end
Source
# File lib/syntax_tree/node.rb, line 9098 def child_nodes parts end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 9102 def copy(beginning: nil, parts: nil, location: nil) RegexpContent.new( beginning: beginning || self.beginning, parts: parts || self.parts, location: location || self.location ) end
Source
# File lib/syntax_tree/node.rb, line 9112 def deconstruct_keys(_keys) { beginning: beginning, parts: parts, location: location } end