Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
Prism.parse_comments
parse_comments(code, **options)
lib/prism/ffi.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/prism/ffi.rb, line 226
def parse_comments(code, **options)
LibRubyParser::PrismBuffer.with do |buffer|
LibRubyParser.pm_serialize_parse_comments(buffer.pointer, code, code.bytesize, dump_options(options))
source = Source.new(code)
loader = Serialize::Loader.new(source, buffer.read)
loader.load_header
loader.load_encoding
loader.load_start_line
loader.load_comments
end
end
Mirror the Prism.parse_comments API by using the serialization API.