Class: RBS::Parser
- Inherits:
-
Object
- Object
- RBS::Parser
- Defined in:
- lib/rbs/parser_aux.rb,
ext/rbs_extension/parser.c
Defined Under Namespace
Classes: LocatedValue
Constant Summary collapse
- KEYWORDS =
%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 =
RBS::ParsingError
- SyntaxError =
RBS::ParsingError
- SemanticsError =
RBS::ParsingError
Class Method Summary collapse
- ._parse_method_type(buffer, line, column, variables) ⇒ Object
- ._parse_signature(buffer, line, column) ⇒ Object
- ._parse_type(buffer, line, column, variables) ⇒ Object
- .buffer(source) ⇒ Object
- .parse_method_type(source, line: 1, column: 0, variables: []) ⇒ Object
- .parse_signature(source, line: 1, column: 0) ⇒ Object
- .parse_type(source, line: 1, column: 0, variables: []) ⇒ Object
Class Method Details
._parse_method_type(buffer, line, column, variables) ⇒ Object
2367 2368 2369 2370 2371 2372 2373 2374 2375 |
# File 'ext/rbs_extension/parser.c', line 2367
static VALUE
rbsparser_parse_method_type(VALUE self, VALUE buffer, VALUE line, VALUE column, VALUE variables)
{
parserstate *parser = alloc_parser(buffer, FIX2INT(line), FIX2INT(column), variables);
VALUE method_type = parse_method_type(parser);
free(parser);
return method_type;
}
|
._parse_signature(buffer, line, column) ⇒ Object
2377 2378 2379 2380 2381 2382 2383 2384 2385 |
# File 'ext/rbs_extension/parser.c', line 2377
static VALUE
rbsparser_parse_signature(VALUE self, VALUE buffer, VALUE line, VALUE column)
{
parserstate *parser = alloc_parser(buffer, FIX2INT(line), FIX2INT(column), Qnil);
VALUE signature = parse_signature(parser);
free_parser(parser);
return signature;
}
|
._parse_type(buffer, line, column, variables) ⇒ Object
2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 |
# File 'ext/rbs_extension/parser.c', line 2354
static VALUE
rbsparser_parse_type(VALUE self, VALUE buffer, VALUE line, VALUE column, VALUE variables)
{
parserstate *parser = alloc_parser(buffer, FIX2INT(line), FIX2INT(column), variables);
VALUE type = parse_type(parser);
parser_advance_assert(parser, pEOF);
free_parser(parser);
return type;
}
|
.buffer(source) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/rbs/parser_aux.rb', line 15 def self.buffer(source) case source when String Buffer.new(content: source, name: "a.rbs") when Buffer source end end |
.parse_method_type(source, line: 1, column: 0, variables: []) ⇒ Object
7 8 9 |
# File 'lib/rbs/parser_aux.rb', line 7 def self.parse_method_type(source, line: 1, column: 0, variables: []) _parse_method_type(buffer(source), line, column, variables) end |
.parse_signature(source, line: 1, column: 0) ⇒ Object
11 12 13 |
# File 'lib/rbs/parser_aux.rb', line 11 def self.parse_signature(source, line: 1, column: 0) _parse_signature(buffer(source), line, column) end |
.parse_type(source, line: 1, column: 0, variables: []) ⇒ Object
3 4 5 |
# File 'lib/rbs/parser_aux.rb', line 3 def self.parse_type(source, line: 1, column: 0, variables: []) _parse_type(buffer(source), line, column, variables) end |