Rename generate-symbols.js to generate-info.js

This task generates build related metadata for the library based on doc annotations.  Since it is about more than writing out exportable symbols, it makes sense to have a more general name.
This commit is contained in:
Tim Schaub
2014-05-04 15:01:17 -07:00
parent 48828a238a
commit f9157a6123
7 changed files with 12 additions and 12 deletions

View File

@@ -0,0 +1,34 @@
/**
* @fileoverview This plugin extracts info from boolean defines. This only
* handles boolean defines with the default value in the description. Default
* is assumed to be provided with something like "default is `true`" (case
* insensitive, with or without ticks).
*/
var DEFAULT_VALUE = /default\s+is\s+`?(true|false)`?/i;
/**
* Hook to define new tags.
* @param {Object} dictionary The tag dictionary.
*/
exports.defineTags = function(dictionary) {
dictionary.defineTag('define', {
canHaveType: true,
mustHaveValue: true,
onTagged: function(doclet, tag) {
var types = tag.value.type.names;
if (types.length === 1 && types[0] === 'boolean') {
var match = tag.value.description.match(DEFAULT_VALUE);
if (match) {
doclet.define = {
default: match[1] === 'true'
};
}
}
}
});
};