RAssign
represents a single-line pattern match.
value in pattern value => patternAttributes
Kw
| Op
the operator being used to match against the pattern, which is
either => or in
Node
the pattern on the right-hand side of the expression
Node
the left-hand expression
def initialize(value:, operator:, pattern:, location:) @value = value @operator = operator @pattern = pattern @location = location @comments = [] endPublic Instance Methods Source
def ===(other) other.is_a?(RAssign) && value === other.value && operator === other.operator && pattern === other.pattern endSource
def accept(visitor) visitor.visit_rassign(self) endSource
def child_nodes [value, operator, pattern] endSource
def copy(value: nil, operator: nil, pattern: nil, location: nil) node = RAssign.new( value: value || self.value, operator: operator || self.operator, pattern: pattern || self.pattern, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node endSource
def deconstruct_keys(_keys) { value: value, operator: operator, pattern: pattern, location: location, comments: comments } endSource
def format(q) q.group do q.format(value) q.text(" ") q.format(operator) case pattern when AryPtn, FndPtn, HshPtn q.text(" ") q.format(pattern) else q.group do q.indent do q.breakable_space q.format(pattern) end end end end end
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4