123456789_123456789_123456789_123456789_123456789_

Class: Prism::InspectVisitor

Relationships & Source Files
Namespace Children
Classes:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Prism::Visitor
Defined in: lib/prism/inspect_visitor.rb

Overview

This visitor is responsible for composing the strings that get returned by the various #inspect methods defined on each of the nodes.

Class Method Summary

Instance Attribute Summary

  • #commands readonly

    The list of commands that we need to execute in order to compose the final string.

  • #indent readonly

    The current prefix string.

Instance Method Summary

Visitor - Inherited

#visit_alias_global_variable_node
#visit_alias_method_node

Visit a AliasMethodNode node.

#visit_alternation_pattern_node
#visit_and_node

Visit a AndNode node.

#visit_arguments_node

Visit a ArgumentsNode node.

#visit_array_node

Visit a ArrayNode node.

#visit_array_pattern_node

Visit a ArrayPatternNode node.

#visit_assoc_node

Visit a AssocNode node.

#visit_assoc_splat_node

Visit a AssocSplatNode node.

#visit_back_reference_read_node

Visit a BackReferenceReadNode node.

#visit_begin_node

Visit a BeginNode node.

#visit_block_argument_node

Visit a BlockArgumentNode node.

#visit_block_local_variable_node
#visit_block_node

Visit a BlockNode node.

#visit_block_parameter_node

Visit a BlockParameterNode node.

#visit_block_parameters_node

Visit a BlockParametersNode node.

#visit_break_node

Visit a BreakNode node.

#visit_call_and_write_node

Visit a CallAndWriteNode node.

#visit_call_node

Visit a CallNode node.

#visit_call_operator_write_node

Visit a CallOperatorWriteNode node.

#visit_call_or_write_node

Visit a CallOrWriteNode node.

#visit_call_target_node

Visit a CallTargetNode node.

#visit_capture_pattern_node

Visit a CapturePatternNode node.

#visit_case_match_node

Visit a CaseMatchNode node.

#visit_case_node

Visit a CaseNode node.

#visit_class_node

Visit a ClassNode node.

#visit_class_variable_and_write_node
#visit_class_variable_operator_write_node
#visit_class_variable_or_write_node
#visit_class_variable_read_node

Visit a ClassVariableReadNode node.

#visit_class_variable_target_node
#visit_class_variable_write_node
#visit_constant_and_write_node

Visit a ConstantAndWriteNode node.

#visit_constant_operator_write_node
#visit_constant_or_write_node

Visit a ConstantOrWriteNode node.

#visit_constant_path_and_write_node
#visit_constant_path_node

Visit a ConstantPathNode node.

#visit_constant_path_operator_write_node
#visit_constant_path_or_write_node
#visit_constant_path_target_node
#visit_constant_path_write_node

Visit a ConstantPathWriteNode node.

#visit_constant_read_node

Visit a ConstantReadNode node.

#visit_constant_target_node

Visit a ConstantTargetNode node.

#visit_constant_write_node

Visit a ConstantWriteNode node.

#visit_def_node

Visit a DefNode node.

#visit_defined_node

Visit a DefinedNode node.

#visit_else_node

Visit a ElseNode node.

#visit_embedded_statements_node
#visit_embedded_variable_node

Visit a EmbeddedVariableNode node.

#visit_ensure_node

Visit a EnsureNode node.

#visit_false_node

Visit a FalseNode node.

#visit_find_pattern_node

Visit a FindPatternNode node.

#visit_flip_flop_node

Visit a FlipFlopNode node.

#visit_float_node

Visit a FloatNode node.

#visit_for_node

Visit a ForNode node.

#visit_forwarding_arguments_node
#visit_forwarding_parameter_node
#visit_forwarding_super_node

Visit a ForwardingSuperNode node.

#visit_global_variable_and_write_node
#visit_global_variable_operator_write_node
#visit_global_variable_or_write_node
#visit_global_variable_read_node
#visit_global_variable_target_node
#visit_global_variable_write_node
#visit_hash_node

Visit a HashNode node.

#visit_hash_pattern_node

Visit a HashPatternNode node.

#visit_if_node

Visit a IfNode node.

#visit_imaginary_node

Visit a ImaginaryNode node.

#visit_implicit_node

Visit a ImplicitNode node.

#visit_implicit_rest_node

Visit a ImplicitRestNode node.

#visit_in_node

Visit a InNode node.

#visit_index_and_write_node

Visit a IndexAndWriteNode node.

#visit_index_operator_write_node
#visit_index_or_write_node

Visit a IndexOrWriteNode node.

#visit_index_target_node

Visit a IndexTargetNode node.

#visit_instance_variable_and_write_node
#visit_instance_variable_operator_write_node
#visit_instance_variable_or_write_node
#visit_instance_variable_read_node
#visit_instance_variable_target_node
#visit_instance_variable_write_node
#visit_integer_node

Visit a IntegerNode node.

#visit_interpolated_match_last_line_node
#visit_interpolated_regular_expression_node
#visit_interpolated_string_node
#visit_interpolated_symbol_node
#visit_interpolated_x_string_node
#visit_it_local_variable_read_node
#visit_it_parameters_node

Visit a ItParametersNode node.

#visit_keyword_hash_node

Visit a KeywordHashNode node.

#visit_keyword_rest_parameter_node
#visit_lambda_node

Visit a LambdaNode node.

#visit_local_variable_and_write_node
#visit_local_variable_operator_write_node
#visit_local_variable_or_write_node
#visit_local_variable_read_node

Visit a LocalVariableReadNode node.

#visit_local_variable_target_node
#visit_local_variable_write_node
#visit_match_last_line_node

Visit a MatchLastLineNode node.

#visit_match_predicate_node

Visit a MatchPredicateNode node.

#visit_match_required_node

Visit a MatchRequiredNode node.

#visit_match_write_node

Visit a MatchWriteNode node.

#visit_missing_node

Visit a MissingNode node.

#visit_module_node

Visit a ModuleNode node.

#visit_multi_target_node

Visit a MultiTargetNode node.

#visit_multi_write_node

Visit a MultiWriteNode node.

#visit_next_node

Visit a NextNode node.

#visit_nil_node

Visit a NilNode node.

#visit_no_keywords_parameter_node
#visit_numbered_parameters_node
#visit_numbered_reference_read_node
#visit_optional_keyword_parameter_node
#visit_optional_parameter_node

Visit a OptionalParameterNode node.

#visit_or_node

Visit a OrNode node.

#visit_parameters_node

Visit a ParametersNode node.

#visit_parentheses_node

Visit a ParenthesesNode node.

#visit_pinned_expression_node

Visit a PinnedExpressionNode node.

#visit_pinned_variable_node

Visit a PinnedVariableNode node.

#visit_post_execution_node

Visit a PostExecutionNode node.

#visit_pre_execution_node

Visit a PreExecutionNode node.

#visit_program_node

Visit a ProgramNode node.

#visit_range_node

Visit a RangeNode node.

#visit_rational_node

Visit a RationalNode node.

#visit_redo_node

Visit a RedoNode node.

#visit_regular_expression_node

Visit a RegularExpressionNode node.

#visit_required_keyword_parameter_node
#visit_required_parameter_node

Visit a RequiredParameterNode node.

#visit_rescue_modifier_node

Visit a RescueModifierNode node.

#visit_rescue_node

Visit a RescueNode node.

#visit_rest_parameter_node

Visit a RestParameterNode node.

#visit_retry_node

Visit a RetryNode node.

#visit_return_node

Visit a ReturnNode node.

#visit_self_node

Visit a SelfNode node.

#visit_shareable_constant_node

Visit a ShareableConstantNode node.

#visit_singleton_class_node

Visit a SingletonClassNode node.

#visit_source_encoding_node

Visit a SourceEncodingNode node.

#visit_source_file_node

Visit a SourceFileNode node.

#visit_source_line_node

Visit a SourceLineNode node.

#visit_splat_node

Visit a SplatNode node.

#visit_statements_node

Visit a StatementsNode node.

#visit_string_node

Visit a StringNode node.

#visit_super_node

Visit a SuperNode node.

#visit_symbol_node

Visit a SymbolNode node.

#visit_true_node

Visit a TrueNode node.

#visit_undef_node

Visit a UndefNode node.

#visit_unless_node

Visit a UnlessNode node.

#visit_until_node

Visit a UntilNode node.

#visit_when_node

Visit a WhenNode node.

#visit_while_node

Visit a WhileNode node.

#visit_x_string_node

Visit a XStringNode node.

#visit_yield_node

Visit a YieldNode node.

BasicVisitor - Inherited

#visit

Calls accept on the given node if it is not nil, which in turn should call back into this visitor by calling the appropriate visit_* method.

#visit_all

Visits each node in nodes by calling accept on each one.

#visit_child_nodes

Visits the child nodes of node by calling accept on each one.

Constructor Details

.new(indent = +"")) ⇒ InspectVisitor

Initializes a new instance of the InspectVisitor.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 38

def initialize(indent = +"")
  @indent = indent
  @commands = []
end

Class Method Details

.compose(node)

Compose an inspect string for the given node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 44

def self.compose(node)
  visitor = new
  node.accept(visitor)
  visitor.compose
end

Instance Attribute Details

#commands (readonly)

The list of commands that we need to execute in order to compose the final string.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 35

attr_reader :commands

#indent (readonly)

The current prefix string.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 31

attr_reader :indent

Instance Method Details

#compose

Compose the final string.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 51

def compose
  buffer = +""
  replace = nil

  until commands.empty?
    # @type var command: String | node | Replace
    # @type var indent: String
    command, indent = *commands.shift

    case command
    when String
      buffer << (replace || indent)
      buffer << command
      replace = nil
    when Node
      visitor = InspectVisitor.new(indent)
      command.accept(visitor)
      @commands = [*visitor.commands, *@commands]
    when Replace
      replace = command.value
    else
      raise "Unknown command: #{command.inspect}"
    end
  end

  buffer
end

#inspect_location(location) (private)

Compose a string representing the given inner location field.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2385

def inspect_location(location)
  if location
    "(#{location.start_line},#{location.start_column})-(#{location.end_line},#{location.end_column}) = #{location.slice.inspect}"
  else
    ""
  end
end

#inspect_node(name, node) (private)

Compose a header for the given node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2379

