This represents a YAML
Document
. This node must be a child of Psych::Nodes::Stream
. A Psych::Nodes::Document
must have one child, and that child may be one of the following:
Represents a YAML
stream. This is the root node for any YAML
parse tree. This node must have one or more child nodes. The only valid child node for a Psych::Nodes::Stream
node is Psych::Nodes::Document
.
YAMLTree
builds a YAML
ast given a Ruby object. For example:
builder = Psych::Visitors::YAMLTree.new builder << { :foo => 'bar' } builder.tree # => #<Psych::Nodes::Stream .. }
Default formatter for log messages.
Raised when the data length recorded in the gzip file footer is not equivalent to the length of the actual uncompressed data.
Raised when the buffer cannot be allocated for some reason, or you try to use a buffer that’s not allocated.
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.