Now support /*!* comments. Closes #26.

This commit is contained in:
Michael Mathews 2011-09-23 22:04:53 +01:00
parent d8503ed9ab
commit de4f31b46e
5 changed files with 21 additions and 2 deletions

View File

@ -1,7 +1,7 @@
{
"name": "JSDoc",
"version": "3.0.0alpha",
"revision": "1316040176608",
"revision": "1316811854469",
"description": "An automatic documentation generator for javascript.",
"keywords": [ "documentation", "javascript" ],
"licenses": [

View File

@ -120,7 +120,9 @@ function pretreat(code) {
// merge adjacent doclets
.replace(/\*\/\/\*\*+/g, '@also')
// make lent objectliterals documentable by giving them a dummy name
.replace(/(\/\*\*[\s\S]*?@lends\b[\s\S]*?\*\/\s*)\{/g, '$1____ = {');
.replace(/(\/\*\*[\s\S]*?@lends\b[\s\S]*?\*\/\s*)\{/g, '$1____ = {')
// make starbangstar comments look like real jsdoc comments
.replace(/\/\*\!\*/g, '/***');
}
/**

View File

@ -0,0 +1,7 @@
/**
* Script that does something awesome
*
* @copyright (c) 2011 Rotorz Limited. All rights reserved.
* @author Lea Hayes
* @module myscript/core
*/

View File

@ -147,6 +147,7 @@ testFile('test/t/cases/requirestag.js');
testFile('test/t/cases/returnstag.js');
testFile('test/t/cases/seetag.js');
testFile('test/t/cases/sincetag.js');
testFile('test/t/cases/starbangstar.js');
testFile('test/t/cases/thistag.js');
testFile('test/t/cases/typekind.js');
testFile('test/t/cases/typetag.js');

View File

@ -0,0 +1,9 @@
(function() {
var docSet = testhelpers.getDocSetFromFile('test/cases/starbangstar.js'),
mod = docSet.getByLongname('module:myscript/core')[0];
test('When doclet starts wuth /*!* it, it is treated as a JSDoc comment.', function() {
assert.equal(mod.description, 'Script that does something awesome');
});
})();