module YARP

def self.lex(code, filepath = nil)

Mirror the YARP.lex API by using the serialization API.
def self.lex(code, filepath = nil)
  LibRubyParser::YPBuffer.with do |buffer|
    LibRubyParser.yp_lex_serialize(code, code.bytesize, filepath, buffer.pointer)
    Serialize.load_tokens(Source.new(code), buffer.read)
  end
end