Module
A module responsible for deserializing parse results.
Constants
The major version of prism that we are expecting to find in the serialized strings.
The minor version of prism that we are expecting to find in the serialized strings.
The patch version of prism that we are expecting to find in the serialized strings.
The token types that can be indexed by their enum values.
Class Methods
lib/prism/serialize.rb
View on GitHub
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/serialize.rb, line 28
def self.load(input, serialized)
input = input.dup
source = Source.for(input)
loader = Loader.new(source, serialized)
result = loader.load_result
input.force_encoding(loader.encoding)
result
end
Deserialize the AST represented by the given string into a parse result.
lib/prism/serialize.rb
View on GitHub
# File tmp/rubies/ruby-3.4.0-preview1/lib/prism/serialize.rb, line 40
def self.load_tokens(source, serialized)
Loader.new(source, serialized).load_tokens_result
end
Deserialize the tokens represented by the given string into a parse result.