sproutcore 1.6.0.rc.1-x86-mingw32 → 1.6.0.rc.2-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (217) hide show
  1. data/CHANGELOG +31 -6
  2. data/{History.txt → History.rdoc} +0 -0
  3. data/{README.txt → README.rdoc} +3 -2
  4. data/Rakefile +15 -15
  5. data/{Todo.txt → Todo.rdoc} +0 -0
  6. data/VERSION.yml +1 -1
  7. data/lib/buildtasks/manifest.rake +11 -4
  8. data/lib/buildtasks/target.rake +20 -23
  9. data/lib/frameworks/sproutcore/CHANGELOG.md +36 -0
  10. data/lib/frameworks/sproutcore/frameworks/core_foundation/core.js +2 -42
  11. data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/bind.js +2 -1
  12. data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/handlebars/collection.js +3 -1
  13. data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/checkbox_support.js +5 -5
  14. data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/text_field_support.js +29 -12
  15. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +4 -4
  16. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/mixins/template_helpers/text_field_support.js +9 -0
  17. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/collection.js +110 -0
  18. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template_collection.js +63 -26
  19. data/lib/frameworks/sproutcore/frameworks/datastore/system/child_array.js +25 -5
  20. data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +3 -3
  21. data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array.js +26 -3
  22. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/core_methods.js +74 -53
  23. data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +6 -7
  24. data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +6 -3
  25. data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +25 -1
  26. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/tab/methods.js +1 -3
  27. data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/tab/ui.js +20 -1
  28. data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +1 -1
  29. data/lib/frameworks/sproutcore/frameworks/desktop/views/tab.js +46 -49
  30. data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +23 -0
  31. data/lib/frameworks/sproutcore/frameworks/foundation/views/container.js +14 -2
  32. data/lib/frameworks/sproutcore/frameworks/jquery/jquery-buffered.js +2 -76
  33. data/lib/frameworks/sproutcore/frameworks/jquery/jquery.js +3348 -1591
  34. data/lib/frameworks/sproutcore/frameworks/runtime/core.js +25 -5
  35. data/lib/frameworks/sproutcore/frameworks/runtime/system/index_set.js +0 -3
  36. data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/objectForPropertyPath.js +10 -5
  37. data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/requiredObjectForPropertyPath.js +29 -0
  38. data/lib/frameworks/sproutcore/frameworks/runtime/tests/private/observer_queue.js +98 -0
  39. data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list_item.css +2 -2
  40. data/lib/frameworks/sproutcore/themes/ace/resources/split/split.css +1 -1
  41. data/lib/gen/language/Buildfile +1 -1
  42. data/lib/sproutcore.rb +1 -14
  43. data/lib/sproutcore/buildfile/string_ext.rb +0 -4
  44. data/lib/sproutcore/helpers/cssmin.rb +44 -59
  45. data/lib/sproutcore/helpers/text_helper.rb +11 -13
  46. data/lib/sproutcore/models/manifest.rb +4 -4
  47. data/lib/sproutcore/models/target.rb +11 -110
  48. data/lib/sproutcore/rack.rb +0 -1
  49. data/lib/sproutcore/rack/dev.rb +0 -1
  50. data/lib/sproutcore/rack/proxy.rb +9 -8
  51. data/lib/sproutcore/rack/service.rb +1 -1
  52. data/lib/sproutcore/render_engines/haml.rb +2 -5
  53. data/lib/sproutcore/tools/build.rb +2 -0
  54. data/lib/sproutcore/tools/docs.rb +7 -36
  55. data/lib/sproutcore/tools/manifest.rb +1 -1
  56. data/spec/buildtasks/target_spec.rb +9 -0
  57. data/spec/fixtures/real_world/frameworks/sproutcore/Buildfile +1 -1
  58. data/sproutcore.gemspec +3 -4
  59. data/vendor/chance/lib/chance/instance.rb +5 -8
  60. metadata +41 -207
  61. data/lib/doc_templates/jsdoc/allclasses.tmpl +0 -17
  62. data/lib/doc_templates/jsdoc/allfiles.tmpl +0 -56
  63. data/lib/doc_templates/jsdoc/class.tmpl +0 -487
  64. data/lib/doc_templates/jsdoc/index.tmpl +0 -38
  65. data/lib/doc_templates/jsdoc/publish.js +0 -170
  66. data/lib/doc_templates/jsdoc/static/default.css +0 -162
  67. data/lib/doc_templates/jsdoc/static/header.html +0 -2
  68. data/lib/doc_templates/jsdoc/static/index.html +0 -19
  69. data/lib/doc_templates/jsdoc/symbol.tmpl +0 -35
  70. data/lib/doc_templates/sproutcore/allclasses.tmpl +0 -0
  71. data/lib/doc_templates/sproutcore/allfiles.tmpl +0 -56
  72. data/lib/doc_templates/sproutcore/class.tmpl +0 -674
  73. data/lib/doc_templates/sproutcore/classes-json.tmpl +0 -55
  74. data/lib/doc_templates/sproutcore/index.tmpl +0 -62
  75. data/lib/doc_templates/sproutcore/publish.js +0 -346
  76. data/lib/doc_templates/sproutcore/static/default.css +0 -258
  77. data/lib/doc_templates/sproutcore/static/header.html +0 -2
  78. data/lib/doc_templates/sproutcore/static/index.html +0 -19
  79. data/lib/doc_templates/sproutcore/symbol.tmpl +0 -35
  80. data/lib/frameworks/sproutcore/frameworks/runtime/tests/private/observer_queue/isObservingSuspended.js +0 -55
  81. data/lib/sproutcore/rack/docs.rb +0 -24
  82. data/spec/fixtures/real_world/frameworks/sproutcore/apps/docs/PLACEHOLDER +0 -0
  83. data/vendor/jsdoc/README.txt +0 -151
  84. data/vendor/jsdoc/app/frame.js +0 -33
  85. data/vendor/jsdoc/app/frame/Chain.js +0 -102
  86. data/vendor/jsdoc/app/frame/Dumper.js +0 -144
  87. data/vendor/jsdoc/app/frame/Hash.js +0 -47
  88. data/vendor/jsdoc/app/frame/Link.js +0 -142
  89. data/vendor/jsdoc/app/frame/Namespace.js +0 -10
  90. data/vendor/jsdoc/app/frame/Opt.js +0 -134
  91. data/vendor/jsdoc/app/frame/Reflection.js +0 -26
  92. data/vendor/jsdoc/app/frame/String.js +0 -93
  93. data/vendor/jsdoc/app/frame/Testrun.js +0 -129
  94. data/vendor/jsdoc/app/handlers/FOODOC.js +0 -26
  95. data/vendor/jsdoc/app/handlers/XMLDOC.js +0 -26
  96. data/vendor/jsdoc/app/handlers/XMLDOC/DomReader.js +0 -159
  97. data/vendor/jsdoc/app/handlers/XMLDOC/XMLDoc.js +0 -16
  98. data/vendor/jsdoc/app/handlers/XMLDOC/XMLParse.js +0 -292
  99. data/vendor/jsdoc/app/lib/JSDOC.js +0 -98
  100. data/vendor/jsdoc/app/lib/JSDOC/DocComment.js +0 -200
  101. data/vendor/jsdoc/app/lib/JSDOC/DocTag.js +0 -294
  102. data/vendor/jsdoc/app/lib/JSDOC/JsDoc.js +0 -162
  103. data/vendor/jsdoc/app/lib/JSDOC/JsPlate.js +0 -100
  104. data/vendor/jsdoc/app/lib/JSDOC/Lang.js +0 -144
  105. data/vendor/jsdoc/app/lib/JSDOC/Parser.js +0 -109
  106. data/vendor/jsdoc/app/lib/JSDOC/PluginManager.js +0 -33
  107. data/vendor/jsdoc/app/lib/JSDOC/Symbol.js +0 -681
  108. data/vendor/jsdoc/app/lib/JSDOC/SymbolSet.js +0 -226
  109. data/vendor/jsdoc/app/lib/JSDOC/TextStream.js +0 -41
  110. data/vendor/jsdoc/app/lib/JSDOC/Token.js +0 -18
  111. data/vendor/jsdoc/app/lib/JSDOC/TokenReader.js +0 -332
  112. data/vendor/jsdoc/app/lib/JSDOC/TokenStream.js +0 -133
  113. data/vendor/jsdoc/app/lib/JSDOC/Util.js +0 -32
  114. data/vendor/jsdoc/app/lib/JSDOC/Walker.js +0 -453
  115. data/vendor/jsdoc/app/main.js +0 -74
  116. data/vendor/jsdoc/app/plugins/commentSrcJson.js +0 -19
  117. data/vendor/jsdoc/app/plugins/frameworkPrototype.js +0 -16
  118. data/vendor/jsdoc/app/plugins/functionCall.js +0 -10
  119. data/vendor/jsdoc/app/plugins/publishSrcHilite.js +0 -62
  120. data/vendor/jsdoc/app/plugins/sproutcoreTags.js +0 -26
  121. data/vendor/jsdoc/app/plugins/symbolLink.js +0 -9
  122. data/vendor/jsdoc/app/plugins/tagParamConfig.js +0 -31
  123. data/vendor/jsdoc/app/plugins/tagSynonyms.js +0 -43
  124. data/vendor/jsdoc/app/run.js +0 -346
  125. data/vendor/jsdoc/app/t/TestDoc.js +0 -144
  126. data/vendor/jsdoc/app/t/runner.js +0 -13
  127. data/vendor/jsdoc/app/test.js +0 -304
  128. data/vendor/jsdoc/app/test/addon.js +0 -24
  129. data/vendor/jsdoc/app/test/anon_inner.js +0 -14
  130. data/vendor/jsdoc/app/test/augments.js +0 -31
  131. data/vendor/jsdoc/app/test/augments2.js +0 -26
  132. data/vendor/jsdoc/app/test/borrows.js +0 -41
  133. data/vendor/jsdoc/app/test/borrows2.js +0 -23
  134. data/vendor/jsdoc/app/test/config.js +0 -22
  135. data/vendor/jsdoc/app/test/constructs.js +0 -18
  136. data/vendor/jsdoc/app/test/encoding.js +0 -10
  137. data/vendor/jsdoc/app/test/encoding_other.js +0 -12
  138. data/vendor/jsdoc/app/test/functions_anon.js +0 -39
  139. data/vendor/jsdoc/app/test/functions_nested.js +0 -33
  140. data/vendor/jsdoc/app/test/global.js +0 -13
  141. data/vendor/jsdoc/app/test/globals.js +0 -25
  142. data/vendor/jsdoc/app/test/ignore.js +0 -10
  143. data/vendor/jsdoc/app/test/inner.js +0 -16
  144. data/vendor/jsdoc/app/test/jsdoc_test.js +0 -477
  145. data/vendor/jsdoc/app/test/lend.js +0 -33
  146. data/vendor/jsdoc/app/test/memberof.js +0 -20
  147. data/vendor/jsdoc/app/test/memberof_constructor.js +0 -15
  148. data/vendor/jsdoc/app/test/name.js +0 -19
  149. data/vendor/jsdoc/app/test/namespace_nested.js +0 -23
  150. data/vendor/jsdoc/app/test/nocode.js +0 -13
  151. data/vendor/jsdoc/app/test/oblit_anon.js +0 -20
  152. data/vendor/jsdoc/app/test/overview.js +0 -20
  153. data/vendor/jsdoc/app/test/param_inline.js +0 -37
  154. data/vendor/jsdoc/app/test/params_optional.js +0 -8
  155. data/vendor/jsdoc/app/test/prototype.js +0 -17
  156. data/vendor/jsdoc/app/test/prototype_nested.js +0 -9
  157. data/vendor/jsdoc/app/test/prototype_oblit.js +0 -13
  158. data/vendor/jsdoc/app/test/prototype_oblit_constructor.js +0 -24
  159. data/vendor/jsdoc/app/test/public.js +0 -10
  160. data/vendor/jsdoc/app/test/shared.js +0 -42
  161. data/vendor/jsdoc/app/test/shared2.js +0 -2
  162. data/vendor/jsdoc/app/test/shortcuts.js +0 -22
  163. data/vendor/jsdoc/app/test/static_this.js +0 -13
  164. data/vendor/jsdoc/app/test/synonyms.js +0 -23
  165. data/vendor/jsdoc/app/test/tosource.js +0 -23
  166. data/vendor/jsdoc/app/test/variable_redefine.js +0 -14
  167. data/vendor/jsdoc/changes.txt +0 -47
  168. data/vendor/jsdoc/conf/sample.conf +0 -31
  169. data/vendor/jsdoc/java/build.xml +0 -36
  170. data/vendor/jsdoc/java/build_1.4.xml +0 -36
  171. data/vendor/jsdoc/java/classes/js.jar +0 -0
  172. data/vendor/jsdoc/java/src/JsDebugRun.java +0 -21
  173. data/vendor/jsdoc/java/src/JsRun.java +0 -21
  174. data/vendor/jsdoc/jsdebug.jar +0 -0
  175. data/vendor/jsdoc/jsrun.jar +0 -0
  176. data/vendor/jsdoc/t/TestDoc.js +0 -144
  177. data/vendor/jsdoc/t/runner.js +0 -13
  178. data/vendor/jsdoc/test.js +0 -304
  179. data/vendor/jsdoc/test/addon.js +0 -24
  180. data/vendor/jsdoc/test/anon_inner.js +0 -14
  181. data/vendor/jsdoc/test/augments.js +0 -31
  182. data/vendor/jsdoc/test/augments2.js +0 -26
  183. data/vendor/jsdoc/test/borrows.js +0 -41
  184. data/vendor/jsdoc/test/borrows2.js +0 -23
  185. data/vendor/jsdoc/test/config.js +0 -22
  186. data/vendor/jsdoc/test/constructs.js +0 -18
  187. data/vendor/jsdoc/test/encoding.js +0 -10
  188. data/vendor/jsdoc/test/encoding_other.js +0 -12
  189. data/vendor/jsdoc/test/functions_anon.js +0 -39
  190. data/vendor/jsdoc/test/functions_nested.js +0 -33
  191. data/vendor/jsdoc/test/global.js +0 -13
  192. data/vendor/jsdoc/test/globals.js +0 -25
  193. data/vendor/jsdoc/test/ignore.js +0 -10
  194. data/vendor/jsdoc/test/inner.js +0 -16
  195. data/vendor/jsdoc/test/jsdoc_test.js +0 -477
  196. data/vendor/jsdoc/test/lend.js +0 -33
  197. data/vendor/jsdoc/test/memberof.js +0 -20
  198. data/vendor/jsdoc/test/memberof_constructor.js +0 -15
  199. data/vendor/jsdoc/test/name.js +0 -19
  200. data/vendor/jsdoc/test/namespace_nested.js +0 -23
  201. data/vendor/jsdoc/test/nocode.js +0 -13
  202. data/vendor/jsdoc/test/oblit_anon.js +0 -20
  203. data/vendor/jsdoc/test/overview.js +0 -20
  204. data/vendor/jsdoc/test/param_inline.js +0 -37
  205. data/vendor/jsdoc/test/params_optional.js +0 -8
  206. data/vendor/jsdoc/test/prototype.js +0 -17
  207. data/vendor/jsdoc/test/prototype_nested.js +0 -9
  208. data/vendor/jsdoc/test/prototype_oblit.js +0 -13
  209. data/vendor/jsdoc/test/prototype_oblit_constructor.js +0 -24
  210. data/vendor/jsdoc/test/public.js +0 -10
  211. data/vendor/jsdoc/test/shared.js +0 -42
  212. data/vendor/jsdoc/test/shared2.js +0 -2
  213. data/vendor/jsdoc/test/shortcuts.js +0 -22
  214. data/vendor/jsdoc/test/static_this.js +0 -13
  215. data/vendor/jsdoc/test/synonyms.js +0 -23
  216. data/vendor/jsdoc/test/tosource.js +0 -23
  217. data/vendor/jsdoc/test/variable_redefine.js +0 -14
