class RBS::Parser

Constants

KEYWORDS

Public Class Methods

buffer(source) click to toggle source
# File rbs-3.6.1/lib/rbs/parser_aux.rb, line 34
def self.buffer(source)
  case source
  when String
    Buffer.new(content: source, name: "a.rbs")
  when Buffer
    source
  end
end
lex(source) click to toggle source
# File rbs-3.6.1/lib/rbs/parser_aux.rb, line 25
def self.lex(source)
  buf = buffer(source)
  list = _lex(buf, buf.last_position)
  value = list.map do |type, location|
    Token.new(type: type, location: location)
  end
  LexResult.new(buffer: buf, value: value)
end
parse_method_type(source, range: 0..., variables: [], require_eof: false) click to toggle source
# File rbs-3.6.1/lib/rbs/parser_aux.rb, line 13
def self.parse_method_type(source, range: 0..., variables: [], require_eof: false)
  buf = buffer(source)
  _parse_method_type(buf, range.begin || 0, range.end || buf.last_position, variables, require_eof)
end
parse_signature(source) click to toggle source
# File rbs-3.6.1/lib/rbs/parser_aux.rb, line 18
def self.parse_signature(source)
  buf = buffer(source)
  dirs, decls = _parse_signature(buf, buf.last_position)

  [buf, dirs, decls]
end
parse_type(source, range: 0..., variables: [], require_eof: false) click to toggle source
# File rbs-3.6.1/lib/rbs/parser_aux.rb, line 8
def self.parse_type(source, range: 0..., variables: [], require_eof: false)
  buf = buffer(source)
  _parse_type(buf, range.begin || 0, range.end || buf.last_position, variables, require_eof)
end