class Prism::IndexTargetNode

表示对索引的赋值。

foo[bar], = 1
^^^^^^^^

begin
rescue => foo[bar]
          ^^^^^^^^
end

for foo[bar] in baz do end
    ^^^^^^^^

属性

arguments[R]

attr_reader arguments: ArgumentsNode?

block[R]

attr_reader block: BlockArgumentNode?

receiver[R]

attr_reader receiver: Prism::node

公共类方法

new(source, node_id, location, flags, receiver, opening_loc, arguments, closing_loc, block) 点击切换源代码

初始化一个新的 IndexTargetNode 节点。

# File prism/node.rb, line 9622
def initialize(source, node_id, location, flags, receiver, opening_loc, arguments, closing_loc, block)
  @source = source
  @node_id = node_id
  @location = location
  @flags = flags
  @receiver = receiver
  @opening_loc = opening_loc
  @arguments = arguments
  @closing_loc = closing_loc
  @block = block
end
type() 点击切换源代码

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

# File prism/node.rb, line 9747
def self.type
  :index_target_node
end

公共实例方法

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

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

# File prism/node.rb, line 9753
def ===(other)
  other.is_a?(IndexTargetNode) &&
    (flags === other.flags) &&
    (receiver === other.receiver) &&
    (opening_loc.nil? == other.opening_loc.nil?) &&
    (arguments === other.arguments) &&
    (closing_loc.nil? == other.closing_loc.nil?) &&
    (block === other.block)
end
accept(visitor) 点击切换源代码

def accept: (Visitor visitor) -> void

# File prism/node.rb, line 9635
def accept(visitor)
  visitor.visit_index_target_node(self)
end
attribute_write?() 点击切换源代码

def attribute_write?: () -> bool

# File prism/node.rb, line 9682
def attribute_write?
  flags.anybits?(CallNodeFlags::ATTRIBUTE_WRITE)
end
child_nodes() 点击切换源代码

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

# File prism/node.rb, line 9640
def child_nodes
  [receiver, arguments, block]
end
也别名为:deconstruct
closing() 点击切换源代码

def closing: () -> String

# File prism/node.rb, line 9732
def closing
  closing_loc.slice
end
closing_loc() 点击切换源代码

attr_reader closing_loc: Location

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

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

# File prism/node.rb, line 9654
def comment_targets
  [receiver, opening_loc, *arguments, closing_loc, *block] #: Array[Prism::node | Location]
end
compact_child_nodes() 点击切换源代码

def compact_child_nodes: () -> Array

# File prism/node.rb, line 9645
def compact_child_nodes
  compact = [] #: Array[Prism::node]
  compact << receiver
  compact << arguments if arguments
  compact << block if block
  compact
end
copy(node_id: self.node_id, location: self.location, flags: self.flags, receiver: self.receiver, opening_loc: self.opening_loc, arguments: self.arguments, closing_loc: self.closing_loc, block: self.block) 点击切换源代码

def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?receiver: Prism::node, ?opening_loc: Location, ?arguments: ArgumentsNode?, ?closing_loc: Location, ?block: BlockArgumentNode?) -> IndexTargetNode

# File prism/node.rb, line 9659
def copy(node_id: self.node_id, location: self.location, flags: self.flags, receiver: self.receiver, opening_loc: self.opening_loc, arguments: self.arguments, closing_loc: self.closing_loc, block: self.block)
  IndexTargetNode.new(source, node_id, location, flags, receiver, opening_loc, arguments, closing_loc, block)
end
deconstruct()

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

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

def deconstruct_keys: (Array keys) -> { node_id: Integer, location: Location, receiver: Prism::node, opening_loc: Location, arguments: ArgumentsNode?, closing_loc: Location, block: BlockArgumentNode? }

# File prism/node.rb, line 9667
def deconstruct_keys(keys)
  { node_id: node_id, location: location, receiver: receiver, opening_loc: opening_loc, arguments: arguments, closing_loc: closing_loc, block: block }
end
ignore_visibility?() 点击切换源代码

def ignore_visibility?: () -> bool

# File prism/node.rb, line 9687
def ignore_visibility?
  flags.anybits?(CallNodeFlags::IGNORE_VISIBILITY)
end
inspect() 点击切换源代码

def inspect -> String

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

def opening: () -> String

# File prism/node.rb, line 9727
def opening
  opening_loc.slice
end
opening_loc() 点击切换源代码

attr_reader opening_loc: Location

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

def safe_navigation?: () -> bool

# File prism/node.rb, line 9672
def safe_navigation?
  flags.anybits?(CallNodeFlags::SAFE_NAVIGATION)
end
save_closing_loc(repository) 点击切换源代码

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

# File prism/node.rb, line 9719
def save_closing_loc(repository)
  repository.enter(node_id, :closing_loc)
end
save_opening_loc(repository) 点击切换源代码

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

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

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

# File prism/node.rb, line 9742
def type
  :index_target_node
end
variable_call?() 点击切换源代码

def variable_call?: () -> bool

# File prism/node.rb, line 9677
def variable_call?
  flags.anybits?(CallNodeFlags::VARIABLE_CALL)
end