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.with_buffer do |buffer|
    LibRubyParser.yp_lex_serialize(code, code.bytesize, filepath, buffer)
    source = Source.new(code)
    Serialize.load_tokens(source, buffer.to_ruby_string).with_source(source)
  end
end