From f78259f8de749ee49a898827369345c26654ecca Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Sat, 28 May 2011 02:11:30 +0200 Subject: [PATCH] jsdoc: change parser to allow for multiply symbols of the same name. --- build/jsdoc-toolkit/app/lib/JSDOC/Parser.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/build/jsdoc-toolkit/app/lib/JSDOC/Parser.js b/build/jsdoc-toolkit/app/lib/JSDOC/Parser.js index e489c61d..764ec883 100644 --- a/build/jsdoc-toolkit/app/lib/JSDOC/Parser.js +++ b/build/jsdoc-toolkit/app/lib/JSDOC/Parser.js @@ -52,19 +52,13 @@ JSDOC.Parser = { } } - // if a symbol alias is documented more than once the first one with the user docs wins + // if a symbol alias is documented more than once, add ^n to its alias: if (JSDOC.Parser.symbols.hasSymbol(symbol.alias)) { - var oldSymbol = JSDOC.Parser.symbols.getSymbol(symbol.alias); - if (oldSymbol.comment.isUserComment) { - if (JSDOC.opt.m) return; - if (symbol.comment.isUserComment) { // old and new are both documented - LOG.warn("The symbol '"+symbol.alias+"' is documented more than once."); - return; - } - else { // old is documented but new isn't - return; - } + var num = 0; + while (JSDOC.Parser.symbols.hasSymbol(symbol.alias + '^' + num)) { + num++; } + symbol.alias = symbol.alias + '^' + num; } // we don't document anonymous things