模块 Prism::DSL

DSL 模块提供了一组方法,可以使用这些方法以更简洁的方式创建 prism 节点。例如,与其编写

source = Prism::Source.for("[1]")

Prism::ArrayNode.new(
  source,
  0,
  Prism::Location.new(source, 0, 3),
  0,
  [
    Prism::IntegerNode.new(
      source,
      0,
      Prism::Location.new(source, 1, 1),
      Prism::IntegerBaseFlags::DECIMAL,
      1
    )
  ],
  Prism::Location.new(source, 0, 1),
  Prism::Location.new(source, 2, 1)
)

不如编写

class Builder
  include Prism::DSL

  attr_reader :default_source

  def initialize
    @default_source = source("[1]")
  end

  def build
    array_node(
      location: location(start_offset: 0, length: 3),
      elements: [
        integer_node(
          location: location(start_offset: 1, length: 1),
          flags: integer_base_flag(:decimal),
          value: 1
        )
      ],
      opening_loc: location(start_offset: 0, length: 1),
      closing_loc: location(start_offset: 2, length: 1)
    )
  end
end

这在以编程方式生成树时非常有用。

公共实例方法

alias_global_variable_node(source: default_source, node_id: 0, location: default_location, flags: 0, new_name: global_variable_read_node(source: source), old_name: global_variable_read_node(source: source), keyword_loc: location) 单击以切换源代码

创建一个新的 AliasGlobalVariableNode 节点。

# File prism/dsl.rb, line 77
def alias_global_variable_node(source: default_source, node_id: 0, location: default_location, flags: 0, new_name: global_variable_read_node(source: source), old_name: global_variable_read_node(source: source), keyword_loc: location)
  AliasGlobalVariableNode.new(source, node_id, location, flags, new_name, old_name, keyword_loc)
end
alias_method_node(source: default_source, node_id: 0, location: default_location, flags: 0, new_name: symbol_node(source: source), old_name: symbol_node(source: source), keyword_loc: location) 单击以切换源代码

创建一个新的 AliasMethodNode 节点。

# File prism/dsl.rb, line 82
def alias_method_node(source: default_source, node_id: 0, location: default_location, flags: 0, new_name: symbol_node(source: source), old_name: symbol_node(source: source), keyword_loc: location)
  AliasMethodNode.new(source, node_id, location, flags, new_name, old_name, keyword_loc)
end
alternation_pattern_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: default_node(source, location), right: default_node(source, location), operator_loc: location) 单击以切换源代码

创建一个新的 AlternationPatternNode 节点。

# File prism/dsl.rb, line 87
def alternation_pattern_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: default_node(source, location), right: default_node(source, location), operator_loc: location)
  AlternationPatternNode.new(source, node_id, location, flags, left, right, operator_loc)
end
and_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: default_node(source, location), right: default_node(source, location), operator_loc: location) 单击以切换源代码

创建一个新的 AndNode 节点。

# File prism/dsl.rb, line 92
def and_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: default_node(source, location), right: default_node(source, location), operator_loc: location)
  AndNode.new(source, node_id, location, flags, left, right, operator_loc)
end
arguments_node(source: default_source, node_id: 0, location: default_location, flags: 0, arguments: []) 单击以切换源代码

创建一个新的 ArgumentsNode 节点。

# File prism/dsl.rb, line 97
def arguments_node(source: default_source, node_id: 0, location: default_location, flags: 0, arguments: [])
  ArgumentsNode.new(source, node_id, location, flags, arguments)
end
arguments_node_flag(name) 单击以切换源代码

检索 ArgumentsNodeFlags 标志之一的值。

# File prism/dsl.rb, line 832
def arguments_node_flag(name)
  case name
  when :contains_forwarding then ArgumentsNodeFlags::CONTAINS_FORWARDING
  when :contains_keywords then ArgumentsNodeFlags::CONTAINS_KEYWORDS
  when :contains_keyword_splat then ArgumentsNodeFlags::CONTAINS_KEYWORD_SPLAT
  when :contains_splat then ArgumentsNodeFlags::CONTAINS_SPLAT
  when :contains_multiple_splats then ArgumentsNodeFlags::CONTAINS_MULTIPLE_SPLATS
  else Kernel.raise ArgumentError, "invalid ArgumentsNodeFlags flag: #{name.inspect}"
  end
end
array_node(source: default_source, node_id: 0, location: default_location, flags: 0, elements: [], opening_loc: nil, closing_loc: nil) 单击以切换源代码

创建一个新的 ArrayNode 节点。

# File prism/dsl.rb, line 102
def array_node(source: default_source, node_id: 0, location: default_location, flags: 0, elements: [], opening_loc: nil, closing_loc: nil)
  ArrayNode.new(source, node_id, location, flags, elements, opening_loc, closing_loc)
end
array_node_flag(name) 单击以切换源代码

检索 ArrayNodeFlags 标志之一的值。

# File prism/dsl.rb, line 844
def array_node_flag(name)
  case name
  when :contains_splat then ArrayNodeFlags::CONTAINS_SPLAT
  else Kernel.raise ArgumentError, "invalid ArrayNodeFlags flag: #{name.inspect}"
  end
end
array_pattern_node(source: default_source, node_id: 0, location: default_location, flags: 0, constant: nil, requireds: [], rest: nil, posts: [], opening_loc: nil, closing_loc: nil) 单击以切换源代码

创建一个新的 ArrayPatternNode 节点。

# File prism/dsl.rb, line 107
def array_pattern_node(source: default_source, node_id: 0, location: default_location, flags: 0, constant: nil, requireds: [], rest: nil, posts: [], opening_loc: nil, closing_loc: nil)
  ArrayPatternNode.new(source, node_id, location, flags, constant, requireds, rest, posts, opening_loc, closing_loc)
end
assoc_node(source: default_source, node_id: 0, location: default_location, flags: 0, key: default_node(source, location), value: default_node(source, location), operator_loc: nil) 单击以切换源代码

创建一个新的 AssocNode 节点。

# File prism/dsl.rb, line 112
def assoc_node(source: default_source, node_id: 0, location: default_location, flags: 0, key: default_node(source, location), value: default_node(source, location), operator_loc: nil)
  AssocNode.new(source, node_id, location, flags, key, value, operator_loc)
end
assoc_splat_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: nil, operator_loc: location) 单击以切换源代码

创建一个新的 AssocSplatNode 节点。

# File prism/dsl.rb, line 117
def assoc_splat_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: nil, operator_loc: location)
  AssocSplatNode.new(source, node_id, location, flags, value, operator_loc)
end
back_reference_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"") 单击以切换源代码

创建一个新的 BackReferenceReadNode 节点。

# File prism/dsl.rb, line 122
def back_reference_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
  BackReferenceReadNode.new(source, node_id, location, flags, name)
end
begin_node(source: default_source, node_id: 0, location: default_location, flags: 0, begin_keyword_loc: nil, statements: nil, rescue_clause: nil, else_clause: nil, ensure_clause: nil, end_keyword_loc: nil) 单击以切换源代码

创建一个新的 BeginNode 节点。

# File prism/dsl.rb, line 127
def begin_node(source: default_source, node_id: 0, location: default_location, flags: 0, begin_keyword_loc: nil, statements: nil, rescue_clause: nil, else_clause: nil, ensure_clause: nil, end_keyword_loc: nil)
  BeginNode.new(source, node_id, location, flags, begin_keyword_loc, statements, rescue_clause, else_clause, ensure_clause, end_keyword_loc)
end
block_argument_node(source: default_source, node_id: 0, location: default_location, flags: 0, expression: nil, operator_loc: location) 单击以切换源代码

创建一个新的 BlockArgumentNode 节点。

# File prism/dsl.rb, line 132
def block_argument_node(source: default_source, node_id: 0, location: default_location, flags: 0, expression: nil, operator_loc: location)
  BlockArgumentNode.new(source, node_id, location, flags, expression, operator_loc)
end
block_local_variable_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"") 单击以切换源代码

创建一个新的 BlockLocalVariableNode 节点。

# File prism/dsl.rb, line 137
def block_local_variable_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
  BlockLocalVariableNode.new(source, node_id, location, flags, name)
end
block_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], parameters: nil, body: nil, opening_loc: location, closing_loc: location) 单击以切换源代码

创建一个新的 BlockNode 节点。

# File prism/dsl.rb, line 142
def block_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], parameters: nil, body: nil, opening_loc: location, closing_loc: location)
  BlockNode.new(source, node_id, location, flags, locals, parameters, body, opening_loc, closing_loc)
end
block_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: nil, name_loc: nil, operator_loc: location) 单击以切换源代码

创建一个新的 BlockParameterNode 节点。

