Class: RBS::Parser
Relationships & Source Files | |
Namespace Children | |
Classes:
| |
Inherits: | Object |
Defined in: | lib/rbs/parser_aux.rb, ext/rbs_extension/parser.c |
Constant Summary
-
KEYWORDS =
# File 'lib/rbs/parser_aux.rb', line 34%w( bool bot class instance interface nil self singleton top void type unchecked in out end def include extend prepend alias module attr_reader attr_writer attr_accessor public private untyped true false ).each_with_object({}) do |keyword, hash| hash[keyword] = nil end
-
LexerError =
# File 'lib/rbs/parser_compat/lexer_error.rb', line 6RBS::ParsingError
-
SemanticsError =
# File 'lib/rbs/parser_compat/semantics_error.rb', line 6RBS::ParsingError
-
SyntaxError =
# File 'lib/rbs/parser_compat/syntax_error.rb', line 6RBS::ParsingError
Class Method Summary
- ._parse_method_type(buffer, start_pos, end_pos, variables, requires_eof)
- ._parse_signature(buffer, end_pos)
- ._parse_type(buffer, start_pos, end_pos, variables, requires_eof)
- .buffer(source)
- .parse_method_type(source, line: nil, column: nil, range: nil, variables: [])
- .parse_signature(source, line: nil, column: nil)
- .parse_type(source, line: nil, column: nil, range: nil, variables: [])
Class Method Details
._parse_method_type(buffer, start_pos, end_pos, variables, requires_eof)
[ GitHub ]# File 'ext/rbs_extension/parser.c', line 2524
static VALUE rbsparser_parse_method_type(VALUE self, VALUE buffer, VALUE start_pos, VALUE end_pos, VALUE variables, VALUE requires_eof) { parserstate *parser = alloc_parser(buffer, FIX2INT(start_pos), FIX2INT(end_pos), variables); if (parser->next_token.type == pEOF) { return Qnil; } VALUE method_type = parse_method_type(parser); if (RTEST(requires_eof)) { parser_advance_assert(parser, pEOF); } free_parser(parser); return method_type; }
._parse_signature(buffer, end_pos)
[ GitHub ]# File 'ext/rbs_extension/parser.c', line 2544
static VALUE rbsparser_parse_signature(VALUE self, VALUE buffer, VALUE end_pos) { parserstate *parser = alloc_parser(buffer, 0, FIX2INT(end_pos), Qnil); VALUE signature = parse_signature(parser); free_parser(parser); return signature; }
._parse_type(buffer, start_pos, end_pos, variables, requires_eof)
[ GitHub ]# File 'ext/rbs_extension/parser.c', line 2504
static VALUE rbsparser_parse_type(VALUE self, VALUE buffer, VALUE start_pos, VALUE end_pos, VALUE variables, VALUE requires_eof) { parserstate *parser = alloc_parser(buffer, FIX2INT(start_pos), FIX2INT(end_pos), variables); if (parser->next_token.type == pEOF) { return Qnil; } VALUE type = parse_type(parser); if (RTEST(requires_eof)) { parser_advance_assert(parser, pEOF); } free_parser(parser); return type; }
.buffer(source)
[ GitHub ].parse_method_type(source, line: nil, column: nil, range: nil, variables: [])
[ GitHub ]# File 'lib/rbs/parser_aux.rb', line 10
def self.parse_method_type(source, line: nil, column: nil, range: nil, variables: []) buf = buffer(source) _parse_method_type(buf, range&.begin || 0, range&.end || buf.last_position, variables, range.nil?) end
.parse_signature(source, line: nil, column: nil)
[ GitHub ]# File 'lib/rbs/parser_aux.rb', line 15
def self.parse_signature(source, line: nil, column: nil) buf = buffer(source) _parse_signature(buf, buf.last_position) end
.parse_type(source, line: nil, column: nil, range: nil, variables: [])
[ GitHub ]# File 'lib/rbs/parser_aux.rb', line 5
def self.parse_type(source, line: nil, column: nil, range: nil, variables: []) buf = buffer(source) _parse_type(buf, range&.begin || 0, range&.end || buf.last_position, variables, range.nil?) end