REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.06 KB
Close
/proc/thread-self/root/opt/alt/ruby33/share/ruby/prism/node_inspector.rb
Text
Base64
# frozen_string_literal: true module Prism # This object is responsible for generating the output for the inspect method # implementations of child nodes. class NodeInspector # :nodoc: attr_reader :prefix, :output def initialize(prefix = "") @prefix = prefix @output = +"" end # Appends a line to the output with the current prefix. def <<(line) output << "#{prefix}#{line}" end # This generates a string that is used as the header of the inspect output # for any given node. def header(node) output = +"@ #{node.class.name.split("::").last} (" output << "location: (#{node.location.start_line},#{node.location.start_column})-(#{node.location.end_line},#{node.location.end_column})" output << ", newline: true" if node.newline? output << ")\n" output end # Generates a string that represents a list of nodes. It handles properly # using the box drawing characters to make the output look nice. def list(prefix, nodes) output = +"(length: #{nodes.length})\n" last_index = nodes.length - 1 nodes.each_with_index do |node, index| pointer, preadd = (index == last_index) ? ["└── ", " "] : ["├── ", "│ "] node_prefix = "#{prefix}#{preadd}" output << node.inspect(NodeInspector.new(node_prefix)).sub(node_prefix, "#{prefix}#{pointer}") end output end # Generates a string that represents a location field on a node. def location(value) if value "(#{value.start_line},#{value.start_column})-(#{value.end_line},#{value.end_column}) = #{value.slice.inspect}" else "∅" end end # Generates a string that represents a child node. def child_node(node, append) node.inspect(child_inspector(append)).delete_prefix(prefix) end # Returns a new inspector that can be used to inspect a child node. def child_inspector(append) NodeInspector.new("#{prefix}#{append}") end # Returns the output as a string. def to_str output end end end
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 17
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
parse_result
DIR
-
drwxr-xr-x
2026-04-30 07:09:17
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
compiler.rb
14.88 KB
lrw-r--r--
2026-04-07 13:52:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
debug.rb
6.12 KB
lrw-r--r--
2026-04-07 13:52:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
desugar_compiler.rb
5.71 KB
lrw-r--r--
2026-04-07 13:52:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
dispatcher.rb
108.90 KB
lrw-r--r--
2026-04-07 13:52:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
dsl.rb
31.99 KB
lrw-r--r--
2026-04-07 13:52:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ffi.rb
10.27 KB
lrw-r--r--
2026-04-07 13:52:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
lex_compat.rb
31.04 KB
lrw-r--r--
2026-04-07 13:52:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
mutation_compiler.rb
20.81 KB
lrw-r--r--
2026-04-07 13:52:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
node.rb
575.41 KB
lrw-r--r--
2026-04-07 13:52:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
node_ext.rb
5.01 KB
lrw-r--r--
2026-04-07 13:52:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
node_inspector.rb
2.06 KB
lrw-r--r--
2026-04-07 13:52:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
pack.rb
5.77 KB
lrw-r--r--
2026-04-07 13:52:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
parse_result.rb
13.43 KB
lrw-r--r--
2026-04-07 13:52:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
pattern.rb
7.56 KB
lrw-r--r--
2026-04-07 13:52:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ripper_compat.rb
5.95 KB
lrw-r--r--
2026-04-07 13:52:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
serialize.rb
56.71 KB
lrw-r--r--
2026-04-07 13:52:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
visitor.rb
15.02 KB
lrw-r--r--
2026-04-07 13:52:15
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).