# File prism/dsl.rb, line 147
def block_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: nil, name_loc: nil, operator_loc: location)
  BlockParameterNode.new(source, node_id, location, flags, name, name_loc, operator_loc)
end
block_parameters_node(source: default_source, node_id: 0, location: default_location, flags: 0, parameters: nil, locals: [], opening_loc: nil, closing_loc: nil) 单击以切换源代码

创建一个新的 BlockParametersNode 节点。

# File prism/dsl.rb, line 152
def block_parameters_node(source: default_source, node_id: 0, location: default_location, flags: 0, parameters: nil, locals: [], opening_loc: nil, closing_loc: nil)
  BlockParametersNode.new(source, node_id, location, flags, parameters, locals, opening_loc, closing_loc)
end
break_node(source: default_source, node_id: 0, location: default_location, flags: 0, arguments: nil, keyword_loc: location) 单击以切换源代码

创建一个新的 BreakNode 节点。

# File prism/dsl.rb, line 157
def break_node(source: default_source, node_id: 0, location: default_location, flags: 0, arguments: nil, keyword_loc: location)
  BreakNode.new(source, node_id, location, flags, arguments, keyword_loc)
end
call_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, message_loc: nil, read_name: :"", write_name: :"", operator_loc: location, value: default_node(source, location)) 单击以切换源代码

创建一个新的 CallAndWriteNode 节点。

# File prism/dsl.rb, line 162
def call_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, message_loc: nil, read_name: :"", write_name: :"", operator_loc: location, value: default_node(source, location))
  CallAndWriteNode.new(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value)
end
call_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, name: :"", message_loc: nil, opening_loc: nil, arguments: nil, closing_loc: nil, block: nil) 单击以切换源代码

创建一个新的 CallNode 节点。

# File prism/dsl.rb, line 167
def call_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, name: :"", message_loc: nil, opening_loc: nil, arguments: nil, closing_loc: nil, block: nil)
  CallNode.new(source, node_id, location, flags, receiver, call_operator_loc, name, message_loc, opening_loc, arguments, closing_loc, block)
end
call_node_flag(name) 单击以切换源代码

检索 CallNodeFlags 标志之一的值。

# File prism/dsl.rb, line 852
def call_node_flag(name)
  case name
  when :safe_navigation then CallNodeFlags::SAFE_NAVIGATION
  when :variable_call then CallNodeFlags::VARIABLE_CALL
  when :attribute_write then CallNodeFlags::ATTRIBUTE_WRITE
  when :ignore_visibility then CallNodeFlags::IGNORE_VISIBILITY
  else Kernel.raise ArgumentError, "invalid CallNodeFlags flag: #{name.inspect}"
  end
end
call_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, message_loc: nil, read_name: :"", write_name: :"", binary_operator: :"", binary_operator_loc: location, value: default_node(source, location)) 点击切换源代码

创建一个新的 CallOperatorWriteNode 节点。

# File prism/dsl.rb, line 172
def call_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, message_loc: nil, read_name: :"", write_name: :"", binary_operator: :"", binary_operator_loc: location, value: default_node(source, location))
  CallOperatorWriteNode.new(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, binary_operator, binary_operator_loc, value)
end
call_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, message_loc: nil, read_name: :"", write_name: :"", operator_loc: location, value: default_node(source, location)) 点击切换源代码

创建一个新的 CallOrWriteNode 节点。

# File prism/dsl.rb, line 177
def call_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, message_loc: nil, read_name: :"", write_name: :"", operator_loc: location, value: default_node(source, location))
  CallOrWriteNode.new(source, node_id, location, flags, receiver, call_operator_loc, message_loc, read_name, write_name, operator_loc, value)
end
call_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: default_node(source, location), call_operator_loc: location, name: :"", message_loc: location) 点击切换源代码

创建一个新的 CallTargetNode 节点。

# File prism/dsl.rb, line 182
def call_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: default_node(source, location), call_operator_loc: location, name: :"", message_loc: location)
  CallTargetNode.new(source, node_id, location, flags, receiver, call_operator_loc, name, message_loc)
end
capture_pattern_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: default_node(source, location), target: local_variable_target_node(source: source), operator_loc: location) 点击切换源代码

创建一个新的 CapturePatternNode 节点。

# File prism/dsl.rb, line 187
def capture_pattern_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: default_node(source, location), target: local_variable_target_node(source: source), operator_loc: location)
  CapturePatternNode.new(source, node_id, location, flags, value, target, operator_loc)
end
case_match_node(source: default_source, node_id: 0, location: default_location, flags: 0, predicate: nil, conditions: [], else_clause: nil, case_keyword_loc: location, end_keyword_loc: location) 点击切换源代码

创建一个新的 CaseMatchNode 节点。

# File prism/dsl.rb, line 192
def case_match_node(source: default_source, node_id: 0, location: default_location, flags: 0, predicate: nil, conditions: [], else_clause: nil, case_keyword_loc: location, end_keyword_loc: location)
  CaseMatchNode.new(source, node_id, location, flags, predicate, conditions, else_clause, case_keyword_loc, end_keyword_loc)
end
case_node(source: default_source, node_id: 0, location: default_location, flags: 0, predicate: nil, conditions: [], else_clause: nil, case_keyword_loc: location, end_keyword_loc: location) 点击切换源代码

创建一个新的 CaseNode 节点。

# File prism/dsl.rb, line 197
def case_node(source: default_source, node_id: 0, location: default_location, flags: 0, predicate: nil, conditions: [], else_clause: nil, case_keyword_loc: location, end_keyword_loc: location)
  CaseNode.new(source, node_id, location, flags, predicate, conditions, else_clause, case_keyword_loc, end_keyword_loc)
end
class_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], class_keyword_loc: location, constant_path: constant_read_node(source: source), inheritance_operator_loc: nil, superclass: nil, body: nil, end_keyword_loc: location, name: :"") 点击切换源代码

创建一个新的 ClassNode 节点。

# File prism/dsl.rb, line 202
def class_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], class_keyword_loc: location, constant_path: constant_read_node(source: source), inheritance_operator_loc: nil, superclass: nil, body: nil, end_keyword_loc: location, name: :"")
  ClassNode.new(source, node_id, location, flags, locals, class_keyword_loc, constant_path, inheritance_operator_loc, superclass, body, end_keyword_loc, name)
end
class_variable_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location)) 点击切换源代码

创建一个新的 ClassVariableAndWriteNode 节点。

# File prism/dsl.rb, line 207
def class_variable_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location))
  ClassVariableAndWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
end
class_variable_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, binary_operator_loc: location, value: default_node(source, location), binary_operator: :"") 点击切换源代码

创建一个新的 ClassVariableOperatorWriteNode 节点。

# File prism/dsl.rb, line 212
def class_variable_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, binary_operator_loc: location, value: default_node(source, location), binary_operator: :"")
  ClassVariableOperatorWriteNode.new(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator)
end
class_variable_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location)) 点击切换源代码

创建一个新的 ClassVariableOrWriteNode 节点。

# File prism/dsl.rb, line 217
def class_variable_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location))
  ClassVariableOrWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
end
class_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"") 点击切换源代码

创建一个新的 ClassVariableReadNode 节点。

# File prism/dsl.rb, line 222
def class_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
  ClassVariableReadNode.new(source, node_id, location, flags, name)
end
class_variable_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"") 点击切换源代码

创建一个新的 ClassVariableTargetNode 节点。

# File prism/dsl.rb, line 227
def class_variable_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
  ClassVariableTargetNode.new(source, node_id, location, flags, name)
end
class_variable_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, value: default_node(source, location), operator_loc: location) 点击切换源代码

创建一个新的 ClassVariableWriteNode 节点。

# File prism/dsl.rb, line 232
def class_variable_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, value: default_node(source, location), operator_loc: location)
  ClassVariableWriteNode.new(source, node_id, location, flags, name, name_loc, value, operator_loc)
end
constant_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location)) 点击切换源代码

创建一个新的 ConstantAndWriteNode 节点。

# File prism/dsl.rb, line 237
def constant_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location))
  ConstantAndWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
end
constant_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, binary_operator_loc: location, value: default_node(source, location), binary_operator: :"") 点击切换源代码

创建一个新的 ConstantOperatorWriteNode 节点。

# File prism/dsl.rb, line 242
def constant_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, binary_operator_loc: location, value: default_node(source, location), binary_operator: :"")
  ConstantOperatorWriteNode.new(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator)
end
constant_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location)) 点击切换源代码

创建一个新的 ConstantOrWriteNode 节点。

# File prism/dsl.rb, line 247
def constant_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location))
  ConstantOrWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
end
constant_path_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, target: constant_path_node(source: source), operator_loc: location, value: default_node(source, location)) 点击切换源代码

创建一个新的 ConstantPathAndWriteNode 节点。

