Sha256: c7b901d5d5a9b9916868e6c90fea17db98f7230198cf03adc3c5c3447234d1b5

Contents?: true

Size: 1.3 KB

Versions: 20

Compression:

Stored size: 1.3 KB

Contents

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

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

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

    def self.buffer(source)
      case source
      when String
        Buffer.new(content: source, name: "a.rbs")
      when Buffer
        source
      end
    end

    autoload :SyntaxError, "rbs/parser_compat/syntax_error"
    autoload :SemanticsError, "rbs/parser_compat/semantics_error"
    autoload :LexerError, "rbs/parser_compat/lexer_error"
    autoload :LocatedValue, "rbs/parser_compat/located_value"

    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
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
rbs-2.6.0 lib/rbs/parser_aux.rb
rbs-2.5.1 lib/rbs/parser_aux.rb
rbs-2.5.0 lib/rbs/parser_aux.rb
rbs-2.4.0 lib/rbs/parser_aux.rb
rbs-2.3.2 lib/rbs/parser_aux.rb
rbs-2.3.1 lib/rbs/parser_aux.rb
rbs-2.3.0 lib/rbs/parser_aux.rb
rbs-2.2.2 lib/rbs/parser_aux.rb
rbs-2.2.1 lib/rbs/parser_aux.rb
rbs-2.2.0 lib/rbs/parser_aux.rb
rbs-2.1.0 lib/rbs/parser_aux.rb
rbs-2.0.0 lib/rbs/parser_aux.rb
rbs-2.0.0.pre2 lib/rbs/parser_aux.rb
rbs-2.0.0.pre1 lib/rbs/parser_aux.rb
rbs-1.8.1 lib/rbs/parser_aux.rb
rbs-1.8.0 lib/rbs/parser_aux.rb
rbs-1.7.1 lib/rbs/parser_aux.rb
rbs-1.7.0 lib/rbs/parser_aux.rb
rbs-1.7.0.beta.5 lib/rbs/parser_aux.rb
rbs-1.7.0.beta.4 lib/rbs/parser_aux.rb