On this page
Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
class · Ruby 3.4
Prism::Node
This represents a node in the tree. It is the parent class of all of the various node types.
Class methods 2
Instance methods 37
#accept
#breadth_first_search
#cached_end_code_units_column
#cached_end_code_units_offset
#cached_start_code_units_column
#cached_start_code_units_offset
#child_nodes
#comments
#comment_targets
#compact_child_nodes
#deconstruct
#end_character_column
#end_character_offset
#end_column
#end_line
#end_offset
#inspect
#leading_comments
#location
#newline?
#pretty_print
#save
#save_location
#script_lines
#slice
#slice_lines
#source_lines
#start_character_column
#start_character_offset
#start_column
#start_line
#start_offset
#static_literal?
#to_dot
#trailing_comments
#tunnel
#type
Attributes
Read
An bitset of flags for this node. There are certain flags that are common for all nodes, and then some nodes have specific flags.
Read
A unique identifier for this node. This is used in a very specific use case where you want to keep around a reference to a node without having to keep around the syntax tree in memory. This unique identifier will be consistent across multiple parses of the same source code.
Read
A pointer to the source that this node was created from.