Commit c4559313 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Process @var tag fully inside Tag:CssVar.

parent 88ef0369
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -75,9 +75,6 @@ module JsDuck
      def create_css_var(docs, doc_map)
        return add_shared({
            :tagname => :css_var,
            :name => detect_name(:css_var, doc_map),
            :type => detect_type(:css_var, doc_map),
            :default => detect_default(:css_var, doc_map),
            :doc => detect_doc(:css_var, doc_map),
          }, doc_map)
      end
@@ -102,10 +99,6 @@ module JsDuck
        return hash
      end

      def detect_name(tagname, doc_map)
        extract(doc_map, tagname, :name)
      end

      def extract(doc_map, tagname, propname = nil)
        tag = doc_map[tagname] ? doc_map[tagname].first : nil
        if tag && propname
@@ -115,14 +108,6 @@ module JsDuck
        end
      end

      def detect_type(tagname, doc_map)
        extract(doc_map, tagname, :type) || extract(doc_map, :type, :type)
      end

      def detect_default(tagname, doc_map)
        extract(doc_map, tagname, :default)
      end

      # Returns documentation for class or member.
      def detect_doc(tagname, doc_map)
        doc = extract(doc_map, :doc, :doc) || ""
+8 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ module JsDuck::Tag
  class CssVar < Tag
    def initialize
      @pattern = "var"
      @key = :css_var
      @member_type = :css_var
    end

@@ -11,5 +12,12 @@ module JsDuck::Tag
    def parse(p)
      p.standard_tag({:tagname => :css_var, :type => true, :name => true})
    end

    def process_doc(h, tags, pos)
      p = tags[0]
      h[:name] = p[:name]
      h[:type] = p[:type]
      h[:default] = p[:default]
    end
  end
end