Loading lib/jsduck/merger.rb +17 −2 Original line number Diff line number Diff line require 'jsduck/logger' module JsDuck # Takes data from doc-comment and code that follows it and combines Loading @@ -6,6 +8,15 @@ module JsDuck # # The main method merge() produces a hash as a result. class Merger # Allow passing in filename and line for error reporting attr_accessor :filename attr_accessor :linenr def initialize @filename = "" @linenr = 0 end def merge(docs, code) case detect_doc_type(docs, code) when :class Loading Loading @@ -417,8 +428,12 @@ module JsDuck if it[:name] =~ /^(.+)\.([^.]+)$/ it[:name] = $2 parent = index[$1] if parent parent[:properties] = [] unless parent[:properties] parent[:properties] << it else Logger.instance.warn("Ignoring subproperty #{$1}.#{$2}, no parent found with name '#{$1}'.", @filename, @linenr) end else items << it end Loading lib/jsduck/source_file.rb +2 −0 Original line number Diff line number Diff line Loading @@ -23,7 +23,9 @@ module JsDuck @links = {} merger = Merger.new merger.filename = @filename @docs = parse.map do |docset| merger.linenr = docset[:linenr] link(docset[:linenr], merger.merge(docset[:comment], docset[:code])) end end Loading Loading
lib/jsduck/merger.rb +17 −2 Original line number Diff line number Diff line require 'jsduck/logger' module JsDuck # Takes data from doc-comment and code that follows it and combines Loading @@ -6,6 +8,15 @@ module JsDuck # # The main method merge() produces a hash as a result. class Merger # Allow passing in filename and line for error reporting attr_accessor :filename attr_accessor :linenr def initialize @filename = "" @linenr = 0 end def merge(docs, code) case detect_doc_type(docs, code) when :class Loading Loading @@ -417,8 +428,12 @@ module JsDuck if it[:name] =~ /^(.+)\.([^.]+)$/ it[:name] = $2 parent = index[$1] if parent parent[:properties] = [] unless parent[:properties] parent[:properties] << it else Logger.instance.warn("Ignoring subproperty #{$1}.#{$2}, no parent found with name '#{$1}'.", @filename, @linenr) end else items << it end Loading
lib/jsduck/source_file.rb +2 −0 Original line number Diff line number Diff line Loading @@ -23,7 +23,9 @@ module JsDuck @links = {} merger = Merger.new merger.filename = @filename @docs = parse.map do |docset| merger.linenr = docset[:linenr] link(docset[:linenr], merger.merge(docset[:comment], docset[:code])) end end Loading