diff options
author | Kevin Newton <[email protected]> | 2023-11-02 14:13:28 -0400 |
---|---|---|
committer | Kevin Newton <[email protected]> | 2023-11-03 10:13:49 -0400 |
commit | 649659119490eb8df75a05f85f0ae8be78e42bed () | |
tree | 2a512116c742fa8c5038b60791b4abcd8a7144d6 /lib/prism/ffi.rb | |
parent | 05f5c545d232554b6ffb183d6948ad37f46df53b (diff) |
[ruby/prism] Rename serialization APIs for consistency
https://.com/ruby/prism/commit/5a2252e3ac
-rw-r--r-- | lib/prism/ffi.rb | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -69,10 +69,10 @@ module Prism load_exported_functions_from( "prism.h", "pm_version", - "pm_parse_serialize", - "pm_parse_serialize_comments", - "pm_lex_serialize", - "pm_parse_lex_serialize" ) load_exported_functions_from( @@ -180,7 +180,7 @@ module Prism # Mirror the Prism.dump API by using the serialization API. def dump(code, **options) LibRubyParser::PrismBuffer.with do |buffer| - LibRubyParser.pm_parse_serialize(code, code.bytesize, buffer.pointer, dump_options(options)) buffer.read end end @@ -195,7 +195,7 @@ module Prism # Mirror the Prism.lex API by using the serialization API. def lex(code, **options) LibRubyParser::PrismBuffer.with do |buffer| - LibRubyParser.pm_lex_serialize(code, code.bytesize, dump_options(options), buffer.pointer) Serialize.load_tokens(Source.new(code), buffer.read) end end @@ -224,7 +224,7 @@ module Prism # Mirror the Prism.parse_comments API by using the serialization API. def parse_comments(code, **options) LibRubyParser::PrismBuffer.with do |buffer| - LibRubyParser.pm_parse_serialize_comments(code, code.bytesize, buffer.pointer, dump_options(options)) source = Source.new(code) loader = Serialize::Loader.new(source, buffer.read) @@ -247,15 +247,15 @@ module Prism # Mirror the Prism.parse_lex API by using the serialization API. def parse_lex(code, **options) LibRubyParser::PrismBuffer.with do |buffer| - LibRubyParser.pm_parse_lex_serialize(code, code.bytesize, buffer.pointer, dump_options(options)) source = Source.new(code) loader = Serialize::Loader.new(source, buffer.read) tokens = loader.load_tokens node, comments, magic_comments, errors, warnings = loader.load_nodes - tokens.each { |token,| token.value.force_encoding(loader.encoding) } ParseResult.new([node, tokens], comments, magic_comments, errors, warnings, source) end end |