# File prism/dsl.rb, line 252
def constant_path_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, target: constant_path_node(source: source), operator_loc: location, value: default_node(source, location))
  ConstantPathAndWriteNode.new(source, node_id, location, flags, target, operator_loc, value)
end
constant_path_node(source: default_source, node_id: 0, location: default_location, flags: 0, parent: nil, name: nil, delimiter_loc: location, name_loc: location) 点击切换源代码

创建一个新的 ConstantPathNode 节点。

# File prism/dsl.rb, line 257
def constant_path_node(source: default_source, node_id: 0, location: default_location, flags: 0, parent: nil, name: nil, delimiter_loc: location, name_loc: location)
  ConstantPathNode.new(source, node_id, location, flags, parent, name, delimiter_loc, name_loc)
end
constant_path_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, target: constant_path_node(source: source), binary_operator_loc: location, value: default_node(source, location), binary_operator: :"") 点击切换源代码

创建一个新的 ConstantPathOperatorWriteNode 节点。

# File prism/dsl.rb, line 262
def constant_path_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, target: constant_path_node(source: source), binary_operator_loc: location, value: default_node(source, location), binary_operator: :"")
  ConstantPathOperatorWriteNode.new(source, node_id, location, flags, target, binary_operator_loc, value, binary_operator)
end
constant_path_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, target: constant_path_node(source: source), operator_loc: location, value: default_node(source, location)) 点击切换源代码

创建一个新的 ConstantPathOrWriteNode 节点。

# File prism/dsl.rb, line 267
def constant_path_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, target: constant_path_node(source: source), operator_loc: location, value: default_node(source, location))
  ConstantPathOrWriteNode.new(source, node_id, location, flags, target, operator_loc, value)
end
constant_path_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, parent: nil, name: nil, delimiter_loc: location, name_loc: location) 点击切换源代码

创建一个新的 ConstantPathTargetNode 节点。

# File prism/dsl.rb, line 272
def constant_path_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, parent: nil, name: nil, delimiter_loc: location, name_loc: location)
  ConstantPathTargetNode.new(source, node_id, location, flags, parent, name, delimiter_loc, name_loc)
end
constant_path_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, target: constant_path_node(source: source), operator_loc: location, value: default_node(source, location)) 点击切换源代码

创建一个新的 ConstantPathWriteNode 节点。

# File prism/dsl.rb, line 277
def constant_path_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, target: constant_path_node(source: source), operator_loc: location, value: default_node(source, location))
  ConstantPathWriteNode.new(source, node_id, location, flags, target, operator_loc, value)
end
constant_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"") 点击切换源代码

创建一个新的 ConstantReadNode 节点。

# File prism/dsl.rb, line 282
def constant_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
  ConstantReadNode.new(source, node_id, location, flags, name)
end
constant_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"") 点击切换源代码

创建一个新的 ConstantTargetNode 节点。

# File prism/dsl.rb, line 287
def constant_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
  ConstantTargetNode.new(source, node_id, location, flags, name)
end
constant_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, value: default_node(source, location), operator_loc: location) 点击切换源代码

创建一个新的 ConstantWriteNode 节点。

# File prism/dsl.rb, line 292
def constant_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, value: default_node(source, location), operator_loc: location)
  ConstantWriteNode.new(source, node_id, location, flags, name, name_loc, value, operator_loc)
end
def_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, receiver: nil, parameters: nil, body: nil, locals: [], def_keyword_loc: location, operator_loc: nil, lparen_loc: nil, rparen_loc: nil, equal_loc: nil, end_keyword_loc: nil) 点击切换源代码

创建一个新的 DefNode 节点。

# File prism/dsl.rb, line 297
def def_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, receiver: nil, parameters: nil, body: nil, locals: [], def_keyword_loc: location, operator_loc: nil, lparen_loc: nil, rparen_loc: nil, equal_loc: nil, end_keyword_loc: nil)
  DefNode.new(source, node_id, location, flags, name, name_loc, receiver, parameters, body, locals, def_keyword_loc, operator_loc, lparen_loc, rparen_loc, equal_loc, end_keyword_loc)
end
defined_node(source: default_source, node_id: 0, location: default_location, flags: 0, lparen_loc: nil, value: default_node(source, location), rparen_loc: nil, keyword_loc: location) 点击切换源代码

创建一个新的 DefinedNode 节点。

# File prism/dsl.rb, line 302
def defined_node(source: default_source, node_id: 0, location: default_location, flags: 0, lparen_loc: nil, value: default_node(source, location), rparen_loc: nil, keyword_loc: location)
  DefinedNode.new(source, node_id, location, flags, lparen_loc, value, rparen_loc, keyword_loc)
end
else_node(source: default_source, node_id: 0, location: default_location, flags: 0, else_keyword_loc: location, statements: nil, end_keyword_loc: nil) 点击切换源代码

创建一个新的 ElseNode 节点。

# File prism/dsl.rb, line 307
def else_node(source: default_source, node_id: 0, location: default_location, flags: 0, else_keyword_loc: location, statements: nil, end_keyword_loc: nil)
  ElseNode.new(source, node_id, location, flags, else_keyword_loc, statements, end_keyword_loc)
end
embedded_statements_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, statements: nil, closing_loc: location) 点击切换源代码

创建一个新的 EmbeddedStatementsNode 节点。

# File prism/dsl.rb, line 312
def embedded_statements_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, statements: nil, closing_loc: location)
  EmbeddedStatementsNode.new(source, node_id, location, flags, opening_loc, statements, closing_loc)
end
embedded_variable_node(source: default_source, node_id: 0, location: default_location, flags: 0, operator_loc: location, variable: instance_variable_read_node(source: source)) 点击切换源代码

创建一个新的 EmbeddedVariableNode 节点。

# File prism/dsl.rb, line 317
def embedded_variable_node(source: default_source, node_id: 0, location: default_location, flags: 0, operator_loc: location, variable: instance_variable_read_node(source: source))
  EmbeddedVariableNode.new(source, node_id, location, flags, operator_loc, variable)
end
encoding_flag(name) 点击切换源代码

检索 EncodingFlags 标志之一的值。

# File prism/dsl.rb, line 863
def encoding_flag(name)
  case name
  when :forced_utf8_encoding then EncodingFlags::FORCED_UTF8_ENCODING
  when :forced_binary_encoding then EncodingFlags::FORCED_BINARY_ENCODING
  else Kernel.raise ArgumentError, "invalid EncodingFlags flag: #{name.inspect}"
  end
end
ensure_node(source: default_source, node_id: 0, location: default_location, flags: 0, ensure_keyword_loc: location, statements: nil, end_keyword_loc: location) 点击切换源代码

创建一个新的 EnsureNode 节点。

# File prism/dsl.rb, line 322
def ensure_node(source: default_source, node_id: 0, location: default_location, flags: 0, ensure_keyword_loc: location, statements: nil, end_keyword_loc: location)
  EnsureNode.new(source, node_id, location, flags, ensure_keyword_loc, statements, end_keyword_loc)
end
false_node(source: default_source, node_id: 0, location: default_location, flags: 0) 点击切换源代码

创建一个新的 FalseNode 节点。

# File prism/dsl.rb, line 327
def false_node(source: default_source, node_id: 0, location: default_location, flags: 0)
  FalseNode.new(source, node_id, location, flags)
end
find_pattern_node(source: default_source, node_id: 0, location: default_location, flags: 0, constant: nil, left: splat_node(source: source), requireds: [], right: splat_node(source: source), opening_loc: nil, closing_loc: nil) 点击切换源代码

创建一个新的 FindPatternNode 节点。

# File prism/dsl.rb, line 332
def find_pattern_node(source: default_source, node_id: 0, location: default_location, flags: 0, constant: nil, left: splat_node(source: source), requireds: [], right: splat_node(source: source), opening_loc: nil, closing_loc: nil)
  FindPatternNode.new(source, node_id, location, flags, constant, left, requireds, right, opening_loc, closing_loc)
end
flip_flop_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: nil, right: nil, operator_loc: location) 点击切换源代码

创建一个新的 FlipFlopNode 节点。

# File prism/dsl.rb, line 337
def flip_flop_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: nil, right: nil, operator_loc: location)
  FlipFlopNode.new(source, node_id, location, flags, left, right, operator_loc)
end
float_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: 0.0) 点击切换源代码

创建一个新的 FloatNode 节点。

# File prism/dsl.rb, line 342
def float_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: 0.0)
  FloatNode.new(source, node_id, location, flags, value)
end
for_node(source: default_source, node_id: 0, location: default_location, flags: 0, index: local_variable_target_node(source: source), collection: default_node(source, location), statements: nil, for_keyword_loc: location, in_keyword_loc: location, do_keyword_loc: nil, end_keyword_loc: location) 点击切换源代码

创建一个新的 ForNode 节点。

# File prism/dsl.rb, line 347
def for_node(source: default_source, node_id: 0, location: default_location, flags: 0, index: local_variable_target_node(source: source), collection: default_node(source, location), statements: nil, for_keyword_loc: location, in_keyword_loc: location, do_keyword_loc: nil, end_keyword_loc: location)
  ForNode.new(source, node_id, location, flags, index, collection, statements, for_keyword_loc, in_keyword_loc, do_keyword_loc, end_keyword_loc)
end
forwarding_arguments_node(source: default_source, node_id: 0, location: default_location, flags: 0) 点击切换源代码

创建一个新的 ForwardingArgumentsNode 节点。

# File prism/dsl.rb, line 352
def forwarding_arguments_node(source: default_source, node_id: 0, location: default_location, flags: 0)
  ForwardingArgumentsNode.new(source, node_id, location, flags)
end
forwarding_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0) 点击切换源代码

创建一个新的 ForwardingParameterNode 节点。

# File prism/dsl.rb, line 357
def forwarding_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0)
  ForwardingParameterNode.new(source, node_id, location, flags)
end
forwarding_super_node(source: default_source, node_id: 0, location: default_location, flags: 0, block: nil) 点击切换源代码

创建一个新的 ForwardingSuperNode 节点。

# File prism/dsl.rb, line 362
def forwarding_super_node(source: default_source, node_id: 0, location: default_location, flags: 0, block: nil)
  ForwardingSuperNode.new(source, node_id, location, flags, block)
end
global_variable_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location)) 点击切换源代码

创建一个新的 GlobalVariableAndWriteNode 节点。

# File prism/dsl.rb, line 367
def global_variable_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location))
  GlobalVariableAndWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
end
global_variable_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, binary_operator_loc: location, value: default_node(source, location), binary_operator: :"") 点击切换源代码

创建一个新的 GlobalVariableOperatorWriteNode 节点。

# File prism/dsl.rb, line 372
def global_variable_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, binary_operator_loc: location, value: default_node(source, location), binary_operator: :"")
  GlobalVariableOperatorWriteNode.new(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator)
end
global_variable_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location)) 点击切换源代码

创建一个新的 GlobalVariableOrWriteNode 节点。

# File prism/dsl.rb, line 377
def global_variable_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location))
  GlobalVariableOrWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
end
global_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"") 点击切换源代码

创建一个新的 GlobalVariableReadNode 节点。

# File prism/dsl.rb, line 382
def global_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
  GlobalVariableReadNode.new(source, node_id, location, flags, name)
end
global_variable_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"") 点击切换源代码

创建一个新的 GlobalVariableTargetNode 节点。

# File prism/dsl.rb, line 387
def global_variable_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
  GlobalVariableTargetNode.new(source, node_id, location, flags, name)
end
global_variable_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, value: default_node(source, location), operator_loc: location) 点击切换源代码

创建一个新的 GlobalVariableWriteNode 节点。

# File prism/dsl.rb, line 392
def global_variable_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, value: default_node(source, location), operator_loc: location)
  GlobalVariableWriteNode.new(source, node_id, location, flags, name, name_loc, value, operator_loc)
end
hash_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, elements: [], closing_loc: location) 点击切换源代码

创建一个新的 HashNode 节点。

# File prism/dsl.rb, line 397
def hash_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, elements: [], closing_loc: location)
  HashNode.new(source, node_id, location, flags, opening_loc, elements, closing_loc)
end
hash_pattern_node(source: default_source, node_id: 0, location: default_location, flags: 0, constant: nil, elements: [], rest: nil, opening_loc: nil, closing_loc: nil) 点击切换源代码

创建一个新的 HashPatternNode 节点。

# File prism/dsl.rb, line 402
def hash_pattern_node(source: default_source, node_id: 0, location: default_location, flags: 0, constant: nil, elements: [], rest: nil, opening_loc: nil, closing_loc: nil)
  HashPatternNode.new(source, node_id, location, flags, constant, elements, rest, opening_loc, closing_loc)
end
if_node(source: default_source, node_id: 0, location: default_location, flags: 0, if_keyword_loc: nil, predicate: default_node(source, location), then_keyword_loc: nil, statements: nil, subsequent: nil, end_keyword_loc: nil) 点击切换源代码

创建一个新的 IfNode 节点。

# File prism/dsl.rb, line 407
def if_node(source: default_source, node_id: 0, location: default_location, flags: 0, if_keyword_loc: nil, predicate: default_node(source, location), then_keyword_loc: nil, statements: nil, subsequent: nil, end_keyword_loc: nil)
  IfNode.new(source, node_id, location, flags, if_keyword_loc, predicate, then_keyword_loc, statements, subsequent, end_keyword_loc)
end
imaginary_node(source: default_source, node_id: 0, location: default_location, flags: 0, numeric: float_node(source: source)) 点击切换源代码

创建一个新的 ImaginaryNode 节点。

# File prism/dsl.rb, line 412
def imaginary_node(source: default_source, node_id: 0, location: default_location, flags: 0, numeric: float_node(source: source))
  ImaginaryNode.new(source, node_id, location, flags, numeric)
end
implicit_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: local_variable_read_node(source: source)) 点击切换源代码

创建一个新的 ImplicitNode 节点。

# File prism/dsl.rb, line 417
def implicit_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: local_variable_read_node(source: source))
  ImplicitNode.new(source, node_id, location, flags, value)
end
implicit_rest_node(source: default_source, node_id: 0, location: default_location, flags: 0) 点击切换源代码

创建一个新的 ImplicitRestNode 节点。

# File prism/dsl.rb, line 422
def implicit_rest_node(source: default_source, node_id: 0, location: default_location, flags: 0)
  ImplicitRestNode.new(source, node_id, location, flags)
end
in_node(source: default_source, node_id: 0, location: default_location, flags: 0, pattern: default_node(source, location), statements: nil, in_loc: location, then_loc: nil) 点击切换源代码

创建一个新的 InNode 节点。

# File prism/dsl.rb, line 427
def in_node(source: default_source, node_id: 0, location: default_location, flags: 0, pattern: default_node(source, location), statements: nil, in_loc: location, then_loc: nil)
  InNode.new(source, node_id, location, flags, pattern, statements, in_loc, then_loc)
end
index_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, opening_loc: location, arguments: nil, closing_loc: location, block: nil, operator_loc: location, value: default_node(source, location)) 点击切换源代码

创建一个新的 IndexAndWriteNode 节点。

# File prism/dsl.rb, line 432
def index_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, opening_loc: location, arguments: nil, closing_loc: location, block: nil, operator_loc: location, value: default_node(source, location))
  IndexAndWriteNode.new(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value)
end
index_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, opening_loc: location, arguments: nil, closing_loc: location, block: nil, binary_operator: :"", binary_operator_loc: location, value: default_node(source, location)) 点击切换源代码

创建一个新的 IndexOperatorWriteNode 节点。

# File prism/dsl.rb, line 437
def index_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, opening_loc: location, arguments: nil, closing_loc: location, block: nil, binary_operator: :"", binary_operator_loc: location, value: default_node(source, location))
  IndexOperatorWriteNode.new(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, binary_operator, binary_operator_loc, value)
end
index_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, opening_loc: location, arguments: nil, closing_loc: location, block: nil, operator_loc: location, value: default_node(source, location)) 点击切换源代码

创建一个新的 IndexOrWriteNode 节点。

# File prism/dsl.rb, line 442
def index_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: nil, call_operator_loc: nil, opening_loc: location, arguments: nil, closing_loc: location, block: nil, operator_loc: location, value: default_node(source, location))
  IndexOrWriteNode.new(source, node_id, location, flags, receiver, call_operator_loc, opening_loc, arguments, closing_loc, block, operator_loc, value)
end
index_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: default_node(source, location), opening_loc: location, arguments: nil, closing_loc: location, block: nil) 点击切换源代码

创建一个新的 IndexTargetNode 节点。

# File prism/dsl.rb, line 447
def index_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, receiver: default_node(source, location), opening_loc: location, arguments: nil, closing_loc: location, block: nil)
  IndexTargetNode.new(source, node_id, location, flags, receiver, opening_loc, arguments, closing_loc, block)
end
instance_variable_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location)) 点击切换源代码

创建一个新的 InstanceVariableAndWriteNode 节点。

# File prism/dsl.rb, line 452
def instance_variable_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location))
  InstanceVariableAndWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
end
instance_variable_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, binary_operator_loc: location, value: default_node(source, location), binary_operator: :"") 点击切换源代码

创建一个新的 InstanceVariableOperatorWriteNode 节点。

