OpAssign
represents assigning a value to a variable or constant using an operator like += or ||=.
variable += valueAttributes
Op
the operator being used for the assignment
Node
the expression to be assigned
def initialize(target:, operator:, value:, location:) @target = target @operator = operator @value = value @location = location @comments = [] endPublic Instance Methods Source
def ===(other) other.is_a?(OpAssign) && target === other.target && operator === other.operator && value === other.value endSource
def accept(visitor) visitor.visit_opassign(self) endSource
def child_nodes [target, operator, value] endSource
def copy(target: nil, operator: nil, value: nil, location: nil) node = OpAssign.new( target: target || self.target, operator: operator || self.operator, value: value || self.value, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node endSource
def deconstruct_keys(_keys) { target: target, operator: operator, value: value, location: location, comments: comments } endSource
def format(q) q.group do q.format(target) q.text(" ") q.format(operator) if skip_indent? q.text(" ") q.format(value) else q.indent do q.breakable_space q.format(value) 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