xpcomcore-rubygem 0.3.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +14 -0
- data/Rakefile +13 -11
- data/VERSION +1 -1
- data/bin/xpcomcore +7 -0
- data/lib/xpcomcore-rubygem.rb +9 -0
- data/lib/xpcomcore-rubygem/commands.rb +54 -0
- data/lib/xpcomcore-rubygem/commands/generate.rb +23 -0
- data/lib/xpcomcore-rubygem/commands/generate/application.rb +63 -0
- data/lib/xpcomcore-rubygem/commands/generate/jeweler_builder_command.rb +108 -0
- data/lib/xpcomcore-rubygem/commands/generate/library.rb +25 -0
- data/lib/xpcomcore-rubygem/commands/generate/template_helpers.rb +78 -0
- data/lib/xpcomcore-rubygem/commands/launch.rb +129 -0
- data/templates/application/application.ini.erb +12 -0
- data/templates/application/chrome/chrome.manifest.erb +1 -0
- data/templates/application/chrome/content/xul/main_window.xul.erb +6 -0
- data/{extension → templates/application}/components/bootstrapper.js +1 -1
- data/templates/application/defaults/preferences/prefs.js.erb +7 -0
- data/templates/shared/jsdoc_doc_task.erb +7 -0
- data/templates/shared/xultestrunner_test_task.erb +7 -0
- data/xpcomcore-rubygem.gemspec +48 -136
- data/xpcomcore/Rakefile +42 -19
- data/xpcomcore/bootstrapper.js +1 -3
- data/xpcomcore/{VERSION.yml → build_properties.yml} +3 -0
- data/xpcomcore/components/XPCOMCore.js +0 -2
- data/xpcomcore/doc/files.html +10 -10
- data/xpcomcore/doc/index.html +17 -17
- data/xpcomcore/doc/symbols/_global_.html +10 -9
- data/xpcomcore/doc/symbols/{Error.html → error.html} +10 -9
- data/xpcomcore/doc/symbols/{File.html → file.html} +13 -12
- data/xpcomcore/doc/symbols/{File.NoSuchFileError.html → file.nosuchfileerror.html} +13 -12
- data/xpcomcore/doc/symbols/{Kernel.html → kernel.html} +48 -47
- data/xpcomcore/doc/symbols/{LoadError.html → loaderror.html} +13 -12
- data/xpcomcore/doc/symbols/{SelfConceptError.html → selfconcepterror.html} +13 -12
- data/xpcomcore/doc/symbols/{Sys.html → sys.html} +12 -11
- data/xpcomcore/doc/symbols/{XPCBuiltins.html → xpcbuiltins.html} +11 -10
- metadata +61 -135
- data/README.rdoc +0 -18
- data/bin/xpcomcore-firefox +0 -4
- data/bin/xpcomcore-rubygem-install +0 -205
- data/extension/README.txt +0 -1
- data/extension/install.rdf +0 -16
- data/xpcomcore/etc/jsdoc-toolkit/README.txt +0 -186
- data/xpcomcore/etc/jsdoc-toolkit/app/frame.js +0 -33
- data/xpcomcore/etc/jsdoc-toolkit/app/frame/Chain.js +0 -102
- data/xpcomcore/etc/jsdoc-toolkit/app/frame/Dumper.js +0 -144
- data/xpcomcore/etc/jsdoc-toolkit/app/frame/Hash.js +0 -84
- data/xpcomcore/etc/jsdoc-toolkit/app/frame/Link.js +0 -153
- data/xpcomcore/etc/jsdoc-toolkit/app/frame/Namespace.js +0 -10
- data/xpcomcore/etc/jsdoc-toolkit/app/frame/Opt.js +0 -134
- data/xpcomcore/etc/jsdoc-toolkit/app/frame/Reflection.js +0 -26
- data/xpcomcore/etc/jsdoc-toolkit/app/frame/String.js +0 -93
- data/xpcomcore/etc/jsdoc-toolkit/app/frame/Testrun.js +0 -129
- data/xpcomcore/etc/jsdoc-toolkit/app/handlers/FOODOC.js +0 -26
- data/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC.js +0 -26
- data/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js +0 -159
- data/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js +0 -16
- data/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js +0 -292
- data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC.js +0 -104
- data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/DocComment.js +0 -200
- data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/DocTag.js +0 -294
- data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/JsDoc.js +0 -126
- data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/JsPlate.js +0 -109
- data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Lang.js +0 -144
- data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Parser.js +0 -145
- data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/PluginManager.js +0 -33
- data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Symbol.js +0 -645
- data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/SymbolSet.js +0 -241
- data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TextStream.js +0 -41
- data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Token.js +0 -18
- data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TokenReader.js +0 -332
- data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TokenStream.js +0 -133
- data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Util.js +0 -32
- data/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Walker.js +0 -474
- data/xpcomcore/etc/jsdoc-toolkit/app/main.js +0 -111
- data/xpcomcore/etc/jsdoc-toolkit/app/plugins/commentSrcJson.js +0 -20
- data/xpcomcore/etc/jsdoc-toolkit/app/plugins/frameworkPrototype.js +0 -16
- data/xpcomcore/etc/jsdoc-toolkit/app/plugins/functionCall.js +0 -10
- data/xpcomcore/etc/jsdoc-toolkit/app/plugins/publishSrcHilite.js +0 -62
- data/xpcomcore/etc/jsdoc-toolkit/app/plugins/symbolLink.js +0 -10
- data/xpcomcore/etc/jsdoc-toolkit/app/plugins/tagParamConfig.js +0 -31
- data/xpcomcore/etc/jsdoc-toolkit/app/plugins/tagSynonyms.js +0 -43
- data/xpcomcore/etc/jsdoc-toolkit/app/run.js +0 -348
- data/xpcomcore/etc/jsdoc-toolkit/app/t/TestDoc.js +0 -144
- data/xpcomcore/etc/jsdoc-toolkit/app/t/runner.js +0 -13
- data/xpcomcore/etc/jsdoc-toolkit/app/test.js +0 -325
- data/xpcomcore/etc/jsdoc-toolkit/app/test/addon.js +0 -24
- data/xpcomcore/etc/jsdoc-toolkit/app/test/anon_inner.js +0 -14
- data/xpcomcore/etc/jsdoc-toolkit/app/test/augments.js +0 -31
- data/xpcomcore/etc/jsdoc-toolkit/app/test/augments2.js +0 -26
- data/xpcomcore/etc/jsdoc-toolkit/app/test/borrows.js +0 -46
- data/xpcomcore/etc/jsdoc-toolkit/app/test/borrows2.js +0 -23
- data/xpcomcore/etc/jsdoc-toolkit/app/test/config.js +0 -22
- data/xpcomcore/etc/jsdoc-toolkit/app/test/constructs.js +0 -18
- data/xpcomcore/etc/jsdoc-toolkit/app/test/encoding.js +0 -10
- data/xpcomcore/etc/jsdoc-toolkit/app/test/encoding_other.js +0 -12
- data/xpcomcore/etc/jsdoc-toolkit/app/test/event.js +0 -54
- data/xpcomcore/etc/jsdoc-toolkit/app/test/exports.js +0 -14
- data/xpcomcore/etc/jsdoc-toolkit/app/test/functions_anon.js +0 -39
- data/xpcomcore/etc/jsdoc-toolkit/app/test/functions_nested.js +0 -33
- data/xpcomcore/etc/jsdoc-toolkit/app/test/global.js +0 -13
- data/xpcomcore/etc/jsdoc-toolkit/app/test/globals.js +0 -25
- data/xpcomcore/etc/jsdoc-toolkit/app/test/ignore.js +0 -10
- data/xpcomcore/etc/jsdoc-toolkit/app/test/inner.js +0 -16
- data/xpcomcore/etc/jsdoc-toolkit/app/test/jsdoc_test.js +0 -477
- data/xpcomcore/etc/jsdoc-toolkit/app/test/lend.js +0 -33
- data/xpcomcore/etc/jsdoc-toolkit/app/test/memberof.js +0 -19
- data/xpcomcore/etc/jsdoc-toolkit/app/test/memberof_constructor.js +0 -17
- data/xpcomcore/etc/jsdoc-toolkit/app/test/module.js +0 -17
- data/xpcomcore/etc/jsdoc-toolkit/app/test/name.js +0 -19
- data/xpcomcore/etc/jsdoc-toolkit/app/test/namespace_nested.js +0 -23
- data/xpcomcore/etc/jsdoc-toolkit/app/test/nocode.js +0 -13
- data/xpcomcore/etc/jsdoc-toolkit/app/test/oblit_anon.js +0 -20
- data/xpcomcore/etc/jsdoc-toolkit/app/test/overview.js +0 -20
- data/xpcomcore/etc/jsdoc-toolkit/app/test/param_inline.js +0 -37
- data/xpcomcore/etc/jsdoc-toolkit/app/test/params_optional.js +0 -8
- data/xpcomcore/etc/jsdoc-toolkit/app/test/prototype.js +0 -17
- data/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_nested.js +0 -9
- data/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_oblit.js +0 -13
- data/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_oblit_constructor.js +0 -24
- data/xpcomcore/etc/jsdoc-toolkit/app/test/public.js +0 -10
- data/xpcomcore/etc/jsdoc-toolkit/app/test/scripts/code.js +0 -5
- data/xpcomcore/etc/jsdoc-toolkit/app/test/scripts/notcode.txt +0 -5
- data/xpcomcore/etc/jsdoc-toolkit/app/test/shared.js +0 -42
- data/xpcomcore/etc/jsdoc-toolkit/app/test/shared2.js +0 -2
- data/xpcomcore/etc/jsdoc-toolkit/app/test/shortcuts.js +0 -22
- data/xpcomcore/etc/jsdoc-toolkit/app/test/static_this.js +0 -13
- data/xpcomcore/etc/jsdoc-toolkit/app/test/synonyms.js +0 -31
- data/xpcomcore/etc/jsdoc-toolkit/app/test/tosource.js +0 -23
- data/xpcomcore/etc/jsdoc-toolkit/app/test/variable_redefine.js +0 -14
- data/xpcomcore/etc/jsdoc-toolkit/changes.txt +0 -96
- data/xpcomcore/etc/jsdoc-toolkit/conf/sample.conf +0 -31
- data/xpcomcore/etc/jsdoc-toolkit/java/build.xml +0 -36
- data/xpcomcore/etc/jsdoc-toolkit/java/build_1.4.xml +0 -36
- data/xpcomcore/etc/jsdoc-toolkit/java/classes/js.jar +0 -0
- data/xpcomcore/etc/jsdoc-toolkit/java/src/JsDebugRun.java +0 -21
- data/xpcomcore/etc/jsdoc-toolkit/java/src/JsRun.java +0 -21
- data/xpcomcore/etc/jsdoc-toolkit/jsdebug.jar +0 -0
- data/xpcomcore/etc/jsdoc-toolkit/jsrun.jar +0 -0
- data/xpcomcore/etc/jsdoc-toolkit/jsrun.sh +0 -52
- data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/allclasses.tmpl +0 -17
- data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/allfiles.tmpl +0 -56
- data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/class.tmpl +0 -646
- data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/index.tmpl +0 -39
- data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/publish.js +0 -200
- data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/default.css +0 -162
- data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/header.html +0 -2
- data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/index.html +0 -19
- data/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/symbol.tmpl +0 -35
@@ -1,126 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
@constructor
|
3
|
-
@param [opt] Used to override the commandline options. Useful for testing.
|
4
|
-
@version $Id: JsDoc.js 773 2009-01-24 09:42:04Z micmath $
|
5
|
-
*/
|
6
|
-
JSDOC.JsDoc = function(/**object*/ opt) {
|
7
|
-
if (opt) {
|
8
|
-
JSDOC.opt = opt;
|
9
|
-
}
|
10
|
-
|
11
|
-
if (JSDOC.opt.h) {
|
12
|
-
JSDOC.usage();
|
13
|
-
quit();
|
14
|
-
}
|
15
|
-
|
16
|
-
// defend against options that are not sane
|
17
|
-
if (JSDOC.opt._.length == 0) {
|
18
|
-
LOG.warn("No source files to work on. Nothing to do.");
|
19
|
-
quit();
|
20
|
-
}
|
21
|
-
if (JSDOC.opt.t === true || JSDOC.opt.d === true) {
|
22
|
-
JSDOC.usage();
|
23
|
-
}
|
24
|
-
|
25
|
-
if (typeof JSDOC.opt.d == "string") {
|
26
|
-
if (!JSDOC.opt.d.charAt(JSDOC.opt.d.length-1).match(/[\\\/]/)) {
|
27
|
-
JSDOC.opt.d = JSDOC.opt.d+"/";
|
28
|
-
}
|
29
|
-
LOG.inform("Output directory set to '"+JSDOC.opt.d+"'.");
|
30
|
-
IO.mkPath(JSDOC.opt.d);
|
31
|
-
}
|
32
|
-
if (JSDOC.opt.e) IO.setEncoding(JSDOC.opt.e);
|
33
|
-
|
34
|
-
// the -r option: scan source directories recursively
|
35
|
-
if (typeof JSDOC.opt.r == "boolean") JSDOC.opt.r = 10;
|
36
|
-
else if (!isNaN(parseInt(JSDOC.opt.r))) JSDOC.opt.r = parseInt(JSDOC.opt.r);
|
37
|
-
else JSDOC.opt.r = 1;
|
38
|
-
|
39
|
-
// the -D option: define user variables
|
40
|
-
var D = {};
|
41
|
-
if (JSDOC.opt.D) {
|
42
|
-
for (var i = 0; i < JSDOC.opt.D.length; i++) {
|
43
|
-
var defineParts = JSDOC.opt.D[i].split(":", 2);
|
44
|
-
if (defineParts) D[defineParts[0]] = defineParts[1];
|
45
|
-
}
|
46
|
-
}
|
47
|
-
JSDOC.opt.D = D;
|
48
|
-
// combine any conf file D options with the commandline D options
|
49
|
-
if (defined(JSDOC.conf)) for (var c in JSDOC.conf.D) {
|
50
|
-
if (!defined(JSDOC.opt.D[c])) {
|
51
|
-
JSDOC.opt.D[c] = JSDOC.conf.D[c];
|
52
|
-
}
|
53
|
-
}
|
54
|
-
|
55
|
-
// Give plugins a chance to initialize
|
56
|
-
if (defined(JSDOC.PluginManager)) {
|
57
|
-
JSDOC.PluginManager.run("onInit", JSDOC.opt);
|
58
|
-
}
|
59
|
-
|
60
|
-
JSDOC.opt.srcFiles = JSDOC.JsDoc._getSrcFiles();
|
61
|
-
JSDOC.JsDoc._parseSrcFiles();
|
62
|
-
JSDOC.JsDoc.symbolSet = JSDOC.Parser.symbols;
|
63
|
-
}
|
64
|
-
|
65
|
-
/**
|
66
|
-
Retrieve source file list.
|
67
|
-
@returns {String[]} The pathnames of the files to be parsed.
|
68
|
-
*/
|
69
|
-
JSDOC.JsDoc._getSrcFiles = function() {
|
70
|
-
JSDOC.JsDoc.srcFiles = [];
|
71
|
-
|
72
|
-
var ext = ["js"];
|
73
|
-
if (JSDOC.opt.x) {
|
74
|
-
ext = JSDOC.opt.x.split(",").map(function($) {return $.toLowerCase()});
|
75
|
-
}
|
76
|
-
|
77
|
-
for (var i = 0; i < JSDOC.opt._.length; i++) {
|
78
|
-
JSDOC.JsDoc.srcFiles = JSDOC.JsDoc.srcFiles.concat(
|
79
|
-
IO.ls(JSDOC.opt._[i], JSDOC.opt.r).filter(
|
80
|
-
function($) {
|
81
|
-
var thisExt = $.split(".").pop().toLowerCase();
|
82
|
-
|
83
|
-
if (JSDOC.opt.E) {
|
84
|
-
for(var n = 0; n < JSDOC.opt.E.length; n++) {
|
85
|
-
if ($.match(new RegExp(JSDOC.opt.E[n]))) {
|
86
|
-
LOG.inform("Excluding " + $);
|
87
|
-
return false; // if the file matches the regex then it's excluded.
|
88
|
-
}
|
89
|
-
}
|
90
|
-
}
|
91
|
-
|
92
|
-
return (ext.indexOf(thisExt) > -1); // we're only interested in files with certain extensions
|
93
|
-
}
|
94
|
-
)
|
95
|
-
);
|
96
|
-
}
|
97
|
-
|
98
|
-
return JSDOC.JsDoc.srcFiles;
|
99
|
-
}
|
100
|
-
|
101
|
-
JSDOC.JsDoc._parseSrcFiles = function() {
|
102
|
-
JSDOC.Parser.init();
|
103
|
-
for (var i = 0, l = JSDOC.JsDoc.srcFiles.length; i < l; i++) {
|
104
|
-
var srcFile = JSDOC.JsDoc.srcFiles[i];
|
105
|
-
|
106
|
-
if (JSDOC.opt.v) LOG.inform("Parsing file: " + srcFile);
|
107
|
-
|
108
|
-
try {
|
109
|
-
var src = IO.readFile(srcFile);
|
110
|
-
}
|
111
|
-
catch(e) {
|
112
|
-
LOG.warn("Can't read source file '"+srcFile+"': "+e.message);
|
113
|
-
}
|
114
|
-
|
115
|
-
var tr = new JSDOC.TokenReader();
|
116
|
-
var ts = new JSDOC.TokenStream(tr.tokenize(new JSDOC.TextStream(src)));
|
117
|
-
|
118
|
-
JSDOC.Parser.parse(ts, srcFile);
|
119
|
-
|
120
|
-
}
|
121
|
-
JSDOC.Parser.finish();
|
122
|
-
|
123
|
-
if (JSDOC.PluginManager) {
|
124
|
-
JSDOC.PluginManager.run("onFinishedParsing", JSDOC.Parser.symbols);
|
125
|
-
}
|
126
|
-
}
|
@@ -1,109 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
@constructor
|
3
|
-
*/
|
4
|
-
JSDOC.JsPlate = function(templateFile) {
|
5
|
-
if (templateFile) this.template = IO.readFile(templateFile);
|
6
|
-
|
7
|
-
this.templateFile = templateFile;
|
8
|
-
this.code = "";
|
9
|
-
this.parse();
|
10
|
-
}
|
11
|
-
|
12
|
-
JSDOC.JsPlate.prototype.parse = function() {
|
13
|
-
this.template = this.template.replace(/\{#[\s\S]+?#\}/gi, "");
|
14
|
-
this.code = "var output=``"+this.template;
|
15
|
-
|
16
|
-
this.code = this.code.replace(
|
17
|
-
/<for +each="(.+?)" +in="(.+?)" *>/gi,
|
18
|
-
function (match, eachName, inName) {
|
19
|
-
return "``;\rvar $"+eachName+"_keys = keys("+inName+");\rfor(var $"+eachName+"_i = 0; $"+eachName+"_i < $"+eachName+"_keys.length; $"+eachName+"_i++) {\rvar $"+eachName+"_last = ($"+eachName+"_i == $"+eachName+"_keys.length-1);\rvar $"+eachName+"_key = $"+eachName+"_keys[$"+eachName+"_i];\rvar "+eachName+" = "+inName+"[$"+eachName+"_key];\routput+=``";
|
20
|
-
}
|
21
|
-
);
|
22
|
-
this.code = this.code.replace(/<if test="(.+?)">/g, "``;\rif ($1) { output+=``");
|
23
|
-
this.code = this.code.replace(/<elseif test="(.+?)"\s*\/>/g, "``;}\relse if ($1) { output+=``");
|
24
|
-
this.code = this.code.replace(/<else\s*\/>/g, "``;}\relse { output+=``");
|
25
|
-
this.code = this.code.replace(/<\/(if|for)>/g, "``;\r};\routput+=``");
|
26
|
-
this.code = this.code.replace(
|
27
|
-
/\{\+\s*([\s\S]+?)\s*\+\}/gi,
|
28
|
-
function (match, code) {
|
29
|
-
code = code.replace(/"/g, "``"); // prevent qoute-escaping of inline code
|
30
|
-
code = code.replace(/(\r?\n)/g, " ");
|
31
|
-
return "``+ ("+code+") +``";
|
32
|
-
}
|
33
|
-
);
|
34
|
-
this.code = this.code.replace(
|
35
|
-
/\{!\s*([\s\S]+?)\s*!\}/gi,
|
36
|
-
function (match, code) {
|
37
|
-
code = code.replace(/"/g, "``"); // prevent qoute-escaping of inline code
|
38
|
-
code = code.replace(/(\n)/g, " ");
|
39
|
-
return "``; "+code+";\routput+=``";
|
40
|
-
}
|
41
|
-
);
|
42
|
-
this.code = this.code+"``;";
|
43
|
-
|
44
|
-
this.code = this.code.replace(/(\r?\n)/g, "\\n");
|
45
|
-
this.code = this.code.replace(/"/g, "\\\"");
|
46
|
-
this.code = this.code.replace(/``/g, "\"");
|
47
|
-
}
|
48
|
-
|
49
|
-
JSDOC.JsPlate.prototype.toCode = function() {
|
50
|
-
return this.code;
|
51
|
-
}
|
52
|
-
|
53
|
-
JSDOC.JsPlate.keys = function(obj) {
|
54
|
-
var keys = [];
|
55
|
-
if (obj.constructor.toString().indexOf("Array") > -1) {
|
56
|
-
for (var i = 0; i < obj.length; i++) {
|
57
|
-
keys.push(i);
|
58
|
-
}
|
59
|
-
}
|
60
|
-
else {
|
61
|
-
for (var i in obj) {
|
62
|
-
keys.push(i);
|
63
|
-
}
|
64
|
-
}
|
65
|
-
return keys;
|
66
|
-
};
|
67
|
-
|
68
|
-
JSDOC.JsPlate.values = function(obj) {
|
69
|
-
var values = [];
|
70
|
-
if (obj.constructor.toString().indexOf("Array") > -1) {
|
71
|
-
for (var i = 0; i < obj.length; i++) {
|
72
|
-
values.push(obj[i]);
|
73
|
-
}
|
74
|
-
}
|
75
|
-
else {
|
76
|
-
for (var i in obj) {
|
77
|
-
values.push(obj[i]);
|
78
|
-
}
|
79
|
-
}
|
80
|
-
return values;
|
81
|
-
};
|
82
|
-
|
83
|
-
JSDOC.JsPlate.prototype.process = function(data, compact) {
|
84
|
-
var keys = JSDOC.JsPlate.keys;
|
85
|
-
var values = JSDOC.JsPlate.values;
|
86
|
-
|
87
|
-
try {
|
88
|
-
eval(this.code);
|
89
|
-
}
|
90
|
-
catch (e) {
|
91
|
-
print(">> There was an error evaluating the compiled code from template: "+this.templateFile);
|
92
|
-
print(" The error was on line "+e.lineNumber+" "+e.name+": "+e.message);
|
93
|
-
var lines = this.code.split("\r");
|
94
|
-
if (e.lineNumber-2 >= 0) print("line "+(e.lineNumber-1)+": "+lines[e.lineNumber-2]);
|
95
|
-
print("line "+e.lineNumber+": "+lines[e.lineNumber-1]);
|
96
|
-
print("");
|
97
|
-
}
|
98
|
-
|
99
|
-
if (compact) { // patch by mcbain.asm
|
100
|
-
// Remove lines that contain only space-characters, usually left by lines in the template
|
101
|
-
// which originally only contained JSPlate tags or code. This makes it easier to write
|
102
|
-
// non-tricky templates which still put out nice code (not bloated with extra lines).
|
103
|
-
// Lines purposely left blank (just a line ending) are left alone.
|
104
|
-
output = output.replace(/\s+?(\r?)\n/g, "$1\n");
|
105
|
-
}
|
106
|
-
|
107
|
-
/*debug*///print(this.code);
|
108
|
-
return output;
|
109
|
-
}
|
@@ -1,144 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
@namespace
|
3
|
-
*/
|
4
|
-
JSDOC.Lang = {
|
5
|
-
}
|
6
|
-
|
7
|
-
JSDOC.Lang.isBuiltin = function(name) {
|
8
|
-
return (JSDOC.Lang.isBuiltin.coreObjects.indexOf(name) > -1);
|
9
|
-
}
|
10
|
-
JSDOC.Lang.isBuiltin.coreObjects = ['_global_', 'Array', 'Boolean', 'Date', 'Error', 'Function', 'Math', 'Number', 'Object', 'RegExp', 'String'];
|
11
|
-
|
12
|
-
JSDOC.Lang.whitespace = function(ch) {
|
13
|
-
return JSDOC.Lang.whitespace.names[ch];
|
14
|
-
}
|
15
|
-
JSDOC.Lang.whitespace.names = {
|
16
|
-
" ": "SPACE",
|
17
|
-
"\f": "FORMFEED",
|
18
|
-
"\t": "TAB",
|
19
|
-
"\u0009": "UNICODE_TAB",
|
20
|
-
"\u000A": "UNICODE_NBR",
|
21
|
-
"\u0008": "VERTICAL_TAB"
|
22
|
-
};
|
23
|
-
|
24
|
-
JSDOC.Lang.newline = function(ch) {
|
25
|
-
return JSDOC.Lang.newline.names[ch];
|
26
|
-
}
|
27
|
-
JSDOC.Lang.newline.names = {
|
28
|
-
"\n": "NEWLINE",
|
29
|
-
"\r": "RETURN",
|
30
|
-
"\u000A": "UNICODE_LF",
|
31
|
-
"\u000D": "UNICODE_CR",
|
32
|
-
"\u2029": "UNICODE_PS",
|
33
|
-
"\u2028": "UNICODE_LS"
|
34
|
-
};
|
35
|
-
|
36
|
-
JSDOC.Lang.keyword = function(word) {
|
37
|
-
return JSDOC.Lang.keyword.names["="+word];
|
38
|
-
}
|
39
|
-
JSDOC.Lang.keyword.names = {
|
40
|
-
"=break": "BREAK",
|
41
|
-
"=case": "CASE",
|
42
|
-
"=catch": "CATCH",
|
43
|
-
"=const": "VAR",
|
44
|
-
"=continue": "CONTINUE",
|
45
|
-
"=default": "DEFAULT",
|
46
|
-
"=delete": "DELETE",
|
47
|
-
"=do": "DO",
|
48
|
-
"=else": "ELSE",
|
49
|
-
"=false": "FALSE",
|
50
|
-
"=finally": "FINALLY",
|
51
|
-
"=for": "FOR",
|
52
|
-
"=function": "FUNCTION",
|
53
|
-
"=if": "IF",
|
54
|
-
"=in": "IN",
|
55
|
-
"=instanceof": "INSTANCEOF",
|
56
|
-
"=new": "NEW",
|
57
|
-
"=null": "NULL",
|
58
|
-
"=return": "RETURN",
|
59
|
-
"=switch": "SWITCH",
|
60
|
-
"=this": "THIS",
|
61
|
-
"=throw": "THROW",
|
62
|
-
"=true": "TRUE",
|
63
|
-
"=try": "TRY",
|
64
|
-
"=typeof": "TYPEOF",
|
65
|
-
"=void": "VOID",
|
66
|
-
"=while": "WHILE",
|
67
|
-
"=with": "WITH",
|
68
|
-
"=var": "VAR"
|
69
|
-
};
|
70
|
-
|
71
|
-
JSDOC.Lang.punc = function(ch) {
|
72
|
-
return JSDOC.Lang.punc.names[ch];
|
73
|
-
}
|
74
|
-
JSDOC.Lang.punc.names = {
|
75
|
-
";": "SEMICOLON",
|
76
|
-
",": "COMMA",
|
77
|
-
"?": "HOOK",
|
78
|
-
":": "COLON",
|
79
|
-
"||": "OR",
|
80
|
-
"&&": "AND",
|
81
|
-
"|": "BITWISE_OR",
|
82
|
-
"^": "BITWISE_XOR",
|
83
|
-
"&": "BITWISE_AND",
|
84
|
-
"===": "STRICT_EQ",
|
85
|
-
"==": "EQ",
|
86
|
-
"=": "ASSIGN",
|
87
|
-
"!==": "STRICT_NE",
|
88
|
-
"!=": "NE",
|
89
|
-
"<<": "LSH",
|
90
|
-
"<=": "LE",
|
91
|
-
"<": "LT",
|
92
|
-
">>>": "URSH",
|
93
|
-
">>": "RSH",
|
94
|
-
">=": "GE",
|
95
|
-
">": "GT",
|
96
|
-
"++": "INCREMENT",
|
97
|
-
"--": "DECREMENT",
|
98
|
-
"+": "PLUS",
|
99
|
-
"-": "MINUS",
|
100
|
-
"*": "MUL",
|
101
|
-
"/": "DIV",
|
102
|
-
"%": "MOD",
|
103
|
-
"!": "NOT",
|
104
|
-
"~": "BITWISE_NOT",
|
105
|
-
".": "DOT",
|
106
|
-
"[": "LEFT_BRACKET",
|
107
|
-
"]": "RIGHT_BRACKET",
|
108
|
-
"{": "LEFT_CURLY",
|
109
|
-
"}": "RIGHT_CURLY",
|
110
|
-
"(": "LEFT_PAREN",
|
111
|
-
")": "RIGHT_PAREN"
|
112
|
-
};
|
113
|
-
|
114
|
-
JSDOC.Lang.matching = function(name) {
|
115
|
-
return JSDOC.Lang.matching.names[name];
|
116
|
-
}
|
117
|
-
JSDOC.Lang.matching.names = {
|
118
|
-
"LEFT_PAREN": "RIGHT_PAREN",
|
119
|
-
"RIGHT_PAREN": "LEFT_PAREN",
|
120
|
-
"LEFT_CURLY": "RIGHT_CURLY",
|
121
|
-
"RIGHT_CURLY": "LEFT_CURLY",
|
122
|
-
"LEFT_BRACE": "RIGHT_BRACE",
|
123
|
-
"RIGHT_BRACE": "LEFT_BRACE"
|
124
|
-
}
|
125
|
-
|
126
|
-
JSDOC.Lang.isNumber = function(str) {
|
127
|
-
return /^(\.[0-9]|[0-9]+\.|[0-9])[0-9]*([eE][+-][0-9]+)?$/i.test(str);
|
128
|
-
}
|
129
|
-
|
130
|
-
JSDOC.Lang.isHexDec = function(str) {
|
131
|
-
return /^0x[0-9A-F]+$/i.test(str);
|
132
|
-
}
|
133
|
-
|
134
|
-
JSDOC.Lang.isWordChar = function(str) {
|
135
|
-
return /^[a-zA-Z0-9$_.]+$/.test(str);
|
136
|
-
}
|
137
|
-
|
138
|
-
JSDOC.Lang.isSpace = function(str) {
|
139
|
-
return (typeof JSDOC.Lang.whitespace(str) != "undefined");
|
140
|
-
}
|
141
|
-
|
142
|
-
JSDOC.Lang.isNewline = function(str) {
|
143
|
-
return (typeof JSDOC.Lang.newline(str) != "undefined");
|
144
|
-
}
|
@@ -1,145 +0,0 @@
|
|
1
|
-
if (typeof JSDOC == "undefined") JSDOC = {};
|
2
|
-
|
3
|
-
/**
|
4
|
-
@namespace
|
5
|
-
@requires JSDOC.Walker
|
6
|
-
@requires JSDOC.Symbol
|
7
|
-
@requires JSDOC.DocComment
|
8
|
-
*/
|
9
|
-
JSDOC.Parser = {
|
10
|
-
conf: {
|
11
|
-
ignoreCode: JSDOC.opt.n,
|
12
|
-
ignoreAnonymous: true, // factory: true
|
13
|
-
treatUnderscoredAsPrivate: true, // factory: true
|
14
|
-
explain: false // factory: false
|
15
|
-
},
|
16
|
-
|
17
|
-
addSymbol: function(symbol) {
|
18
|
-
|
19
|
-
if (JSDOC.Parser.rename) {
|
20
|
-
for (var n in JSDOC.Parser.rename) {
|
21
|
-
if (symbol.alias.indexOf(n) == 0) {
|
22
|
-
if (symbol.name == symbol.alias) {
|
23
|
-
symbol.name = symbol.name.replace(n, JSDOC.Parser.rename[n]);
|
24
|
-
}
|
25
|
-
symbol.alias = symbol.alias.replace(n, JSDOC.Parser.rename[n]);
|
26
|
-
}
|
27
|
-
}
|
28
|
-
}
|
29
|
-
|
30
|
-
if (JSDOC.opt.S) {
|
31
|
-
if (typeof JSDOC.Parser.secureModules == "undefined") JSDOC.Parser.secureModules = {};
|
32
|
-
if (/^exports\./.test(symbol.alias)) {
|
33
|
-
symbol.srcFile.match(/(^|[\\\/])([^\\\/]+)\.js/i);
|
34
|
-
var fileNS = RegExp.$2;
|
35
|
-
symbol.alias = symbol.alias.replace(/^exports\./, fileNS);
|
36
|
-
symbol.name = symbol.name.replace(/^exports\./, "");
|
37
|
-
symbol.memberOf = fileNS;
|
38
|
-
|
39
|
-
// need to create the namespace associated with this file first
|
40
|
-
if (!JSDOC.Parser.secureModules[fileNS]) {
|
41
|
-
JSDOC.Parser.secureModules[fileNS] = 1;
|
42
|
-
var nsSymbol = new JSDOC.Symbol(fileNS, [], "GLOBAL", new JSDOC.DocComment(""));
|
43
|
-
nsSymbol.isNamespace = true;
|
44
|
-
nsSymbol.srcFile = "";
|
45
|
-
nsSymbol.isPrivate = false;
|
46
|
-
nsSymbol.srcFile = symbol.srcFile;
|
47
|
-
nsSymbol.desc = (JSDOC.Parser.symbols.getSymbol(symbol.srcFile) || {desc: ""}).desc;
|
48
|
-
JSDOC.Parser.addSymbol(nsSymbol);
|
49
|
-
|
50
|
-
}
|
51
|
-
}
|
52
|
-
else { // a method that is not exported?
|
53
|
-
if (!symbol.isNamespace) return;
|
54
|
-
}
|
55
|
-
}
|
56
|
-
// if a symbol alias is documented more than once the last one with the user docs wins
|
57
|
-
if (JSDOC.Parser.symbols.hasSymbol(symbol.alias)) {
|
58
|
-
var oldSymbol = JSDOC.Parser.symbols.getSymbol(symbol.alias);
|
59
|
-
if (oldSymbol.comment.isUserComment) {
|
60
|
-
if (symbol.comment.isUserComment) { // old and new are both documented
|
61
|
-
LOG.warn("The symbol '"+symbol.alias+"' is documented more than once.");
|
62
|
-
}
|
63
|
-
else { // old is documented but new isn't
|
64
|
-
return;
|
65
|
-
}
|
66
|
-
}
|
67
|
-
}
|
68
|
-
|
69
|
-
// we don't document anonymous things
|
70
|
-
if (JSDOC.Parser.conf.ignoreAnonymous && symbol.name.match(/\$anonymous\b/)) return;
|
71
|
-
|
72
|
-
// uderscored things may be treated as if they were marked private, this cascades
|
73
|
-
if (JSDOC.Parser.conf.treatUnderscoredAsPrivate && symbol.name.match(/[.#-]_[^.#-]+$/)) {
|
74
|
-
if (!symbol.comment.getTag("public").length > 0) symbol.isPrivate = true;
|
75
|
-
}
|
76
|
-
|
77
|
-
// -p flag is required to document private things
|
78
|
-
if (!JSDOC.opt.p && symbol.isPrivate) return; // issue #161 fixed by mcbain.asm
|
79
|
-
|
80
|
-
// ignored things are not documented, this doesn't cascade
|
81
|
-
if (symbol.isIgnored) return;
|
82
|
-
JSDOC.Parser.symbols.addSymbol(symbol);
|
83
|
-
},
|
84
|
-
|
85
|
-
addBuiltin: function(name) {
|
86
|
-
var builtin = new JSDOC.Symbol(name, [], "CONSTRUCTOR", new JSDOC.DocComment(""));
|
87
|
-
builtin.isNamespace = true;
|
88
|
-
builtin.srcFile = "";
|
89
|
-
builtin.isPrivate = false;
|
90
|
-
JSDOC.Parser.addSymbol(builtin);
|
91
|
-
return builtin;
|
92
|
-
},
|
93
|
-
|
94
|
-
init: function() {
|
95
|
-
JSDOC.Parser.symbols = new JSDOC.SymbolSet();
|
96
|
-
JSDOC.Parser.walker = new JSDOC.Walker();
|
97
|
-
},
|
98
|
-
|
99
|
-
finish: function() {
|
100
|
-
JSDOC.Parser.symbols.relate();
|
101
|
-
|
102
|
-
// make a litle report about what was found
|
103
|
-
if (JSDOC.Parser.conf.explain) {
|
104
|
-
var symbols = JSDOC.Parser.symbols.toArray();
|
105
|
-
var srcFile = "";
|
106
|
-
for (var i = 0, l = symbols.length; i < l; i++) {
|
107
|
-
var symbol = symbols[i];
|
108
|
-
if (srcFile != symbol.srcFile) {
|
109
|
-
srcFile = symbol.srcFile;
|
110
|
-
print("\n"+srcFile+"\n-------------------");
|
111
|
-
}
|
112
|
-
print(i+":\n alias => "+symbol.alias + "\n name => "+symbol.name+ "\n isa => "+symbol.isa + "\n memberOf => " + symbol.memberOf + "\n isStatic => " + symbol.isStatic + ", isInner => " + symbol.isInner+ ", isPrivate => " + symbol.isPrivate);
|
113
|
-
}
|
114
|
-
print("-------------------\n");
|
115
|
-
}
|
116
|
-
}
|
117
|
-
}
|
118
|
-
|
119
|
-
JSDOC.Parser.parse = function(/**JSDOC.TokenStream*/ts, /**String*/srcFile) {
|
120
|
-
JSDOC.Symbol.srcFile = (srcFile || "");
|
121
|
-
JSDOC.DocComment.shared = ""; // shared comments don't cross file boundaries
|
122
|
-
|
123
|
-
if (!JSDOC.Parser.walker) JSDOC.Parser.init();
|
124
|
-
JSDOC.Parser.walker.walk(ts); // adds to our symbols
|
125
|
-
|
126
|
-
// filter symbols by option
|
127
|
-
for (var p = JSDOC.Parser.symbols._index.first(); p; p = JSDOC.Parser.symbols._index.next()) {
|
128
|
-
var symbol = p.value;
|
129
|
-
|
130
|
-
if (!symbol) continue;
|
131
|
-
|
132
|
-
if (symbol.is("FILE") || symbol.is("GLOBAL")) {
|
133
|
-
continue;
|
134
|
-
}
|
135
|
-
else if (!JSDOC.opt.a && !symbol.comment.isUserComment) {
|
136
|
-
JSDOC.Parser.symbols.deleteSymbol(symbol.alias);
|
137
|
-
}
|
138
|
-
|
139
|
-
if (/#$/.test(symbol.alias)) { // we don't document prototypes
|
140
|
-
JSDOC.Parser.symbols.deleteSymbol(symbol.alias);
|
141
|
-
}
|
142
|
-
}
|
143
|
-
|
144
|
-
return JSDOC.Parser.symbols.toArray();
|
145
|
-
}
|