# File prism/dsl.rb, line 457
def instance_variable_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, binary_operator_loc: location, value: default_node(source, location), binary_operator: :"")
  InstanceVariableOperatorWriteNode.new(source, node_id, location, flags, name, name_loc, binary_operator_loc, value, binary_operator)
end
instance_variable_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location)) 点击切换源代码

创建一个新的 InstanceVariableOrWriteNode 节点。

# File prism/dsl.rb, line 462
def instance_variable_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location))
  InstanceVariableOrWriteNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
end
instance_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"") 点击切换源代码

创建一个新的 InstanceVariableReadNode 节点。

# File prism/dsl.rb, line 467
def instance_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
  InstanceVariableReadNode.new(source, node_id, location, flags, name)
end
instance_variable_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"") 点击切换源代码

创建一个新的 InstanceVariableTargetNode 节点。

# File prism/dsl.rb, line 472
def instance_variable_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
  InstanceVariableTargetNode.new(source, node_id, location, flags, name)
end
instance_variable_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, value: default_node(source, location), operator_loc: location) 点击切换源代码

创建一个新的 InstanceVariableWriteNode 节点。

# File prism/dsl.rb, line 477
def instance_variable_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, value: default_node(source, location), operator_loc: location)
  InstanceVariableWriteNode.new(source, node_id, location, flags, name, name_loc, value, operator_loc)
end
integer_base_flag(name) 点击切换源代码

检索 IntegerBaseFlags 标志之一的值。

# File prism/dsl.rb, line 872
def integer_base_flag(name)
  case name
  when :binary then IntegerBaseFlags::BINARY
  when :decimal then IntegerBaseFlags::DECIMAL
  when :octal then IntegerBaseFlags::OCTAL
  when :hexadecimal then IntegerBaseFlags::HEXADECIMAL
  else Kernel.raise ArgumentError, "invalid IntegerBaseFlags flag: #{name.inspect}"
  end
end
integer_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: 0) 点击切换源代码

创建一个新的 IntegerNode 节点。

# File prism/dsl.rb, line 482
def integer_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: 0)
  IntegerNode.new(source, node_id, location, flags, value)
end
interpolated_match_last_line_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, parts: [], closing_loc: location) 点击切换源代码

创建一个新的 InterpolatedMatchLastLineNode 节点。

# File prism/dsl.rb, line 487
def interpolated_match_last_line_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, parts: [], closing_loc: location)
  InterpolatedMatchLastLineNode.new(source, node_id, location, flags, opening_loc, parts, closing_loc)
end
interpolated_regular_expression_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, parts: [], closing_loc: location) 点击切换源代码

创建一个新的 InterpolatedRegularExpressionNode 节点。

# File prism/dsl.rb, line 492
def interpolated_regular_expression_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, parts: [], closing_loc: location)
  InterpolatedRegularExpressionNode.new(source, node_id, location, flags, opening_loc, parts, closing_loc)
end
interpolated_string_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: nil, parts: [], closing_loc: nil) 点击切换源代码

创建一个新的 InterpolatedStringNode 节点。

# File prism/dsl.rb, line 497
def interpolated_string_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: nil, parts: [], closing_loc: nil)
  InterpolatedStringNode.new(source, node_id, location, flags, opening_loc, parts, closing_loc)
end
interpolated_string_node_flag(name) 点击切换源代码

检索 InterpolatedStringNodeFlags 标志之一的值。

# File prism/dsl.rb, line 883
def interpolated_string_node_flag(name)
  case name
  when :frozen then InterpolatedStringNodeFlags::FROZEN
  when :mutable then InterpolatedStringNodeFlags::MUTABLE
  else Kernel.raise ArgumentError, "invalid InterpolatedStringNodeFlags flag: #{name.inspect}"
  end
end
interpolated_symbol_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: nil, parts: [], closing_loc: nil) 点击切换源代码

创建一个新的 InterpolatedSymbolNode 节点。

# File prism/dsl.rb, line 502
def interpolated_symbol_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: nil, parts: [], closing_loc: nil)
  InterpolatedSymbolNode.new(source, node_id, location, flags, opening_loc, parts, closing_loc)
end
interpolated_x_string_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, parts: [], closing_loc: location) 点击切换源码

创建一个新的InterpolatedXStringNode节点。

# File prism/dsl.rb, line 507
def interpolated_x_string_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, parts: [], closing_loc: location)
  InterpolatedXStringNode.new(source, node_id, location, flags, opening_loc, parts, closing_loc)
end
it_local_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0) 点击切换源码

创建一个新的ItLocalVariableReadNode节点。

# File prism/dsl.rb, line 512
def it_local_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0)
  ItLocalVariableReadNode.new(source, node_id, location, flags)
end
it_parameters_node(source: default_source, node_id: 0, location: default_location, flags: 0) 点击切换源码

创建一个新的ItParametersNode节点。

# File prism/dsl.rb, line 517
def it_parameters_node(source: default_source, node_id: 0, location: default_location, flags: 0)
  ItParametersNode.new(source, node_id, location, flags)
end
keyword_hash_node(source: default_source, node_id: 0, location: default_location, flags: 0, elements: []) 点击切换源码

创建一个新的KeywordHashNode节点。

# File prism/dsl.rb, line 522
def keyword_hash_node(source: default_source, node_id: 0, location: default_location, flags: 0, elements: [])
  KeywordHashNode.new(source, node_id, location, flags, elements)
end
keyword_hash_node_flag(name) 点击切换源码

检索KeywordHashNodeFlags标志中的一个值。

# File prism/dsl.rb, line 892
def keyword_hash_node_flag(name)
  case name
  when :symbol_keys then KeywordHashNodeFlags::SYMBOL_KEYS
  else Kernel.raise ArgumentError, "invalid KeywordHashNodeFlags flag: #{name.inspect}"
  end
end
keyword_rest_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: nil, name_loc: nil, operator_loc: location) 点击切换源码

创建一个新的KeywordRestParameterNode节点。

# File prism/dsl.rb, line 527
def keyword_rest_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: nil, name_loc: nil, operator_loc: location)
  KeywordRestParameterNode.new(source, node_id, location, flags, name, name_loc, operator_loc)
end
lambda_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], operator_loc: location, opening_loc: location, closing_loc: location, parameters: nil, body: nil) 点击切换源码

创建一个新的LambdaNode节点。

# File prism/dsl.rb, line 532
def lambda_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], operator_loc: location, opening_loc: location, closing_loc: location, parameters: nil, body: nil)
  LambdaNode.new(source, node_id, location, flags, locals, operator_loc, opening_loc, closing_loc, parameters, body)
end
local_variable_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name_loc: location, operator_loc: location, value: default_node(source, location), name: :"", depth: 0) 点击切换源码

创建一个新的LocalVariableAndWriteNode节点。

# File prism/dsl.rb, line 537
def local_variable_and_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name_loc: location, operator_loc: location, value: default_node(source, location), name: :"", depth: 0)
  LocalVariableAndWriteNode.new(source, node_id, location, flags, name_loc, operator_loc, value, name, depth)
end
local_variable_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name_loc: location, binary_operator_loc: location, value: default_node(source, location), name: :"", binary_operator: :"", depth: 0) 点击切换源码

创建一个新的LocalVariableOperatorWriteNode节点。

# File prism/dsl.rb, line 542
def local_variable_operator_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name_loc: location, binary_operator_loc: location, value: default_node(source, location), name: :"", binary_operator: :"", depth: 0)
  LocalVariableOperatorWriteNode.new(source, node_id, location, flags, name_loc, binary_operator_loc, value, name, binary_operator, depth)
end
local_variable_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name_loc: location, operator_loc: location, value: default_node(source, location), name: :"", depth: 0) 点击切换源码

创建一个新的LocalVariableOrWriteNode节点。

# File prism/dsl.rb, line 547
def local_variable_or_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name_loc: location, operator_loc: location, value: default_node(source, location), name: :"", depth: 0)
  LocalVariableOrWriteNode.new(source, node_id, location, flags, name_loc, operator_loc, value, name, depth)
end
local_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", depth: 0) 点击切换源码

创建一个新的LocalVariableReadNode节点。

# File prism/dsl.rb, line 552
def local_variable_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", depth: 0)
  LocalVariableReadNode.new(source, node_id, location, flags, name, depth)
end
local_variable_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", depth: 0) 点击切换源码

创建一个新的LocalVariableTargetNode节点。

# File prism/dsl.rb, line 557
def local_variable_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", depth: 0)
  LocalVariableTargetNode.new(source, node_id, location, flags, name, depth)
end
local_variable_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", depth: 0, name_loc: location, value: default_node(source, location), operator_loc: location) 点击切换源码

创建一个新的LocalVariableWriteNode节点。

