class RBS::Parser

Constants

KEYWORDS
LexerError
SemanticsError
SyntaxError

Public Class Methods

buffer(source) click to toggle source
# File rbs-3.2.2/lib/rbs/parser_aux.rb, line 22
def self.buffer(source)
  case source
  when String
    Buffer.new(content: source, name: "a.rbs")
  when Buffer
    source
  end
end
parse_method_type(source, range: 0..., variables: [], require_eof: false) click to toggle source
# File rbs-3.2.2/lib/rbs/parser_aux.rb, line 10
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.2.2/lib/rbs/parser_aux.rb, line 15
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.2.2/lib/rbs/parser_aux.rb, line 5
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