mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
jsdoc: change parser to allow for multiply symbols of the same name.
This commit is contained in:
parent
1520cad144
commit
f78259f8de
1 changed files with 5 additions and 11 deletions
|
@ -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)) {
|
if (JSDOC.Parser.symbols.hasSymbol(symbol.alias)) {
|
||||||
var oldSymbol = JSDOC.Parser.symbols.getSymbol(symbol.alias);
|
var num = 0;
|
||||||
if (oldSymbol.comment.isUserComment) {
|
while (JSDOC.Parser.symbols.hasSymbol(symbol.alias + '^' + num)) {
|
||||||
if (JSDOC.opt.m) return;
|
num++;
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
symbol.alias = symbol.alias + '^' + num;
|
||||||
}
|
}
|
||||||
|
|
||||||
// we don't document anonymous things
|
// we don't document anonymous things
|
||||||
|
|
Loading…
Reference in a new issue