# File prism/dsl.rb, line 562
def local_variable_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", depth: 0, name_loc: location, value: default_node(source, location), operator_loc: location)
  LocalVariableWriteNode.new(source, node_id, location, flags, name, depth, name_loc, value, operator_loc)
end
location(source: default_source, start_offset: 0, length: 0) 点击切换源码

创建一个新的Location对象。

# File prism/dsl.rb, line 72
def location(source: default_source, start_offset: 0, length: 0)
  Location.new(source, start_offset, length)
end
loop_flag(name) 点击切换源码

检索LoopFlags标志中的一个值。

# File prism/dsl.rb, line 900
def loop_flag(name)
  case name
  when :begin_modifier then LoopFlags::BEGIN_MODIFIER
  else Kernel.raise ArgumentError, "invalid LoopFlags flag: #{name.inspect}"
  end
end
match_last_line_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, content_loc: location, closing_loc: location, unescaped: "") 点击切换源码

创建一个新的MatchLastLineNode节点。

# File prism/dsl.rb, line 567
def match_last_line_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, content_loc: location, closing_loc: location, unescaped: "")
  MatchLastLineNode.new(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped)
end
match_predicate_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: default_node(source, location), pattern: default_node(source, location), operator_loc: location) 点击切换源码

创建一个新的MatchPredicateNode节点。

# File prism/dsl.rb, line 572
def match_predicate_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: default_node(source, location), pattern: default_node(source, location), operator_loc: location)
  MatchPredicateNode.new(source, node_id, location, flags, value, pattern, operator_loc)
end
match_required_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: default_node(source, location), pattern: default_node(source, location), operator_loc: location) 点击切换源码

创建一个新的MatchRequiredNode节点。

# File prism/dsl.rb, line 577
def match_required_node(source: default_source, node_id: 0, location: default_location, flags: 0, value: default_node(source, location), pattern: default_node(source, location), operator_loc: location)
  MatchRequiredNode.new(source, node_id, location, flags, value, pattern, operator_loc)
end
match_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, call: call_node(source: source), targets: []) 点击切换源码

创建一个新的MatchWriteNode节点。

# File prism/dsl.rb, line 582
def match_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, call: call_node(source: source), targets: [])
  MatchWriteNode.new(source, node_id, location, flags, call, targets)
end
missing_node(source: default_source, node_id: 0, location: default_location, flags: 0) 点击切换源码

创建一个新的MissingNode节点。

# File prism/dsl.rb, line 587
def missing_node(source: default_source, node_id: 0, location: default_location, flags: 0)
  MissingNode.new(source, node_id, location, flags)
end
module_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], module_keyword_loc: location, constant_path: constant_read_node(source: source), body: nil, end_keyword_loc: location, name: :"") 点击切换源码

创建一个新的ModuleNode节点。

# File prism/dsl.rb, line 592
def module_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], module_keyword_loc: location, constant_path: constant_read_node(source: source), body: nil, end_keyword_loc: location, name: :"")
  ModuleNode.new(source, node_id, location, flags, locals, module_keyword_loc, constant_path, body, end_keyword_loc, name)
end
multi_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, lefts: [], rest: nil, rights: [], lparen_loc: nil, rparen_loc: nil) 点击切换源码

创建一个新的MultiTargetNode节点。

# File prism/dsl.rb, line 597
def multi_target_node(source: default_source, node_id: 0, location: default_location, flags: 0, lefts: [], rest: nil, rights: [], lparen_loc: nil, rparen_loc: nil)
  MultiTargetNode.new(source, node_id, location, flags, lefts, rest, rights, lparen_loc, rparen_loc)
end
multi_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, lefts: [], rest: nil, rights: [], lparen_loc: nil, rparen_loc: nil, operator_loc: location, value: default_node(source, location)) 点击切换源码

创建一个新的MultiWriteNode节点。

# File prism/dsl.rb, line 602
def multi_write_node(source: default_source, node_id: 0, location: default_location, flags: 0, lefts: [], rest: nil, rights: [], lparen_loc: nil, rparen_loc: nil, operator_loc: location, value: default_node(source, location))
  MultiWriteNode.new(source, node_id, location, flags, lefts, rest, rights, lparen_loc, rparen_loc, operator_loc, value)
end
next_node(source: default_source, node_id: 0, location: default_location, flags: 0, arguments: nil, keyword_loc: location) 点击切换源码

创建一个新的NextNode节点。

# File prism/dsl.rb, line 607
def next_node(source: default_source, node_id: 0, location: default_location, flags: 0, arguments: nil, keyword_loc: location)
  NextNode.new(source, node_id, location, flags, arguments, keyword_loc)
end
nil_node(source: default_source, node_id: 0, location: default_location, flags: 0) 点击切换源码

创建一个新的NilNode节点。

# File prism/dsl.rb, line 612
def nil_node(source: default_source, node_id: 0, location: default_location, flags: 0)
  NilNode.new(source, node_id, location, flags)
end
no_keywords_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, operator_loc: location, keyword_loc: location) 点击切换源码

创建一个新的NoKeywordsParameterNode节点。

# File prism/dsl.rb, line 617
def no_keywords_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, operator_loc: location, keyword_loc: location)
  NoKeywordsParameterNode.new(source, node_id, location, flags, operator_loc, keyword_loc)
end
numbered_parameters_node(source: default_source, node_id: 0, location: default_location, flags: 0, maximum: 0) 点击切换源码

创建一个新的NumberedParametersNode节点。

# File prism/dsl.rb, line 622
def numbered_parameters_node(source: default_source, node_id: 0, location: default_location, flags: 0, maximum: 0)
  NumberedParametersNode.new(source, node_id, location, flags, maximum)
end
numbered_reference_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, number: 0) 点击切换源码

创建一个新的NumberedReferenceReadNode节点。

# File prism/dsl.rb, line 627
def numbered_reference_read_node(source: default_source, node_id: 0, location: default_location, flags: 0, number: 0)
  NumberedReferenceReadNode.new(source, node_id, location, flags, number)
end
optional_keyword_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, value: default_node(source, location)) 点击切换源码

创建一个新的OptionalKeywordParameterNode节点。

# File prism/dsl.rb, line 632
def optional_keyword_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, value: default_node(source, location))
  OptionalKeywordParameterNode.new(source, node_id, location, flags, name, name_loc, value)
end
optional_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location)) 点击切换源码

创建一个新的OptionalParameterNode节点。

# File prism/dsl.rb, line 637
def optional_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location, operator_loc: location, value: default_node(source, location))
  OptionalParameterNode.new(source, node_id, location, flags, name, name_loc, operator_loc, value)
end
or_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: default_node(source, location), right: default_node(source, location), operator_loc: location) 点击切换源码

创建一个新的OrNode节点。

# File prism/dsl.rb, line 642
def or_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: default_node(source, location), right: default_node(source, location), operator_loc: location)
  OrNode.new(source, node_id, location, flags, left, right, operator_loc)
end
parameter_flag(name) 点击切换源码

检索ParameterFlags标志中的一个值。

# File prism/dsl.rb, line 908
def parameter_flag(name)
  case name
  when :repeated_parameter then ParameterFlags::REPEATED_PARAMETER
  else Kernel.raise ArgumentError, "invalid ParameterFlags flag: #{name.inspect}"
  end
end
parameters_node(source: default_source, node_id: 0, location: default_location, flags: 0, requireds: [], optionals: [], rest: nil, posts: [], keywords: [], keyword_rest: nil, block: nil) 点击切换源码

创建一个新的ParametersNode节点。

# File prism/dsl.rb, line 647
def parameters_node(source: default_source, node_id: 0, location: default_location, flags: 0, requireds: [], optionals: [], rest: nil, posts: [], keywords: [], keyword_rest: nil, block: nil)
  ParametersNode.new(source, node_id, location, flags, requireds, optionals, rest, posts, keywords, keyword_rest, block)
end
parentheses_node(source: default_source, node_id: 0, location: default_location, flags: 0, body: nil, opening_loc: location, closing_loc: location) 点击切换源码

创建一个新的ParenthesesNode节点。

# File prism/dsl.rb, line 652
def parentheses_node(source: default_source, node_id: 0, location: default_location, flags: 0, body: nil, opening_loc: location, closing_loc: location)
  ParenthesesNode.new(source, node_id, location, flags, body, opening_loc, closing_loc)
end
pinned_expression_node(source: default_source, node_id: 0, location: default_location, flags: 0, expression: default_node(source, location), operator_loc: location, lparen_loc: location, rparen_loc: location) 点击切换源码

创建一个新的PinnedExpressionNode节点。

# File prism/dsl.rb, line 657
def pinned_expression_node(source: default_source, node_id: 0, location: default_location, flags: 0, expression: default_node(source, location), operator_loc: location, lparen_loc: location, rparen_loc: location)
  PinnedExpressionNode.new(source, node_id, location, flags, expression, operator_loc, lparen_loc, rparen_loc)
