Assign
represents assigning something to a variable or constant. Generally, the left side of the assignment is going to be any node that ends with the name “Field”.
variable = valueAttributes
Node
the expression to be assigned
def initialize(target:, value:, location:) @target = target @value = value @location = location @comments = [] endPublic Instance Methods Source
def ===(other) other.is_a?(Assign) && target === other.target && value === other.value endSource
def accept(visitor) visitor.visit_assign(self) endSource
def child_nodes [target, value] endSource
def copy(target: nil, value: nil, location: nil) node = Assign.new( target: target || self.target, value: value || self.value, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node endSource
def deconstruct_keys(_keys) { target: target, value: value, location: location, comments: comments } endSource
def format(q) q.group do q.format(target) q.text(" =") 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