Sha256: 66142920ea8945bb0fd004facbe7e0c55bf2c8a03092e053c3d9ce8e89ed8fdb

Contents?: true

Size: 710 Bytes

Versions: 29

Compression:

Stored size: 710 Bytes

Contents

require "jsduck/tag/tag"
require "jsduck/js/utils"

module JsDuck::Tag
  class Xtype < Tag
    def initialize
      @pattern = "xtype"
      @ext_define_pattern = "xtype"
      @repeatable = true
    end

    # @xtype name
    def parse_doc(p, pos)
      {
        :tagname => :aliases,
        :name => parse_alias_shorthand(p, "widget")
      }
    end

    # Parses the name after @ftype, @xtype or @ptype
    # and returns it with the given namespace prefix.
    def parse_alias_shorthand(p, namespace)
      namespace + "." + (p.ident_chain || "")
    end

    def parse_ext_define(cls, ast)
      cls[:aliases] += JsDuck::Js::Utils.make_string_list(ast).map {|xtype| "widget."+xtype }
    end

  end
end

Version data entries

29 entries across 29 versions & 3 rubygems

Version Path
solvas-jsduck-6.0.0.30539 lib/jsduck/tag/xtype.rb
solvas-jsduck-6.0.0.9571 lib/jsduck/tag/xtype.rb
solvas-jsduck-6.0.0.6154 lib/jsduck/tag/xtype.rb
solvas-jsduck-6.0.0.4021 lib/jsduck/tag/xtype.rb
solvas-jsduck-6.0.0.2554 lib/jsduck/tag/xtype.rb
solvas-jsduck-6.0.0.1891 lib/jsduck/tag/xtype.rb
solvas-jsduck-6.0.0.beta.1888 lib/jsduck/tag/xtype.rb
jsduck-troopjs-0.0.10 lib/jsduck/tag/xtype.rb
jsduck-troopjs-0.0.9 lib/jsduck/tag/xtype.rb
jsduck-troopjs-0.0.8 lib/jsduck/tag/xtype.rb
jsduck-troopjs-0.0.7 lib/jsduck/tag/xtype.rb
jsduck-troopjs-0.0.5 lib/jsduck/tag/xtype.rb
jsduck-troopjs-0.0.4 lib/jsduck/tag/xtype.rb
jsduck-troopjs-0.0.3 lib/jsduck/tag/xtype.rb
jsduck-troopjs-0.0.1 lib/jsduck/tag/xtype.rb
jsduck-6.0.0beta lib/jsduck/tag/xtype.rb
jsduck-5.3.4 lib/jsduck/tag/xtype.rb
jsduck-5.3.3 lib/jsduck/tag/xtype.rb
jsduck-5.3.2 lib/jsduck/tag/xtype.rb
jsduck-5.3.1 lib/jsduck/tag/xtype.rb