end
pinned_variable_node(source: default_source, node_id: 0, location: default_location, flags: 0, variable: local_variable_read_node(source: source), operator_loc: location) 点击切换源码

创建一个新的PinnedVariableNode节点。

# File prism/dsl.rb, line 662
def pinned_variable_node(source: default_source, node_id: 0, location: default_location, flags: 0, variable: local_variable_read_node(source: source), operator_loc: location)
  PinnedVariableNode.new(source, node_id, location, flags, variable, operator_loc)
end
post_execution_node(source: default_source, node_id: 0, location: default_location, flags: 0, statements: nil, keyword_loc: location, opening_loc: location, closing_loc: location) 点击切换源码

创建一个新的PostExecutionNode节点。

# File prism/dsl.rb, line 667
def post_execution_node(source: default_source, node_id: 0, location: default_location, flags: 0, statements: nil, keyword_loc: location, opening_loc: location, closing_loc: location)
  PostExecutionNode.new(source, node_id, location, flags, statements, keyword_loc, opening_loc, closing_loc)
end
pre_execution_node(source: default_source, node_id: 0, location: default_location, flags: 0, statements: nil, keyword_loc: location, opening_loc: location, closing_loc: location) 点击切换源码

创建一个新的PreExecutionNode节点。

# File prism/dsl.rb, line 672
def pre_execution_node(source: default_source, node_id: 0, location: default_location, flags: 0, statements: nil, keyword_loc: location, opening_loc: location, closing_loc: location)
  PreExecutionNode.new(source, node_id, location, flags, statements, keyword_loc, opening_loc, closing_loc)
end
program_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], statements: statements_node(source: source)) 点击切换源码

创建一个新的ProgramNode节点。

# File prism/dsl.rb, line 677
def program_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], statements: statements_node(source: source))
  ProgramNode.new(source, node_id, location, flags, locals, statements)
end
range_flag(name) 点击切换源码

检索RangeFlags标志中的一个值。

# File prism/dsl.rb, line 916
def range_flag(name)
  case name
  when :exclude_end then RangeFlags::EXCLUDE_END
  else Kernel.raise ArgumentError, "invalid RangeFlags flag: #{name.inspect}"
  end
end
range_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: nil, right: nil, operator_loc: location) 点击切换源码

创建一个新的RangeNode节点。

# File prism/dsl.rb, line 682
def range_node(source: default_source, node_id: 0, location: default_location, flags: 0, left: nil, right: nil, operator_loc: location)
  RangeNode.new(source, node_id, location, flags, left, right, operator_loc)
end
rational_node(source: default_source, node_id: 0, location: default_location, flags: 0, numerator: 0, denominator: 0) 点击切换源码

创建一个新的RationalNode节点。

# File prism/dsl.rb, line 687
def rational_node(source: default_source, node_id: 0, location: default_location, flags: 0, numerator: 0, denominator: 0)
  RationalNode.new(source, node_id, location, flags, numerator, denominator)
end
redo_node(source: default_source, node_id: 0, location: default_location, flags: 0) 点击切换源码

创建一个新的RedoNode节点。

# File prism/dsl.rb, line 692
def redo_node(source: default_source, node_id: 0, location: default_location, flags: 0)
  RedoNode.new(source, node_id, location, flags)
end
regular_expression_flag(name) 点击切换源代码

检索 RegularExpressionFlags 标志之一的值。

# File prism/dsl.rb, line 924
def regular_expression_flag(name)
  case name
  when :ignore_case then RegularExpressionFlags::IGNORE_CASE
  when :extended then RegularExpressionFlags::EXTENDED
  when :multi_line then RegularExpressionFlags::MULTI_LINE
  when :once then RegularExpressionFlags::ONCE
  when :euc_jp then RegularExpressionFlags::EUC_JP
  when :ascii_8bit then RegularExpressionFlags::ASCII_8BIT
  when :windows_31j then RegularExpressionFlags::WINDOWS_31J
  when :utf_8 then RegularExpressionFlags::UTF_8
  when :forced_utf8_encoding then RegularExpressionFlags::FORCED_UTF8_ENCODING
  when :forced_binary_encoding then RegularExpressionFlags::FORCED_BINARY_ENCODING
  when :forced_us_ascii_encoding then RegularExpressionFlags::FORCED_US_ASCII_ENCODING
  else Kernel.raise ArgumentError, "invalid RegularExpressionFlags flag: #{name.inspect}"
  end
end
regular_expression_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, content_loc: location, closing_loc: location, unescaped: "") 点击切换源代码

创建一个新的 RegularExpressionNode 节点。

# File prism/dsl.rb, line 697
def regular_expression_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, content_loc: location, closing_loc: location, unescaped: "")
  RegularExpressionNode.new(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped)
end
required_keyword_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location) 点击切换源代码

创建一个新的 RequiredKeywordParameterNode 节点。

# File prism/dsl.rb, line 702
def required_keyword_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"", name_loc: location)
  RequiredKeywordParameterNode.new(source, node_id, location, flags, name, name_loc)
end
required_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"") 点击切换源代码

创建一个新的 RequiredParameterNode 节点。

# File prism/dsl.rb, line 707
def required_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: :"")
  RequiredParameterNode.new(source, node_id, location, flags, name)
end
rescue_modifier_node(source: default_source, node_id: 0, location: default_location, flags: 0, expression: default_node(source, location), keyword_loc: location, rescue_expression: default_node(source, location)) 点击切换源代码

创建一个新的 RescueModifierNode 节点。

# File prism/dsl.rb, line 712
def rescue_modifier_node(source: default_source, node_id: 0, location: default_location, flags: 0, expression: default_node(source, location), keyword_loc: location, rescue_expression: default_node(source, location))
  RescueModifierNode.new(source, node_id, location, flags, expression, keyword_loc, rescue_expression)
end
rescue_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, exceptions: [], operator_loc: nil, reference: nil, statements: nil, subsequent: nil) 点击切换源代码

创建一个新的 RescueNode 节点。

# File prism/dsl.rb, line 717
def rescue_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, exceptions: [], operator_loc: nil, reference: nil, statements: nil, subsequent: nil)
  RescueNode.new(source, node_id, location, flags, keyword_loc, exceptions, operator_loc, reference, statements, subsequent)
end
rest_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: nil, name_loc: nil, operator_loc: location) 点击切换源代码

创建一个新的 RestParameterNode 节点。

# File prism/dsl.rb, line 722
def rest_parameter_node(source: default_source, node_id: 0, location: default_location, flags: 0, name: nil, name_loc: nil, operator_loc: location)
  RestParameterNode.new(source, node_id, location, flags, name, name_loc, operator_loc)
end
retry_node(source: default_source, node_id: 0, location: default_location, flags: 0) 点击切换源代码

创建一个新的 RetryNode 节点。

# File prism/dsl.rb, line 727
def retry_node(source: default_source, node_id: 0, location: default_location, flags: 0)
  RetryNode.new(source, node_id, location, flags)
end
return_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, arguments: nil) 点击切换源代码

创建一个新的 ReturnNode 节点。

# File prism/dsl.rb, line 732
def return_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, arguments: nil)
  ReturnNode.new(source, node_id, location, flags, keyword_loc, arguments)
end
self_node(source: default_source, node_id: 0, location: default_location, flags: 0) 点击切换源代码

创建一个新的 SelfNode 节点。

# File prism/dsl.rb, line 737
def self_node(source: default_source, node_id: 0, location: default_location, flags: 0)
  SelfNode.new(source, node_id, location, flags)
end
shareable_constant_node(source: default_source, node_id: 0, location: default_location, flags: 0, write: constant_write_node(source: source)) 点击切换源代码

创建一个新的 ShareableConstantNode 节点。

# File prism/dsl.rb, line 742
def shareable_constant_node(source: default_source, node_id: 0, location: default_location, flags: 0, write: constant_write_node(source: source))
  ShareableConstantNode.new(source, node_id, location, flags, write)
end
shareable_constant_node_flag(name) 点击切换源代码

检索 ShareableConstantNodeFlags 标志之一的值。

# File prism/dsl.rb, line 942
def shareable_constant_node_flag(name)
  case name
  when :literal then ShareableConstantNodeFlags::LITERAL
  when :experimental_everything then ShareableConstantNodeFlags::EXPERIMENTAL_EVERYTHING
  when :experimental_copy then ShareableConstantNodeFlags::EXPERIMENTAL_COPY
  else Kernel.raise ArgumentError, "invalid ShareableConstantNodeFlags flag: #{name.inspect}"
  end
