Loading lib/jsduck/doc/parser.rb +2 −2 Original line number Diff line number Diff line Loading @@ -95,14 +95,14 @@ module JsDuck if !tag.repeatable if @non_repeatable_tags[name] Logger.warn(:tag_repeated, "@#{name} tag can occur only once per doc-comment", @position) warn(:tag_repeated, "@#{name} tag can occur only once per doc-comment") end @non_repeatable_tags[name] = true end skip_white else Logger.warn(:tag, "Unsupported tag: @#{name}", @position) warn(:tag, "Unsupported tag: @#{name}") @multiline_tag[:doc] += "@" end end Loading lib/jsduck/doc/scanner.rb +6 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ module JsDuck @ident_chain_pattern = /[$\w-]+(\.[$\w-]+)*/ @input = nil # set to StringScanner in subclass @position = {} # set in subclass end # Provides access to StringScanner Loading Loading @@ -70,6 +71,11 @@ module JsDuck self end # Prints a warning message def warn(type, msg) Logger.warn(type, msg, @position) end end end Loading lib/jsduck/doc/standard_tag_parser.rb +10 −5 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ module JsDuck # were specified and how their matching succeeded. # def parse(cfg) @tagname = cfg[:tagname] tag = {:tagname => cfg[:tagname]} add_type(tag) if cfg[:type] add_name_with_default(tag) if cfg[:name] Loading Loading @@ -61,7 +62,7 @@ module JsDuck optional = nil end match(/\}/) match(/\}/) or warn("@#{tagname} tag syntax: '}' expected") return {:type => name, :optional => optional} end Loading @@ -74,7 +75,7 @@ module JsDuck hw tag[:default] = default_value end hw.match(/\]/) hw.match(/\]/) or warn("@#{tagname} tag syntax: ']' expected") tag[:optional] = true else tag[:name] = hw.ident_chain Loading Loading @@ -148,6 +149,10 @@ module JsDuck def hw @ds.hw end def warn(msg) @ds.warn(:tag_syntax, msg) end end end Loading lib/jsduck/logger.rb +1 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ module JsDuck [:extend, "@extend/mixin/requires/uses referring to unknown class"], [:tag, "Use of unsupported @tag"], [:tag_repeated, "An @tag used multiple times, but only once allowed"], [:tag_syntax, "@tag syntax error"], [:link, "{@link} to unknown class or member"], [:link_ambiguous, "{@link} is ambiguous"], [:link_auto, "Auto-detected link to unknown class or member"], Loading Loading
lib/jsduck/doc/parser.rb +2 −2 Original line number Diff line number Diff line Loading @@ -95,14 +95,14 @@ module JsDuck if !tag.repeatable if @non_repeatable_tags[name] Logger.warn(:tag_repeated, "@#{name} tag can occur only once per doc-comment", @position) warn(:tag_repeated, "@#{name} tag can occur only once per doc-comment") end @non_repeatable_tags[name] = true end skip_white else Logger.warn(:tag, "Unsupported tag: @#{name}", @position) warn(:tag, "Unsupported tag: @#{name}") @multiline_tag[:doc] += "@" end end Loading
lib/jsduck/doc/scanner.rb +6 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ module JsDuck @ident_chain_pattern = /[$\w-]+(\.[$\w-]+)*/ @input = nil # set to StringScanner in subclass @position = {} # set in subclass end # Provides access to StringScanner Loading Loading @@ -70,6 +71,11 @@ module JsDuck self end # Prints a warning message def warn(type, msg) Logger.warn(type, msg, @position) end end end Loading
lib/jsduck/doc/standard_tag_parser.rb +10 −5 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ module JsDuck # were specified and how their matching succeeded. # def parse(cfg) @tagname = cfg[:tagname] tag = {:tagname => cfg[:tagname]} add_type(tag) if cfg[:type] add_name_with_default(tag) if cfg[:name] Loading Loading @@ -61,7 +62,7 @@ module JsDuck optional = nil end match(/\}/) match(/\}/) or warn("@#{tagname} tag syntax: '}' expected") return {:type => name, :optional => optional} end Loading @@ -74,7 +75,7 @@ module JsDuck hw tag[:default] = default_value end hw.match(/\]/) hw.match(/\]/) or warn("@#{tagname} tag syntax: ']' expected") tag[:optional] = true else tag[:name] = hw.ident_chain Loading Loading @@ -148,6 +149,10 @@ module JsDuck def hw @ds.hw end def warn(msg) @ds.warn(:tag_syntax, msg) end end end Loading
lib/jsduck/logger.rb +1 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ module JsDuck [:extend, "@extend/mixin/requires/uses referring to unknown class"], [:tag, "Use of unsupported @tag"], [:tag_repeated, "An @tag used multiple times, but only once allowed"], [:tag_syntax, "@tag syntax error"], [:link, "{@link} to unknown class or member"], [:link_ambiguous, "{@link} is ambiguous"], [:link_auto, "Auto-detected link to unknown class or member"], Loading