mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
[ruby/prism] Freeze AST option
To make it so that you can pass `freeze: true` to Prism parse
methods and get back a deeply-frozen AST that is Ractor-
shareable.
8e6a93b2d2
This commit is contained in:
parent
1758137ead
commit
713f31872a
9 changed files with 539 additions and 192 deletions
|
@ -59,11 +59,11 @@ module Prism
|
|||
end
|
||||
|
||||
# :call-seq:
|
||||
# Prism::load(source, serialized) -> ParseResult
|
||||
# Prism::load(source, serialized, freeze) -> ParseResult
|
||||
#
|
||||
# Load the serialized AST using the source as a reference into a tree.
|
||||
def self.load(source, serialized)
|
||||
Serialize.load(source, serialized)
|
||||
def self.load(source, serialized, freeze = false)
|
||||
Serialize.load(source, serialized, freeze)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue