123456789_123456789_123456789_123456789_123456789_

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

Class Method Summary

Class Method Details

._parse_method_type(buffer, line, column, variables)

[ GitHub ]

  
# File 'ext/rbs_extension/parser.c', line 2517

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)

[ GitHub ]

  
# File 'ext/rbs_extension/parser.c', line 2527

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)

[ GitHub ]

  
# File 'ext/rbs_extension/parser.c', line 2504

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)

[ GitHub ]

  
# File 'lib/rbs/parser_aux.rb', line 17

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: [])

[ GitHub ]

  
# File 'lib/rbs/parser_aux.rb', line 9

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)

[ GitHub ]

  
# File 'lib/rbs/parser_aux.rb', line 13

def self.parse_signature(source, line: 1, column: 0)
  _parse_signature(buffer(source), line, column)
end

.parse_type(source, line: 1, column: 0, variables: [])

[ GitHub ]

  
# File 'lib/rbs/parser_aux.rb', line 5

def self.parse_type(source, line: 1, column: 0, variables: [])
  _parse_type(buffer(source), line, column, variables)
end