Raised if you try to access a buffer slice which no longer references a valid memory range of the underlying source.
In-memory session storage class.
Implements session storage as a global in-memory hash. Session
data will only persist for as long as the Ruby interpreter instance does.
Switch
that takes no arguments.
Switch
that takes an argument.
Switch
that takes an argument, which does not begin with ‘-’ or is ‘-’.
Tokens where state should be ignored used for :on_comment, :on_heredoc_end, :on_embexpr_end
The result of parsing a pack template.
When we’ve parsed the source, we have both the syntax tree and the list of comments that we found in the source. This class is responsible for walking the tree and finding the nearest location to attach each comment.
It does this by first finding the nearest locations to each comment. Locations can either come from nodes directly or from location fields on nodes. For example, a ‘ClassNode` has an overall location encompassing the entire class, but it also has a location for the `class` keyword.
Once the nearest locations are found, it determines which one to attach to. If it’s a trailing comment (a comment on the same line as other source code), it will favor attaching to the nearest location that occurs before the comment. Otherwise it will favor attaching to the nearest location that is after the comment.
Raised when the query given to a pattern is either invalid Ruby syntax or is using syntax that we don’t yet support.
An optional node field represents a single child node in the syntax tree that may or may not be present. It resolves to either a Prism::Node
or nil in Ruby.
An optional constant field represents a constant value on a node that may or may not be present. It resolves to either a symbol or nil in Ruby.
A location field represents the location of some part of the node in the source code. For example, the location of a keyword or an operator. It resolves to a Prism::Location
in Ruby.
A float field represents a double-precision floating point value. It is used exclusively to represent the value of a floating point literal. It resolves to a Float
in Ruby.
This class is the entry-point for converting a prism syntax tree into the whitequark/parser gem’s syntax tree. It inherits from the base parser for the parser gem, and overrides the parse* methods to parse with prism and then translate.
This class is the entry-point for Ruby 3.3 of ‘Prism::Translation::Parser`.
This class is the entry-point for Ruby 3.4 of ‘Prism::Translation::Parser`.
This module is the entry-point for converting a prism syntax tree into the seattlerb/ruby_parser gem’s syntax tree.