def inspect_node(name, node)
  location = node.location
  "@ #{name} (location: (#{location.start_line},#{location.start_column})-(#{location.end_line},#{location.end_column}))\n"
end

#visit_alias_global_variable_node(node)

Inspect a AliasGlobalVariableNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 80

def visit_alias_global_variable_node(node)
  commands << [inspect_node("AliasGlobalVariableNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── new_name:\n", indent]
  commands << [node.new_name, "#{indent}"]
  commands << ["├── old_name:\n", indent]
  commands << [node.old_name, "#{indent}"]
  commands << ["└── keyword_loc: #{inspect_location(node.keyword_loc)}\n", indent]
end

#visit_alias_method_node(node)

Inspect a AliasMethodNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 92

def visit_alias_method_node(node)
  commands << [inspect_node("AliasMethodNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── new_name:\n", indent]
  commands << [node.new_name, "#{indent}"]
  commands << ["├── old_name:\n", indent]
  commands << [node.old_name, "#{indent}"]
  commands << ["└── keyword_loc: #{inspect_location(node.keyword_loc)}\n", indent]
end

#visit_alternation_pattern_node(node)

Inspect a AlternationPatternNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 104

def visit_alternation_pattern_node(node)
  commands << [inspect_node("AlternationPatternNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── left:\n", indent]
  commands << [node.left, "#{indent}"]
  commands << ["├── right:\n", indent]
  commands << [node.right, "#{indent}"]
  commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end

#visit_and_node(node)

Inspect a AndNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 116

def visit_and_node(node)
  commands << [inspect_node("AndNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── left:\n", indent]
  commands << [node.left, "#{indent}"]
  commands << ["├── right:\n", indent]
  commands << [node.right, "#{indent}"]
  commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end

#visit_arguments_node(node)

Inspect a ArgumentsNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 128

def visit_arguments_node(node)
  commands << [inspect_node("ArgumentsNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("contains_forwarding" if node.contains_forwarding?), ("contains_keywords" if node.contains_keywords?), ("contains_keyword_splat" if node.contains_keyword_splat?), ("contains_splat" if node.contains_splat?), ("contains_multiple_splats" if node.contains_multiple_splats?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── arguments: (length: #{(arguments = node.arguments).length})\n", indent]
  if arguments.any?
    arguments[0...-1].each do |child|
      commands << [Replace.new("#{indent}    ├── "), indent]
      commands << [child, "#{indent}"]
    end
    commands << [Replace.new("#{indent}    └── "), indent]
    commands << [arguments[-1], "#{indent}        "]
  end
end

#visit_array_node(node)

Inspect a ArrayNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 144

def visit_array_node(node)
  commands << [inspect_node("ArrayNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("contains_splat" if node.contains_splat?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── elements: (length: #{(elements = node.elements).length})\n", indent]
  if elements.any?
    elements[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [elements[-1], "#{indent}"]
  end
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["└── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
end

#visit_array_pattern_node(node)

Inspect a ArrayPatternNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 162

def visit_array_pattern_node(node)
  commands << [inspect_node("ArrayPatternNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (constant = node.constant).nil?
    commands << ["├── constant: ∅\n", indent]
  else
    commands << ["├── constant:\n", indent]
    commands << [constant, "#{indent}"]
  end
  commands << ["├── requireds: (length: #{(requireds = node.requireds).length})\n", indent]
  if requireds.any?
    requireds[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [requireds[-1], "#{indent}"]
  end
  if (rest = node.rest).nil?
    commands << ["├── rest: ∅\n", indent]
  else
    commands << ["├── rest:\n", indent]
    commands << [rest, "#{indent}"]
  end
  commands << ["├── posts: (length: #{(posts = node.posts).length})\n", indent]
  if posts.any?
    posts[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [posts[-1], "#{indent}"]
  end
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["└── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
end

#visit_assoc_node(node)

Inspect a AssocNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 201

def visit_assoc_node(node)
  commands << [inspect_node("AssocNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── key:\n", indent]
  commands << [node.key, "#{indent}"]
  commands << ["├── value:\n", indent]
  commands << [node.value, "#{indent}"]
  commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end

#visit_assoc_splat_node(node)

Inspect a AssocSplatNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 213

def visit_assoc_splat_node(node)
  commands << [inspect_node("AssocSplatNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (value = node.value).nil?
    commands << ["├── value: ∅\n", indent]
  else
    commands << ["├── value:\n", indent]
    commands << [value, "#{indent}"]
  end
  commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end

#visit_back_reference_read_node(node)

Inspect a BackReferenceReadNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 227

def visit_back_reference_read_node(node)
  commands << [inspect_node("BackReferenceReadNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── name: #{node.name.inspect}\n", indent]
end

#visit_begin_node(node)

Inspect a BeginNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 235

def visit_begin_node(node)
  commands << [inspect_node("BeginNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── begin_keyword_loc: #{inspect_location(node.begin_keyword_loc)}\n", indent]
  if (statements = node.statements).nil?
    commands << ["├── statements: ∅\n", indent]
  else
    commands << ["├── statements:\n", indent]
    commands << [statements, "#{indent}"]
  end
  if (rescue_clause = node.rescue_clause).nil?
    commands << ["├── rescue_clause: ∅\n", indent]
  else
    commands << ["├── rescue_clause:\n", indent]
    commands << [rescue_clause, "#{indent}"]
  end
  if (else_clause = node.else_clause).nil?
    commands << ["├── else_clause: ∅\n", indent]
  else
    commands << ["├── else_clause:\n", indent]
    commands << [else_clause, "#{indent}"]
  end
  if (ensure_clause = node.ensure_clause).nil?
    commands << ["├── ensure_clause: ∅\n", indent]
  else
    commands << ["├── ensure_clause:\n", indent]
    commands << [ensure_clause, "#{indent}"]
  end
  commands << ["└── end_keyword_loc: #{inspect_location(node.end_keyword_loc)}\n", indent]
end

#visit_block_argument_node(node)

Inspect a BlockArgumentNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 268

def visit_block_argument_node(node)
  commands << [inspect_node("BlockArgumentNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (expression = node.expression).nil?
    commands << ["├── expression: ∅\n", indent]
  else
    commands << ["├── expression:\n", indent]
    commands << [expression, "#{indent}"]
  end
  commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end

#visit_block_local_variable_node(node)

Inspect a BlockLocalVariableNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 282

def visit_block_local_variable_node(node)
  commands << [inspect_node("BlockLocalVariableNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("repeated_parameter" if node.repeated_parameter?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── name: #{node.name.inspect}\n", indent]
end

#visit_block_node(node)

Inspect a BlockNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 290

def visit_block_node(node)
  commands << [inspect_node("BlockNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── locals: #{node.locals.inspect}\n", indent]
  if (parameters = node.parameters).nil?
    commands << ["├── parameters: ∅\n", indent]
  else
    commands << ["├── parameters:\n", indent]
    commands << [parameters, "#{indent}"]
  end
  if (body = node.body).nil?
    commands << ["├── body: ∅\n", indent]
  else
    commands << ["├── body:\n", indent]
    commands << [body, "#{indent}"]
  end
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["└── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
end

#visit_block_parameter_node(node)

Inspect a BlockParameterNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 312

def visit_block_parameter_node(node)
  commands << [inspect_node("BlockParameterNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("repeated_parameter" if node.repeated_parameter?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (name = node.name).nil?
    commands << ["├── name: ∅\n", indent]
  else
    commands << ["├── name: #{name.inspect}\n", indent]
  end
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end

#visit_block_parameters_node(node)

Inspect a BlockParametersNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 326

def visit_block_parameters_node(node)
  commands << [inspect_node("BlockParametersNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (parameters = node.parameters).nil?
    commands << ["├── parameters: ∅\n", indent]
  else
    commands << ["├── parameters:\n", indent]
    commands << [parameters, "#{indent}"]
  end
  commands << ["├── locals: (length: #{(locals = node.locals).length})\n", indent]
  if locals.any?
    locals[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [locals[-1], "#{indent}"]
  end
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["└── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
end

#visit_break_node(node)

Inspect a BreakNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 350

def visit_break_node(node)
  commands << [inspect_node("BreakNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (arguments = node.arguments).nil?
    commands << ["├── arguments: ∅\n", indent]
  else
    commands << ["├── arguments:\n", indent]
    commands << [arguments, "#{indent}"]
  end
  commands << ["└── keyword_loc: #{inspect_location(node.keyword_loc)}\n", indent]
end

#visit_call_and_write_node(node)

Inspect a CallAndWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 364

def visit_call_and_write_node(node)
  commands << [inspect_node("CallAndWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("safe_navigation" if node.safe_navigation?), ("variable_call" if node.variable_call?), ("attribute_write" if node.attribute_write?), ("ignore_visibility" if node.ignore_visibility?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (receiver = node.receiver).nil?
    commands << ["├── receiver: ∅\n", indent]
  else
    commands << ["├── receiver:\n", indent]
    commands << [receiver, "#{indent}"]
  end
  commands << ["├── call_operator_loc: #{inspect_location(node.call_operator_loc)}\n", indent]
  commands << ["├── message_loc: #{inspect_location(node.message_loc)}\n", indent]
  commands << ["├── read_name: #{node.read_name.inspect}\n", indent]
  commands << ["├── write_name: #{node.write_name.inspect}\n", indent]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_call_node(node)

Inspect a CallNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 384

def visit_call_node(node)
  commands << [inspect_node("CallNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("safe_navigation" if node.safe_navigation?), ("variable_call" if node.variable_call?), ("attribute_write" if node.attribute_write?), ("ignore_visibility" if node.ignore_visibility?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (receiver = node.receiver).nil?
    commands << ["├── receiver: ∅\n", indent]
  else
    commands << ["├── receiver:\n", indent]
    commands << [receiver, "#{indent}"]
  end
  commands << ["├── call_operator_loc: #{inspect_location(node.call_operator_loc)}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── message_loc: #{inspect_location(node.message_loc)}\n", indent]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  if (arguments = node.arguments).nil?
    commands << ["├── arguments: ∅\n", indent]
  else
    commands << ["├── arguments:\n", indent]
    commands << [arguments, "#{indent}"]
  end
  commands << ["├── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
  commands << ["├── equal_loc: #{inspect_location(node.equal_loc)}\n", indent]
  if (block = node.block).nil?
    commands << ["└── block: ∅\n", indent]
  else
    commands << ["└── block:\n", indent]
    commands << [block, "#{indent}    "]
  end
end

#visit_call_operator_write_node(node)

Inspect a CallOperatorWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 415

def visit_call_operator_write_node(node)
  commands << [inspect_node("CallOperatorWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("safe_navigation" if node.safe_navigation?), ("variable_call" if node.variable_call?), ("attribute_write" if node.attribute_write?), ("ignore_visibility" if node.ignore_visibility?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (receiver = node.receiver).nil?
    commands << ["├── receiver: ∅\n", indent]
  else
    commands << ["├── receiver:\n", indent]
    commands << [receiver, "#{indent}"]
  end
  commands << ["├── call_operator_loc: #{inspect_location(node.call_operator_loc)}\n", indent]
  commands << ["├── message_loc: #{inspect_location(node.message_loc)}\n", indent]
  commands << ["├── read_name: #{node.read_name.inspect}\n", indent]
  commands << ["├── write_name: #{node.write_name.inspect}\n", indent]
  commands << ["├── binary_operator: #{node.binary_operator.inspect}\n", indent]
  commands << ["├── binary_operator_loc: #{inspect_location(node.binary_operator_loc)}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_call_or_write_node(node)

Inspect a CallOrWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 436

def visit_call_or_write_node(node)
  commands << [inspect_node("CallOrWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("safe_navigation" if node.safe_navigation?), ("variable_call" if node.variable_call?), ("attribute_write" if node.attribute_write?), ("ignore_visibility" if node.ignore_visibility?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (receiver = node.receiver).nil?
    commands << ["├── receiver: ∅\n", indent]
  else
    commands << ["├── receiver:\n", indent]
    commands << [receiver, "#{indent}"]
  end
  commands << ["├── call_operator_loc: #{inspect_location(node.call_operator_loc)}\n", indent]
  commands << ["├── message_loc: #{inspect_location(node.message_loc)}\n", indent]
  commands << ["├── read_name: #{node.read_name.inspect}\n", indent]
  commands << ["├── write_name: #{node.write_name.inspect}\n", indent]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_call_target_node(node)

Inspect a CallTargetNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 456

def visit_call_target_node(node)
  commands << [inspect_node("CallTargetNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("safe_navigation" if node.safe_navigation?), ("variable_call" if node.variable_call?), ("attribute_write" if node.attribute_write?), ("ignore_visibility" if node.ignore_visibility?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── receiver:\n", indent]
  commands << [node.receiver, "#{indent}"]
  commands << ["├── call_operator_loc: #{inspect_location(node.call_operator_loc)}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["└── message_loc: #{inspect_location(node.message_loc)}\n", indent]
end

#visit_capture_pattern_node(node)

Inspect a CapturePatternNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 468

def visit_capture_pattern_node(node)
  commands << [inspect_node("CapturePatternNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── value:\n", indent]
  commands << [node.value, "#{indent}"]
  commands << ["├── target:\n", indent]
  commands << [node.target, "#{indent}"]
  commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end

#visit_case_match_node(node)

Inspect a CaseMatchNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 480

def visit_case_match_node(node)
  commands << [inspect_node("CaseMatchNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (predicate = node.predicate).nil?
    commands << ["├── predicate: ∅\n", indent]
  else
    commands << ["├── predicate:\n", indent]
    commands << [predicate, "#{indent}"]
  end
  commands << ["├── conditions: (length: #{(conditions = node.conditions).length})\n", indent]
  if conditions.any?
    conditions[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [conditions[-1], "#{indent}"]
  end
  if (else_clause = node.else_clause).nil?
    commands << ["├── else_clause: ∅\n", indent]
  else
    commands << ["├── else_clause:\n", indent]
    commands << [else_clause, "#{indent}"]
  end
  commands << ["├── case_keyword_loc: #{inspect_location(node.case_keyword_loc)}\n", indent]
  commands << ["└── end_keyword_loc: #{inspect_location(node.end_keyword_loc)}\n", indent]
end

#visit_case_node(node)

Inspect a CaseNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 510

def visit_case_node(node)
  commands << [inspect_node("CaseNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (predicate = node.predicate).nil?
    commands << ["├── predicate: ∅\n", indent]
  else
    commands << ["├── predicate:\n", indent]
    commands << [predicate, "#{indent}"]
  end
  commands << ["├── conditions: (length: #{(conditions = node.conditions).length})\n", indent]
  if conditions.any?
    conditions[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [conditions[-1], "#{indent}"]
  end
  if (else_clause = node.else_clause).nil?
    commands << ["├── else_clause: ∅\n", indent]
  else
    commands << ["├── else_clause:\n", indent]
    commands << [else_clause, "#{indent}"]
  end
  commands << ["├── case_keyword_loc: #{inspect_location(node.case_keyword_loc)}\n", indent]
  commands << ["└── end_keyword_loc: #{inspect_location(node.end_keyword_loc)}\n", indent]
end

#visit_class_node(node)

Inspect a ClassNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 540

def visit_class_node(node)
  commands << [inspect_node("ClassNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── locals: #{node.locals.inspect}\n", indent]
  commands << ["├── class_keyword_loc: #{inspect_location(node.class_keyword_loc)}\n", indent]
  commands << ["├── constant_path:\n", indent]
  commands << [node.constant_path, "#{indent}"]
  commands << ["├── inheritance_operator_loc: #{inspect_location(node.inheritance_operator_loc)}\n", indent]
  if (superclass = node.superclass).nil?
    commands << ["├── superclass: ∅\n", indent]
  else
    commands << ["├── superclass:\n", indent]
    commands << [superclass, "#{indent}"]
  end
  if (body = node.body).nil?
    commands << ["├── body: ∅\n", indent]
  else
    commands << ["├── body:\n", indent]
    commands << [body, "#{indent}"]
  end
  commands << ["├── end_keyword_loc: #{inspect_location(node.end_keyword_loc)}\n", indent]
  commands << ["└── name: #{node.name.inspect}\n", indent]
end

#visit_class_variable_and_write_node(node)

Inspect a ClassVariableAndWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 566

def visit_class_variable_and_write_node(node)
  commands << [inspect_node("ClassVariableAndWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_class_variable_operator_write_node(node)

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 578

def visit_class_variable_operator_write_node(node)
  commands << [inspect_node("ClassVariableOperatorWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── binary_operator_loc: #{inspect_location(node.binary_operator_loc)}\n", indent]
  commands << ["├── value:\n", indent]
  commands << [node.value, "#{indent}"]
  commands << ["└── binary_operator: #{node.binary_operator.inspect}\n", indent]
end

#visit_class_variable_or_write_node(node)

Inspect a ClassVariableOrWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 591

def visit_class_variable_or_write_node(node)
  commands << [inspect_node("ClassVariableOrWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_class_variable_read_node(node)

Inspect a ClassVariableReadNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 603

def visit_class_variable_read_node(node)
  commands << [inspect_node("ClassVariableReadNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── name: #{node.name.inspect}\n", indent]
end

#visit_class_variable_target_node(node)

Inspect a ClassVariableTargetNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 611

def visit_class_variable_target_node(node)
  commands << [inspect_node("ClassVariableTargetNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── name: #{node.name.inspect}\n", indent]
end

#visit_class_variable_write_node(node)

Inspect a ClassVariableWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 619

def visit_class_variable_write_node(node)
  commands << [inspect_node("ClassVariableWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── value:\n", indent]
  commands << [node.value, "#{indent}"]
  commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end

#visit_constant_and_write_node(node)

Inspect a ConstantAndWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 631

def visit_constant_and_write_node(node)
  commands << [inspect_node("ConstantAndWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_constant_operator_write_node(node)

Inspect a ConstantOperatorWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 643

def visit_constant_operator_write_node(node)
  commands << [inspect_node("ConstantOperatorWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── binary_operator_loc: #{inspect_location(node.binary_operator_loc)}\n", indent]
  commands << ["├── value:\n", indent]
  commands << [node.value, "#{indent}"]
  commands << ["└── binary_operator: #{node.binary_operator.inspect}\n", indent]
end

#visit_constant_or_write_node(node)

Inspect a ConstantOrWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 656

def visit_constant_or_write_node(node)
  commands << [inspect_node("ConstantOrWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_constant_path_and_write_node(node)

Inspect a ConstantPathAndWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 668

def visit_constant_path_and_write_node(node)
  commands << [inspect_node("ConstantPathAndWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── target:\n", indent]
  commands << [node.target, "#{indent}"]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_constant_path_node(node)

Inspect a ConstantPathNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 680

def visit_constant_path_node(node)
  commands << [inspect_node("ConstantPathNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (parent = node.parent).nil?
    commands << ["├── parent: ∅\n", indent]
  else
    commands << ["├── parent:\n", indent]
    commands << [parent, "#{indent}"]
  end
  if (name = node.name).nil?
    commands << ["├── name: ∅\n", indent]
  else
    commands << ["├── name: #{name.inspect}\n", indent]
  end
  commands << ["├── delimiter_loc: #{inspect_location(node.delimiter_loc)}\n", indent]
  commands << ["└── name_loc: #{inspect_location(node.name_loc)}\n", indent]
end

#visit_constant_path_operator_write_node(node)

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 700

def visit_constant_path_operator_write_node(node)
  commands << [inspect_node("ConstantPathOperatorWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── target:\n", indent]
  commands << [node.target, "#{indent}"]
  commands << ["├── binary_operator_loc: #{inspect_location(node.binary_operator_loc)}\n", indent]
  commands << ["├── value:\n", indent]
  commands << [node.value, "#{indent}"]
  commands << ["└── binary_operator: #{node.binary_operator.inspect}\n", indent]
end

#visit_constant_path_or_write_node(node)

Inspect a ConstantPathOrWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 713

def visit_constant_path_or_write_node(node)
  commands << [inspect_node("ConstantPathOrWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── target:\n", indent]
  commands << [node.target, "#{indent}"]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_constant_path_target_node(node)

Inspect a ConstantPathTargetNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 725

def visit_constant_path_target_node(node)
  commands << [inspect_node("ConstantPathTargetNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (parent = node.parent).nil?
    commands << ["├── parent: ∅\n", indent]
  else
    commands << ["├── parent:\n", indent]
    commands << [parent, "#{indent}"]
  end
  if (name = node.name).nil?
    commands << ["├── name: ∅\n", indent]
  else
    commands << ["├── name: #{name.inspect}\n", indent]
  end
  commands << ["├── delimiter_loc: #{inspect_location(node.delimiter_loc)}\n", indent]
  commands << ["└── name_loc: #{inspect_location(node.name_loc)}\n", indent]
end

#visit_constant_path_write_node(node)

Inspect a ConstantPathWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 745

def visit_constant_path_write_node(node)
  commands << [inspect_node("ConstantPathWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── target:\n", indent]
  commands << [node.target, "#{indent}"]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_constant_read_node(node)

Inspect a ConstantReadNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 757

def visit_constant_read_node(node)
  commands << [inspect_node("ConstantReadNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── name: #{node.name.inspect}\n", indent]
end

#visit_constant_target_node(node)

Inspect a ConstantTargetNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 765

def visit_constant_target_node(node)
  commands << [inspect_node("ConstantTargetNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── name: #{node.name.inspect}\n", indent]
end

#visit_constant_write_node(node)

Inspect a ConstantWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 773

def visit_constant_write_node(node)
  commands << [inspect_node("ConstantWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── value:\n", indent]
  commands << [node.value, "#{indent}"]
  commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end

#visit_def_node(node)

Inspect a DefNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 785

def visit_def_node(node)
  commands << [inspect_node("DefNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  if (receiver = node.receiver).nil?
    commands << ["├── receiver: ∅\n", indent]
  else
    commands << ["├── receiver:\n", indent]
    commands << [receiver, "#{indent}"]
  end
  if (parameters = node.parameters).nil?
    commands << ["├── parameters: ∅\n", indent]
  else
    commands << ["├── parameters:\n", indent]
    commands << [parameters, "#{indent}"]
  end
  if (body = node.body).nil?
    commands << ["├── body: ∅\n", indent]
  else
    commands << ["├── body:\n", indent]
    commands << [body, "#{indent}"]
  end
  commands << ["├── locals: #{node.locals.inspect}\n", indent]
  commands << ["├── def_keyword_loc: #{inspect_location(node.def_keyword_loc)}\n", indent]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["├── lparen_loc: #{inspect_location(node.lparen_loc)}\n", indent]
  commands << ["├── rparen_loc: #{inspect_location(node.rparen_loc)}\n", indent]
  commands << ["├── equal_loc: #{inspect_location(node.equal_loc)}\n", indent]
  commands << ["└── end_keyword_loc: #{inspect_location(node.end_keyword_loc)}\n", indent]
end

#visit_defined_node(node)

Inspect a DefinedNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 819

def visit_defined_node(node)
  commands << [inspect_node("DefinedNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── lparen_loc: #{inspect_location(node.lparen_loc)}\n", indent]
  commands << ["├── value:\n", indent]
  commands << [node.value, "#{indent}"]
  commands << ["├── rparen_loc: #{inspect_location(node.rparen_loc)}\n", indent]
  commands << ["└── keyword_loc: #{inspect_location(node.keyword_loc)}\n", indent]
end

#visit_else_node(node)

Inspect a ElseNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 831

def visit_else_node(node)
  commands << [inspect_node("ElseNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── else_keyword_loc: #{inspect_location(node.else_keyword_loc)}\n", indent]
  if (statements = node.statements).nil?
    commands << ["├── statements: ∅\n", indent]
  else
    commands << ["├── statements:\n", indent]
    commands << [statements, "#{indent}"]
  end
  commands << ["└── end_keyword_loc: #{inspect_location(node.end_keyword_loc)}\n", indent]
end

#visit_embedded_statements_node(node)

Inspect a EmbeddedStatementsNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 846

def visit_embedded_statements_node(node)
  commands << [inspect_node("EmbeddedStatementsNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  if (statements = node.statements).nil?
    commands << ["├── statements: ∅\n", indent]
  else
    commands << ["├── statements:\n", indent]
    commands << [statements, "#{indent}"]
  end
  commands << ["└── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
end

#visit_embedded_variable_node(node)

Inspect a EmbeddedVariableNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 861

def visit_embedded_variable_node(node)
  commands << [inspect_node("EmbeddedVariableNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["└── variable:\n", indent]
  commands << [node.variable, "#{indent}    "]
end

#visit_ensure_node(node)

Inspect a EnsureNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 871

def visit_ensure_node(node)
  commands << [inspect_node("EnsureNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── ensure_keyword_loc: #{inspect_location(node.ensure_keyword_loc)}\n", indent]
  if (statements = node.statements).nil?
    commands << ["├── statements: ∅\n", indent]
  else
    commands << ["├── statements:\n", indent]
    commands << [statements, "#{indent}"]
  end
  commands << ["└── end_keyword_loc: #{inspect_location(node.end_keyword_loc)}\n", indent]
end

#visit_false_node(node)

Inspect a FalseNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 886

def visit_false_node(node)
  commands << [inspect_node("FalseNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["└── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
end

#visit_find_pattern_node(node)

Inspect a FindPatternNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 893

def visit_find_pattern_node(node)
  commands << [inspect_node("FindPatternNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (constant = node.constant).nil?
    commands << ["├── constant: ∅\n", indent]
  else
    commands << ["├── constant:\n", indent]
    commands << [constant, "#{indent}"]
  end
  commands << ["├── left:\n", indent]
  commands << [node.left, "#{indent}"]
  commands << ["├── requireds: (length: #{(requireds = node.requireds).length})\n", indent]
  if requireds.any?
    requireds[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [requireds[-1], "#{indent}"]
  end
  commands << ["├── right:\n", indent]
  commands << [node.right, "#{indent}"]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["└── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
end

#visit_flip_flop_node(node)

Inspect a FlipFlopNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 921

def visit_flip_flop_node(node)
  commands << [inspect_node("FlipFlopNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("exclude_end" if node.exclude_end?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (left = node.left).nil?
    commands << ["├── left: ∅\n", indent]
  else
    commands << ["├── left:\n", indent]
    commands << [left, "#{indent}"]
  end
  if (right = node.right).nil?
    commands << ["├── right: ∅\n", indent]
  else
    commands << ["├── right:\n", indent]
    commands << [right, "#{indent}"]
  end
  commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end

#visit_float_node(node)

Inspect a FloatNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 941

def visit_float_node(node)
  commands << [inspect_node("FloatNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── value: #{node.value.inspect}\n", indent]
end

#visit_for_node(node)

Inspect a ForNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 949

def visit_for_node(node)
  commands << [inspect_node("ForNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── index:\n", indent]
  commands << [node.index, "#{indent}"]
  commands << ["├── collection:\n", indent]
  commands << [node.collection, "#{indent}"]
  if (statements = node.statements).nil?
    commands << ["├── statements: ∅\n", indent]
  else
    commands << ["├── statements:\n", indent]
    commands << [statements, "#{indent}"]
  end
  commands << ["├── for_keyword_loc: #{inspect_location(node.for_keyword_loc)}\n", indent]
  commands << ["├── in_keyword_loc: #{inspect_location(node.in_keyword_loc)}\n", indent]
  commands << ["├── do_keyword_loc: #{inspect_location(node.do_keyword_loc)}\n", indent]
  commands << ["└── end_keyword_loc: #{inspect_location(node.end_keyword_loc)}\n", indent]
end

#visit_forwarding_arguments_node(node)

Inspect a ForwardingArgumentsNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 970

def visit_forwarding_arguments_node(node)
  commands << [inspect_node("ForwardingArgumentsNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["└── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
end

#visit_forwarding_parameter_node(node)

Inspect a ForwardingParameterNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 977

def visit_forwarding_parameter_node(node)
  commands << [inspect_node("ForwardingParameterNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["└── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
end

#visit_forwarding_super_node(node)

Inspect a ForwardingSuperNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 984

def visit_forwarding_super_node(node)
  commands << [inspect_node("ForwardingSuperNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (block = node.block).nil?
    commands << ["└── block: ∅\n", indent]
  else
    commands << ["└── block:\n", indent]
    commands << [block, "#{indent}    "]
  end
end

#visit_global_variable_and_write_node(node)

Inspect a GlobalVariableAndWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 997

def visit_global_variable_and_write_node(node)
  commands << [inspect_node("GlobalVariableAndWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_global_variable_operator_write_node(node)

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1009

def visit_global_variable_operator_write_node(node)
  commands << [inspect_node("GlobalVariableOperatorWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── binary_operator_loc: #{inspect_location(node.binary_operator_loc)}\n", indent]
  commands << ["├── value:\n", indent]
  commands << [node.value, "#{indent}"]
  commands << ["└── binary_operator: #{node.binary_operator.inspect}\n", indent]
end

#visit_global_variable_or_write_node(node)

Inspect a GlobalVariableOrWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1022

def visit_global_variable_or_write_node(node)
  commands << [inspect_node("GlobalVariableOrWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_global_variable_read_node(node)

Inspect a GlobalVariableReadNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1034

def visit_global_variable_read_node(node)
  commands << [inspect_node("GlobalVariableReadNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── name: #{node.name.inspect}\n", indent]
end

#visit_global_variable_target_node(node)

Inspect a GlobalVariableTargetNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1042

def visit_global_variable_target_node(node)
  commands << [inspect_node("GlobalVariableTargetNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── name: #{node.name.inspect}\n", indent]
end

#visit_global_variable_write_node(node)

Inspect a GlobalVariableWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1050

def visit_global_variable_write_node(node)
  commands << [inspect_node("GlobalVariableWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── value:\n", indent]
  commands << [node.value, "#{indent}"]
  commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end

#visit_hash_node(node)

Inspect a HashNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1062

def visit_hash_node(node)
  commands << [inspect_node("HashNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["├── elements: (length: #{(elements = node.elements).length})\n", indent]
  if elements.any?
    elements[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [elements[-1], "#{indent}"]
  end
  commands << ["└── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
end

#visit_hash_pattern_node(node)

Inspect a HashPatternNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1080

def visit_hash_pattern_node(node)
  commands << [inspect_node("HashPatternNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (constant = node.constant).nil?
    commands << ["├── constant: ∅\n", indent]
  else
    commands << ["├── constant:\n", indent]
    commands << [constant, "#{indent}"]
  end
  commands << ["├── elements: (length: #{(elements = node.elements).length})\n", indent]
  if elements.any?
    elements[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [elements[-1], "#{indent}"]
  end
  if (rest = node.rest).nil?
    commands << ["├── rest: ∅\n", indent]
  else
    commands << ["├── rest:\n", indent]
    commands << [rest, "#{indent}"]
  end
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["└── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
end

#visit_if_node(node)

Inspect a IfNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1110

def visit_if_node(node)
  commands << [inspect_node("IfNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── if_keyword_loc: #{inspect_location(node.if_keyword_loc)}\n", indent]
  commands << ["├── predicate:\n", indent]
  commands << [node.predicate, "#{indent}"]
  commands << ["├── then_keyword_loc: #{inspect_location(node.then_keyword_loc)}\n", indent]
  if (statements = node.statements).nil?
    commands << ["├── statements: ∅\n", indent]
  else
    commands << ["├── statements:\n", indent]
    commands << [statements, "#{indent}"]
  end
  if (subsequent = node.subsequent).nil?
    commands << ["├── subsequent: ∅\n", indent]
  else
    commands << ["├── subsequent:\n", indent]
    commands << [subsequent, "#{indent}"]
  end
  commands << ["└── end_keyword_loc: #{inspect_location(node.end_keyword_loc)}\n", indent]
end

#visit_imaginary_node(node)

Inspect a ImaginaryNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1134

def visit_imaginary_node(node)
  commands << [inspect_node("ImaginaryNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── numeric:\n", indent]
  commands << [node.numeric, "#{indent}    "]
end

#visit_implicit_node(node)

Inspect a ImplicitNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1143

def visit_implicit_node(node)
  commands << [inspect_node("ImplicitNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_implicit_rest_node(node)

Inspect a ImplicitRestNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1152

def visit_implicit_rest_node(node)
  commands << [inspect_node("ImplicitRestNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["└── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
end

#visit_in_node(node)

Inspect a InNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1159

def visit_in_node(node)
  commands << [inspect_node("InNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── pattern:\n", indent]
  commands << [node.pattern, "#{indent}"]
  if (statements = node.statements).nil?
    commands << ["├── statements: ∅\n", indent]
  else
    commands << ["├── statements:\n", indent]
    commands << [statements, "#{indent}"]
  end
  commands << ["├── in_loc: #{inspect_location(node.in_loc)}\n", indent]
  commands << ["└── then_loc: #{inspect_location(node.then_loc)}\n", indent]
end

#visit_index_and_write_node(node)

Inspect a IndexAndWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1176

def visit_index_and_write_node(node)
  commands << [inspect_node("IndexAndWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("safe_navigation" if node.safe_navigation?), ("variable_call" if node.variable_call?), ("attribute_write" if node.attribute_write?), ("ignore_visibility" if node.ignore_visibility?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (receiver = node.receiver).nil?
    commands << ["├── receiver: ∅\n", indent]
  else
    commands << ["├── receiver:\n", indent]
    commands << [receiver, "#{indent}"]
  end
  commands << ["├── call_operator_loc: #{inspect_location(node.call_operator_loc)}\n", indent]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  if (arguments = node.arguments).nil?
    commands << ["├── arguments: ∅\n", indent]
  else
    commands << ["├── arguments:\n", indent]
    commands << [arguments, "#{indent}"]
  end
  commands << ["├── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
  if (block = node.block).nil?
    commands << ["├── block: ∅\n", indent]
  else
    commands << ["├── block:\n", indent]
    commands << [block, "#{indent}"]
  end
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_index_operator_write_node(node)

Inspect a IndexOperatorWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1207

def visit_index_operator_write_node(node)
  commands << [inspect_node("IndexOperatorWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("safe_navigation" if node.safe_navigation?), ("variable_call" if node.variable_call?), ("attribute_write" if node.attribute_write?), ("ignore_visibility" if node.ignore_visibility?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (receiver = node.receiver).nil?
    commands << ["├── receiver: ∅\n", indent]
  else
    commands << ["├── receiver:\n", indent]
    commands << [receiver, "#{indent}"]
  end
  commands << ["├── call_operator_loc: #{inspect_location(node.call_operator_loc)}\n", indent]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  if (arguments = node.arguments).nil?
    commands << ["├── arguments: ∅\n", indent]
  else
    commands << ["├── arguments:\n", indent]
    commands << [arguments, "#{indent}"]
  end
  commands << ["├── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
  if (block = node.block).nil?
    commands << ["├── block: ∅\n", indent]
  else
    commands << ["├── block:\n", indent]
    commands << [block, "#{indent}"]
  end
  commands << ["├── binary_operator: #{node.binary_operator.inspect}\n", indent]
  commands << ["├── binary_operator_loc: #{inspect_location(node.binary_operator_loc)}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_index_or_write_node(node)

Inspect a IndexOrWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1239

def visit_index_or_write_node(node)
  commands << [inspect_node("IndexOrWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("safe_navigation" if node.safe_navigation?), ("variable_call" if node.variable_call?), ("attribute_write" if node.attribute_write?), ("ignore_visibility" if node.ignore_visibility?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (receiver = node.receiver).nil?
    commands << ["├── receiver: ∅\n", indent]
  else
    commands << ["├── receiver:\n", indent]
    commands << [receiver, "#{indent}"]
  end
  commands << ["├── call_operator_loc: #{inspect_location(node.call_operator_loc)}\n", indent]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  if (arguments = node.arguments).nil?
    commands << ["├── arguments: ∅\n", indent]
  else
    commands << ["├── arguments:\n", indent]
    commands << [arguments, "#{indent}"]
  end
  commands << ["├── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
  if (block = node.block).nil?
    commands << ["├── block: ∅\n", indent]
  else
    commands << ["├── block:\n", indent]
    commands << [block, "#{indent}"]
  end
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_index_target_node(node)

Inspect a IndexTargetNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1270

def visit_index_target_node(node)
  commands << [inspect_node("IndexTargetNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("safe_navigation" if node.safe_navigation?), ("variable_call" if node.variable_call?), ("attribute_write" if node.attribute_write?), ("ignore_visibility" if node.ignore_visibility?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── receiver:\n", indent]
  commands << [node.receiver, "#{indent}"]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  if (arguments = node.arguments).nil?
    commands << ["├── arguments: ∅\n", indent]
  else
    commands << ["├── arguments:\n", indent]
    commands << [arguments, "#{indent}"]
  end
  commands << ["├── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
  if (block = node.block).nil?
    commands << ["└── block: ∅\n", indent]
  else
    commands << ["└── block:\n", indent]
    commands << [block, "#{indent}    "]
  end
end

#visit_instance_variable_and_write_node(node)

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1293

def visit_instance_variable_and_write_node(node)
  commands << [inspect_node("InstanceVariableAndWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_instance_variable_operator_write_node(node)

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1305

def visit_instance_variable_operator_write_node(node)
  commands << [inspect_node("InstanceVariableOperatorWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── binary_operator_loc: #{inspect_location(node.binary_operator_loc)}\n", indent]
  commands << ["├── value:\n", indent]
  commands << [node.value, "#{indent}"]
  commands << ["└── binary_operator: #{node.binary_operator.inspect}\n", indent]
end

#visit_instance_variable_or_write_node(node)

Inspect a InstanceVariableOrWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1318

def visit_instance_variable_or_write_node(node)
  commands << [inspect_node("InstanceVariableOrWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_instance_variable_read_node(node)

Inspect a InstanceVariableReadNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1330

def visit_instance_variable_read_node(node)
  commands << [inspect_node("InstanceVariableReadNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── name: #{node.name.inspect}\n", indent]
end

#visit_instance_variable_target_node(node)

Inspect a InstanceVariableTargetNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1338

def visit_instance_variable_target_node(node)
  commands << [inspect_node("InstanceVariableTargetNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── name: #{node.name.inspect}\n", indent]
end

#visit_instance_variable_write_node(node)

Inspect a InstanceVariableWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1346

def visit_instance_variable_write_node(node)
  commands << [inspect_node("InstanceVariableWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── value:\n", indent]
  commands << [node.value, "#{indent}"]
  commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end

#visit_integer_node(node)

Inspect a IntegerNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1358

def visit_integer_node(node)
  commands << [inspect_node("IntegerNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("binary" if node.binary?), ("decimal" if node.decimal?), ("octal" if node.octal?), ("hexadecimal" if node.hexadecimal?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── value: #{node.value.inspect}\n", indent]
end

#visit_interpolated_match_last_line_node(node)

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1366

def visit_interpolated_match_last_line_node(node)
  commands << [inspect_node("InterpolatedMatchLastLineNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("ignore_case" if node.ignore_case?), ("extended" if node.extended?), ("multi_line" if node.multi_line?), ("once" if node.once?), ("euc_jp" if node.euc_jp?), ("ascii_8bit" if node.ascii_8bit?), ("windows_31j" if node.windows_31j?), ("utf_8" if node.utf_8?), ("forced_utf8_encoding" if node.forced_utf8_encoding?), ("forced_binary_encoding" if node.forced_binary_encoding?), ("forced_us_ascii_encoding" if node.forced_us_ascii_encoding?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["├── parts: (length: #{(parts = node.parts).length})\n", indent]
  if parts.any?
    parts[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [parts[-1], "#{indent}"]
  end
  commands << ["└── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
end

#visit_interpolated_regular_expression_node(node)

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1384

def visit_interpolated_regular_expression_node(node)
  commands << [inspect_node("InterpolatedRegularExpressionNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("ignore_case" if node.ignore_case?), ("extended" if node.extended?), ("multi_line" if node.multi_line?), ("once" if node.once?), ("euc_jp" if node.euc_jp?), ("ascii_8bit" if node.ascii_8bit?), ("windows_31j" if node.windows_31j?), ("utf_8" if node.utf_8?), ("forced_utf8_encoding" if node.forced_utf8_encoding?), ("forced_binary_encoding" if node.forced_binary_encoding?), ("forced_us_ascii_encoding" if node.forced_us_ascii_encoding?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["├── parts: (length: #{(parts = node.parts).length})\n", indent]
  if parts.any?
    parts[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [parts[-1], "#{indent}"]
  end
  commands << ["└── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
end

#visit_interpolated_string_node(node)

Inspect a InterpolatedStringNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1402

def visit_interpolated_string_node(node)
  commands << [inspect_node("InterpolatedStringNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("frozen" if node.frozen?), ("mutable" if node.mutable?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["├── parts: (length: #{(parts = node.parts).length})\n", indent]
  if parts.any?
    parts[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [parts[-1], "#{indent}"]
  end
  commands << ["└── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
end

#visit_interpolated_symbol_node(node)

Inspect a InterpolatedSymbolNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1420

def visit_interpolated_symbol_node(node)
  commands << [inspect_node("InterpolatedSymbolNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["├── parts: (length: #{(parts = node.parts).length})\n", indent]
  if parts.any?
    parts[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [parts[-1], "#{indent}"]
  end
  commands << ["└── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
end

#visit_interpolated_x_string_node(node)

Inspect a InterpolatedXStringNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1438

def visit_interpolated_x_string_node(node)
  commands << [inspect_node("InterpolatedXStringNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["├── parts: (length: #{(parts = node.parts).length})\n", indent]
  if parts.any?
    parts[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [parts[-1], "#{indent}"]
  end
  commands << ["└── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
end

#visit_it_local_variable_read_node(node)

Inspect a ItLocalVariableReadNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1456

def visit_it_local_variable_read_node(node)
  commands << [inspect_node("ItLocalVariableReadNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["└── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
end

#visit_it_parameters_node(node)

Inspect a ItParametersNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1463

def visit_it_parameters_node(node)
  commands << [inspect_node("ItParametersNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["└── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
end

#visit_keyword_hash_node(node)

Inspect a KeywordHashNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1470

def visit_keyword_hash_node(node)
  commands << [inspect_node("KeywordHashNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("symbol_keys" if node.symbol_keys?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── elements: (length: #{(elements = node.elements).length})\n", indent]
  if elements.any?
    elements[0...-1].each do |child|
      commands << [Replace.new("#{indent}    ├── "), indent]
      commands << [child, "#{indent}"]
    end
    commands << [Replace.new("#{indent}    └── "), indent]
    commands << [elements[-1], "#{indent}        "]
  end
end

#visit_keyword_rest_parameter_node(node)

Inspect a KeywordRestParameterNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1486

def visit_keyword_rest_parameter_node(node)
  commands << [inspect_node("KeywordRestParameterNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("repeated_parameter" if node.repeated_parameter?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (name = node.name).nil?
    commands << ["├── name: ∅\n", indent]
  else
    commands << ["├── name: #{name.inspect}\n", indent]
  end
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end

#visit_lambda_node(node)

Inspect a LambdaNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1500

def visit_lambda_node(node)
  commands << [inspect_node("LambdaNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── locals: #{node.locals.inspect}\n", indent]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["├── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
  if (parameters = node.parameters).nil?
    commands << ["├── parameters: ∅\n", indent]
  else
    commands << ["├── parameters:\n", indent]
    commands << [parameters, "#{indent}"]
  end
  if (body = node.body).nil?
    commands << ["└── body: ∅\n", indent]
  else
    commands << ["└── body:\n", indent]
    commands << [body, "#{indent}    "]
  end
end

#visit_local_variable_and_write_node(node)

Inspect a LocalVariableAndWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1523

def visit_local_variable_and_write_node(node)
  commands << [inspect_node("LocalVariableAndWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["├── value:\n", indent]
  commands << [node.value, "#{indent}"]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["└── depth: #{node.depth.inspect}\n", indent]
end

#visit_local_variable_operator_write_node(node)

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1536

def visit_local_variable_operator_write_node(node)
  commands << [inspect_node("LocalVariableOperatorWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── binary_operator_loc: #{inspect_location(node.binary_operator_loc)}\n", indent]
  commands << ["├── value:\n", indent]
  commands << [node.value, "#{indent}"]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── binary_operator: #{node.binary_operator.inspect}\n", indent]
  commands << ["└── depth: #{node.depth.inspect}\n", indent]
end

#visit_local_variable_or_write_node(node)

Inspect a LocalVariableOrWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1550

def visit_local_variable_or_write_node(node)
  commands << [inspect_node("LocalVariableOrWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["├── value:\n", indent]
  commands << [node.value, "#{indent}"]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["└── depth: #{node.depth.inspect}\n", indent]
end

#visit_local_variable_read_node(node)

Inspect a LocalVariableReadNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1563

def visit_local_variable_read_node(node)
  commands << [inspect_node("LocalVariableReadNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["└── depth: #{node.depth.inspect}\n", indent]
end

#visit_local_variable_target_node(node)

Inspect a LocalVariableTargetNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1572

def visit_local_variable_target_node(node)
  commands << [inspect_node("LocalVariableTargetNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["└── depth: #{node.depth.inspect}\n", indent]
end

#visit_local_variable_write_node(node)

Inspect a LocalVariableWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1581

def visit_local_variable_write_node(node)
  commands << [inspect_node("LocalVariableWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── depth: #{node.depth.inspect}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── value:\n", indent]
  commands << [node.value, "#{indent}"]
  commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end

#visit_match_last_line_node(node)

Inspect a MatchLastLineNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1594

def visit_match_last_line_node(node)
  commands << [inspect_node("MatchLastLineNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("ignore_case" if node.ignore_case?), ("extended" if node.extended?), ("multi_line" if node.multi_line?), ("once" if node.once?), ("euc_jp" if node.euc_jp?), ("ascii_8bit" if node.ascii_8bit?), ("windows_31j" if node.windows_31j?), ("utf_8" if node.utf_8?), ("forced_utf8_encoding" if node.forced_utf8_encoding?), ("forced_binary_encoding" if node.forced_binary_encoding?), ("forced_us_ascii_encoding" if node.forced_us_ascii_encoding?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["├── content_loc: #{inspect_location(node.content_loc)}\n", indent]
  commands << ["├── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
  commands << ["└── unescaped: #{node.unescaped.inspect}\n", indent]
end

#visit_match_predicate_node(node)

Inspect a MatchPredicateNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1605

def visit_match_predicate_node(node)
  commands << [inspect_node("MatchPredicateNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── value:\n", indent]
  commands << [node.value, "#{indent}"]
  commands << ["├── pattern:\n", indent]
  commands << [node.pattern, "#{indent}"]
  commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end

#visit_match_required_node(node)

Inspect a MatchRequiredNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1617

def visit_match_required_node(node)
  commands << [inspect_node("MatchRequiredNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── value:\n", indent]
  commands << [node.value, "#{indent}"]
  commands << ["├── pattern:\n", indent]
  commands << [node.pattern, "#{indent}"]
  commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end

#visit_match_write_node(node)

Inspect a MatchWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1629

def visit_match_write_node(node)
  commands << [inspect_node("MatchWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── call:\n", indent]
  commands << [node.call, "#{indent}"]
  commands << ["└── targets: (length: #{(targets = node.targets).length})\n", indent]
  if targets.any?
    targets[0...-1].each do |child|
      commands << [Replace.new("#{indent}    ├── "), indent]
      commands << [child, "#{indent}"]
    end
    commands << [Replace.new("#{indent}    └── "), indent]
    commands << [targets[-1], "#{indent}        "]
  end
end

#visit_missing_node(node)

Inspect a MissingNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1647

def visit_missing_node(node)
  commands << [inspect_node("MissingNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["└── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
end

#visit_module_node(node)

Inspect a ModuleNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1654

def visit_module_node(node)
  commands << [inspect_node("ModuleNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── locals: #{node.locals.inspect}\n", indent]
  commands << ["├── module_keyword_loc: #{inspect_location(node.module_keyword_loc)}\n", indent]
  commands << ["├── constant_path:\n", indent]
  commands << [node.constant_path, "#{indent}"]
  if (body = node.body).nil?
    commands << ["├── body: ∅\n", indent]
  else
    commands << ["├── body:\n", indent]
    commands << [body, "#{indent}"]
  end
  commands << ["├── end_keyword_loc: #{inspect_location(node.end_keyword_loc)}\n", indent]
  commands << ["└── name: #{node.name.inspect}\n", indent]
end

#visit_multi_target_node(node)

Inspect a MultiTargetNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1673

def visit_multi_target_node(node)
  commands << [inspect_node("MultiTargetNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── lefts: (length: #{(lefts = node.lefts).length})\n", indent]
  if lefts.any?
    lefts[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [lefts[-1], "#{indent}"]
  end
  if (rest = node.rest).nil?
    commands << ["├── rest: ∅\n", indent]
  else
    commands << ["├── rest:\n", indent]
    commands << [rest, "#{indent}"]
  end
  commands << ["├── rights: (length: #{(rights = node.rights).length})\n", indent]
  if rights.any?
    rights[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [rights[-1], "#{indent}"]
  end
  commands << ["├── lparen_loc: #{inspect_location(node.lparen_loc)}\n", indent]
  commands << ["└── rparen_loc: #{inspect_location(node.rparen_loc)}\n", indent]
end

#visit_multi_write_node(node)

Inspect a MultiWriteNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1706

def visit_multi_write_node(node)
  commands << [inspect_node("MultiWriteNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── lefts: (length: #{(lefts = node.lefts).length})\n", indent]
  if lefts.any?
    lefts[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [lefts[-1], "#{indent}"]
  end
  if (rest = node.rest).nil?
    commands << ["├── rest: ∅\n", indent]
  else
    commands << ["├── rest:\n", indent]
    commands << [rest, "#{indent}"]
  end
  commands << ["├── rights: (length: #{(rights = node.rights).length})\n", indent]
  if rights.any?
    rights[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [rights[-1], "#{indent}"]
  end
  commands << ["├── lparen_loc: #{inspect_location(node.lparen_loc)}\n", indent]
  commands << ["├── rparen_loc: #{inspect_location(node.rparen_loc)}\n", indent]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_next_node(node)

Inspect a NextNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1742

def visit_next_node(node)
  commands << [inspect_node("NextNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (arguments = node.arguments).nil?
    commands << ["├── arguments: ∅\n", indent]
  else
    commands << ["├── arguments:\n", indent]
    commands << [arguments, "#{indent}"]
  end
  commands << ["└── keyword_loc: #{inspect_location(node.keyword_loc)}\n", indent]
end

#visit_nil_node(node)

Inspect a NilNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1756

def visit_nil_node(node)
  commands << [inspect_node("NilNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["└── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
end

#visit_no_keywords_parameter_node(node)

Inspect a NoKeywordsParameterNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1763

def visit_no_keywords_parameter_node(node)
  commands << [inspect_node("NoKeywordsParameterNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["└── keyword_loc: #{inspect_location(node.keyword_loc)}\n", indent]
end

#visit_numbered_parameters_node(node)

Inspect a NumberedParametersNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1772

def visit_numbered_parameters_node(node)
  commands << [inspect_node("NumberedParametersNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── maximum: #{node.maximum.inspect}\n", indent]
end

#visit_numbered_reference_read_node(node)

Inspect a NumberedReferenceReadNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1780

def visit_numbered_reference_read_node(node)
  commands << [inspect_node("NumberedReferenceReadNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── number: #{node.number.inspect}\n", indent]
end

#visit_optional_keyword_parameter_node(node)

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1788

def visit_optional_keyword_parameter_node(node)
  commands << [inspect_node("OptionalKeywordParameterNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("repeated_parameter" if node.repeated_parameter?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_optional_parameter_node(node)

Inspect a OptionalParameterNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1799

def visit_optional_parameter_node(node)
  commands << [inspect_node("OptionalParameterNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("repeated_parameter" if node.repeated_parameter?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["└── value:\n", indent]
  commands << [node.value, "#{indent}    "]
end

#visit_or_node(node)

Inspect a OrNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1811

def visit_or_node(node)
  commands << [inspect_node("OrNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── left:\n", indent]
  commands << [node.left, "#{indent}"]
  commands << ["├── right:\n", indent]
  commands << [node.right, "#{indent}"]
  commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end

#visit_parameters_node(node)

Inspect a ParametersNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1823

def visit_parameters_node(node)
  commands << [inspect_node("ParametersNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── requireds: (length: #{(requireds = node.requireds).length})\n", indent]
  if requireds.any?
    requireds[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [requireds[-1], "#{indent}"]
  end
  commands << ["├── optionals: (length: #{(optionals = node.optionals).length})\n", indent]
  if optionals.any?
    optionals[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [optionals[-1], "#{indent}"]
  end
  if (rest = node.rest).nil?
    commands << ["├── rest: ∅\n", indent]
  else
    commands << ["├── rest:\n", indent]
    commands << [rest, "#{indent}"]
  end
  commands << ["├── posts: (length: #{(posts = node.posts).length})\n", indent]
  if posts.any?
    posts[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [posts[-1], "#{indent}"]
  end
  commands << ["├── keywords: (length: #{(keywords = node.keywords).length})\n", indent]
  if keywords.any?
    keywords[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [keywords[-1], "#{indent}"]
  end
  if (keyword_rest = node.keyword_rest).nil?
    commands << ["├── keyword_rest: ∅\n", indent]
  else
    commands << ["├── keyword_rest:\n", indent]
    commands << [keyword_rest, "#{indent}"]
  end
  if (block = node.block).nil?
    commands << ["└── block: ∅\n", indent]
  else
    commands << ["└── block:\n", indent]
    commands << [block, "#{indent}    "]
  end
end

#visit_parentheses_node(node)

Inspect a ParenthesesNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1884

def visit_parentheses_node(node)
  commands << [inspect_node("ParenthesesNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("multiple_statements" if node.multiple_statements?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (body = node.body).nil?
    commands << ["├── body: ∅\n", indent]
  else
    commands << ["├── body:\n", indent]
    commands << [body, "#{indent}"]
  end
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["└── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
end

#visit_pinned_expression_node(node)

Inspect a PinnedExpressionNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1899

def visit_pinned_expression_node(node)
  commands << [inspect_node("PinnedExpressionNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── expression:\n", indent]
  commands << [node.expression, "#{indent}"]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["├── lparen_loc: #{inspect_location(node.lparen_loc)}\n", indent]
  commands << ["└── rparen_loc: #{inspect_location(node.rparen_loc)}\n", indent]
end

#visit_pinned_variable_node(node)

Inspect a PinnedVariableNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1911

def visit_pinned_variable_node(node)
  commands << [inspect_node("PinnedVariableNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── variable:\n", indent]
  commands << [node.variable, "#{indent}"]
  commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end

#visit_post_execution_node(node)

Inspect a PostExecutionNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1921

def visit_post_execution_node(node)
  commands << [inspect_node("PostExecutionNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (statements = node.statements).nil?
    commands << ["├── statements: ∅\n", indent]
  else
    commands << ["├── statements:\n", indent]
    commands << [statements, "#{indent}"]
  end
  commands << ["├── keyword_loc: #{inspect_location(node.keyword_loc)}\n", indent]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["└── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
end

#visit_pre_execution_node(node)

Inspect a PreExecutionNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1937

def visit_pre_execution_node(node)
  commands << [inspect_node("PreExecutionNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (statements = node.statements).nil?
    commands << ["├── statements: ∅\n", indent]
  else
    commands << ["├── statements:\n", indent]
    commands << [statements, "#{indent}"]
  end
  commands << ["├── keyword_loc: #{inspect_location(node.keyword_loc)}\n", indent]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["└── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
end

#visit_program_node(node)

Inspect a ProgramNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1953

def visit_program_node(node)
  commands << [inspect_node("ProgramNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── locals: #{node.locals.inspect}\n", indent]
  commands << ["└── statements:\n", indent]
  commands << [node.statements, "#{indent}    "]
end

#visit_range_node(node)

Inspect a RangeNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1963

def visit_range_node(node)
  commands << [inspect_node("RangeNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("exclude_end" if node.exclude_end?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (left = node.left).nil?
    commands << ["├── left: ∅\n", indent]
  else
    commands << ["├── left:\n", indent]
    commands << [left, "#{indent}"]
  end
  if (right = node.right).nil?
    commands << ["├── right: ∅\n", indent]
  else
    commands << ["├── right:\n", indent]
    commands << [right, "#{indent}"]
  end
  commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end

#visit_rational_node(node)

Inspect a RationalNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1983

def visit_rational_node(node)
  commands << [inspect_node("RationalNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("binary" if node.binary?), ("decimal" if node.decimal?), ("octal" if node.octal?), ("hexadecimal" if node.hexadecimal?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── numerator: #{node.numerator.inspect}\n", indent]
  commands << ["└── denominator: #{node.denominator.inspect}\n", indent]
end

#visit_redo_node(node)

Inspect a RedoNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1992

def visit_redo_node(node)
  commands << [inspect_node("RedoNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["└── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
end

#visit_regular_expression_node(node)

Inspect a RegularExpressionNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 1999

def visit_regular_expression_node(node)
  commands << [inspect_node("RegularExpressionNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("ignore_case" if node.ignore_case?), ("extended" if node.extended?), ("multi_line" if node.multi_line?), ("once" if node.once?), ("euc_jp" if node.euc_jp?), ("ascii_8bit" if node.ascii_8bit?), ("windows_31j" if node.windows_31j?), ("utf_8" if node.utf_8?), ("forced_utf8_encoding" if node.forced_utf8_encoding?), ("forced_binary_encoding" if node.forced_binary_encoding?), ("forced_us_ascii_encoding" if node.forced_us_ascii_encoding?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["├── content_loc: #{inspect_location(node.content_loc)}\n", indent]
  commands << ["├── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
  commands << ["└── unescaped: #{node.unescaped.inspect}\n", indent]
end

#visit_required_keyword_parameter_node(node)

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2010

def visit_required_keyword_parameter_node(node)
  commands << [inspect_node("RequiredKeywordParameterNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("repeated_parameter" if node.repeated_parameter?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── name: #{node.name.inspect}\n", indent]
  commands << ["└── name_loc: #{inspect_location(node.name_loc)}\n", indent]
end

#visit_required_parameter_node(node)

Inspect a RequiredParameterNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2019

def visit_required_parameter_node(node)
  commands << [inspect_node("RequiredParameterNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("repeated_parameter" if node.repeated_parameter?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── name: #{node.name.inspect}\n", indent]
end

#visit_rescue_modifier_node(node)

Inspect a RescueModifierNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2027

def visit_rescue_modifier_node(node)
  commands << [inspect_node("RescueModifierNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── expression:\n", indent]
  commands << [node.expression, "#{indent}"]
  commands << ["├── keyword_loc: #{inspect_location(node.keyword_loc)}\n", indent]
  commands << ["└── rescue_expression:\n", indent]
  commands << [node.rescue_expression, "#{indent}    "]
end

#visit_rescue_node(node)

Inspect a RescueNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2039

def visit_rescue_node(node)
  commands << [inspect_node("RescueNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── keyword_loc: #{inspect_location(node.keyword_loc)}\n", indent]
  commands << ["├── exceptions: (length: #{(exceptions = node.exceptions).length})\n", indent]
  if exceptions.any?
    exceptions[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [exceptions[-1], "#{indent}"]
  end
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  if (reference = node.reference).nil?
    commands << ["├── reference: ∅\n", indent]
  else
    commands << ["├── reference:\n", indent]
    commands << [reference, "#{indent}"]
  end
  commands << ["├── then_keyword_loc: #{inspect_location(node.then_keyword_loc)}\n", indent]
  if (statements = node.statements).nil?
    commands << ["├── statements: ∅\n", indent]
  else
    commands << ["├── statements:\n", indent]
    commands << [statements, "#{indent}"]
  end
  if (subsequent = node.subsequent).nil?
    commands << ["└── subsequent: ∅\n", indent]
  else
    commands << ["└── subsequent:\n", indent]
    commands << [subsequent, "#{indent}    "]
  end
end

#visit_rest_parameter_node(node)

Inspect a RestParameterNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2076

def visit_rest_parameter_node(node)
  commands << [inspect_node("RestParameterNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("repeated_parameter" if node.repeated_parameter?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  if (name = node.name).nil?
    commands << ["├── name: ∅\n", indent]
  else
    commands << ["├── name: #{name.inspect}\n", indent]
  end
  commands << ["├── name_loc: #{inspect_location(node.name_loc)}\n", indent]
  commands << ["└── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
end

#visit_retry_node(node)

Inspect a RetryNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2090

def visit_retry_node(node)
  commands << [inspect_node("RetryNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["└── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
end

#visit_return_node(node)

Inspect a ReturnNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2097

def visit_return_node(node)
  commands << [inspect_node("ReturnNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── keyword_loc: #{inspect_location(node.keyword_loc)}\n", indent]
  if (arguments = node.arguments).nil?
    commands << ["└── arguments: ∅\n", indent]
  else
    commands << ["└── arguments:\n", indent]
    commands << [arguments, "#{indent}    "]
  end
end

#visit_self_node(node)

Inspect a SelfNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2111

def visit_self_node(node)
  commands << [inspect_node("SelfNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["└── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
end

#visit_shareable_constant_node(node)

Inspect a ShareableConstantNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2118

def visit_shareable_constant_node(node)
  commands << [inspect_node("ShareableConstantNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("literal" if node.literal?), ("experimental_everything" if node.experimental_everything?), ("experimental_copy" if node.experimental_copy?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── write:\n", indent]
  commands << [node.write, "#{indent}    "]
end

#visit_singleton_class_node(node)

Inspect a SingletonClassNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2127

def visit_singleton_class_node(node)
  commands << [inspect_node("SingletonClassNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── locals: #{node.locals.inspect}\n", indent]
  commands << ["├── class_keyword_loc: #{inspect_location(node.class_keyword_loc)}\n", indent]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  commands << ["├── expression:\n", indent]
  commands << [node.expression, "#{indent}"]
  if (body = node.body).nil?
    commands << ["├── body: ∅\n", indent]
  else
    commands << ["├── body:\n", indent]
    commands << [body, "#{indent}"]
  end
  commands << ["└── end_keyword_loc: #{inspect_location(node.end_keyword_loc)}\n", indent]
end

#visit_source_encoding_node(node)

Inspect a SourceEncodingNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2146

def visit_source_encoding_node(node)
  commands << [inspect_node("SourceEncodingNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["└── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
end

#visit_source_file_node(node)

Inspect a SourceFileNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2153

def visit_source_file_node(node)
  commands << [inspect_node("SourceFileNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("forced_utf8_encoding" if node.forced_utf8_encoding?), ("forced_binary_encoding" if node.forced_binary_encoding?), ("frozen" if node.frozen?), ("mutable" if node.mutable?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── filepath: #{node.filepath.inspect}\n", indent]
end

#visit_source_line_node(node)

Inspect a SourceLineNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2161

def visit_source_line_node(node)
  commands << [inspect_node("SourceLineNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["└── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
end

#visit_splat_node(node)

Inspect a SplatNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2168

def visit_splat_node(node)
  commands << [inspect_node("SplatNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── operator_loc: #{inspect_location(node.operator_loc)}\n", indent]
  if (expression = node.expression).nil?
    commands << ["└── expression: ∅\n", indent]
  else
    commands << ["└── expression:\n", indent]
    commands << [expression, "#{indent}    "]
  end
end

#visit_statements_node(node)

Inspect a StatementsNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2182

def visit_statements_node(node)
  commands << [inspect_node("StatementsNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["└── body: (length: #{(body = node.body).length})\n", indent]
  if body.any?
    body[0...-1].each do |child|
      commands << [Replace.new("#{indent}    ├── "), indent]
      commands << [child, "#{indent}"]
    end
    commands << [Replace.new("#{indent}    └── "), indent]
    commands << [body[-1], "#{indent}        "]
  end
end

#visit_string_node(node)

Inspect a StringNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2198

def visit_string_node(node)
  commands << [inspect_node("StringNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("forced_utf8_encoding" if node.forced_utf8_encoding?), ("forced_binary_encoding" if node.forced_binary_encoding?), ("frozen" if node.frozen?), ("mutable" if node.mutable?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["├── content_loc: #{inspect_location(node.content_loc)}\n", indent]
  commands << ["├── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
  commands << ["└── unescaped: #{node.unescaped.inspect}\n", indent]
end

#visit_super_node(node)

Inspect a SuperNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2209

def visit_super_node(node)
  commands << [inspect_node("SuperNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── keyword_loc: #{inspect_location(node.keyword_loc)}\n", indent]
  commands << ["├── lparen_loc: #{inspect_location(node.lparen_loc)}\n", indent]
  if (arguments = node.arguments).nil?
    commands << ["├── arguments: ∅\n", indent]
  else
    commands << ["├── arguments:\n", indent]
    commands << [arguments, "#{indent}"]
  end
  commands << ["├── rparen_loc: #{inspect_location(node.rparen_loc)}\n", indent]
  if (block = node.block).nil?
    commands << ["└── block: ∅\n", indent]
  else
    commands << ["└── block:\n", indent]
    commands << [block, "#{indent}    "]
  end
end

#visit_symbol_node(node)

Inspect a SymbolNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2231

def visit_symbol_node(node)
  commands << [inspect_node("SymbolNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("forced_utf8_encoding" if node.forced_utf8_encoding?), ("forced_binary_encoding" if node.forced_binary_encoding?), ("forced_us_ascii_encoding" if node.forced_us_ascii_encoding?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["├── value_loc: #{inspect_location(node.value_loc)}\n", indent]
  commands << ["├── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
  commands << ["└── unescaped: #{node.unescaped.inspect}\n", indent]
end

#visit_true_node(node)

Inspect a TrueNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2242

def visit_true_node(node)
  commands << [inspect_node("TrueNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["└── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
end

#visit_undef_node(node)

Inspect a UndefNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2249

def visit_undef_node(node)
  commands << [inspect_node("UndefNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── names: (length: #{(names = node.names).length})\n", indent]
  if names.any?
    names[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [names[-1], "#{indent}"]
  end
  commands << ["└── keyword_loc: #{inspect_location(node.keyword_loc)}\n", indent]
end

#visit_unless_node(node)

Inspect a UnlessNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2266

def visit_unless_node(node)
  commands << [inspect_node("UnlessNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── keyword_loc: #{inspect_location(node.keyword_loc)}\n", indent]
  commands << ["├── predicate:\n", indent]
  commands << [node.predicate, "#{indent}"]
  commands << ["├── then_keyword_loc: #{inspect_location(node.then_keyword_loc)}\n", indent]
  if (statements = node.statements).nil?
    commands << ["├── statements: ∅\n", indent]
  else
    commands << ["├── statements:\n", indent]
    commands << [statements, "#{indent}"]
  end
  if (else_clause = node.else_clause).nil?
    commands << ["├── else_clause: ∅\n", indent]
  else
    commands << ["├── else_clause:\n", indent]
    commands << [else_clause, "#{indent}"]
  end
  commands << ["└── end_keyword_loc: #{inspect_location(node.end_keyword_loc)}\n", indent]
end

#visit_until_node(node)

Inspect a UntilNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2290

def visit_until_node(node)
  commands << [inspect_node("UntilNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("begin_modifier" if node.begin_modifier?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── keyword_loc: #{inspect_location(node.keyword_loc)}\n", indent]
  commands << ["├── do_keyword_loc: #{inspect_location(node.do_keyword_loc)}\n", indent]
  commands << ["├── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
  commands << ["├── predicate:\n", indent]
  commands << [node.predicate, "#{indent}"]
  if (statements = node.statements).nil?
    commands << ["└── statements: ∅\n", indent]
  else
    commands << ["└── statements:\n", indent]
    commands << [statements, "#{indent}    "]
  end
end

#visit_when_node(node)

Inspect a WhenNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2308

def visit_when_node(node)
  commands << [inspect_node("WhenNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── keyword_loc: #{inspect_location(node.keyword_loc)}\n", indent]
  commands << ["├── conditions: (length: #{(conditions = node.conditions).length})\n", indent]
  if conditions.any?
    conditions[0...-1].each do |child|
      commands << [Replace.new("#{indent}│   ├── "), indent]
      commands << [child, "#{indent}│   │   "]
    end
    commands << [Replace.new("#{indent}│   └── "), indent]
    commands << [conditions[-1], "#{indent}"]
  end
  commands << ["├── then_keyword_loc: #{inspect_location(node.then_keyword_loc)}\n", indent]
  if (statements = node.statements).nil?
    commands << ["└── statements: ∅\n", indent]
  else
    commands << ["└── statements:\n", indent]
    commands << [statements, "#{indent}    "]
  end
end

#visit_while_node(node)

Inspect a WhileNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2332

def visit_while_node(node)
  commands << [inspect_node("WhileNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("begin_modifier" if node.begin_modifier?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── keyword_loc: #{inspect_location(node.keyword_loc)}\n", indent]
  commands << ["├── do_keyword_loc: #{inspect_location(node.do_keyword_loc)}\n", indent]
  commands << ["├── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
  commands << ["├── predicate:\n", indent]
  commands << [node.predicate, "#{indent}"]
  if (statements = node.statements).nil?
    commands << ["└── statements: ∅\n", indent]
  else
    commands << ["└── statements:\n", indent]
    commands << [statements, "#{indent}    "]
  end
end

#visit_x_string_node(node)

Inspect a XStringNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2350

def visit_x_string_node(node)
  commands << [inspect_node("XStringNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ("forced_utf8_encoding" if node.forced_utf8_encoding?), ("forced_binary_encoding" if node.forced_binary_encoding?)].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── opening_loc: #{inspect_location(node.opening_loc)}\n", indent]
  commands << ["├── content_loc: #{inspect_location(node.content_loc)}\n", indent]
  commands << ["├── closing_loc: #{inspect_location(node.closing_loc)}\n", indent]
  commands << ["└── unescaped: #{node.unescaped.inspect}\n", indent]
end

#visit_yield_node(node)

Inspect a YieldNode node.

[ GitHub ]

  
# File 'lib/prism/inspect_visitor.rb', line 2361

def visit_yield_node(node)
  commands << [inspect_node("YieldNode", node), indent]
  flags = [("newline" if node.newline?), ("static_literal" if node.static_literal?), ].compact
  commands << ["├── flags: #{flags.empty? ? "" : flags.join(", ")}\n", indent]
  commands << ["├── keyword_loc: #{inspect_location(node.keyword_loc)}\n", indent]
  commands << ["├── lparen_loc: #{inspect_location(node.lparen_loc)}\n", indent]
  if (arguments = node.arguments).nil?
    commands << ["├── arguments: ∅\n", indent]
  else
    commands << ["├── arguments:\n", indent]
    commands << [arguments, "#{indent}"]
  end
  commands << ["└── rparen_loc: #{inspect_location(node.rparen_loc)}\n", indent]
end