class Prism::ConstantOperatorWriteNode

表示使用非“=”运算符赋值给常量。

Target += value
^^^^^^^^^^^^^^^

属性

binary_operator[R]

attr_reader binary_operator: Symbol

name[R]

attr_reader name: Symbol

value[R]

attr_reader value: Prism::node

公共类方法

new(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator) 点击切换源代码

初始化一个新的 ConstantOperatorWriteNode 节点。

# File prism/node.rb, line 4721
def initialize(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator)
  @source = source
  @node_id = node_id
  @location = location
  @flags = flags
  @name = name
  @name_loc = name_loc
  @binary_operator_loc = binary_operator_loc
  @value = value
  @binary_operator = binary_operator
end
type() 点击切换源代码

返回此节点类型的符号表示。请参阅 “Node::type”。

# File prism/node.rb, line 4812
def self.type
  :constant_operator_write_node
end

公共实例方法

===(other) 点击切换源代码

为节点实现 case-equality。 这实际上是 == 但不比较位置的值。仅检查位置是否存在。

# File prism/node.rb, line 4818
def ===(other)
  other.is_a?(ConstantOperatorWriteNode) &&
    (name === other.name) &&
    (name_loc.nil? == other.name_loc.nil?) &&
    (binary_operator_loc.nil? == other.binary_operator_loc.nil?) &&
    (value === other.value) &&
    (binary_operator === other.binary_operator)
end
accept(visitor) 点击切换源代码

def accept: (Visitor visitor) -> void

# File prism/node.rb, line 4734
def accept(visitor)
  visitor.visit_constant_operator_write_node(self)
end
binary_operator_loc() 点击切换源代码

attr_reader binary_operator_loc: Location

# File prism/node.rb, line 4783
def binary_operator_loc
  location = @binary_operator_loc
  return location if location.is_a?(Location)
  @binary_operator_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
end
child_nodes() 点击切换源代码

def child_nodes: () -> Array[nil | Node]

# File prism/node.rb, line 4739
def child_nodes
  [value]
end
也别名为:deconstruct
comment_targets() 点击切换源代码

def comment_targets: () -> Array[Node | Location]

# File prism/node.rb, line 4749
def comment_targets
  [name_loc, binary_operator_loc, value] #: Array[Prism::node | Location]
end
compact_child_nodes() 点击切换源代码

def compact_child_nodes: () -> Array

# File prism/node.rb, line 4744
def compact_child_nodes
  [value]
end
copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, binary_operator_loc: self.binary_operator_loc, value: self.value, binary_operator: self.binary_operator) 点击切换源代码

def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?name: Symbol, ?name_loc: Location, ?binary_operator_loc: Location, ?value: Prism::node, ?binary_operator: Symbol) -> ConstantOperatorWriteNode

# File prism/node.rb, line 4754
def copy(node_id: self.node_id, location: self.location, flags: self.flags, name: self.name, name_loc: self.name_loc, binary_operator_loc: self.binary_operator_loc, value: self.value, binary_operator: self.binary_operator)
  ConstantOperatorWriteNode.new(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator)
end
deconstruct()

def deconstruct: () -> Array[nil | Node]

别名为:child_nodes
deconstruct_keys(keys) 点击切换源代码

def deconstruct_keys: (Array keys) -> { node_id: Integer, location: Location, name: Symbol, name_loc: Location, binary_operator_loc: Location, value: Prism::node, binary_operator: Symbol }

# File prism/node.rb, line 4762
def deconstruct_keys(keys)
  { node_id: node_id, location: location, name: name, name_loc: name_loc, binary_operator_loc: binary_operator_loc, value: value, binary_operator: binary_operator }
end
inspect() 点击切换源代码

def inspect -> String

# File prism/node.rb, line 4802
def inspect
  InspectVisitor.compose(self)
end
name_loc() 点击切换源代码

attr_reader name_loc: Location

# File prism/node.rb, line 4770
def name_loc
  location = @name_loc
  return location if location.is_a?(Location)
  @name_loc = Location.new(source, location >> 32, location & 0xFFFFFFFF)
end
operator() 点击切换源代码

返回用于修改接收器的二元运算符。此方法已被弃用,请使用 binary_operator

# File prism/node_ext.rb, line 371
def operator
  deprecated("binary_operator")
  binary_operator
end
operator_loc() 点击切换源代码

返回用于修改接收器的二元运算符的位置。此方法已被弃用,请使用 binary_operator_loc

# File prism/node_ext.rb, line 378
def operator_loc
  deprecated("binary_operator_loc")
  binary_operator_loc
end
save_binary_operator_loc(repository) 点击切换源代码

使用给定的已保存源保存 binary_operator_loc 位置,以便稍后检索。

# File prism/node.rb, line 4791
def save_binary_operator_loc(repository)
  repository.enter(node_id, :binary_operator_loc)
end
save_name_loc(repository) 点击切换源代码

使用给定的已保存源保存 name_loc 位置,以便稍后检索。

# File prism/node.rb, line 4778
def save_name_loc(repository)
  repository.enter(node_id, :name_loc)
end
type() 点击切换源代码

返回此节点类型的符号表示。请参阅 “Node#type”。

# File prism/node.rb, line 4807
def type
  :constant_operator_write_node
end