Commit 0ef7c8f6 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Make most StandardTagParser methods private.

Let the #hw method return it's original return value, which is the
DocScanner class - then it chained with one of the DocScanner
methods like #look or #match.  The only exception being #default_value
method which belongs to StandardTagParser and can't be therefore
chained from #hw method - but that's just a one little exception
we can live with.
parent e56b22ef
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@ module JsDuck
      tag
    end

    private

    # matches {type} if possible and sets it on given tag hash.
    # Also checks for {optionality=} in type definition.
    def add_type(tag)
@@ -68,7 +70,8 @@ module JsDuck
      if hw.match(/\[/)
        tag[:name] = hw.ident_chain
        if hw.match(/=/)
          tag[:default] = hw.default_value
          hw
          tag[:default] = default_value
        end
        hw.match(/\]/)
        tag[:optional] = true
@@ -143,7 +146,6 @@ module JsDuck

    def hw
      @ds.hw
      self
    end
  end