Skip to content

Commit

Permalink
Now support /*!* comments. Closes jsdoc#26.
Browse files Browse the repository at this point in the history
  • Loading branch information
micmath committed Sep 23, 2011
1 parent d8503ed commit de4f31b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
4 changes: 3 additions & 1 deletion rhino_modules/jsdoc/src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, '/***');
}

/**
Expand Down
7 changes: 7 additions & 0 deletions test/cases/starbangstar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* Script that does something awesome
*
* @copyright (c) 2011 Rotorz Limited. All rights reserved.
* @author Lea Hayes
* @module myscript/core
*/
1 change: 1 addition & 0 deletions test/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
9 changes: 9 additions & 0 deletions test/t/cases/starbangstar.js
Original file line number Diff line number Diff line change
@@ -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');
});

})();

0 comments on commit de4f31b

Please sign in to comment.