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