Commit 718c4c90 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Add position paramater to Tag#parse_doc.

This will now break all the extensions written so far against 5.0 beta.
However, I think it's only right to provide the position information
also inside #parse_doc allowing therefore warnings to be reported
in that stage too.  And it's the right time to make this change.
parent cd0dd0c5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ module JsDuck
          match(/\w+/)
          hw # Skip the whitespace right after the tag.

          tags = tag.parse_doc(self)
          tags = tag.parse_doc(self, @position)
          if tags.is_a?(Hash)
            add_tag(tags)
          elsif tags.is_a?(Array)
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ module JsDuck::Tag
    # For backwards compatibility decide whether the @alias was used
    # as @inheritdoc (@alias used to have the meaning of @inheritdoc
    # before) or as a real Ext4 style alias definition.
    def parse_doc(p)
    def parse_doc(p, pos)
      if p.look(/([\w.]+)?#\w+/)
        parse_as_inheritdoc(p)
      else
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ module JsDuck::Tag
    end

    # Parses: @aside [ guide | video| example ] name
    def parse_doc(p)
    def parse_doc(p, pos)
      {
        :tagname => :aside,
        :type => aside_type(p),
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ module JsDuck::Tag
    end

    # @author Name of Author <email@example.com> ...
    def parse_doc(p)
    def parse_doc(p, pos)
      name = p.match(/[^<\n]*/).strip
      if p.look(/</)
        p.match(/</)
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ module JsDuck::Tag
    end

    # Parses just the name of the tag.
    def parse_doc(p)
    def parse_doc(p, pos)
      {:tagname => @tagname}
    end

Loading