Commit 97a98209 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Skip whitespace after @tagane before calling #parse_doc.

The whitespace after a tag is never useful - having each Tag
class deal with parsing that is simply a waste.
parent 2c6a8897
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ module JsDuck
          # ignore
        elsif tag = TagRegistry.get_by_pattern(name)
          match(/\w+/)
          hw # Skip the whitespace right after the tag.

          tags = tag.parse_doc(self)
          if tags.is_a?(Hash)
+2 −2
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ module JsDuck::Tag
    # as @inheritdoc (@alias used to have the meaning of @inheritdoc
    # before) or as a real Ext4 style alias definition.
    def parse_doc(p)
      if p.look(/\s+([\w.]+)?#\w+/)
      if p.look(/([\w.]+)?#\w+/)
        parse_as_inheritdoc(p)
      else
        parse_as_alias(p)
@@ -26,7 +26,7 @@ module JsDuck::Tag
    def parse_as_alias(p)
      {
        :tagname => :aliases,
        :name => p.hw.ident_chain,
        :name => p.ident_chain,
      }
    end

+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ module JsDuck::Tag
    end

    def aside_type(p)
      p.hw.look(/\w+/) ? p.ident.to_sym : nil
      p.look(/\w+/) ? p.ident.to_sym : nil
    end

    def process_doc(h, tags, pos)
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ module JsDuck::Tag
    def parse_doc(p)
      {
        :tagname => :class,
        :name => p.hw.ident_chain,
        :name => p.ident_chain,
      }
    end

+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ module JsDuck::Tag
    def parse_doc(p)
      {
        :tagname => @tagname,
        :version => p.hw.match(/[0-9.]+/),
        :version => p.match(/[0-9.]+/),
        :doc => :multiline,
      }
    end
Loading