@@ -1,226 +0,0 @@
1
- if (typeof JSDOC == "undefined") JSDOC = {};
2
-
3
- /** @constructor */
4
- JSDOC.SymbolSet = function() {
5
- this.init();
6
- }
7
-
8
- JSDOC.SymbolSet.prototype.init = function() {
9
- this._index = {};
10
- }
11
-
12
- JSDOC.SymbolSet.prototype.keys = function() {
13
- var found = [];
14
- for (var p in this._index) {
15
- found.push(p);
16
- }
17
- return found;
18
- }
19
-
20
- JSDOC.SymbolSet.prototype.hasSymbol = function(alias) {
21
- return this._index.hasOwnProperty(alias);
22
- }
23
-
24
- JSDOC.SymbolSet.prototype.addSymbol = function(symbol) {
25
- if (this.hasSymbol(symbol.alias)) {
26
- LOG.warn("Overwriting symbol documentation for: "+symbol.alias + ".");
27
- }
28
- this._index[symbol.alias] = symbol;
29
- }
30
-
31
- JSDOC.SymbolSet.prototype.getSymbol = function(alias) {
32
- if (this.hasSymbol(alias)) return this._index[alias];
33
- }
34
-
35
- JSDOC.SymbolSet.prototype.getSymbolByName = function(name) {
36
- for (var p in this._index) {
37
- var symbol = this.getSymbol(p);
38
- if (symbol.name == name) return symbol;
39
- }
40
- }
41
-
42
- JSDOC.SymbolSet.prototype.toArray = function() {
43
- var found = [];
44
- for (var p in this._index) {
45
- found.push(this._index[p]);
46
- }
47
- return found;
48
- }
49
-
50
- JSDOC.SymbolSet.prototype.deleteSymbol = function(alias) {
51
- if (!this.hasSymbol(alias)) return;
52
- delete this._index[alias];
53
- }
54
-
55
- JSDOC.SymbolSet.prototype.renameSymbol = function(oldName, newName) {
56
- // todo: should check if oldname or newname already exist
57
- this._index[newName] = this._index[oldName];
58
- this.deleteSymbol(oldName);
59
- this._index[newName].alias = newName;
60
- return newName;
61
- }
62
-
63
- JSDOC.SymbolSet.prototype.relate = function() {
64
- this.resolveBorrows();
65
- this.resolveMemberOf();
66
- this.resolveAugments();
67
- }
68
-
69
- JSDOC.SymbolSet.prototype.resolveBorrows = function() {
70
- for (p in this._index) {
71
- var symbol = this._index[p];
72
- if (symbol.is("FILE") || symbol.is("GLOBAL")) continue;
73
-
74
- var borrows = symbol.inherits;
75
- for (var i = 0; i < borrows.length; i++) {
76
- var borrowed = this.getSymbol(borrows[i].alias);
77
- if (!borrowed) {
78
- LOG.warn("Can't borrow undocumented "+borrows[i].alias+".");
79
- continue;
80
- }
81
-
82
- var borrowAsName = borrows[i].as;
83
- var borrowAsAlias = borrowAsName;
84
- if (!borrowAsName) {
85
- LOG.warn("Malformed @borrow, 'as' is required.");
86
- continue;
87
- }
88
-
89
- if (borrowAsName.length > symbol.alias.length && borrowAsName.indexOf(symbol.alias) == 0) {
90
- borrowAsName = borrowAsName.replace(borrowed.alias, "")
91
- }
92
- else {
93
- var joiner = "";
94
- if (borrowAsName.charAt(0) != "#") joiner = ".";
95
- borrowAsAlias = borrowed.alias + joiner + borrowAsName;
96
- }
97
-
98
- borrowAsName = borrowAsName.replace(/^[#.]/, "");
99
-
100
- if (this.hasSymbol(borrowAsAlias)) continue;
101
-
102
- var clone = borrowed.clone();
103
- clone.name = borrowAsName;
104
- clone.alias = borrowAsAlias;
105
- this.addSymbol(clone);
106
- }
107
- }
108
- }
109
-
110
- JSDOC.SymbolSet.prototype.resolveMemberOf = function() {
111
- for (var p in this._index) {
112
- var symbol = this.getSymbol(p);
113
-
114
- if (symbol.is("FILE") || symbol.is("GLOBAL")) continue;
115
-
116
- // the memberOf value was provided in the @memberOf tag
117
- else if (symbol.memberOf) {
118
- var parts = symbol.alias.match(new RegExp("^("+symbol.memberOf+"[.#-])(.+)$"));
119
-
120
- // like foo.bar is a memberOf foo
121
- if (parts) {
122
- symbol.memberOf = parts[1];
123
- symbol.name = parts[2];
124
- }
125
- // like bar is a memberOf foo
126
- else {
127
- var joiner = symbol.memberOf.charAt(symbol.memberOf.length-1);
128
- if (!/[.#-]/.test(joiner)) symbol.memberOf += ".";
129
-
130
- this.renameSymbol(p, symbol.memberOf + symbol.name);
131
- }
132
- }
133
- // the memberOf must be calculated
134
- else {
135
- var parts = symbol.alias.match(/^(.*[.#-])([^.#-]+)$/);
136
- if (parts) {
137
- symbol.memberOf = parts[1];
138
- symbol.name = parts[2];
139
- }
140
- }
141
-
142
- // set isStatic, isInner
143
- if (symbol.memberOf) {
144
- switch (symbol.memberOf.charAt(symbol.memberOf.length-1)) {
145
- case '#' :
146
- symbol.isStatic = false;
147
- symbol.isInner = false;
148
- break;
149
- case '.' :
150
- symbol.isStatic = true;
151
- symbol.isInner = false;
152
- break;
153
- case '-' :
154
- symbol.isStatic = false;
155
- symbol.isInner = true;
156
- break;
157
- }
158
- }
159
-
160
- // unowned methods and fields belong to the global object
161
- if (!symbol.is("CONSTRUCTOR") && !symbol.isNamespace && symbol.memberOf == "") {
162
- symbol.memberOf = "_global_";
163
- }
164
-
165
- // clean up
166
- if (symbol.memberOf.match(/[.#-]$/)) {
167
- symbol.memberOf = symbol.memberOf.substr(0, symbol.memberOf.length-1);
168
- }
169
-
170
- // add to parent's methods or properties list
171
- if (symbol.memberOf) {
172
- var container = this.getSymbol(symbol.memberOf);
173
- if (!container) {
174
- if (JSDOC.Lang.isBuiltin(symbol.memberOf)) container = JSDOC.Parser.addBuiltin(symbol.memberOf);
175
- else {
176
- LOG.warn("Can't document "+symbol.name +" as a member of undocumented symbol "+symbol.memberOf+".");
177
- }
178
- }
179
-
180
- if (container) container.addMember(symbol);
181
- }
182
- }
183
- }
184
-
185
- JSDOC.SymbolSet.prototype.resolveAugments = function() {
186
- for (var p in this._index) {
187
- var symbol = this.getSymbol(p);
188
- if (symbol.alias == "_global_" || symbol.is("FILE")) continue;
189
- JSDOC.SymbolSet.prototype.walk.apply(this, [symbol]);
190
- }
191
- }
192
-
193
- JSDOC.SymbolSet.prototype.walk = function(symbol) {
194
-
195
- var augments = symbol.augments;
196
- for(var i = 0; i < augments.length; i++) {
197
- var contributer = this.getSymbol(augments[i]);
198
- if (contributer) {
199
- if (contributer.augments.length > 1) {
200
- /** This is a quick sanity check to make sure we
201
- don't try and augment ourselves. */
202
- if(contributer.alias === symbol.alias) {
203
- LOG.warn("Cannot augment "+contributer.alias+" with "+symbol.alias+". Circular reference.");
204
- } else {
205
- JSDOC.SymbolSet.prototype.walk.apply(this, [contributer]);
206
- }
207
- }
208
-
209
- symbol.inheritsFrom.push(contributer.alias);
210
- if (!isUnique(symbol.inheritsFrom)) {
211
- //LOG.warn("Can't resolve augments: Circular reference: "+symbol.alias+" inherits from "+contributer.alias+" more than once.");
212
- }
213
- else {
214
- var cmethods = contributer.methods;
215
- var cproperties = contributer.properties;
216
-
217
- for (var ci = 0, cl = cmethods.length; ci < cl; ci++)
218
- symbol.inherit(cmethods[ci]);
219
- for (var ci = 0, cl = cproperties.length; ci < cl; ci++)
220
- symbol.inherit(cproperties[ci]);
221
- }
222
- }
223
- else LOG.warn("Can't augment contributer: "+augments[i]+", not found.");
224
- }
225
- }
226
-
@@ -1,41 +0,0 @@
1
-
2
- /**
3
- @constructor
4
- */
5
- JSDOC.TextStream = function(text) {
6
- if (typeof(text) == "undefined") text = "";
7
- text = ""+text;
8
- this.text = text;
9
- this.cursor = 0;
10
- }
11
-
12
- JSDOC.TextStream.prototype.look = function(n) {
13
- if (typeof n == "undefined") n = 0;
14
-
15
- if (this.cursor+n < 0 || this.cursor+n >= this.text.length) {
16
- var result = new String("");
17
- result.eof = true;
18
- return result;
19
- }
20
- return this.text.charAt(this.cursor+n);
21
- }
22
-
23
- JSDOC.TextStream.prototype.next = function(n) {
24
- if (typeof n == "undefined") n = 1;
25
- if (n < 1) return null;
26
-
27
- var pulled = "";
28
- for (var i = 0; i < n; i++) {
29
- if (this.cursor+i < this.text.length) {
30
- pulled += this.text.charAt(this.cursor+i);
31
- }
32
- else {
33
- var result = new String("");
34
- result.eof = true;
35
- return result;
36
- }
37
- }
38
-
39
- this.cursor += n;
40
- return pulled;
41
- }
@@ -1,18 +0,0 @@
1
- if (typeof JSDOC == "undefined") JSDOC = {};
2
-
3
- /**
4
- @constructor
5
- */
6
- JSDOC.Token = function(data, type, name) {
7
- this.data = data;
8
- this.type = type;
9
- this.name = name;
10
- }
11
-
12
- JSDOC.Token.prototype.toString = function() {
13
- return "<"+this.type+" name=\""+this.name+"\">"+this.data+"</"+this.type+">";
14
- }
15
-
16
- JSDOC.Token.prototype.is = function(what) {
17
- return this.name === what || this.type === what;
18
- }
@@ -1,332 +0,0 @@
1
- if (typeof JSDOC == "undefined") JSDOC = {};
2
-
3
- /**
4
- @class Search a {@link JSDOC.TextStream} for language tokens.
5
- */
6
- JSDOC.TokenReader = function() {
7
- this.keepDocs = true;
8
- this.keepWhite = false;
9
- this.keepComments = false;
10
- }
11
-
12
- /**
13
- @type {JSDOC.Token[]}
14
- */
15
- JSDOC.TokenReader.prototype.tokenize = function(/**JSDOC.TextStream*/stream) {
16
- var tokens = [];
17
- /**@ignore*/ tokens.last = function() { return tokens[tokens.length-1]; }
18
- /**@ignore*/ tokens.lastSym = function() {
19
- for (var i = tokens.length-1; i >= 0; i--) {
20
- if (!(tokens[i].is("WHIT") || tokens[i].is("COMM"))) return tokens[i];
21
- }
22
- }
23
-
24
- while (!stream.look().eof) {
25
- if (this.read_mlcomment(stream, tokens)) continue;
26
- if (this.read_slcomment(stream, tokens)) continue;
27
- if (this.read_dbquote(stream, tokens)) continue;
28
- if (this.read_snquote(stream, tokens)) continue;
29
- if (this.read_regx(stream, tokens)) continue;
30
- if (this.read_numb(stream, tokens)) continue;
31
- if (this.read_punc(stream, tokens)) continue;
32
- if (this.read_space(stream, tokens)) continue;
33
- if (this.read_newline(stream, tokens)) continue;
34
- if (this.read_word(stream, tokens)) continue;
35
-
36
- // if execution reaches here then an error has happened
37
- tokens.push(new JSDOC.Token(stream.next(), "TOKN", "UNKNOWN_TOKEN"));
38
- }
39
- return tokens;
40
- }
41
-
42
- /**
43
- @returns {Boolean} Was the token found?
44
- */
45
- JSDOC.TokenReader.prototype.read_word = function(/**JSDOC.TokenStream*/stream, tokens) {
46
- var found = "";
47
- while (!stream.look().eof && JSDOC.Lang.isWordChar(stream.look())) {
48
- found += stream.next();
49
- }
50
-
51
- if (found === "") {
52
- return false;
53
- }
54
- else {
55
- var name;
56
- if ((name = JSDOC.Lang.keyword(found))) tokens.push(new JSDOC.Token(found, "KEYW", name));
57
- else tokens.push(new JSDOC.Token(found, "NAME", "NAME"));
58
- return true;
59
- }
60
- }
61
-
62
- /**
63
- @returns {Boolean} Was the token found?
64
- */
65
- JSDOC.TokenReader.prototype.read_punc = function(/**JSDOC.TokenStream*/stream, tokens) {
66
- var found = "";
67
- var name;
68
- while (!stream.look().eof && JSDOC.Lang.punc(found+stream.look())) {
69
- found += stream.next();
70
- }
71
-
72
- if (found === "") {
73
- return false;
74
- }
75
- else {
76
- tokens.push(new JSDOC.Token(found, "PUNC", JSDOC.Lang.punc(found)));
77
- return true;
78
- }
79
- }
80
-
81
- /**
82
- @returns {Boolean} Was the token found?
83
- */
84
- JSDOC.TokenReader.prototype.read_space = function(/**JSDOC.TokenStream*/stream, tokens) {
85
- var found = "";
86
-
87
- while (!stream.look().eof && JSDOC.Lang.isSpace(stream.look())) {
88
- found += stream.next();
89
- }
90
-
91
- if (found === "") {
92
- return false;
93
- }
94
- else {
95
- if (this.collapseWhite) found = " ";
96
- if (this.keepWhite) tokens.push(new JSDOC.Token(found, "WHIT", "SPACE"));
97
- return true;
98
- }
99
- }
100
-
101
- /**
102
- @returns {Boolean} Was the token found?
103
- */
104
- JSDOC.TokenReader.prototype.read_newline = function(/**JSDOC.TokenStream*/stream, tokens) {
105
- var found = "";
106
-
107
- while (!stream.look().eof && JSDOC.Lang.isNewline(stream.look())) {
108
- found += stream.next();
109
- }
110
-
111
- if (found === "") {
112
- return false;
113
- }
114
- else {
115
- if (this.collapseWhite) found = "\n";
116
- if (this.keepWhite) tokens.push(new JSDOC.Token(found, "WHIT", "NEWLINE"));
117
- return true;
118
- }
119
- }
120
-
121
- /**
122
- @returns {Boolean} Was the token found?
123
- */
124
- JSDOC.TokenReader.prototype.read_mlcomment = function(/**JSDOC.TokenStream*/stream, tokens) {
125
- if (stream.look() == "/" && stream.look(1) == "*") {
126
- var found = stream.next(2);
127
-
128
- while (!stream.look().eof && !(stream.look(-1) == "/" && stream.look(-2) == "*")) {
129
- found += stream.next();
130
- }
131
-
132
- // to start doclet we allow /** or /*** but not /**/ or /****
133
- if (/^\/\*\*([^\/]|\*[^*])/.test(found) && this.keepDocs) tokens.push(new JSDOC.Token(found, "COMM", "JSDOC"));
134
- else if (this.keepComments) tokens.push(new JSDOC.Token(found, "COMM", "MULTI_LINE_COMM"));
135
- return true;
136
- }
137
- return false;
138
- }
139
-
140
- /**
141
- @returns {Boolean} Was the token found?
142
- */
143
- JSDOC.TokenReader.prototype.read_slcomment = function(/**JSDOC.TokenStream*/stream, tokens) {
144
- var found;
145
- if (
146
- (stream.look() == "/" && stream.look(1) == "/" && (found=stream.next(2)))
147
- ||
148
- (stream.look() == "<" && stream.look(1) == "!" && stream.look(2) == "-" && stream.look(3) == "-" && (found=stream.next(4)))
149
- ) {
150
-
151
- while (!stream.look().eof && !JSDOC.Lang.isNewline(stream.look())) {
152
- found += stream.next();
153
- }
154
-
155
- if (this.keepComments) {
156
- tokens.push(new JSDOC.Token(found, "COMM", "SINGLE_LINE_COMM"));
157
- }
158
- return true;
159
- }
160
- return false;
161
- }
162
-
163
- /**
164
- @returns {Boolean} Was the token found?
165
- */
166
- JSDOC.TokenReader.prototype.read_dbquote = function(/**JSDOC.TokenStream*/stream, tokens) {
167
- if (stream.look() == "\"") {
168
- // find terminator
169
- var string = stream.next();
170
-
171
- while (!stream.look().eof) {
172
- if (stream.look() == "\\") {
173
- if (JSDOC.Lang.isNewline(stream.look(1))) {
174
- do {
175
- stream.next();
176
- } while (!stream.look().eof && JSDOC.Lang.isNewline(stream.look()));
177
- string += "\\\n";
178
- }
179
- else {
180
- string += stream.next(2);
181
- }
182
- }
183
- else if (stream.look() == "\"") {
184
- string += stream.next();
185
- tokens.push(new JSDOC.Token(string, "STRN", "DOUBLE_QUOTE"));
186
- return true;
187
- }
188
- else {
189
- string += stream.next();
190
- }
191
- }
192
- }
193
- return false; // error! unterminated string
194
- }
195
-
196
- /**
197
- @returns {Boolean} Was the token found?
198
- */
199
- JSDOC.TokenReader.prototype.read_snquote = function(/**JSDOC.TokenStream*/stream, tokens) {
200
- if (stream.look() == "'") {
201
- // find terminator
202
- var string = stream.next();
203
-
204
- while (!stream.look().eof) {
205
- if (stream.look() == "\\") { // escape sequence
206
- string += stream.next(2);
207
- }
208
- else if (stream.look() == "'") {
209
- string += stream.next();
210
- tokens.push(new JSDOC.Token(string, "STRN", "SINGLE_QUOTE"));
211
- return true;
212
- }
213
- else {
214
- string += stream.next();
215
- }
216
- }
217
- }
218
- return false; // error! unterminated string
219
- }
220
-
221
- /**
222
- @returns {Boolean} Was the token found?
223
- */
224
- JSDOC.TokenReader.prototype.read_numb = function(/**JSDOC.TokenStream*/stream, tokens) {
225
- if (stream.look() === "0" && stream.look(1) == "x") {
226
- return this.read_hex(stream, tokens);
227
- }
228
-
229
- var found = "";
230
-
231
- while (!stream.look().eof && JSDOC.Lang.isNumber(found+stream.look())){
232
- found += stream.next();
233
- }
234
-
235
- if (found === "") {
236
- return false;
237
- }
238
- else {
239
- if (/^0[0-7]/.test(found)) tokens.push(new JSDOC.Token(found, "NUMB", "OCTAL"));
240
- else tokens.push(new JSDOC.Token(found, "NUMB", "DECIMAL"));
241
- return true;
242
- }
243
- }
244
- /*t:
245
- requires("../lib/JSDOC/TextStream.js");
246
- requires("../lib/JSDOC/Token.js");
247
- requires("../lib/JSDOC/Lang.js");
248
-
249
- plan(3, "testing JSDOC.TokenReader.prototype.read_numb");
250
-
251
- //// setup
252
- var src = "function foo(num){while (num+8.0 >= 0x20 && num < 0777){}}";
253
- var tr = new JSDOC.TokenReader();
254
- var tokens = tr.tokenize(new JSDOC.TextStream(src));
255
-
256
- var hexToken, octToken, decToken;
257
- for (var i = 0; i < tokens.length; i++) {
258
- if (tokens[i].name == "HEX_DEC") hexToken = tokens[i];
259
- if (tokens[i].name == "OCTAL") octToken = tokens[i];
260
- if (tokens[i].name == "DECIMAL") decToken = tokens[i];
261
- }
262
- ////
263
-
264
- is(decToken.data, "8.0", "decimal number is found in source.");
265
- is(hexToken.data, "0x20", "hexdec number is found in source (issue #99).");
266
- is(octToken.data, "0777", "octal number is found in source.");
267
- */
268
-
269
- /**
270
- @returns {Boolean} Was the token found?
271
- */
272
- JSDOC.TokenReader.prototype.read_hex = function(/**JSDOC.TokenStream*/stream, tokens) {
273
- var found = stream.next(2);
274
-
275
- while (!stream.look().eof) {
276
- if (JSDOC.Lang.isHexDec(found) && !JSDOC.Lang.isHexDec(found+stream.look())) { // done
277
- tokens.push(new JSDOC.Token(found, "NUMB", "HEX_DEC"));
278
- return true;
279
- }
280
- else {
281
- found += stream.next();
282
- }
283
- }
284
- return false;
285
- }
286
-
287
- /**
288
- @returns {Boolean} Was the token found?
289
- */
290
- JSDOC.TokenReader.prototype.read_regx = function(/**JSDOC.TokenStream*/stream, tokens) {
291
- var last;
292
- if (
293
- stream.look() == "/"
294
- &&
295
- (
296
-
297
- (
298
- !(last = tokens.lastSym()) // there is no last, the regex is the first symbol
299
- ||
300
- (
301
- !last.is("NUMB")
302
- && !last.is("NAME")
303
- && !last.is("RIGHT_PAREN")
304
- && !last.is("RIGHT_BRACKET")
305
- )
306
- )
307
- )
308
- ) {
309
- var regex = stream.next();
310
-
311
- while (!stream.look().eof) {
312
- if (stream.look() == "\\") { // escape sequence
313
- regex += stream.next(2);
314
- }
315
- else if (stream.look() == "/") {
316
- regex += stream.next();
317
-
318
- while (/[gmi]/.test(stream.look())) {
319
- regex += stream.next();
320
- }
321
-
322
- tokens.push(new JSDOC.Token(regex, "REGX", "REGX"));
323
- return true;
324
- }
325
- else {
326
- regex += stream.next();
327
- }
328
- }
329
- // error: unterminated regex
330
- }
331
- return false;
332
- }