mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
cleanup
This commit is contained in:
parent
7ef13bf40b
commit
277d712f3e
@ -146,6 +146,11 @@ function setDocletNameToFilename(doclet, tag) {
|
|||||||
doclet.name = name;
|
doclet.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function parseTypeText(text) {
|
||||||
|
var tagType = jsdoc.tag.type.parse(text, false, true);
|
||||||
|
return tagType.typeExpression || text;
|
||||||
|
}
|
||||||
|
|
||||||
function parseBorrows(doclet, tag) {
|
function parseBorrows(doclet, tag) {
|
||||||
var m = /^(\S+)(?:\s+as\s+(\S+))?$/.exec(tag.text);
|
var m = /^(\S+)(?:\s+as\s+(\S+))?$/.exec(tag.text);
|
||||||
if (m) {
|
if (m) {
|
||||||
@ -222,11 +227,7 @@ exports.defineTags = function(dictionary) {
|
|||||||
dictionary.defineTag('augments', {
|
dictionary.defineTag('augments', {
|
||||||
mustHaveValue: true,
|
mustHaveValue: true,
|
||||||
// Allow augments value to be specified as a normal type, e.g. {Type}
|
// Allow augments value to be specified as a normal type, e.g. {Type}
|
||||||
onTagText: function(text) {
|
onTagText: parseTypeText,
|
||||||
|
|
||||||
var tagType = jsdoc.tag.type.parse(text, false, true);
|
|
||||||
return tagType.typeExpression || text;
|
|
||||||
},
|
|
||||||
onTagged: function(doclet, tag) {
|
onTagged: function(doclet, tag) {
|
||||||
doclet.augment( firstWordOf(tag.value) );
|
doclet.augment( firstWordOf(tag.value) );
|
||||||
}
|
}
|
||||||
@ -268,26 +269,6 @@ exports.defineTags = function(dictionary) {
|
|||||||
})
|
})
|
||||||
.synonym('constructor');
|
.synonym('constructor');
|
||||||
|
|
||||||
dictionary.defineTag('interface', {
|
|
||||||
mustNotHaveValue: true,
|
|
||||||
onTagged: function(doclet, tag) {
|
|
||||||
doclet.addTag('kind', 'interface');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
dictionary.defineTag('implements', {
|
|
||||||
mustHaveValue: true,
|
|
||||||
onTagText: function(text) {
|
|
||||||
return text.replace(/(^\{|\}$)/g, '');
|
|
||||||
},
|
|
||||||
onTagged: function(doclet, tag) {
|
|
||||||
if (!doclet.implements) {
|
|
||||||
doclet.implements = [];
|
|
||||||
}
|
|
||||||
doclet.implements.push(tag.value);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
dictionary.defineTag('classdesc', {
|
dictionary.defineTag('classdesc', {
|
||||||
onTagged: function(doclet, tag) {
|
onTagged: function(doclet, tag) {
|
||||||
doclet.classdesc = tag.value;
|
doclet.classdesc = tag.value;
|
||||||
@ -487,6 +468,24 @@ exports.defineTags = function(dictionary) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
dictionary.defineTag('implements', {
|
||||||
|
mustHaveValue: true,
|
||||||
|
onTagText: parseTypeText,
|
||||||
|
onTagged: function(doclet, tag) {
|
||||||
|
if (!doclet.implements) {
|
||||||
|
doclet.implements = [];
|
||||||
|
}
|
||||||
|
doclet.implements.push(tag.value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
dictionary.defineTag('interface', {
|
||||||
|
mustNotHaveValue: true,
|
||||||
|
onTagged: function(doclet, tag) {
|
||||||
|
doclet.addTag('kind', 'interface');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
dictionary.defineTag('kind', {
|
dictionary.defineTag('kind', {
|
||||||
mustHaveValue: true
|
mustHaveValue: true
|
||||||
});
|
});
|
||||||
|
|||||||
2
test/fixtures/interface-implements.js
vendored
2
test/fixtures/interface-implements.js
vendored
@ -54,6 +54,7 @@ MyTester.prototype.it = function() {};
|
|||||||
* @interface
|
* @interface
|
||||||
*/
|
*/
|
||||||
function IWorker() {}
|
function IWorker() {}
|
||||||
|
/** Interface for doing some work. */
|
||||||
IWorker.prototype.work = function() {};
|
IWorker.prototype.work = function() {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -61,6 +62,7 @@ IWorker.prototype.work = function() {};
|
|||||||
* @implements {IWorker}
|
* @implements {IWorker}
|
||||||
*/
|
*/
|
||||||
function MyWorker() {}
|
function MyWorker() {}
|
||||||
|
/** Do some work. */
|
||||||
MyWorker.prototype.work = function() {};
|
MyWorker.prototype.work = function() {};
|
||||||
MyWorker.prototype.process = function() {};
|
MyWorker.prototype.process = function() {};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user