end
singleton_class_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], class_keyword_loc: location, operator_loc: location, expression: default_node(source, location), body: nil, end_keyword_loc: location) 点击切换源代码

创建一个新的 SingletonClassNode 节点。

# File prism/dsl.rb, line 747
def singleton_class_node(source: default_source, node_id: 0, location: default_location, flags: 0, locals: [], class_keyword_loc: location, operator_loc: location, expression: default_node(source, location), body: nil, end_keyword_loc: location)
  SingletonClassNode.new(source, node_id, location, flags, locals, class_keyword_loc, operator_loc, expression, body, end_keyword_loc)
end
source(string) 点击切换源代码

创建一个新的 Source 对象。

# File prism/dsl.rb, line 67
def source(string)
  Source.for(string)
end
source_encoding_node(source: default_source, node_id: 0, location: default_location, flags: 0) 点击切换源代码

创建一个新的 SourceEncodingNode 节点。

# File prism/dsl.rb, line 752
def source_encoding_node(source: default_source, node_id: 0, location: default_location, flags: 0)
  SourceEncodingNode.new(source, node_id, location, flags)
end
source_file_node(source: default_source, node_id: 0, location: default_location, flags: 0, filepath: "") 点击切换源代码

创建一个新的 SourceFileNode 节点。

# File prism/dsl.rb, line 757
def source_file_node(source: default_source, node_id: 0, location: default_location, flags: 0, filepath: "")
  SourceFileNode.new(source, node_id, location, flags, filepath)
end
source_line_node(source: default_source, node_id: 0, location: default_location, flags: 0) 点击切换源代码

创建一个新的 SourceLineNode 节点。

# File prism/dsl.rb, line 762
def source_line_node(source: default_source, node_id: 0, location: default_location, flags: 0)
  SourceLineNode.new(source, node_id, location, flags)
end
splat_node(source: default_source, node_id: 0, location: default_location, flags: 0, operator_loc: location, expression: nil) 点击切换源代码

创建一个新的 SplatNode 节点。

# File prism/dsl.rb, line 767
def splat_node(source: default_source, node_id: 0, location: default_location, flags: 0, operator_loc: location, expression: nil)
  SplatNode.new(source, node_id, location, flags, operator_loc, expression)
end
statements_node(source: default_source, node_id: 0, location: default_location, flags: 0, body: []) 点击切换源代码

创建一个新的 StatementsNode 节点。

# File prism/dsl.rb, line 772
def statements_node(source: default_source, node_id: 0, location: default_location, flags: 0, body: [])
  StatementsNode.new(source, node_id, location, flags, body)
end
string_flag(name) 点击切换源代码

检索 StringFlags 标志之一的值。

# File prism/dsl.rb, line 952
def string_flag(name)
  case name
  when :forced_utf8_encoding then StringFlags::FORCED_UTF8_ENCODING
  when :forced_binary_encoding then StringFlags::FORCED_BINARY_ENCODING
  when :frozen then StringFlags::FROZEN
  when :mutable then StringFlags::MUTABLE
  else Kernel.raise ArgumentError, "invalid StringFlags flag: #{name.inspect}"
  end
end
string_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: nil, content_loc: location, closing_loc: nil, unescaped: "") 点击切换源代码

创建一个新的 StringNode 节点。

# File prism/dsl.rb, line 777
def string_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: nil, content_loc: location, closing_loc: nil, unescaped: "")
  StringNode.new(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped)
end
super_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, lparen_loc: nil, arguments: nil, rparen_loc: nil, block: nil) 点击切换源代码

创建一个新的 SuperNode 节点。

# File prism/dsl.rb, line 782
def super_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, lparen_loc: nil, arguments: nil, rparen_loc: nil, block: nil)
  SuperNode.new(source, node_id, location, flags, keyword_loc, lparen_loc, arguments, rparen_loc, block)
end
symbol_flag(name) 点击切换源代码

检索 SymbolFlags 标志之一的值。

# File prism/dsl.rb, line 963
def symbol_flag(name)
  case name
  when :forced_utf8_encoding then SymbolFlags::FORCED_UTF8_ENCODING
  when :forced_binary_encoding then SymbolFlags::FORCED_BINARY_ENCODING
  when :forced_us_ascii_encoding then SymbolFlags::FORCED_US_ASCII_ENCODING
  else Kernel.raise ArgumentError, "invalid SymbolFlags flag: #{name.inspect}"
  end
end
symbol_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: nil, value_loc: nil, closing_loc: nil, unescaped: "") 点击切换源代码

创建一个新的 SymbolNode 节点。

# File prism/dsl.rb, line 787
def symbol_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: nil, value_loc: nil, closing_loc: nil, unescaped: "")
  SymbolNode.new(source, node_id, location, flags, opening_loc, value_loc, closing_loc, unescaped)
end
true_node(source: default_source, node_id: 0, location: default_location, flags: 0) 点击切换源代码

创建一个新的 TrueNode 节点。

# File prism/dsl.rb, line 792
def true_node(source: default_source, node_id: 0, location: default_location, flags: 0)
  TrueNode.new(source, node_id, location, flags)
end
undef_node(source: default_source, node_id: 0, location: default_location, flags: 0, names: [], keyword_loc: location) 点击切换源代码

创建一个新的 UndefNode 节点。

# File prism/dsl.rb, line 797
def undef_node(source: default_source, node_id: 0, location: default_location, flags: 0, names: [], keyword_loc: location)
  UndefNode.new(source, node_id, location, flags, names, keyword_loc)
end
unless_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, predicate: default_node(source, location), then_keyword_loc: nil, statements: nil, else_clause: nil, end_keyword_loc: nil) 点击切换源代码

创建一个新的 UnlessNode 节点。

# File prism/dsl.rb, line 802
def unless_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, predicate: default_node(source, location), then_keyword_loc: nil, statements: nil, else_clause: nil, end_keyword_loc: nil)
  UnlessNode.new(source, node_id, location, flags, keyword_loc, predicate, then_keyword_loc, statements, else_clause, end_keyword_loc)
end
until_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, do_keyword_loc: nil, closing_loc: nil, predicate: default_node(source, location), statements: nil) 点击切换源代码

创建一个新的 UntilNode 节点。

# File prism/dsl.rb, line 807
def until_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, do_keyword_loc: nil, closing_loc: nil, predicate: default_node(source, location), statements: nil)
  UntilNode.new(source, node_id, location, flags, keyword_loc, do_keyword_loc, closing_loc, predicate, statements)
end
when_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, conditions: [], then_keyword_loc: nil, statements: nil) 点击切换源代码

创建一个新的 WhenNode 节点。

# File prism/dsl.rb, line 812
def when_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, conditions: [], then_keyword_loc: nil, statements: nil)
  WhenNode.new(source, node_id, location, flags, keyword_loc, conditions, then_keyword_loc, statements)
end
while_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, do_keyword_loc: nil, closing_loc: nil, predicate: default_node(source, location), statements: nil) 点击切换源代码

创建一个新的 WhileNode 节点。

# File prism/dsl.rb, line 817
def while_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, do_keyword_loc: nil, closing_loc: nil, predicate: default_node(source, location), statements: nil)
  WhileNode.new(source, node_id, location, flags, keyword_loc, do_keyword_loc, closing_loc, predicate, statements)
end
x_string_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, content_loc: location, closing_loc: location, unescaped: "") 点击切换源代码

创建一个新的 XStringNode 节点。

# File prism/dsl.rb, line 822
def x_string_node(source: default_source, node_id: 0, location: default_location, flags: 0, opening_loc: location, content_loc: location, closing_loc: location, unescaped: "")
  XStringNode.new(source, node_id, location, flags, opening_loc, content_loc, closing_loc, unescaped)
end
yield_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, lparen_loc: nil, arguments: nil, rparen_loc: nil) 点击切换源代码

创建一个新的 YieldNode 节点。

# File prism/dsl.rb, line 827
def yield_node(source: default_source, node_id: 0, location: default_location, flags: 0, keyword_loc: location, lparen_loc: nil, arguments: nil, rparen_loc: nil)
  YieldNode.new(source, node_id, location, flags, keyword_loc, lparen_loc, arguments, rparen_loc)
end

私有实例方法

default_location() 点击切换源代码

如果未指定位置,则附加到节点的默认位置对象,它使用给定的源。

# File prism/dsl.rb, line 982
def default_location
  Location.new(default_source, 0, 0)
end
default_node(source, location) 点击切换源代码

如果未为必需的节点字段指定节点,则附加到节点的默认节点。

# File prism/dsl.rb, line 988
def default_node(source, location)
  MissingNode.new(source, -1, location, 0)
end
default_source() 点击切换源代码

如果未指定源,则附加到节点和位置的默认源对象。

# File prism/dsl.rb, line 976
def default_source
  Source.for("")
end