Sha256: 6adee2e9e91b8b311b33f34cdd1bf6c6e605a8a51c3e35d89f620b385feef5fb

Contents?: true

Size: 1.32 KB

Versions: 23

Compression:

Stored size: 1.32 KB

Contents

module Steep
  class AnnotationParser
    VAR_NAME: Regexp

    METHOD_NAME: Regexp

    CONST_NAME: Regexp

    DYNAMIC_NAME: Regexp

    IVAR_NAME: Regexp

    attr_reader factory: AST::Types::Factory

    def initialize: (factory: AST::Types::Factory) -> void

    class SyntaxError < StandardError
      attr_reader source: String

      attr_reader location: RBS::Location[untyped, untyped]

      def initialize: (source: String, location: RBS::Location[untyped, untyped], exn: Exception) -> void
                    | (source: String, location: RBS::Location[untyped, untyped], message: String) -> void
    end

    TYPE: Regexp

    COLON: Regexp

    PARAM: Regexp

    TYPE_PARAMS: Regexp

    def parse_type: (MatchData, ?Symbol, location: RBS::Location[untyped, untyped]) -> AST::Types::t

    # ```
    # @type ${keyword} ${name}: ${type}
    # ```
    #
    # Example:
    #
    # - `@type const Foo::Bar: String`
    # - `@type var xyzzy: Array[String]`
    #
    def keyword_subject_type: (String keyword, Regexp name) -> Regexp

    # ```
    # @type ${keyword}: ${type}
    # ```
    #
    # Example:
    #
    # - `@type break: String`
    # - `@type self: Foo`
    #
    def keyword_and_type: (String keyword) -> ::Regexp

    def parse: (String src, location: RBS::Location[untyped, untyped]) -> AST::Annotation::t?
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
steep-1.7.0.dev.3 sig/steep/annotation_parser.rbs
steep-1.7.0.dev.2 sig/steep/annotation_parser.rbs
steep-1.7.0.dev.1 sig/steep/annotation_parser.rbs
steep-1.6.0 sig/steep/annotation_parser.rbs
steep-1.6.0.pre.4 sig/steep/annotation_parser.rbs
steep-1.6.0.pre.3 sig/steep/annotation_parser.rbs
steep-1.6.0.pre.2 sig/steep/annotation_parser.rbs
steep-1.6.0.pre.1 sig/steep/annotation_parser.rbs
steep-1.5.3 sig/steep/annotation_parser.rbs
steep-1.5.2 sig/steep/annotation_parser.rbs
steep-1.5.1 sig/steep/annotation_parser.rbs
steep-1.5.0 sig/steep/annotation_parser.rbs
steep-1.5.0.pre.6 sig/steep/annotation_parser.rbs
steep-1.5.0.pre.5 sig/steep/annotation_parser.rbs
steep-1.5.0.pre.4 sig/steep/annotation_parser.rbs
steep-1.5.0.pre.3 sig/steep/annotation_parser.rbs
steep-1.5.0.pre.2 sig/steep/annotation_parser.rbs
steep-1.5.0.pre.1 sig/steep/annotation_parser.rbs
steep-1.4.0 sig/steep/annotation_parser.rbs
steep-1.4.0.dev.5 sig/steep/annotation_parser.rbs