spade 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1990) hide show
  1. data/.gitignore +14 -0
  2. data/.gitmodules +15 -0
  3. data/.rspec +1 -0
  4. data/Buildfile +18 -0
  5. data/Gemfile +19 -0
  6. data/Gemfile.lock +34 -0
  7. data/README.md +148 -0
  8. data/Rakefile +9 -0
  9. data/bin/spade +7 -0
  10. data/examples/format-app/lib/hello.coffee +1 -0
  11. data/examples/format-app/lib/main.js +6 -0
  12. data/examples/format-app/package.json +10 -0
  13. data/examples/format-app/resources/README.txt +1 -0
  14. data/examples/format-app/resources/config.json +3 -0
  15. data/examples/path-test/lib/hello.js +1 -0
  16. data/examples/path-test/lib/main.js +1 -0
  17. data/examples/path-test/package.json +5 -0
  18. data/examples/sc-app/index.html +13 -0
  19. data/examples/sc-app/lib/main.js +24 -0
  20. data/examples/sc-app/package.json +8 -0
  21. data/examples/single-file.js +22 -0
  22. data/examples/todos/index.html +11 -0
  23. data/examples/todos/lib/main.js +10 -0
  24. data/examples/todos/lib/todos.js +93 -0
  25. data/examples/todos/package.json +10 -0
  26. data/examples/todos/resources/stylesheets/todos.css +162 -0
  27. data/examples/todos/resources/templates/todos.handlebars +31 -0
  28. data/examples/web-app/README.md +83 -0
  29. data/examples/web-app/index.html +12 -0
  30. data/examples/web-app/lib/main.js +3 -0
  31. data/examples/web-app/package.json +6 -0
  32. data/examples/web-app/tests.html +12 -0
  33. data/examples/web-app/tests/ct-example-test.js +39 -0
  34. data/examples/web-app/tests/qunit-test.js +23 -0
  35. data/lib/index.js +14 -0
  36. data/lib/node/loader.js +145 -0
  37. data/lib/node/sandbox.js +34 -0
  38. data/lib/spade.js +1099 -0
  39. data/lib/spade.rb +52 -0
  40. data/lib/spade/bundle.rb +156 -0
  41. data/lib/spade/cli.rb +14 -0
  42. data/lib/spade/cli/base.rb +325 -0
  43. data/lib/spade/cli/owner.rb +45 -0
  44. data/lib/spade/compiler.rb +34 -0
  45. data/lib/spade/console.rb +39 -0
  46. data/lib/spade/context.rb +116 -0
  47. data/lib/spade/credentials.rb +36 -0
  48. data/lib/spade/environment.rb +35 -0
  49. data/lib/spade/exports.rb +71 -0
  50. data/lib/spade/loader.rb +243 -0
  51. data/lib/spade/local.rb +53 -0
  52. data/lib/spade/package.rb +143 -0
  53. data/lib/spade/reactor.rb +159 -0
  54. data/lib/spade/remote.rb +75 -0
  55. data/lib/spade/repository.rb +18 -0
  56. data/lib/spade/server.rb +54 -0
  57. data/lib/spade/shell.rb +36 -0
  58. data/lib/spade/version.rb +3 -0
  59. data/package.json +27 -0
  60. data/packages/coffee-script/.gitignore +8 -0
  61. data/packages/coffee-script/.npmignore +11 -0
  62. data/packages/coffee-script/Cakefile +229 -0
  63. data/packages/coffee-script/LICENSE +22 -0
  64. data/packages/coffee-script/README +47 -0
  65. data/packages/coffee-script/Rakefile +78 -0
  66. data/packages/coffee-script/bin/cake +7 -0
  67. data/packages/coffee-script/bin/coffee +7 -0
  68. data/packages/coffee-script/documentation/coffee/aliases.coffee +11 -0
  69. data/packages/coffee-script/documentation/coffee/array_comprehensions.coffee +2 -0
  70. data/packages/coffee-script/documentation/coffee/block_comment.coffee +6 -0
  71. data/packages/coffee-script/documentation/coffee/cake_tasks.coffee +9 -0
  72. data/packages/coffee-script/documentation/coffee/classes.coffee +25 -0
  73. data/packages/coffee-script/documentation/coffee/comparisons.coffee +5 -0
  74. data/packages/coffee-script/documentation/coffee/conditionals.coffee +13 -0
  75. data/packages/coffee-script/documentation/coffee/default_args.coffee +8 -0
  76. data/packages/coffee-script/documentation/coffee/do.coffee +4 -0
  77. data/packages/coffee-script/documentation/coffee/embedded.coffee +5 -0
  78. data/packages/coffee-script/documentation/coffee/existence.coffee +10 -0
  79. data/packages/coffee-script/documentation/coffee/expressions.coffee +9 -0
  80. data/packages/coffee-script/documentation/coffee/expressions_assignment.coffee +3 -0
  81. data/packages/coffee-script/documentation/coffee/expressions_comprehension.coffee +3 -0
  82. data/packages/coffee-script/documentation/coffee/expressions_try.coffee +7 -0
  83. data/packages/coffee-script/documentation/coffee/fat_arrow.coffee +6 -0
  84. data/packages/coffee-script/documentation/coffee/functions.coffee +2 -0
  85. data/packages/coffee-script/documentation/coffee/heredocs.coffee +7 -0
  86. data/packages/coffee-script/documentation/coffee/heregexes.coffee +11 -0
  87. data/packages/coffee-script/documentation/coffee/interpolation.coffee +6 -0
  88. data/packages/coffee-script/documentation/coffee/multiple_return_values.coffee +7 -0
  89. data/packages/coffee-script/documentation/coffee/object_comprehensions.coffee +4 -0
  90. data/packages/coffee-script/documentation/coffee/object_extraction.coffee +13 -0
  91. data/packages/coffee-script/documentation/coffee/objects_and_arrays.coffee +19 -0
  92. data/packages/coffee-script/documentation/coffee/objects_reserved.coffee +5 -0
  93. data/packages/coffee-script/documentation/coffee/overview.coffee +28 -0
  94. data/packages/coffee-script/documentation/coffee/parallel_assignment.coffee +6 -0
  95. data/packages/coffee-script/documentation/coffee/patterns_and_splats.coffee +7 -0
  96. data/packages/coffee-script/documentation/coffee/prototypes.coffee +3 -0
  97. data/packages/coffee-script/documentation/coffee/range_comprehensions.coffee +2 -0
  98. data/packages/coffee-script/documentation/coffee/scope.coffee +5 -0
  99. data/packages/coffee-script/documentation/coffee/slices.coffee +7 -0
  100. data/packages/coffee-script/documentation/coffee/soaks.coffee +1 -0
  101. data/packages/coffee-script/documentation/coffee/splats.coffee +27 -0
  102. data/packages/coffee-script/documentation/coffee/splices.coffee +5 -0
  103. data/packages/coffee-script/documentation/coffee/strings.coffee +8 -0
  104. data/packages/coffee-script/documentation/coffee/switch.coffee +10 -0
  105. data/packages/coffee-script/documentation/coffee/try.coffee +8 -0
  106. data/packages/coffee-script/documentation/coffee/while.coffee +10 -0
  107. data/packages/coffee-script/documentation/css/docs.css +374 -0
  108. data/packages/coffee-script/documentation/css/idle.css +64 -0
  109. data/packages/coffee-script/documentation/docs/browser.html +25 -0
  110. data/packages/coffee-script/documentation/docs/cake.html +43 -0
  111. data/packages/coffee-script/documentation/docs/coffee-script.html +51 -0
  112. data/packages/coffee-script/documentation/docs/command.html +161 -0
  113. data/packages/coffee-script/documentation/docs/docco.css +186 -0
  114. data/packages/coffee-script/documentation/docs/grammar.html +399 -0
  115. data/packages/coffee-script/documentation/docs/helpers.html +31 -0
  116. data/packages/coffee-script/documentation/docs/index.html +3 -0
  117. data/packages/coffee-script/documentation/docs/lexer.html +490 -0
  118. data/packages/coffee-script/documentation/docs/nodes.html +1338 -0
  119. data/packages/coffee-script/documentation/docs/optparse.html +78 -0
  120. data/packages/coffee-script/documentation/docs/repl.html +24 -0
  121. data/packages/coffee-script/documentation/docs/rewriter.html +251 -0
  122. data/packages/coffee-script/documentation/docs/scope.html +54 -0
  123. data/packages/coffee-script/documentation/docs/underscore.html +295 -0
  124. data/packages/coffee-script/documentation/images/background.png +0 -0
  125. data/packages/coffee-script/documentation/images/banding.png +0 -0
  126. data/packages/coffee-script/documentation/images/button_bg.png +0 -0
  127. data/packages/coffee-script/documentation/images/button_bg_dark.gif +0 -0
  128. data/packages/coffee-script/documentation/images/button_bg_green.gif +0 -0
  129. data/packages/coffee-script/documentation/images/favicon.ico +0 -0
  130. data/packages/coffee-script/documentation/images/logo.png +0 -0
  131. data/packages/coffee-script/documentation/images/screenshadow.png +0 -0
  132. data/packages/coffee-script/documentation/index.html.erb +1607 -0
  133. data/packages/coffee-script/documentation/js/aliases.js +17 -0
  134. data/packages/coffee-script/documentation/js/array_comprehensions.js +6 -0
  135. data/packages/coffee-script/documentation/js/block_comment.js +4 -0
  136. data/packages/coffee-script/documentation/js/cake_tasks.js +10 -0
  137. data/packages/coffee-script/documentation/js/classes.js +44 -0
  138. data/packages/coffee-script/documentation/js/comparisons.js +3 -0
  139. data/packages/coffee-script/documentation/js/conditionals.js +12 -0
  140. data/packages/coffee-script/documentation/js/default_args.js +7 -0
  141. data/packages/coffee-script/documentation/js/do.js +10 -0
  142. data/packages/coffee-script/documentation/js/embedded.js +4 -0
  143. data/packages/coffee-script/documentation/js/existence.js +6 -0
  144. data/packages/coffee-script/documentation/js/expressions.js +15 -0
  145. data/packages/coffee-script/documentation/js/expressions_assignment.js +2 -0
  146. data/packages/coffee-script/documentation/js/expressions_comprehension.js +9 -0
  147. data/packages/coffee-script/documentation/js/expressions_try.js +7 -0
  148. data/packages/coffee-script/documentation/js/fat_arrow.js +9 -0
  149. data/packages/coffee-script/documentation/js/functions.js +7 -0
  150. data/packages/coffee-script/documentation/js/heredocs.js +2 -0
  151. data/packages/coffee-script/documentation/js/heregexes.js +2 -0
  152. data/packages/coffee-script/documentation/js/interpolation.js +4 -0
  153. data/packages/coffee-script/documentation/js/multiple_return_values.js +5 -0
  154. data/packages/coffee-script/documentation/js/object_comprehensions.js +15 -0
  155. data/packages/coffee-script/documentation/js/object_extraction.js +10 -0
  156. data/packages/coffee-script/documentation/js/objects_and_arrays.js +17 -0
  157. data/packages/coffee-script/documentation/js/objects_reserved.js +4 -0
  158. data/packages/coffee-script/documentation/js/overview.js +35 -0
  159. data/packages/coffee-script/documentation/js/parallel_assignment.js +4 -0
  160. data/packages/coffee-script/documentation/js/patterns_and_splats.js +4 -0
  161. data/packages/coffee-script/documentation/js/prototypes.js +3 -0
  162. data/packages/coffee-script/documentation/js/range_comprehensions.js +9 -0
  163. data/packages/coffee-script/documentation/js/scope.js +8 -0
  164. data/packages/coffee-script/documentation/js/slices.js +4 -0
  165. data/packages/coffee-script/documentation/js/soaks.js +2 -0
  166. data/packages/coffee-script/documentation/js/splats.js +15 -0
  167. data/packages/coffee-script/documentation/js/splices.js +3 -0
  168. data/packages/coffee-script/documentation/js/strings.js +2 -0
  169. data/packages/coffee-script/documentation/js/switch.js +23 -0
  170. data/packages/coffee-script/documentation/js/try.js +8 -0
  171. data/packages/coffee-script/documentation/js/while.js +18 -0
  172. data/packages/coffee-script/documentation/vendor/jquery-1.4.2.js +6240 -0
  173. data/packages/coffee-script/examples/beautiful_code/binary_search.coffee +16 -0
  174. data/packages/coffee-script/examples/beautiful_code/quicksort_runtime.coffee +13 -0
  175. data/packages/coffee-script/examples/beautiful_code/regular_expression_matcher.coffee +34 -0
  176. data/packages/coffee-script/examples/blocks.coffee +54 -0
  177. data/packages/coffee-script/examples/code.coffee +167 -0
  178. data/packages/coffee-script/examples/computer_science/README +4 -0
  179. data/packages/coffee-script/examples/computer_science/binary_search.coffee +25 -0
  180. data/packages/coffee-script/examples/computer_science/bubble_sort.coffee +11 -0
  181. data/packages/coffee-script/examples/computer_science/linked_list.coffee +108 -0
  182. data/packages/coffee-script/examples/computer_science/luhn_algorithm.coffee +36 -0
  183. data/packages/coffee-script/examples/computer_science/merge_sort.coffee +19 -0
  184. data/packages/coffee-script/examples/computer_science/selection_sort.coffee +23 -0
  185. data/packages/coffee-script/examples/poignant.coffee +181 -0
  186. data/packages/coffee-script/examples/potion.coffee +206 -0
  187. data/packages/coffee-script/examples/underscore.coffee +682 -0
  188. data/packages/coffee-script/examples/web_server.coffee +12 -0
  189. data/packages/coffee-script/extras/EXTRAS +7 -0
  190. data/packages/coffee-script/extras/coffee-script.js +8 -0
  191. data/packages/coffee-script/extras/jsl.conf +44 -0
  192. data/packages/coffee-script/index.html +2515 -0
  193. data/packages/coffee-script/lib/browser.js +52 -0
  194. data/packages/coffee-script/lib/cake.js +76 -0
  195. data/packages/coffee-script/lib/coffee-script.js +82 -0
  196. data/packages/coffee-script/lib/command.js +263 -0
  197. data/packages/coffee-script/lib/grammar.js +581 -0
  198. data/packages/coffee-script/lib/helpers.js +66 -0
  199. data/packages/coffee-script/lib/index.js +8 -0
  200. data/packages/coffee-script/lib/lexer.js +633 -0
  201. data/packages/coffee-script/lib/nodes.js +2165 -0
  202. data/packages/coffee-script/lib/optparse.js +111 -0
  203. data/packages/coffee-script/lib/parser.js +649 -0
  204. data/packages/coffee-script/lib/repl.js +42 -0
  205. data/packages/coffee-script/lib/rewriter.js +353 -0
  206. data/packages/coffee-script/lib/scope.js +120 -0
  207. data/packages/coffee-script/lib/spade-format.js +45 -0
  208. data/packages/coffee-script/package.json +26 -0
  209. data/packages/coffee-script/src/browser.coffee +43 -0
  210. data/packages/coffee-script/src/cake.coffee +69 -0
  211. data/packages/coffee-script/src/coffee-script.coffee +92 -0
  212. data/packages/coffee-script/src/command.coffee +214 -0
  213. data/packages/coffee-script/src/grammar.coffee +590 -0
  214. data/packages/coffee-script/src/helpers.coffee +56 -0
  215. data/packages/coffee-script/src/index.coffee +2 -0
  216. data/packages/coffee-script/src/lexer.coffee +653 -0
  217. data/packages/coffee-script/src/nodes.coffee +1754 -0
  218. data/packages/coffee-script/src/optparse.coffee +99 -0
  219. data/packages/coffee-script/src/repl.coffee +42 -0
  220. data/packages/coffee-script/src/rewriter.coffee +326 -0
  221. data/packages/coffee-script/src/scope.coffee +94 -0
  222. data/packages/coffee-script/test/arguments.coffee +127 -0
  223. data/packages/coffee-script/test/assignment.coffee +98 -0
  224. data/packages/coffee-script/test/break.coffee +18 -0
  225. data/packages/coffee-script/test/comments.coffee +201 -0
  226. data/packages/coffee-script/test/conditionals.coffee +181 -0
  227. data/packages/coffee-script/test/exception_handling.coffee +90 -0
  228. data/packages/coffee-script/test/helpers.coffee +96 -0
  229. data/packages/coffee-script/test/importing.coffee +18 -0
  230. data/packages/coffee-script/test/operators.coffee +225 -0
  231. data/packages/coffee-script/test/ranges_slices_and_splices.coffee +186 -0
  232. data/packages/coffee-script/test/regular_expressions.coffee +56 -0
  233. data/packages/coffee-script/test/test.html +123 -0
  234. data/packages/coffee-script/test/test_chaining.coffee +77 -0
  235. data/packages/coffee-script/test/test_classes.coffee +372 -0
  236. data/packages/coffee-script/test/test_compilation.coffee +26 -0
  237. data/packages/coffee-script/test/test_comprehensions.coffee +318 -0
  238. data/packages/coffee-script/test/test_existence.coffee +165 -0
  239. data/packages/coffee-script/test/test_functions.coffee +379 -0
  240. data/packages/coffee-script/test/test_heredocs.coffee +111 -0
  241. data/packages/coffee-script/test/test_literals.coffee +270 -0
  242. data/packages/coffee-script/test/test_option_parser.coffee +27 -0
  243. data/packages/coffee-script/test/test_pattern_matching.coffee +162 -0
  244. data/packages/coffee-script/test/test_returns.coffee +63 -0
  245. data/packages/coffee-script/test/test_splats.coffee +102 -0
  246. data/packages/coffee-script/test/test_strings.coffee +118 -0
  247. data/packages/coffee-script/test/test_switch.coffee +103 -0
  248. data/packages/coffee-script/test/test_while.coffee +71 -0
  249. data/packages/core-test/.gitignore +2 -0
  250. data/packages/core-test/Buildfile +15 -0
  251. data/packages/core-test/CHANGELOG.md +24 -0
  252. data/packages/core-test/__preamble__.js +34 -0
  253. data/packages/core-test/bin/cot +3 -0
  254. data/packages/core-test/lib/assert.js +306 -0
  255. data/packages/core-test/lib/cli.js +258 -0
  256. data/packages/core-test/lib/core.js +311 -0
  257. data/packages/core-test/lib/loggers/browser.js +390 -0
  258. data/packages/core-test/lib/loggers/console.js +235 -0
  259. data/packages/core-test/lib/loggers/default.js +272 -0
  260. data/packages/core-test/lib/loggers/dummy.js +168 -0
  261. data/packages/core-test/lib/main.js +22 -0
  262. data/packages/core-test/lib/private/jquery.js +6079 -0
  263. data/packages/core-test/lib/qunit.js +159 -0
  264. data/packages/core-test/lib/runner.js +65 -0
  265. data/packages/core-test/lib/spec.js +302 -0
  266. data/packages/core-test/lib/sync.js +64 -0
  267. data/packages/core-test/lib/system/dump.js +208 -0
  268. data/packages/core-test/lib/system/equiv.js +199 -0
  269. data/packages/core-test/lib/system/ext.js +62 -0
  270. data/packages/core-test/lib/system/module.js +162 -0
  271. data/packages/core-test/lib/system/plan.js +223 -0
  272. data/packages/core-test/lib/system/stub.js +98 -0
  273. data/packages/core-test/lib/system/test.js +373 -0
  274. data/packages/core-test/lib/test.js +69 -0
  275. data/packages/core-test/lib/utils.js +256 -0
  276. data/packages/core-test/package.json +10 -0
  277. data/packages/core-test/resources/additions.css +8 -0
  278. data/packages/core-test/resources/runner.css +177 -0
  279. data/packages/core-test/tests/apis/commonjs-test.js +102 -0
  280. data/packages/core-test/tests/apis/core-test.js +154 -0
  281. data/packages/core-test/tests/apis/qunit-test.js +244 -0
  282. data/packages/core-test/tests/apis/spec-test.js +344 -0
  283. data/packages/core-test/tests/system/equiv/qunit-test.js +1400 -0
  284. data/packages/core-test/tests/system/test/assert-test.js +86 -0
  285. data/packages/core-test/tests/system/test/error-test.js +62 -0
  286. data/packages/core-test/tests/system/test/schedule-test.js +210 -0
  287. data/packages/core-test/tests/utils/fmt-test.js +24 -0
  288. data/packages/handlebars/Gemfile +4 -0
  289. data/packages/handlebars/README.markdown +205 -0
  290. data/packages/handlebars/Rakefile +65 -0
  291. data/packages/handlebars/lib/handlebars.js +19 -0
  292. data/packages/handlebars/lib/handlebars/ast.js +88 -0
  293. data/packages/handlebars/lib/handlebars/compiler.js +116 -0
  294. data/packages/handlebars/lib/handlebars/debug.js +25 -0
  295. data/packages/handlebars/lib/handlebars/printer.js +114 -0
  296. data/packages/handlebars/lib/handlebars/runtime.js +280 -0
  297. data/packages/handlebars/lib/handlebars/utils.js +61 -0
  298. data/packages/handlebars/lib/handlebars/visitor.js +14 -0
  299. data/packages/handlebars/lib/handlebars/vm.js +634 -0
  300. data/packages/handlebars/spec/acceptance_spec.rb +100 -0
  301. data/packages/handlebars/spec/parser_spec.rb +181 -0
  302. data/packages/handlebars/spec/qunit_spec.js +497 -0
  303. data/packages/handlebars/spec/spec_helper.rb +107 -0
  304. data/packages/handlebars/spec/tokenizer_spec.rb +145 -0
  305. data/packages/handlebars/src/handlebars.l +27 -0
  306. data/packages/handlebars/src/handlebars.yy +79 -0
  307. data/packages/handlebars/test.js +56 -0
  308. data/packages/ivory/LICENSE.txt +1 -0
  309. data/packages/ivory/README.md +19 -0
  310. data/packages/ivory/lib/buffer.js +111 -0
  311. data/packages/ivory/lib/events.js +137 -0
  312. data/packages/ivory/lib/fs.js +266 -0
  313. data/packages/ivory/lib/main.js +13 -0
  314. data/packages/ivory/lib/path.js +158 -0
  315. data/packages/ivory/lib/ruby/buffer.rb +145 -0
  316. data/packages/ivory/lib/ruby/constants.rb +585 -0
  317. data/packages/ivory/lib/ruby/events.rb +32 -0
  318. data/packages/ivory/lib/ruby/fs.rb +245 -0
  319. data/packages/ivory/lib/ruby/process.rb +28 -0
  320. data/packages/ivory/lib/stream.js +115 -0
  321. data/packages/ivory/lib/util.js +414 -0
  322. data/packages/ivory/package.json +11 -0
  323. data/packages/jquery-core/lib/main.js +897 -0
  324. data/packages/jquery-core/package.json +9 -0
  325. data/packages/jquery/main.js +7179 -0
  326. data/packages/jquery/package.json +10 -0
  327. data/packages/json/lib/main.js +14 -0
  328. data/packages/json/package.json +8 -0
  329. data/packages/lproj/README.md +77 -0
  330. data/packages/lproj/examples/demo-app/en.lproj/localized.strings +2 -0
  331. data/packages/lproj/examples/demo-app/fr.lproj/localized.strings +3 -0
  332. data/packages/lproj/examples/demo-app/index.html +8 -0
  333. data/packages/lproj/examples/demo-app/lib/main.js +7 -0
  334. data/packages/lproj/examples/demo-app/package.json +9 -0
  335. data/packages/lproj/lib/main.js +78 -0
  336. data/packages/lproj/lib/strings-format.js +6 -0
  337. data/packages/lproj/package.json +9 -0
  338. data/packages/optparse/README.md +161 -0
  339. data/packages/optparse/TODO +1 -0
  340. data/packages/optparse/examples/browser-test.html +75 -0
  341. data/packages/optparse/examples/nodejs-test.js +90 -0
  342. data/packages/optparse/lib/optparse.js +309 -0
  343. data/packages/optparse/package.json +13 -0
  344. data/packages/optparse/seed.yml +5 -0
  345. data/packages/sproutcore-bootstrap/lib/main.js +11 -0
  346. data/packages/sproutcore-bootstrap/package.json +15 -0
  347. data/packages/sproutcore-corefoundation/lib/main.js +66 -0
  348. data/packages/sproutcore-corefoundation/lib/tests.js +74 -0
  349. data/packages/sproutcore-corefoundation/package.json +27 -0
  350. data/packages/sproutcore-corefoundation/tests.html +12 -0
  351. data/packages/sproutcore-datastore/lib/main.js +23 -0
  352. data/packages/sproutcore-datastore/package.json +16 -0
  353. data/packages/sproutcore-datetime/lib/main.js +6 -0
  354. data/packages/sproutcore-datetime/package.json +16 -0
  355. data/packages/sproutcore-handlebars/lib/handlebars.js +5 -0
  356. data/packages/sproutcore-handlebars/lib/main.js +15 -0
  357. data/packages/sproutcore-handlebars/package.json +17 -0
  358. data/packages/sproutcore-jquery/lib/main.js +10 -0
  359. data/packages/sproutcore-jquery/package.json +12 -0
  360. data/packages/sproutcore-preprocessor/bin/chance +64 -0
  361. data/packages/sproutcore-preprocessor/lib/css.js +21 -0
  362. data/packages/sproutcore-preprocessor/lib/main.js +1 -0
  363. data/packages/sproutcore-preprocessor/lib/preprocessor.js +12 -0
  364. data/packages/sproutcore-preprocessor/lib/sc_static.js +9 -0
  365. data/packages/sproutcore-preprocessor/package.json +18 -0
  366. data/packages/sproutcore-runtime/lib/main.js +37 -0
  367. data/packages/sproutcore-runtime/package.json +21 -0
  368. data/packages/text/lib/main.js +8 -0
  369. data/packages/text/package.json +9 -0
  370. data/packages/web-file/README.md +7 -0
  371. data/packages/web-file/lib/errors.js +32 -0
  372. data/packages/web-file/lib/file-reader.js +10 -0
  373. data/packages/web-file/lib/file-system.js +234 -0
  374. data/packages/web-file/lib/file-writer.js +10 -0
  375. data/packages/web-file/lib/file.js +9 -0
  376. data/packages/web-file/lib/main.js +34 -0
  377. data/packages/web-file/lib/platform.js +25 -0
  378. data/packages/web-file/lib/ruby/file.rb +252 -0
  379. data/packages/web-file/lib/ruby/file_reader.rb +69 -0
  380. data/packages/web-file/lib/ruby/file_system.rb +134 -0
  381. data/packages/web-file/lib/ruby/file_writer.rb +78 -0
  382. data/packages/web-file/package.json +12 -0
  383. data/packages/web-typed-array/README.md +7 -0
  384. data/packages/web-typed-array/lib/array-buffer-view.js +9 -0
  385. data/packages/web-typed-array/lib/array-buffer.js +7 -0
  386. data/packages/web-typed-array/lib/main.js +33 -0
  387. data/packages/web-typed-array/lib/platform.js +20 -0
  388. data/packages/web-typed-array/lib/ruby/array_buffer.rb +31 -0
  389. data/packages/web-typed-array/lib/ruby/array_buffer_view.rb +130 -0
  390. data/packages/web-typed-array/lib/ruby/typed_array.rb +133 -0
  391. data/packages/web-typed-array/lib/typed-array.js +26 -0
  392. data/packages/web-typed-array/package.json +9 -0
  393. data/spade.gemspec +30 -0
  394. data/spec/cli/build_spec.rb +59 -0
  395. data/spec/cli/install_spec.rb +106 -0
  396. data/spec/cli/installed_spec.rb +55 -0
  397. data/spec/cli/list_spec.rb +75 -0
  398. data/spec/cli/login_spec.rb +76 -0
  399. data/spec/cli/owner_spec.rb +115 -0
  400. data/spec/cli/push_spec.rb +74 -0
  401. data/spec/cli/uninstall_spec.rb +58 -0
  402. data/spec/cli/unpack_spec.rb +73 -0
  403. data/spec/credentials_spec.rb +24 -0
  404. data/spec/fixtures/coffee/bin/cake +0 -0
  405. data/spec/fixtures/coffee/bin/coffee +0 -0
  406. data/spec/fixtures/coffee/lib/coffee.js +0 -0
  407. data/spec/fixtures/coffee/lib/coffee.png +0 -0
  408. data/spec/fixtures/coffee/lib/coffee/base.js +0 -0
  409. data/spec/fixtures/coffee/lib/coffee/mocha/chai.js +0 -0
  410. data/spec/fixtures/coffee/qunit/coffee/test.js +0 -0
  411. data/spec/fixtures/coffee/qunit/test.js +0 -0
  412. data/spec/fixtures/coffee/qunit/test.log +0 -0
  413. data/spec/fixtures/package.json +25 -0
  414. data/spec/gauntlet_spec.rb +30 -0
  415. data/spec/javascript/async-test.js +123 -0
  416. data/spec/javascript/compiler/javascript.js +13 -0
  417. data/spec/javascript/compiler/ruby.js +14 -0
  418. data/spec/javascript/loader-test.js +64 -0
  419. data/spec/javascript/normalize-test.js +59 -0
  420. data/spec/javascript/packages-test.js +44 -0
  421. data/spec/javascript/relative-require-test.js +72 -0
  422. data/spec/javascript/require-test.js +56 -0
  423. data/spec/javascript/sandbox/compile.js +37 -0
  424. data/spec/javascript/sandbox/creation.js +44 -0
  425. data/spec/javascript/sandbox/format.js +79 -0
  426. data/spec/javascript/sandbox/misc.js +57 -0
  427. data/spec/javascript/sandbox/preprocessor.js +81 -0
  428. data/spec/javascript/sandbox/require.js +48 -0
  429. data/spec/javascript/sandbox/run-command.js +21 -0
  430. data/spec/javascript/spade/externs.js +14 -0
  431. data/spec/javascript/spade/load-factory.js +15 -0
  432. data/spec/javascript/spade/misc.js +23 -0
  433. data/spec/javascript/spade/ready.js +12 -0
  434. data/spec/javascript/spade/register.js +13 -0
  435. data/spec/javascript_spec.rb +7 -0
  436. data/spec/package_spec.rb +257 -0
  437. data/spec/spec_helper.rb +30 -0
  438. data/spec/support/cli.rb +94 -0
  439. data/spec/support/core_test.rb +52 -0
  440. data/spec/support/fake.rb +42 -0
  441. data/spec/support/fake_gem_server.rb +50 -0
  442. data/spec/support/fake_gemcutter.rb +29 -0
  443. data/spec/support/matchers.rb +31 -0
  444. data/spec/support/path.rb +54 -0
  445. data/sproutcore/.gitignore +13 -0
  446. data/sproutcore/Buildfile +112 -0
  447. data/sproutcore/CHANGELOG.md +232 -0
  448. data/sproutcore/README.md +68 -0
  449. data/sproutcore/apps/docs/core.js +27 -0
  450. data/sproutcore/apps/docs/design/Doc Viewer.graffle/QuickLook/Preview.pdf +0 -0
  451. data/sproutcore/apps/docs/design/Doc Viewer.graffle/QuickLook/Thumbnail.tiff +0 -0
  452. data/sproutcore/apps/docs/design/Doc Viewer.graffle/data.plist +14378 -0
  453. data/sproutcore/apps/docs/design/Doc Viewer.graffle/image10.png +0 -0
  454. data/sproutcore/apps/docs/design/Doc Viewer.graffle/image11.png +0 -0
  455. data/sproutcore/apps/docs/design/Doc Viewer.graffle/image13.png +0 -0
  456. data/sproutcore/apps/docs/design/Doc Viewer.graffle/image14.png +0 -0
  457. data/sproutcore/apps/docs/design/Doc Viewer.graffle/image8.png +0 -0
  458. data/sproutcore/apps/docs/design/Doc Viewer.graffle/image9.tiff +0 -0
  459. data/sproutcore/apps/docs/english.lproj/loading.rhtml +9 -0
  460. data/sproutcore/apps/docs/english.lproj/main_page.js +22 -0
  461. data/sproutcore/apps/docs/english.lproj/strings.js +15 -0
  462. data/sproutcore/apps/docs/main.js +30 -0
  463. data/sproutcore/apps/greenhouse/README +18 -0
  464. data/sproutcore/apps/greenhouse/TODO +56 -0
  465. data/sproutcore/apps/greenhouse/beautify.js +1058 -0
  466. data/sproutcore/apps/greenhouse/controllers/design.js +20 -0
  467. data/sproutcore/apps/greenhouse/controllers/file.js +35 -0
  468. data/sproutcore/apps/greenhouse/controllers/files.js +40 -0
  469. data/sproutcore/apps/greenhouse/controllers/layout.js +53 -0
  470. data/sproutcore/apps/greenhouse/controllers/library.js +194 -0
  471. data/sproutcore/apps/greenhouse/controllers/page.js +18 -0
  472. data/sproutcore/apps/greenhouse/controllers/property.js +19 -0
  473. data/sproutcore/apps/greenhouse/controllers/property_editor.js +17 -0
  474. data/sproutcore/apps/greenhouse/controllers/target.js +20 -0
  475. data/sproutcore/apps/greenhouse/controllers/targets.js +43 -0
  476. data/sproutcore/apps/greenhouse/controllers/view_configs.js +100 -0
  477. data/sproutcore/apps/greenhouse/core.js +65 -0
  478. data/sproutcore/apps/greenhouse/core_file.js +124 -0
  479. data/sproutcore/apps/greenhouse/data_source.js +250 -0
  480. data/sproutcore/apps/greenhouse/english.lproj/app_page.js +399 -0
  481. data/sproutcore/apps/greenhouse/english.lproj/css/app-selector.css +107 -0
  482. data/sproutcore/apps/greenhouse/english.lproj/css/button.css +314 -0
  483. data/sproutcore/apps/greenhouse/english.lproj/css/dock.css +90 -0
  484. data/sproutcore/apps/greenhouse/english.lproj/css/general.css +51 -0
  485. data/sproutcore/apps/greenhouse/english.lproj/css/main-page.css +93 -0
  486. data/sproutcore/apps/greenhouse/english.lproj/css/menu.css +49 -0
  487. data/sproutcore/apps/greenhouse/english.lproj/css/modal.css +41 -0
  488. data/sproutcore/apps/greenhouse/english.lproj/css/picker.css +195 -0
  489. data/sproutcore/apps/greenhouse/english.lproj/css/search.css +60 -0
  490. data/sproutcore/apps/greenhouse/english.lproj/css/text-field.css +67 -0
  491. data/sproutcore/apps/greenhouse/english.lproj/dialogs.js +303 -0
  492. data/sproutcore/apps/greenhouse/english.lproj/fonts/museosans_500.eot +0 -0
  493. data/sproutcore/apps/greenhouse/english.lproj/fonts/museosans_500.otf +0 -0
  494. data/sproutcore/apps/greenhouse/english.lproj/fonts/museosans_500.woff +0 -0
  495. data/sproutcore/apps/greenhouse/english.lproj/fonts/museosans_500_italic.eot +0 -0
  496. data/sproutcore/apps/greenhouse/english.lproj/fonts/museosans_500_italic.otf +0 -0
  497. data/sproutcore/apps/greenhouse/english.lproj/fonts/museosans_500_italic.woff +0 -0
  498. data/sproutcore/apps/greenhouse/english.lproj/images/app-selector/choose-app.png +0 -0
  499. data/sproutcore/apps/greenhouse/english.lproj/images/app-selector/list-item-sel.png +0 -0
  500. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule-xl/active-l.png +0 -0
  501. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule-xl/active-m.png +0 -0
  502. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule-xl/active-r.png +0 -0
  503. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule-xl/regular-l.png +0 -0
  504. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule-xl/regular-m.png +0 -0
  505. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule-xl/regular-r.png +0 -0
  506. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/active-l.png +0 -0
  507. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/active-r.png +0 -0
  508. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/disabled-l.png +0 -0
  509. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/disabled-r.png +0 -0
  510. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/regular-l.png +0 -0
  511. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/regular-r.png +0 -0
  512. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/sel-active-l.png +0 -0
  513. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/sel-active-r.png +0 -0
  514. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/sel-disabled-l.png +0 -0
  515. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/sel-disabled-r.png +0 -0
  516. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/sel-l.png +0 -0
  517. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/capsule/sel-r.png +0 -0
  518. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/active-l.png +0 -0
  519. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/active-m.png +0 -0
  520. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/active-r.png +0 -0
  521. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-active-l.png +0 -0
  522. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-active-r.png +0 -0
  523. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-l.png +0 -0
  524. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-r.png +0 -0
  525. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-sel-active-l.png +0 -0
  526. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-sel-active-r.png +0 -0
  527. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-sel-l.png +0 -0
  528. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/cap-sel-r.png +0 -0
  529. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/disabled-l.png +0 -0
  530. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/disabled-m.png +0 -0
  531. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/disabled-r.png +0 -0
  532. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/regular-l.png +0 -0
  533. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/regular-m.png +0 -0
  534. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/regular-r.png +0 -0
  535. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-active-l.png +0 -0
  536. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-active-m.png +0 -0
  537. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-active-r.png +0 -0
  538. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-disabled-l.png +0 -0
  539. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-disabled-m.png +0 -0
  540. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-disabled-r.png +0 -0
  541. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-l.png +0 -0
  542. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-m.png +0 -0
  543. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/dark/sel-r.png +0 -0
  544. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/shared/active-m.png +0 -0
  545. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/shared/disabled-m.png +0 -0
  546. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/shared/regular-m.png +0 -0
  547. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/shared/sel-active-m.png +0 -0
  548. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/shared/sel-disabled-m.png +0 -0
  549. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/shared/sel-m.png +0 -0
  550. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/active-l.png +0 -0
  551. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/active-r.png +0 -0
  552. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/disabled-l.png +0 -0
  553. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/disabled-r.png +0 -0
  554. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/regular-l.png +0 -0
  555. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/regular-r.png +0 -0
  556. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/sel-active-l.png +0 -0
  557. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/sel-active-r.png +0 -0
  558. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/sel-disabled-l.png +0 -0
  559. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/sel-disabled-r.png +0 -0
  560. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/sel-l.png +0 -0
  561. data/sproutcore/apps/greenhouse/english.lproj/images/buttons/square/sel-r.png +0 -0
  562. data/sproutcore/apps/greenhouse/english.lproj/images/icons/actions-active.png +0 -0
  563. data/sproutcore/apps/greenhouse/english.lproj/images/icons/actions.png +0 -0
  564. data/sproutcore/apps/greenhouse/english.lproj/images/icons/inspector-active.png +0 -0
  565. data/sproutcore/apps/greenhouse/english.lproj/images/icons/inspector.png +0 -0
  566. data/sproutcore/apps/greenhouse/english.lproj/images/icons/library-active.png +0 -0
  567. data/sproutcore/apps/greenhouse/english.lproj/images/icons/library.png +0 -0
  568. data/sproutcore/apps/greenhouse/english.lproj/images/icons/projects-active.png +0 -0
  569. data/sproutcore/apps/greenhouse/english.lproj/images/icons/projects.png +0 -0
  570. data/sproutcore/apps/greenhouse/english.lproj/images/icons/run-active.png +0 -0
  571. data/sproutcore/apps/greenhouse/english.lproj/images/icons/run.png +0 -0
  572. data/sproutcore/apps/greenhouse/english.lproj/images/icons/save-active.png +0 -0
  573. data/sproutcore/apps/greenhouse/english.lproj/images/icons/save.png +0 -0
  574. data/sproutcore/apps/greenhouse/english.lproj/images/logos/greenhouse-l.png +0 -0
  575. data/sproutcore/apps/greenhouse/english.lproj/images/logos/greenhouse-s.png +0 -0
  576. data/sproutcore/apps/greenhouse/english.lproj/images/logos/sproutcore.png +0 -0
  577. data/sproutcore/apps/greenhouse/english.lproj/images/main-bg.png +0 -0
  578. data/sproutcore/apps/greenhouse/english.lproj/images/picker/bottom-left.png +0 -0
  579. data/sproutcore/apps/greenhouse/english.lproj/images/picker/bottom-right.png +0 -0
  580. data/sproutcore/apps/greenhouse/english.lproj/images/picker/bottom.png +0 -0
  581. data/sproutcore/apps/greenhouse/english.lproj/images/picker/close-active.png +0 -0
  582. data/sproutcore/apps/greenhouse/english.lproj/images/picker/close.png +0 -0
  583. data/sproutcore/apps/greenhouse/english.lproj/images/picker/left.png +0 -0
  584. data/sproutcore/apps/greenhouse/english.lproj/images/picker/pointer-bottom.png +0 -0
  585. data/sproutcore/apps/greenhouse/english.lproj/images/picker/pointer-left.png +0 -0
  586. data/sproutcore/apps/greenhouse/english.lproj/images/picker/pointer-right.png +0 -0
  587. data/sproutcore/apps/greenhouse/english.lproj/images/picker/pointer-top.png +0 -0
  588. data/sproutcore/apps/greenhouse/english.lproj/images/picker/right.png +0 -0
  589. data/sproutcore/apps/greenhouse/english.lproj/images/picker/search-active.png +0 -0
  590. data/sproutcore/apps/greenhouse/english.lproj/images/picker/search.png +0 -0
  591. data/sproutcore/apps/greenhouse/english.lproj/images/picker/top-left.png +0 -0
  592. data/sproutcore/apps/greenhouse/english.lproj/images/picker/top-right.png +0 -0
  593. data/sproutcore/apps/greenhouse/english.lproj/images/picker/top.png +0 -0
  594. data/sproutcore/apps/greenhouse/english.lproj/images/toolbar-bg.png +0 -0
  595. data/sproutcore/apps/greenhouse/english.lproj/inspectors.js +365 -0
  596. data/sproutcore/apps/greenhouse/english.lproj/loading.rhtml +9 -0
  597. data/sproutcore/apps/greenhouse/english.lproj/main_page.js +95 -0
  598. data/sproutcore/apps/greenhouse/english.lproj/strings.js +93 -0
  599. data/sproutcore/apps/greenhouse/fixtures/file.js +35 -0
  600. data/sproutcore/apps/greenhouse/main.js +28 -0
  601. data/sproutcore/apps/greenhouse/mixins/drop_down.js +97 -0
  602. data/sproutcore/apps/greenhouse/models/design.js +26 -0
  603. data/sproutcore/apps/greenhouse/models/dir.js +93 -0
  604. data/sproutcore/apps/greenhouse/models/file.js +51 -0
  605. data/sproutcore/apps/greenhouse/models/target.js +82 -0
  606. data/sproutcore/apps/greenhouse/models/view_config.js +49 -0
  607. data/sproutcore/apps/greenhouse/resources/test_page.js +37 -0
  608. data/sproutcore/apps/greenhouse/states/inspector.js +152 -0
  609. data/sproutcore/apps/greenhouse/states/library.js +142 -0
  610. data/sproutcore/apps/greenhouse/states/main.js +283 -0
  611. data/sproutcore/apps/greenhouse/states/modals.js +299 -0
  612. data/sproutcore/apps/greenhouse/states/ready.js +235 -0
  613. data/sproutcore/apps/greenhouse/tests/controllers/design.js +15 -0
  614. data/sproutcore/apps/greenhouse/tests/controllers/designs.js +15 -0
  615. data/sproutcore/apps/greenhouse/tests/controllers/file.js +15 -0
  616. data/sproutcore/apps/greenhouse/tests/controllers/files.js +15 -0
  617. data/sproutcore/apps/greenhouse/tests/models/file.js +15 -0
  618. data/sproutcore/apps/greenhouse/tests/models/view_config.js +15 -0
  619. data/sproutcore/apps/greenhouse/tests/views/list_item.js +16 -0
  620. data/sproutcore/apps/greenhouse/tests/views/plist_item.js +20 -0
  621. data/sproutcore/apps/greenhouse/theme.js +25 -0
  622. data/sproutcore/apps/greenhouse/views/anchor.js +277 -0
  623. data/sproutcore/apps/greenhouse/views/application_list_item.js +19 -0
  624. data/sproutcore/apps/greenhouse/views/event_blocker.js +32 -0
  625. data/sproutcore/apps/greenhouse/views/label_designer.js +16 -0
  626. data/sproutcore/apps/greenhouse/views/list_item.js +42 -0
  627. data/sproutcore/apps/greenhouse/views/plist_item.js +178 -0
  628. data/sproutcore/apps/greenhouse/views/simple_button.js +157 -0
  629. data/sproutcore/apps/greenhouse/views/tear_off_picker.js +56 -0
  630. data/sproutcore/apps/greenhouse/views/web.js +44 -0
  631. data/sproutcore/apps/test_controls/Buildfile +0 -0
  632. data/sproutcore/apps/test_controls/controllers/buttons.js +21 -0
  633. data/sproutcore/apps/test_controls/controllers/categories.js +108 -0
  634. data/sproutcore/apps/test_controls/controllers/category.js +36 -0
  635. data/sproutcore/apps/test_controls/core.js +29 -0
  636. data/sproutcore/apps/test_controls/main.js +14 -0
  637. data/sproutcore/apps/test_controls/resources/buttons_page.js +142 -0
  638. data/sproutcore/apps/test_controls/resources/checkboxes_page.js +45 -0
  639. data/sproutcore/apps/test_controls/resources/flow_layout_page.js +84 -0
  640. data/sproutcore/apps/test_controls/resources/list_page.js +40 -0
  641. data/sproutcore/apps/test_controls/resources/loading.rhtml +9 -0
  642. data/sproutcore/apps/test_controls/resources/main_page.css +60 -0
  643. data/sproutcore/apps/test_controls/resources/main_page.js +145 -0
  644. data/sproutcore/apps/test_controls/resources/progress_page.js +32 -0
  645. data/sproutcore/apps/test_controls/resources/radio_page.js +48 -0
  646. data/sproutcore/apps/test_controls/resources/scroll_page.js +76 -0
  647. data/sproutcore/apps/test_controls/resources/segmented_page.js +98 -0
  648. data/sproutcore/apps/test_controls/resources/select_page.js +60 -0
  649. data/sproutcore/apps/test_controls/resources/sliders_page.js +53 -0
  650. data/sproutcore/apps/test_controls/resources/strings.js +50 -0
  651. data/sproutcore/apps/test_controls/resources/tab_page.js +44 -0
  652. data/sproutcore/apps/test_controls/resources/text_field_page.js +41 -0
  653. data/sproutcore/apps/test_controls/theme.js +34 -0
  654. data/sproutcore/apps/tests/controllers/detail.js +25 -0
  655. data/sproutcore/apps/tests/controllers/source.js +29 -0
  656. data/sproutcore/apps/tests/controllers/target.js +26 -0
  657. data/sproutcore/apps/tests/controllers/targets.js +86 -0
  658. data/sproutcore/apps/tests/controllers/tests.js +33 -0
  659. data/sproutcore/apps/tests/core.js +133 -0
  660. data/sproutcore/apps/tests/english.lproj/loading.rhtml +9 -0
  661. data/sproutcore/apps/tests/english.lproj/main_page.css +48 -0
  662. data/sproutcore/apps/tests/english.lproj/main_page.js +233 -0
  663. data/sproutcore/apps/tests/english.lproj/strings.js +26 -0
  664. data/sproutcore/apps/tests/main.js +27 -0
  665. data/sproutcore/apps/tests/states/no_targets.js +26 -0
  666. data/sproutcore/apps/tests/states/ready.js +56 -0
  667. data/sproutcore/apps/tests/states/ready_detail.js +41 -0
  668. data/sproutcore/apps/tests/states/ready_empty.js +48 -0
  669. data/sproutcore/apps/tests/states/ready_list.js +41 -0
  670. data/sproutcore/apps/tests/states/ready_loading.js +44 -0
  671. data/sproutcore/apps/tests/states/ready_no_tests.js +31 -0
  672. data/sproutcore/apps/tests/states/start.js +39 -0
  673. data/sproutcore/apps/tests/tests/controllers/detail.js +15 -0
  674. data/sproutcore/apps/tests/tests/controllers/source.js +15 -0
  675. data/sproutcore/apps/tests/tests/controllers/target.js +15 -0
  676. data/sproutcore/apps/tests/tests/controllers/targets.js +15 -0
  677. data/sproutcore/apps/tests/tests/controllers/tests.js +15 -0
  678. data/sproutcore/apps/tests/tests/models/target.js +15 -0
  679. data/sproutcore/apps/tests/tests/models/test.js +15 -0
  680. data/sproutcore/apps/tests/tests/views/offset_checkbox.js +15 -0
  681. data/sproutcore/apps/tests/views/offset_checkbox.js +26 -0
  682. data/sproutcore/apps/welcome/controllers/targets.js +56 -0
  683. data/sproutcore/apps/welcome/core.js +30 -0
  684. data/sproutcore/apps/welcome/english.lproj/images/main-bg.png +0 -0
  685. data/sproutcore/apps/welcome/english.lproj/loading.rhtml +10 -0
  686. data/sproutcore/apps/welcome/english.lproj/main_page.css +25 -0
  687. data/sproutcore/apps/welcome/english.lproj/main_page.js +67 -0
  688. data/sproutcore/apps/welcome/english.lproj/strings.js +15 -0
  689. data/sproutcore/apps/welcome/main.js +19 -0
  690. data/sproutcore/apps/welcome/tests/controllers/targets.js +15 -0
  691. data/sproutcore/design/CollectionView State Charts.graffle +4848 -0
  692. data/sproutcore/design/Design Charts.graffle +16845 -0
  693. data/sproutcore/design/Record State Table.numbers +0 -0
  694. data/sproutcore/design/SproutCore Datastore Design.graffle/QuickLook/Preview.pdf +0 -0
  695. data/sproutcore/design/SproutCore Datastore Design.graffle/QuickLook/Thumbnail.tiff +0 -0
  696. data/sproutcore/design/SproutCore Datastore Design.graffle/data.plist +19588 -0
  697. data/sproutcore/design/SproutCore Datastore Design.graffle/image8.png +0 -0
  698. data/sproutcore/design/SproutCore Design Template.graffle/QuickLook/Preview.pdf +0 -0
  699. data/sproutcore/design/SproutCore Design Template.graffle/QuickLook/Thumbnail.tiff +0 -0
  700. data/sproutcore/design/SproutCore Design Template.graffle/data.plist +1452 -0
  701. data/sproutcore/design/SproutCore Design Template.graffle/image8.png +0 -0
  702. data/sproutcore/design/TestRunner Design.graffle/QuickLook/Preview.pdf +0 -0
  703. data/sproutcore/design/TestRunner Design.graffle/QuickLook/Thumbnail.tiff +0 -0
  704. data/sproutcore/design/TestRunner Design.graffle/data.plist +24187 -0
  705. data/sproutcore/design/TestRunner Design.graffle/image10.png +0 -0
  706. data/sproutcore/design/TestRunner Design.graffle/image11.png +0 -0
  707. data/sproutcore/design/TestRunner Design.graffle/image13.png +0 -0
  708. data/sproutcore/design/TestRunner Design.graffle/image15.png +0 -0
  709. data/sproutcore/design/TestRunner Design.graffle/image16.png +0 -0
  710. data/sproutcore/design/TestRunner Design.graffle/image17.png +0 -0
  711. data/sproutcore/design/TestRunner Design.graffle/image18.png +0 -0
  712. data/sproutcore/design/TestRunner Design.graffle/image19.png +0 -0
  713. data/sproutcore/design/TestRunner Design.graffle/image22.tiff +0 -0
  714. data/sproutcore/design/TestRunner Design.graffle/image23.png +0 -0
  715. data/sproutcore/design/TestRunner Design.graffle/image24.png +0 -0
  716. data/sproutcore/design/TestRunner Design.graffle/image25.png +0 -0
  717. data/sproutcore/design/TestRunner Design.graffle/image30.png +0 -0
  718. data/sproutcore/design/TestRunner Design.graffle/image31.png +0 -0
  719. data/sproutcore/design/TestRunner Design.graffle/image8.png +0 -0
  720. data/sproutcore/design/TestRunner Design.graffle/image9.png +0 -0
  721. data/sproutcore/design/greenhouse-statechart.graffle +9025 -0
  722. data/sproutcore/design/greenhouse-statechart.pdf +0 -0
  723. data/sproutcore/design/iphone-webapp-loading.psd +0 -0
  724. data/sproutcore/frameworks/animation/Buildfile +3 -0
  725. data/sproutcore/frameworks/animation/LICENSE +25 -0
  726. data/sproutcore/frameworks/animation/README.md +79 -0
  727. data/sproutcore/frameworks/animation/core.js +1206 -0
  728. data/sproutcore/frameworks/animation/tests/core.js +152 -0
  729. data/sproutcore/frameworks/bootstrap/README +9 -0
  730. data/sproutcore/frameworks/bootstrap/core.js +7 -0
  731. data/sproutcore/frameworks/bootstrap/setup_body_class_names.js +10 -0
  732. data/sproutcore/frameworks/bootstrap/system/bench.js +14 -0
  733. data/sproutcore/frameworks/bootstrap/system/browser.js +65 -0
  734. data/sproutcore/frameworks/bootstrap/system/loader.js +50 -0
  735. data/sproutcore/frameworks/bootstrap/tests/system/browser.js +187 -0
  736. data/sproutcore/frameworks/core_foundation/.greenhouseconf +33 -0
  737. data/sproutcore/frameworks/core_foundation/controllers/array.js +498 -0
  738. data/sproutcore/frameworks/core_foundation/controllers/controller.js +44 -0
  739. data/sproutcore/frameworks/core_foundation/controllers/object.js +342 -0
  740. data/sproutcore/frameworks/core_foundation/core.js +201 -0
  741. data/sproutcore/frameworks/core_foundation/ext/object.js +83 -0
  742. data/sproutcore/frameworks/core_foundation/ext/run_loop.js +163 -0
  743. data/sproutcore/frameworks/core_foundation/mixins/delegate_support.js +110 -0
  744. data/sproutcore/frameworks/core_foundation/mixins/responder_context.js +269 -0
  745. data/sproutcore/frameworks/core_foundation/mixins/selection_support.js +250 -0
  746. data/sproutcore/frameworks/core_foundation/mixins/string.js +163 -0
  747. data/sproutcore/frameworks/core_foundation/panes/keyboard.js +68 -0
  748. data/sproutcore/frameworks/core_foundation/panes/layout.js +108 -0
  749. data/sproutcore/frameworks/core_foundation/panes/main.js +52 -0
  750. data/sproutcore/frameworks/core_foundation/panes/manipulation.js +27 -0
  751. data/sproutcore/frameworks/core_foundation/panes/pane.js +672 -0
  752. data/sproutcore/frameworks/core_foundation/panes/template.js +24 -0
  753. data/sproutcore/frameworks/core_foundation/panes/visibility.js +11 -0
  754. data/sproutcore/frameworks/core_foundation/protocols/observable_protocol.js +40 -0
  755. data/sproutcore/frameworks/core_foundation/protocols/sparse_array_delegate.js +131 -0
  756. data/sproutcore/frameworks/core_foundation/resources/core.css +371 -0
  757. data/sproutcore/frameworks/core_foundation/resources/view.css +57 -0
  758. data/sproutcore/frameworks/core_foundation/system/application.js +35 -0
  759. data/sproutcore/frameworks/core_foundation/system/browser.js +36 -0
  760. data/sproutcore/frameworks/core_foundation/system/builder.js +210 -0
  761. data/sproutcore/frameworks/core_foundation/system/core_query.js +141 -0
  762. data/sproutcore/frameworks/core_foundation/system/cursor.js +131 -0
  763. data/sproutcore/frameworks/core_foundation/system/device.js +210 -0
  764. data/sproutcore/frameworks/core_foundation/system/event.js +914 -0
  765. data/sproutcore/frameworks/core_foundation/system/json.js +515 -0
  766. data/sproutcore/frameworks/core_foundation/system/locale.js +293 -0
  767. data/sproutcore/frameworks/core_foundation/system/page.js +108 -0
  768. data/sproutcore/frameworks/core_foundation/system/platform.js +399 -0
  769. data/sproutcore/frameworks/core_foundation/system/ready.js +77 -0
  770. data/sproutcore/frameworks/core_foundation/system/render_context.js +1063 -0
  771. data/sproutcore/frameworks/core_foundation/system/responder.js +124 -0
  772. data/sproutcore/frameworks/core_foundation/system/root_responder.js +2173 -0
  773. data/sproutcore/frameworks/core_foundation/system/selection_set.js +695 -0
  774. data/sproutcore/frameworks/core_foundation/system/sparse_array.js +393 -0
  775. data/sproutcore/frameworks/core_foundation/system/theme.js +316 -0
  776. data/sproutcore/frameworks/core_foundation/system/timer.js +553 -0
  777. data/sproutcore/frameworks/core_foundation/system/utils.js +151 -0
  778. data/sproutcore/frameworks/core_foundation/system/utils/rect.js +98 -0
  779. data/sproutcore/frameworks/core_foundation/tests/controllers/array/array_case.js +218 -0
  780. data/sproutcore/frameworks/core_foundation/tests/controllers/array/enum_case.js +206 -0
  781. data/sproutcore/frameworks/core_foundation/tests/controllers/array/null_case.js +64 -0
  782. data/sproutcore/frameworks/core_foundation/tests/controllers/array/selection_support.js +344 -0
  783. data/sproutcore/frameworks/core_foundation/tests/controllers/array/single_case.js +136 -0
  784. data/sproutcore/frameworks/core_foundation/tests/controllers/object/empty_case.js +82 -0
  785. data/sproutcore/frameworks/core_foundation/tests/controllers/object/multiple_case.js +111 -0
  786. data/sproutcore/frameworks/core_foundation/tests/controllers/object/single_case.js +193 -0
  787. data/sproutcore/frameworks/core_foundation/tests/controllers/object/single_enumerable_case.js +265 -0
  788. data/sproutcore/frameworks/core_foundation/tests/mixins/responder_context.js +75 -0
  789. data/sproutcore/frameworks/core_foundation/tests/mixins/string.js +55 -0
  790. data/sproutcore/frameworks/core_foundation/tests/panes/template.js +14 -0
  791. data/sproutcore/frameworks/core_foundation/tests/system/builder.js +42 -0
  792. data/sproutcore/frameworks/core_foundation/tests/system/core_query/within.js +65 -0
  793. data/sproutcore/frameworks/core_foundation/tests/system/json.js +14 -0
  794. data/sproutcore/frameworks/core_foundation/tests/system/locale.js +134 -0
  795. data/sproutcore/frameworks/core_foundation/tests/system/ready/done.js +32 -0
  796. data/sproutcore/frameworks/core_foundation/tests/system/render_context/begin.js +47 -0
  797. data/sproutcore/frameworks/core_foundation/tests/system/render_context/element.js +44 -0
  798. data/sproutcore/frameworks/core_foundation/tests/system/render_context/end.js +124 -0
  799. data/sproutcore/frameworks/core_foundation/tests/system/render_context/get.js +51 -0
  800. data/sproutcore/frameworks/core_foundation/tests/system/render_context/helpers_attr.js +50 -0
  801. data/sproutcore/frameworks/core_foundation/tests/system/render_context/helpers_basic.js +28 -0
  802. data/sproutcore/frameworks/core_foundation/tests/system/render_context/helpers_className.js +177 -0
  803. data/sproutcore/frameworks/core_foundation/tests/system/render_context/helpers_style.js +109 -0
  804. data/sproutcore/frameworks/core_foundation/tests/system/render_context/init.js +55 -0
  805. data/sproutcore/frameworks/core_foundation/tests/system/render_context/join.js +28 -0
  806. data/sproutcore/frameworks/core_foundation/tests/system/render_context/push_text.js +74 -0
  807. data/sproutcore/frameworks/core_foundation/tests/system/render_context/tag.js +46 -0
  808. data/sproutcore/frameworks/core_foundation/tests/system/render_context/update.js +218 -0
  809. data/sproutcore/frameworks/core_foundation/tests/system/root_responder/makeKeyPane.js +124 -0
  810. data/sproutcore/frameworks/core_foundation/tests/system/root_responder/makeMainPane.js +68 -0
  811. data/sproutcore/frameworks/core_foundation/tests/system/root_responder/makeMenuPane.js +48 -0
  812. data/sproutcore/frameworks/core_foundation/tests/system/root_responder/root_responder.js +101 -0
  813. data/sproutcore/frameworks/core_foundation/tests/system/root_responder/targetForAction.js +288 -0
  814. data/sproutcore/frameworks/core_foundation/tests/system/selection_set/add.js +92 -0
  815. data/sproutcore/frameworks/core_foundation/tests/system/selection_set/copy.js +17 -0
  816. data/sproutcore/frameworks/core_foundation/tests/system/selection_set/indexSetForSource.js +98 -0
  817. data/sproutcore/frameworks/core_foundation/tests/system/selection_set/isEqual.js +60 -0
  818. data/sproutcore/frameworks/core_foundation/tests/system/selection_set/remove.js +111 -0
  819. data/sproutcore/frameworks/core_foundation/tests/system/sparse_array.js +194 -0
  820. data/sproutcore/frameworks/core_foundation/tests/system/theme.js +77 -0
  821. data/sproutcore/frameworks/core_foundation/tests/system/timer/invalidate.js +38 -0
  822. data/sproutcore/frameworks/core_foundation/tests/system/timer/invokeLater.js +203 -0
  823. data/sproutcore/frameworks/core_foundation/tests/system/timer/isPaused.js +71 -0
  824. data/sproutcore/frameworks/core_foundation/tests/system/timer/performAction.js +69 -0
  825. data/sproutcore/frameworks/core_foundation/tests/system/timer/schedule.js +170 -0
  826. data/sproutcore/frameworks/core_foundation/tests/system/utils/normalizeURL.js +18 -0
  827. data/sproutcore/frameworks/core_foundation/tests/system/utils/offset.js +271 -0
  828. data/sproutcore/frameworks/core_foundation/tests/system/utils/rect.js +99 -0
  829. data/sproutcore/frameworks/core_foundation/tests/views/main_pane.js +43 -0
  830. data/sproutcore/frameworks/core_foundation/tests/views/pane/append_remove.js +218 -0
  831. data/sproutcore/frameworks/core_foundation/tests/views/pane/child_view.js +20 -0
  832. data/sproutcore/frameworks/core_foundation/tests/views/pane/firstResponder.js +148 -0
  833. data/sproutcore/frameworks/core_foundation/tests/views/pane/keyPane.js +133 -0
  834. data/sproutcore/frameworks/core_foundation/tests/views/pane/layout.js +31 -0
  835. data/sproutcore/frameworks/core_foundation/tests/views/pane/sendEvent.js +206 -0
  836. data/sproutcore/frameworks/core_foundation/tests/views/template/checkbox_support.js +32 -0
  837. data/sproutcore/frameworks/core_foundation/tests/views/template/text_field_support.js +73 -0
  838. data/sproutcore/frameworks/core_foundation/tests/views/template_view/collection.js +111 -0
  839. data/sproutcore/frameworks/core_foundation/tests/views/template_view/core.js +100 -0
  840. data/sproutcore/frameworks/core_foundation/tests/views/template_view/handlebars.js +580 -0
  841. data/sproutcore/frameworks/core_foundation/tests/views/view/animation.js +376 -0
  842. data/sproutcore/frameworks/core_foundation/tests/views/view/build.js +85 -0
  843. data/sproutcore/frameworks/core_foundation/tests/views/view/build_children.js +89 -0
  844. data/sproutcore/frameworks/core_foundation/tests/views/view/clippingFrame.js +117 -0
  845. data/sproutcore/frameworks/core_foundation/tests/views/view/convertFrames.js +248 -0
  846. data/sproutcore/frameworks/core_foundation/tests/views/view/convertLayouts.js +145 -0
  847. data/sproutcore/frameworks/core_foundation/tests/views/view/createChildViews.js +132 -0
  848. data/sproutcore/frameworks/core_foundation/tests/views/view/createLayer.js +97 -0
  849. data/sproutcore/frameworks/core_foundation/tests/views/view/destroyLayer.js +83 -0
  850. data/sproutcore/frameworks/core_foundation/tests/views/view/didAppendToDocument.js +51 -0
  851. data/sproutcore/frameworks/core_foundation/tests/views/view/findLayerInParentLayer.js +50 -0
  852. data/sproutcore/frameworks/core_foundation/tests/views/view/init.js +50 -0
  853. data/sproutcore/frameworks/core_foundation/tests/views/view/insertBefore.js +217 -0
  854. data/sproutcore/frameworks/core_foundation/tests/views/view/isVisible.js +79 -0
  855. data/sproutcore/frameworks/core_foundation/tests/views/view/isVisibleInWindow.js +116 -0
  856. data/sproutcore/frameworks/core_foundation/tests/views/view/keyboard.js +22 -0
  857. data/sproutcore/frameworks/core_foundation/tests/views/view/layer.js +150 -0
  858. data/sproutcore/frameworks/core_foundation/tests/views/view/layoutChildViews.js +162 -0
  859. data/sproutcore/frameworks/core_foundation/tests/views/view/layoutDidChange.js +180 -0
  860. data/sproutcore/frameworks/core_foundation/tests/views/view/layoutStyle.js +735 -0
  861. data/sproutcore/frameworks/core_foundation/tests/views/view/parentViewDidChange.js +67 -0
  862. data/sproutcore/frameworks/core_foundation/tests/views/view/prepareContext.js +203 -0
  863. data/sproutcore/frameworks/core_foundation/tests/views/view/removeChild.js +189 -0
  864. data/sproutcore/frameworks/core_foundation/tests/views/view/render.js +125 -0
  865. data/sproutcore/frameworks/core_foundation/tests/views/view/render_delegate_support.js +163 -0
  866. data/sproutcore/frameworks/core_foundation/tests/views/view/replaceChild.js +29 -0
  867. data/sproutcore/frameworks/core_foundation/tests/views/view/static_layout.js +21 -0
  868. data/sproutcore/frameworks/core_foundation/tests/views/view/theme.js +43 -0
  869. data/sproutcore/frameworks/core_foundation/tests/views/view/updateLayer.js +148 -0
  870. data/sproutcore/frameworks/core_foundation/tests/views/view/updateLayerLocation.js +213 -0
  871. data/sproutcore/frameworks/core_foundation/tests/views/view/view.js +64 -0
  872. data/sproutcore/frameworks/core_foundation/tests/views/view/viewDidResize.js +202 -0
  873. data/sproutcore/frameworks/core_foundation/views/template.js +77 -0
  874. data/sproutcore/frameworks/core_foundation/views/template/checkbox_support.js +20 -0
  875. data/sproutcore/frameworks/core_foundation/views/template/collection.js +106 -0
  876. data/sproutcore/frameworks/core_foundation/views/template/text_field_support.js +35 -0
  877. data/sproutcore/frameworks/core_foundation/views/view.js +1458 -0
  878. data/sproutcore/frameworks/core_foundation/views/view/animation.js +181 -0
  879. data/sproutcore/frameworks/core_foundation/views/view/base.js +1 -0
  880. data/sproutcore/frameworks/core_foundation/views/view/cursor.js +48 -0
  881. data/sproutcore/frameworks/core_foundation/views/view/enabled.js +57 -0
  882. data/sproutcore/frameworks/core_foundation/views/view/keyboard.js +223 -0
  883. data/sproutcore/frameworks/core_foundation/views/view/layout.js +1087 -0
  884. data/sproutcore/frameworks/core_foundation/views/view/layout_style.js +618 -0
  885. data/sproutcore/frameworks/core_foundation/views/view/manipulation.js +426 -0
  886. data/sproutcore/frameworks/core_foundation/views/view/theming.js +362 -0
  887. data/sproutcore/frameworks/core_foundation/views/view/touch.js +67 -0
  888. data/sproutcore/frameworks/core_foundation/views/view/visibility.js +118 -0
  889. data/sproutcore/frameworks/core_tools/core.js +20 -0
  890. data/sproutcore/frameworks/core_tools/data_source.js +99 -0
  891. data/sproutcore/frameworks/core_tools/english.lproj/strings.js +15 -0
  892. data/sproutcore/frameworks/core_tools/fixtures/target.js +87 -0
  893. data/sproutcore/frameworks/core_tools/fixtures/test.js +44 -0
  894. data/sproutcore/frameworks/core_tools/models/target.js +108 -0
  895. data/sproutcore/frameworks/core_tools/models/test.js +48 -0
  896. data/sproutcore/frameworks/datastore/core.js +8 -0
  897. data/sproutcore/frameworks/datastore/data_sources/cascade.js +180 -0
  898. data/sproutcore/frameworks/datastore/data_sources/data_source.js +583 -0
  899. data/sproutcore/frameworks/datastore/data_sources/fixtures.js +393 -0
  900. data/sproutcore/frameworks/datastore/debug/json.js +71 -0
  901. data/sproutcore/frameworks/datastore/debug/standard_setup.js +96 -0
  902. data/sproutcore/frameworks/datastore/fixtures/author_fixtures.js +2503 -0
  903. data/sproutcore/frameworks/datastore/fixtures/sample.js +17 -0
  904. data/sproutcore/frameworks/datastore/models/child_attribute.js +96 -0
  905. data/sproutcore/frameworks/datastore/models/children_attribute.js +75 -0
  906. data/sproutcore/frameworks/datastore/models/fetched_attribute.js +100 -0
  907. data/sproutcore/frameworks/datastore/models/many_attribute.js +154 -0
  908. data/sproutcore/frameworks/datastore/models/record.js +1318 -0
  909. data/sproutcore/frameworks/datastore/models/record_attribute.js +567 -0
  910. data/sproutcore/frameworks/datastore/models/single_attribute.js +159 -0
  911. data/sproutcore/frameworks/datastore/system/child_array.js +222 -0
  912. data/sproutcore/frameworks/datastore/system/many_array.js +418 -0
  913. data/sproutcore/frameworks/datastore/system/nested_store.js +609 -0
  914. data/sproutcore/frameworks/datastore/system/query.js +1599 -0
  915. data/sproutcore/frameworks/datastore/system/record_array.js +710 -0
  916. data/sproutcore/frameworks/datastore/system/store.js +2860 -0
  917. data/sproutcore/frameworks/datastore/tests/data_sources/cascade.js +133 -0
  918. data/sproutcore/frameworks/datastore/tests/data_sources/fixtures.js +122 -0
  919. data/sproutcore/frameworks/datastore/tests/integration/contact_model.js +131 -0
  920. data/sproutcore/frameworks/datastore/tests/integration/cyclical_relationship.js +119 -0
  921. data/sproutcore/frameworks/datastore/tests/integration/mail_model.js +91 -0
  922. data/sproutcore/frameworks/datastore/tests/integration/test_runner_model.js +56 -0
  923. data/sproutcore/frameworks/datastore/tests/models/datetime_recordattribute.js +73 -0
  924. data/sproutcore/frameworks/datastore/tests/models/many_attribute.js +423 -0
  925. data/sproutcore/frameworks/datastore/tests/models/nested_records/data_store.js +180 -0
  926. data/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record.js +309 -0
  927. data/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array.js +363 -0
  928. data/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_array_complex.js +421 -0
  929. data/sproutcore/frameworks/datastore/tests/models/nested_records/nested_record_complex.js +304 -0
  930. data/sproutcore/frameworks/datastore/tests/models/record/core_methods.js +55 -0
  931. data/sproutcore/frameworks/datastore/tests/models/record/destroy.js +92 -0
  932. data/sproutcore/frameworks/datastore/tests/models/record/error_methods.js +56 -0
  933. data/sproutcore/frameworks/datastore/tests/models/record/normalize.js +336 -0
  934. data/sproutcore/frameworks/datastore/tests/models/record/readAttribute.js +53 -0
  935. data/sproutcore/frameworks/datastore/tests/models/record/refresh.js +48 -0
  936. data/sproutcore/frameworks/datastore/tests/models/record/storeDidChangeProperties.js +170 -0
  937. data/sproutcore/frameworks/datastore/tests/models/record/unknownProperty.js +66 -0
  938. data/sproutcore/frameworks/datastore/tests/models/record/writeAttribute.js +112 -0
  939. data/sproutcore/frameworks/datastore/tests/models/record_attribute.js +252 -0
  940. data/sproutcore/frameworks/datastore/tests/models/single_attribute.js +284 -0
  941. data/sproutcore/frameworks/datastore/tests/system/many_array/core_methods.js +204 -0
  942. data/sproutcore/frameworks/datastore/tests/system/nested_store/chain.js +180 -0
  943. data/sproutcore/frameworks/datastore/tests/system/nested_store/commitChanges.js +173 -0
  944. data/sproutcore/frameworks/datastore/tests/system/nested_store/commitChangesFromNestedStore.js +158 -0
  945. data/sproutcore/frameworks/datastore/tests/system/nested_store/core_methods.js +70 -0
  946. data/sproutcore/frameworks/datastore/tests/system/nested_store/dataHashDidChange.js +113 -0
  947. data/sproutcore/frameworks/datastore/tests/system/nested_store/discardChanges.js +102 -0
  948. data/sproutcore/frameworks/datastore/tests/system/nested_store/readDataHash.js +180 -0
  949. data/sproutcore/frameworks/datastore/tests/system/nested_store/readEditableDataHash.js +126 -0
  950. data/sproutcore/frameworks/datastore/tests/system/nested_store/removeDataHash.js +163 -0
  951. data/sproutcore/frameworks/datastore/tests/system/nested_store/writeDataHash.js +166 -0
  952. data/sproutcore/frameworks/datastore/tests/system/query/builders.js +219 -0
  953. data/sproutcore/frameworks/datastore/tests/system/query/compare.js +144 -0
  954. data/sproutcore/frameworks/datastore/tests/system/query/contains.js +131 -0
  955. data/sproutcore/frameworks/datastore/tests/system/query/containsRecordTypes.js +81 -0
  956. data/sproutcore/frameworks/datastore/tests/system/query/copy.js +30 -0
  957. data/sproutcore/frameworks/datastore/tests/system/query/evaluation.js +197 -0
  958. data/sproutcore/frameworks/datastore/tests/system/query/evaluation_of_records.js +92 -0
  959. data/sproutcore/frameworks/datastore/tests/system/query/expandedRecordTypes.js +64 -0
  960. data/sproutcore/frameworks/datastore/tests/system/query/parse.js +216 -0
  961. data/sproutcore/frameworks/datastore/tests/system/query/queryWithScope.js +57 -0
  962. data/sproutcore/frameworks/datastore/tests/system/query/record_type_is.js +47 -0
  963. data/sproutcore/frameworks/datastore/tests/system/query/registered_comparisons.js +70 -0
  964. data/sproutcore/frameworks/datastore/tests/system/query/registered_query_extensions.js +71 -0
  965. data/sproutcore/frameworks/datastore/tests/system/record_array/core_methods.js +177 -0
  966. data/sproutcore/frameworks/datastore/tests/system/record_array/error_methods.js +50 -0
  967. data/sproutcore/frameworks/datastore/tests/system/record_array/flush.js +214 -0
  968. data/sproutcore/frameworks/datastore/tests/system/store/cancelRecord.js +54 -0
  969. data/sproutcore/frameworks/datastore/tests/system/store/commitChangesFromNestedStore.js +137 -0
  970. data/sproutcore/frameworks/datastore/tests/system/store/commitRecord.js +221 -0
  971. data/sproutcore/frameworks/datastore/tests/system/store/core_methods.js +156 -0
  972. data/sproutcore/frameworks/datastore/tests/system/store/createRecord.js +76 -0
  973. data/sproutcore/frameworks/datastore/tests/system/store/dataHashDidChange.js +157 -0
  974. data/sproutcore/frameworks/datastore/tests/system/store/dataSourceCallbacks.js +278 -0
  975. data/sproutcore/frameworks/datastore/tests/system/store/destroyRecord.js +110 -0
  976. data/sproutcore/frameworks/datastore/tests/system/store/error_methods.js +62 -0
  977. data/sproutcore/frameworks/datastore/tests/system/store/find.js +530 -0
  978. data/sproutcore/frameworks/datastore/tests/system/store/init.js +23 -0
  979. data/sproutcore/frameworks/datastore/tests/system/store/loadRecord.js +64 -0
  980. data/sproutcore/frameworks/datastore/tests/system/store/pushChanges.js +61 -0
  981. data/sproutcore/frameworks/datastore/tests/system/store/readDataHash.js +74 -0
  982. data/sproutcore/frameworks/datastore/tests/system/store/readEditableDataHash.js +74 -0
  983. data/sproutcore/frameworks/datastore/tests/system/store/recordDidChange.js +76 -0
  984. data/sproutcore/frameworks/datastore/tests/system/store/removeDataHash.js +144 -0
  985. data/sproutcore/frameworks/datastore/tests/system/store/retrieveRecord.js +200 -0
  986. data/sproutcore/frameworks/datastore/tests/system/store/unloadRecords.js +41 -0
  987. data/sproutcore/frameworks/datastore/tests/system/store/writeDataHash.js +125 -0
  988. data/sproutcore/frameworks/datetime/resources/strings.js +14 -0
  989. data/sproutcore/frameworks/datetime/system/datetime.js +1111 -0
  990. data/sproutcore/frameworks/datetime/tests/system/datetime.js +383 -0
  991. data/sproutcore/frameworks/debug/core.js +114 -0
  992. data/sproutcore/frameworks/debug/invoke_once_last_debugging.js +259 -0
  993. data/sproutcore/frameworks/designer/coders/design.js +20 -0
  994. data/sproutcore/frameworks/designer/coders/object.js +347 -0
  995. data/sproutcore/frameworks/designer/controllers/controllers.js +16 -0
  996. data/sproutcore/frameworks/designer/controllers/design.js +37 -0
  997. data/sproutcore/frameworks/designer/controllers/designs.js +133 -0
  998. data/sproutcore/frameworks/designer/controllers/page_design.js +170 -0
  999. data/sproutcore/frameworks/designer/controllers/page_files.js +22 -0
  1000. data/sproutcore/frameworks/designer/core.js +26 -0
  1001. data/sproutcore/frameworks/designer/css/css_rule.js +22 -0
  1002. data/sproutcore/frameworks/designer/css/css_style.js +29 -0
  1003. data/sproutcore/frameworks/designer/css/css_style_sheet.js +201 -0
  1004. data/sproutcore/frameworks/designer/designers/button.js +21 -0
  1005. data/sproutcore/frameworks/designer/designers/label.js +16 -0
  1006. data/sproutcore/frameworks/designer/designers/object_designer.js +296 -0
  1007. data/sproutcore/frameworks/designer/designers/tab.js +18 -0
  1008. data/sproutcore/frameworks/designer/designers/text_field.js +15 -0
  1009. data/sproutcore/frameworks/designer/designers/view_designer.js +1267 -0
  1010. data/sproutcore/frameworks/designer/english.lproj/css/designer.css +96 -0
  1011. data/sproutcore/frameworks/designer/english.lproj/design_page.js +55 -0
  1012. data/sproutcore/frameworks/designer/english.lproj/high_light.css +10 -0
  1013. data/sproutcore/frameworks/designer/english.lproj/images/controller.png +0 -0
  1014. data/sproutcore/frameworks/designer/english.lproj/images/dock-bg.png +0 -0
  1015. data/sproutcore/frameworks/designer/english.lproj/images/dock-item-bg.png +0 -0
  1016. data/sproutcore/frameworks/designer/english.lproj/images/dock-item-divider.png +0 -0
  1017. data/sproutcore/frameworks/designer/english.lproj/images/dock-item-sel-bg.png +0 -0
  1018. data/sproutcore/frameworks/designer/english.lproj/images/dock-item-sel-divider.png +0 -0
  1019. data/sproutcore/frameworks/designer/english.lproj/images/main-bg.png +0 -0
  1020. data/sproutcore/frameworks/designer/english.lproj/images/page.png +0 -0
  1021. data/sproutcore/frameworks/designer/english.lproj/images/pane.png +0 -0
  1022. data/sproutcore/frameworks/designer/english.lproj/images/view.png +0 -0
  1023. data/sproutcore/frameworks/designer/english.lproj/selection_handles.css +58 -0
  1024. data/sproutcore/frameworks/designer/ext/binding.js +33 -0
  1025. data/sproutcore/frameworks/designer/ext/object.js +26 -0
  1026. data/sproutcore/frameworks/designer/ext/page.js +58 -0
  1027. data/sproutcore/frameworks/designer/ext/view.js +27 -0
  1028. data/sproutcore/frameworks/designer/mixins/button.js +11 -0
  1029. data/sproutcore/frameworks/designer/mixins/snap_lines.js +221 -0
  1030. data/sproutcore/frameworks/designer/tests/coders/page.js +54 -0
  1031. data/sproutcore/frameworks/designer/tests/designers/view_designer.js +47 -0
  1032. data/sproutcore/frameworks/designer/views/designer_drop_target.js +144 -0
  1033. data/sproutcore/frameworks/designer/views/drawing.js +219 -0
  1034. data/sproutcore/frameworks/designer/views/high_light.js +66 -0
  1035. data/sproutcore/frameworks/designer/views/page_item_view.js +130 -0
  1036. data/sproutcore/frameworks/designer/views/selection_handles.js +78 -0
  1037. data/sproutcore/frameworks/desktop/.greenhouseconf +218 -0
  1038. data/sproutcore/frameworks/desktop/core.js +18 -0
  1039. data/sproutcore/frameworks/desktop/debug/drag.js +41 -0
  1040. data/sproutcore/frameworks/desktop/english.lproj/alert.css +56 -0
  1041. data/sproutcore/frameworks/desktop/english.lproj/debug/a_sample_image.jpg +0 -0
  1042. data/sproutcore/frameworks/desktop/english.lproj/debug/apple-logo1.jpeg +0 -0
  1043. data/sproutcore/frameworks/desktop/english.lproj/debug/iframe.html +23 -0
  1044. data/sproutcore/frameworks/desktop/english.lproj/disclosure.css +74 -0
  1045. data/sproutcore/frameworks/desktop/english.lproj/drag.css +7 -0
  1046. data/sproutcore/frameworks/desktop/english.lproj/icons.css +943 -0
  1047. data/sproutcore/frameworks/desktop/english.lproj/images/cap.png +0 -0
  1048. data/sproutcore/frameworks/desktop/english.lproj/images/downbutton.png +0 -0
  1049. data/sproutcore/frameworks/desktop/english.lproj/images/icons/shared.png +0 -0
  1050. data/sproutcore/frameworks/desktop/english.lproj/images/thumb-bottom.png +0 -0
  1051. data/sproutcore/frameworks/desktop/english.lproj/images/thumb-center.png +0 -0
  1052. data/sproutcore/frameworks/desktop/english.lproj/images/thumb-top.png +0 -0
  1053. data/sproutcore/frameworks/desktop/english.lproj/images/track.png +0 -0
  1054. data/sproutcore/frameworks/desktop/english.lproj/images/upbutton.png +0 -0
  1055. data/sproutcore/frameworks/desktop/english.lproj/list_item.css +185 -0
  1056. data/sproutcore/frameworks/desktop/english.lproj/menu.css +12 -0
  1057. data/sproutcore/frameworks/desktop/english.lproj/menu_item_view.css +109 -0
  1058. data/sproutcore/frameworks/desktop/english.lproj/modal.css +9 -0
  1059. data/sproutcore/frameworks/desktop/english.lproj/panel.css +91 -0
  1060. data/sproutcore/frameworks/desktop/english.lproj/picker.css +35 -0
  1061. data/sproutcore/frameworks/desktop/english.lproj/progress.css +33 -0
  1062. data/sproutcore/frameworks/desktop/english.lproj/radio.css +10 -0
  1063. data/sproutcore/frameworks/desktop/english.lproj/segmented.css +132 -0
  1064. data/sproutcore/frameworks/desktop/english.lproj/separator.css +19 -0
  1065. data/sproutcore/frameworks/desktop/english.lproj/slider.css +66 -0
  1066. data/sproutcore/frameworks/desktop/english.lproj/split.css +0 -0
  1067. data/sproutcore/frameworks/desktop/english.lproj/split_divider.css +6 -0
  1068. data/sproutcore/frameworks/desktop/english.lproj/strings.js +14 -0
  1069. data/sproutcore/frameworks/desktop/english.lproj/tab.css +7 -0
  1070. data/sproutcore/frameworks/desktop/english.lproj/toolbar.css +5 -0
  1071. data/sproutcore/frameworks/desktop/english.lproj/touch-scroller.css +196 -0
  1072. data/sproutcore/frameworks/desktop/english.lproj/well.css +71 -0
  1073. data/sproutcore/frameworks/desktop/mixins/border.js +151 -0
  1074. data/sproutcore/frameworks/desktop/mixins/collection_fast_path.js +694 -0
  1075. data/sproutcore/frameworks/desktop/mixins/collection_group.js +22 -0
  1076. data/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +95 -0
  1077. data/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +295 -0
  1078. data/sproutcore/frameworks/desktop/mixins/navigation_builder.js +130 -0
  1079. data/sproutcore/frameworks/desktop/mixins/scrollable.js +253 -0
  1080. data/sproutcore/frameworks/desktop/panes/alert.js +457 -0
  1081. data/sproutcore/frameworks/desktop/panes/menu.js +1141 -0
  1082. data/sproutcore/frameworks/desktop/panes/modal.js +71 -0
  1083. data/sproutcore/frameworks/desktop/panes/palette.js +74 -0
  1084. data/sproutcore/frameworks/desktop/panes/panel.js +207 -0
  1085. data/sproutcore/frameworks/desktop/panes/picker.js +796 -0
  1086. data/sproutcore/frameworks/desktop/panes/select_button.js +895 -0
  1087. data/sproutcore/frameworks/desktop/panes/sheet.js +214 -0
  1088. data/sproutcore/frameworks/desktop/protocols/drag_data_source.js +39 -0
  1089. data/sproutcore/frameworks/desktop/protocols/drag_source.js +81 -0
  1090. data/sproutcore/frameworks/desktop/protocols/drop_target.js +175 -0
  1091. data/sproutcore/frameworks/desktop/protocols/responder.js +299 -0
  1092. data/sproutcore/frameworks/desktop/render_delegates/button.js +105 -0
  1093. data/sproutcore/frameworks/desktop/render_delegates/checkbox.js +100 -0
  1094. data/sproutcore/frameworks/desktop/render_delegates/collection.js +24 -0
  1095. data/sproutcore/frameworks/desktop/render_delegates/disclosure.js +69 -0
  1096. data/sproutcore/frameworks/desktop/render_delegates/helpers/slicing.js +34 -0
  1097. data/sproutcore/frameworks/desktop/render_delegates/image_button.js +30 -0
  1098. data/sproutcore/frameworks/desktop/render_delegates/master_detail.js +28 -0
  1099. data/sproutcore/frameworks/desktop/render_delegates/menu.js +47 -0
  1100. data/sproutcore/frameworks/desktop/render_delegates/panel.js +28 -0
  1101. data/sproutcore/frameworks/desktop/render_delegates/picker.js +43 -0
  1102. data/sproutcore/frameworks/desktop/render_delegates/progress.js +187 -0
  1103. data/sproutcore/frameworks/desktop/render_delegates/radio.js +95 -0
  1104. data/sproutcore/frameworks/desktop/render_delegates/radio_group.js +109 -0
  1105. data/sproutcore/frameworks/desktop/render_delegates/segment.js +55 -0
  1106. data/sproutcore/frameworks/desktop/render_delegates/segmented.js +77 -0
  1107. data/sproutcore/frameworks/desktop/render_delegates/slider.js +58 -0
  1108. data/sproutcore/frameworks/desktop/render_delegates/source_list.js +8 -0
  1109. data/sproutcore/frameworks/desktop/render_delegates/toolbar.js +18 -0
  1110. data/sproutcore/frameworks/desktop/render_delegates/well.js +27 -0
  1111. data/sproutcore/frameworks/desktop/render_delegates/workspace.js +18 -0
  1112. data/sproutcore/frameworks/desktop/system/drag.js +974 -0
  1113. data/sproutcore/frameworks/desktop/system/key_bindings.js +40 -0
  1114. data/sproutcore/frameworks/desktop/system/undo_manager.js +187 -0
  1115. data/sproutcore/frameworks/desktop/tests/integration/dialog.js +48 -0
  1116. data/sproutcore/frameworks/desktop/tests/mixins/border.js +97 -0
  1117. data/sproutcore/frameworks/desktop/tests/panes/alert/methods.js +10 -0
  1118. data/sproutcore/frameworks/desktop/tests/panes/alert/ui.js +158 -0
  1119. data/sproutcore/frameworks/desktop/tests/panes/menu/methods.js +135 -0
  1120. data/sproutcore/frameworks/desktop/tests/panes/menu/ui.js +258 -0
  1121. data/sproutcore/frameworks/desktop/tests/panes/palette/methods.js +10 -0
  1122. data/sproutcore/frameworks/desktop/tests/panes/palette/ui.js +35 -0
  1123. data/sproutcore/frameworks/desktop/tests/panes/pane_page.js +41 -0
  1124. data/sproutcore/frameworks/desktop/tests/panes/panel/methods.js +10 -0
  1125. data/sproutcore/frameworks/desktop/tests/panes/panel/ui.js +83 -0
  1126. data/sproutcore/frameworks/desktop/tests/panes/picker/methods.js +10 -0
  1127. data/sproutcore/frameworks/desktop/tests/panes/picker/ui.js +92 -0
  1128. data/sproutcore/frameworks/desktop/tests/panes/select_button/methods.js +194 -0
  1129. data/sproutcore/frameworks/desktop/tests/panes/select_button/ui.js +220 -0
  1130. data/sproutcore/frameworks/desktop/tests/panes/sheet/methods.js +10 -0
  1131. data/sproutcore/frameworks/desktop/tests/panes/sheet/ui.js +44 -0
  1132. data/sproutcore/frameworks/desktop/tests/views/button/methods.js +166 -0
  1133. data/sproutcore/frameworks/desktop/tests/views/button/ui.js +236 -0
  1134. data/sproutcore/frameworks/desktop/tests/views/checkbox/methods.js +126 -0
  1135. data/sproutcore/frameworks/desktop/tests/views/checkbox/ui.js +124 -0
  1136. data/sproutcore/frameworks/desktop/tests/views/collection/content.js +249 -0
  1137. data/sproutcore/frameworks/desktop/tests/views/collection/deleteSelection.js +82 -0
  1138. data/sproutcore/frameworks/desktop/tests/views/collection/deselect.js +215 -0
  1139. data/sproutcore/frameworks/desktop/tests/views/collection/displayProperties.js +31 -0
  1140. data/sproutcore/frameworks/desktop/tests/views/collection/itemViewForContentIndex.js +300 -0
  1141. data/sproutcore/frameworks/desktop/tests/views/collection/layerIdFor.js +65 -0
  1142. data/sproutcore/frameworks/desktop/tests/views/collection/length.js +88 -0
  1143. data/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +240 -0
  1144. data/sproutcore/frameworks/desktop/tests/views/collection/nowShowing.js +121 -0
  1145. data/sproutcore/frameworks/desktop/tests/views/collection/reload.js +177 -0
  1146. data/sproutcore/frameworks/desktop/tests/views/collection/select.js +240 -0
  1147. data/sproutcore/frameworks/desktop/tests/views/collection/selectNextItem.js +205 -0
  1148. data/sproutcore/frameworks/desktop/tests/views/collection/selectPreviousItem.js +211 -0
  1149. data/sproutcore/frameworks/desktop/tests/views/collection/selection.js +141 -0
  1150. data/sproutcore/frameworks/desktop/tests/views/collection/ui_diagram.js +188 -0
  1151. data/sproutcore/frameworks/desktop/tests/views/date_field/methods.js +76 -0
  1152. data/sproutcore/frameworks/desktop/tests/views/date_field/ui.js +456 -0
  1153. data/sproutcore/frameworks/desktop/tests/views/disclosure/methods.js +10 -0
  1154. data/sproutcore/frameworks/desktop/tests/views/disclosure/ui.js +104 -0
  1155. data/sproutcore/frameworks/desktop/tests/views/grid/methods.js +10 -0
  1156. data/sproutcore/frameworks/desktop/tests/views/grid/ui.js +10 -0
  1157. data/sproutcore/frameworks/desktop/tests/views/image_button/ui.js +25 -0
  1158. data/sproutcore/frameworks/desktop/tests/views/list/render.js +92 -0
  1159. data/sproutcore/frameworks/desktop/tests/views/list/rowDelegate.js +183 -0
  1160. data/sproutcore/frameworks/desktop/tests/views/list/rowHeightForContentIndex.js +133 -0
  1161. data/sproutcore/frameworks/desktop/tests/views/list/rowOffsetForContentIndex.js +131 -0
  1162. data/sproutcore/frameworks/desktop/tests/views/list/ui_alternatingrows.js +130 -0
  1163. data/sproutcore/frameworks/desktop/tests/views/list/ui_outline.js +56 -0
  1164. data/sproutcore/frameworks/desktop/tests/views/list/ui_row_heights.js +205 -0
  1165. data/sproutcore/frameworks/desktop/tests/views/list/ui_simple.js +127 -0
  1166. data/sproutcore/frameworks/desktop/tests/views/list_item.js +396 -0
  1167. data/sproutcore/frameworks/desktop/tests/views/menu_item/methods.js +10 -0
  1168. data/sproutcore/frameworks/desktop/tests/views/menu_item/ui.js +46 -0
  1169. data/sproutcore/frameworks/desktop/tests/views/progress/methods.js +128 -0
  1170. data/sproutcore/frameworks/desktop/tests/views/progress/ui.js +421 -0
  1171. data/sproutcore/frameworks/desktop/tests/views/radio/methods.js +119 -0
  1172. data/sproutcore/frameworks/desktop/tests/views/radio/ui.js +349 -0
  1173. data/sproutcore/frameworks/desktop/tests/views/scroll/methods.js +143 -0
  1174. data/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +162 -0
  1175. data/sproutcore/frameworks/desktop/tests/views/scroller.js +118 -0
  1176. data/sproutcore/frameworks/desktop/tests/views/segmented/methods.js +108 -0
  1177. data/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +457 -0
  1178. data/sproutcore/frameworks/desktop/tests/views/select/methods.js +144 -0
  1179. data/sproutcore/frameworks/desktop/tests/views/select/ui.js +224 -0
  1180. data/sproutcore/frameworks/desktop/tests/views/select_field/methods.js +163 -0
  1181. data/sproutcore/frameworks/desktop/tests/views/select_field/ui.js +117 -0
  1182. data/sproutcore/frameworks/desktop/tests/views/separator.js +44 -0
  1183. data/sproutcore/frameworks/desktop/tests/views/source_list/methods.js +10 -0
  1184. data/sproutcore/frameworks/desktop/tests/views/source_list/ui.js +10 -0
  1185. data/sproutcore/frameworks/desktop/tests/views/split/methods.js +60 -0
  1186. data/sproutcore/frameworks/desktop/tests/views/split/ui.js +59 -0
  1187. data/sproutcore/frameworks/desktop/tests/views/stacked/ui_comments.js +238 -0
  1188. data/sproutcore/frameworks/desktop/tests/views/static_content.js +46 -0
  1189. data/sproutcore/frameworks/desktop/tests/views/tab/methods.js +54 -0
  1190. data/sproutcore/frameworks/desktop/tests/views/tab/ui.js +92 -0
  1191. data/sproutcore/frameworks/desktop/tests/views/toolbar/method.js +33 -0
  1192. data/sproutcore/frameworks/desktop/tests/views/toolbar/ui.js +29 -0
  1193. data/sproutcore/frameworks/desktop/tests/views/web/methods.js +10 -0
  1194. data/sproutcore/frameworks/desktop/tests/views/web/ui.js +110 -0
  1195. data/sproutcore/frameworks/desktop/tests/views/well/ui.js +54 -0
  1196. data/sproutcore/frameworks/desktop/views/button.js +564 -0
  1197. data/sproutcore/frameworks/desktop/views/checkbox.js +110 -0
  1198. data/sproutcore/frameworks/desktop/views/collection.js +3090 -0
  1199. data/sproutcore/frameworks/desktop/views/date_field.js +319 -0
  1200. data/sproutcore/frameworks/desktop/views/disclosure.js +68 -0
  1201. data/sproutcore/frameworks/desktop/views/file.js +112 -0
  1202. data/sproutcore/frameworks/desktop/views/grid.js +207 -0
  1203. data/sproutcore/frameworks/desktop/views/image_button.js +74 -0
  1204. data/sproutcore/frameworks/desktop/views/list.js +637 -0
  1205. data/sproutcore/frameworks/desktop/views/list_item.js +923 -0
  1206. data/sproutcore/frameworks/desktop/views/master_detail.js +257 -0
  1207. data/sproutcore/frameworks/desktop/views/menu_item.js +704 -0
  1208. data/sproutcore/frameworks/desktop/views/menu_scroll.js +615 -0
  1209. data/sproutcore/frameworks/desktop/views/navigation.js +237 -0
  1210. data/sproutcore/frameworks/desktop/views/navigation_bar.js +181 -0
  1211. data/sproutcore/frameworks/desktop/views/popup_button.js +299 -0
  1212. data/sproutcore/frameworks/desktop/views/progress.js +197 -0
  1213. data/sproutcore/frameworks/desktop/views/radio.js +347 -0
  1214. data/sproutcore/frameworks/desktop/views/scene.js +204 -0
  1215. data/sproutcore/frameworks/desktop/views/scroll.js +1824 -0
  1216. data/sproutcore/frameworks/desktop/views/scroller.js +917 -0
  1217. data/sproutcore/frameworks/desktop/views/segment.js +104 -0
  1218. data/sproutcore/frameworks/desktop/views/segmented.js +1002 -0
  1219. data/sproutcore/frameworks/desktop/views/select.js +809 -0
  1220. data/sproutcore/frameworks/desktop/views/select_field.js +344 -0
  1221. data/sproutcore/frameworks/desktop/views/separator.js +36 -0
  1222. data/sproutcore/frameworks/desktop/views/slider.js +291 -0
  1223. data/sproutcore/frameworks/desktop/views/source_list.js +49 -0
  1224. data/sproutcore/frameworks/desktop/views/source_list_group.js +169 -0
  1225. data/sproutcore/frameworks/desktop/views/split.js +891 -0
  1226. data/sproutcore/frameworks/desktop/views/split_divider.js +52 -0
  1227. data/sproutcore/frameworks/desktop/views/stacked.js +110 -0
  1228. data/sproutcore/frameworks/desktop/views/static_content.js +134 -0
  1229. data/sproutcore/frameworks/desktop/views/tab.js +186 -0
  1230. data/sproutcore/frameworks/desktop/views/thumb.js +53 -0
  1231. data/sproutcore/frameworks/desktop/views/toolbar.js +88 -0
  1232. data/sproutcore/frameworks/desktop/views/web.js +87 -0
  1233. data/sproutcore/frameworks/desktop/views/well.js +65 -0
  1234. data/sproutcore/frameworks/desktop/views/workspace.js +251 -0
  1235. data/sproutcore/frameworks/documentation/core.js +0 -0
  1236. data/sproutcore/frameworks/experimental/README.md +23 -0
  1237. data/sproutcore/frameworks/experimental/frameworks/device_motion/README.md +11 -0
  1238. data/sproutcore/frameworks/experimental/frameworks/device_motion/device.js +215 -0
  1239. data/sproutcore/frameworks/experimental/frameworks/device_motion/platform.js +67 -0
  1240. data/sproutcore/frameworks/experimental/frameworks/polymorphism/README.md +34 -0
  1241. data/sproutcore/frameworks/experimental/frameworks/polymorphism/models/polymorphic_single_attribute.js +183 -0
  1242. data/sproutcore/frameworks/experimental/frameworks/polymorphism/models/record.js +23 -0
  1243. data/sproutcore/frameworks/experimental/frameworks/polymorphism/tests/models/polymorphic/single.js +124 -0
  1244. data/sproutcore/frameworks/forms/english.lproj/default_styles.css +5 -0
  1245. data/sproutcore/frameworks/forms/english.lproj/strings.js +15 -0
  1246. data/sproutcore/frameworks/forms/mixins/edit_mode.js +43 -0
  1247. data/sproutcore/frameworks/forms/mixins/emptiness.js +95 -0
  1248. data/sproutcore/frameworks/forms/renderer_delegates/form.js +22 -0
  1249. data/sproutcore/frameworks/forms/renderer_delegates/form_row.js +21 -0
  1250. data/sproutcore/frameworks/forms/tests/views/form.js +15 -0
  1251. data/sproutcore/frameworks/forms/tests/views/form_checkbox_field.js +15 -0
  1252. data/sproutcore/frameworks/forms/tests/views/form_field.js +15 -0
  1253. data/sproutcore/frameworks/forms/tests/views/form_label.js +15 -0
  1254. data/sproutcore/frameworks/forms/tests/views/form_radio_field.js +15 -0
  1255. data/sproutcore/frameworks/forms/tests/views/form_row.js +15 -0
  1256. data/sproutcore/frameworks/forms/tests/views/form_text_field.js +15 -0
  1257. data/sproutcore/frameworks/forms/views/form.js +282 -0
  1258. data/sproutcore/frameworks/forms/views/form_row.js +183 -0
  1259. data/sproutcore/frameworks/foundation/.greenhouseconf +35 -0
  1260. data/sproutcore/frameworks/foundation/TESTING +46 -0
  1261. data/sproutcore/frameworks/foundation/controllers/tree.js +127 -0
  1262. data/sproutcore/frameworks/foundation/core.js +0 -0
  1263. data/sproutcore/frameworks/foundation/debug/control_test_pane.js +191 -0
  1264. data/sproutcore/frameworks/foundation/english.lproj/benchmark.css +146 -0
  1265. data/sproutcore/frameworks/foundation/english.lproj/blank.gif +0 -0
  1266. data/sproutcore/frameworks/foundation/english.lproj/bootstrap.rhtml +67 -0
  1267. data/sproutcore/frameworks/foundation/english.lproj/button_view.css +40 -0
  1268. data/sproutcore/frameworks/foundation/english.lproj/debug/control-test-pane.css +9 -0
  1269. data/sproutcore/frameworks/foundation/english.lproj/images/favicon.ico +0 -0
  1270. data/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-logo.png +0 -0
  1271. data/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-startup-landscape.jpg +0 -0
  1272. data/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-startup-landscape.png +0 -0
  1273. data/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-startup-portrait.jpg +0 -0
  1274. data/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-startup-portrait.png +0 -0
  1275. data/sproutcore/frameworks/foundation/english.lproj/images/sproutcore-startup.png +0 -0
  1276. data/sproutcore/frameworks/foundation/english.lproj/images/sproutcore.png +0 -0
  1277. data/sproutcore/frameworks/foundation/english.lproj/inline_editor.css +12 -0
  1278. data/sproutcore/frameworks/foundation/english.lproj/label.css +47 -0
  1279. data/sproutcore/frameworks/foundation/english.lproj/static_layout.css +5 -0
  1280. data/sproutcore/frameworks/foundation/english.lproj/text_field.css +146 -0
  1281. data/sproutcore/frameworks/foundation/fixtures/file_exists.json +1 -0
  1282. data/sproutcore/frameworks/foundation/fixtures/malformed.json +11 -0
  1283. data/sproutcore/frameworks/foundation/gestures/pinch.js +81 -0
  1284. data/sproutcore/frameworks/foundation/gestures/swipe.js +144 -0
  1285. data/sproutcore/frameworks/foundation/gestures/tap.js +113 -0
  1286. data/sproutcore/frameworks/foundation/license.js +28 -0
  1287. data/sproutcore/frameworks/foundation/mixins/auto_mixin.js +39 -0
  1288. data/sproutcore/frameworks/foundation/mixins/auto_resize.js +233 -0
  1289. data/sproutcore/frameworks/foundation/mixins/button.js +360 -0
  1290. data/sproutcore/frameworks/foundation/mixins/collection_content.js +178 -0
  1291. data/sproutcore/frameworks/foundation/mixins/content_display.js +114 -0
  1292. data/sproutcore/frameworks/foundation/mixins/control.js +422 -0
  1293. data/sproutcore/frameworks/foundation/mixins/editable.js +158 -0
  1294. data/sproutcore/frameworks/foundation/mixins/flowed_layout.js +628 -0
  1295. data/sproutcore/frameworks/foundation/mixins/gestureable.js +214 -0
  1296. data/sproutcore/frameworks/foundation/mixins/inline_editable.js +89 -0
  1297. data/sproutcore/frameworks/foundation/mixins/inline_editor_delegate.js +139 -0
  1298. data/sproutcore/frameworks/foundation/mixins/inline_text_field.js +589 -0
  1299. data/sproutcore/frameworks/foundation/mixins/inner_frame.js +184 -0
  1300. data/sproutcore/frameworks/foundation/mixins/static_layout.js +77 -0
  1301. data/sproutcore/frameworks/foundation/mixins/string.js +391 -0
  1302. data/sproutcore/frameworks/foundation/mixins/tree_item_content.js +160 -0
  1303. data/sproutcore/frameworks/foundation/mixins/validatable.js +189 -0
  1304. data/sproutcore/frameworks/foundation/private/tree_item_observer.js +914 -0
  1305. data/sproutcore/frameworks/foundation/render_delegates/canvas_image.js +110 -0
  1306. data/sproutcore/frameworks/foundation/render_delegates/container.js +18 -0
  1307. data/sproutcore/frameworks/foundation/render_delegates/image.js +97 -0
  1308. data/sproutcore/frameworks/foundation/render_delegates/label.js +139 -0
  1309. data/sproutcore/frameworks/foundation/render_delegates/render_delegate.js +17 -0
  1310. data/sproutcore/frameworks/foundation/system/benchmark.js +718 -0
  1311. data/sproutcore/frameworks/foundation/system/chance.js +64 -0
  1312. data/sproutcore/frameworks/foundation/system/cookie.js +171 -0
  1313. data/sproutcore/frameworks/foundation/system/core_query.js +56 -0
  1314. data/sproutcore/frameworks/foundation/system/exception_handler.js +88 -0
  1315. data/sproutcore/frameworks/foundation/system/gesture.js +363 -0
  1316. data/sproutcore/frameworks/foundation/system/image_queue.js +433 -0
  1317. data/sproutcore/frameworks/foundation/system/math.js +57 -0
  1318. data/sproutcore/frameworks/foundation/system/module.js +583 -0
  1319. data/sproutcore/frameworks/foundation/system/request.js +596 -0
  1320. data/sproutcore/frameworks/foundation/system/response.js +550 -0
  1321. data/sproutcore/frameworks/foundation/system/routes.js +519 -0
  1322. data/sproutcore/frameworks/foundation/system/staticqueue.js +53 -0
  1323. data/sproutcore/frameworks/foundation/system/task_queue.js +153 -0
  1324. data/sproutcore/frameworks/foundation/system/text_selection.js +103 -0
  1325. data/sproutcore/frameworks/foundation/system/time.js +473 -0
  1326. data/sproutcore/frameworks/foundation/system/user_defaults.js +392 -0
  1327. data/sproutcore/frameworks/foundation/system/utils/colors.js +80 -0
  1328. data/sproutcore/frameworks/foundation/system/utils/misc.js +137 -0
  1329. data/sproutcore/frameworks/foundation/system/utils/range.js +64 -0
  1330. data/sproutcore/frameworks/foundation/system/utils/string_measurement.js +247 -0
  1331. data/sproutcore/frameworks/foundation/tasks/preload_bundle.js +41 -0
  1332. data/sproutcore/frameworks/foundation/tasks/task.js +17 -0
  1333. data/sproutcore/frameworks/foundation/tests/controllers/tree/outline_case.js +108 -0
  1334. data/sproutcore/frameworks/foundation/tests/controllers/tree/selection_support.js +340 -0
  1335. data/sproutcore/frameworks/foundation/tests/debug/control_test_pane/methods.js +10 -0
  1336. data/sproutcore/frameworks/foundation/tests/debug/control_test_pane/ui.js +113 -0
  1337. data/sproutcore/frameworks/foundation/tests/integration/creating_views.js +118 -0
  1338. data/sproutcore/frameworks/foundation/tests/mixins/button/content.js +195 -0
  1339. data/sproutcore/frameworks/foundation/tests/mixins/button/displayProperties.js +89 -0
  1340. data/sproutcore/frameworks/foundation/tests/mixins/button/keyEquivalents.js +57 -0
  1341. data/sproutcore/frameworks/foundation/tests/mixins/button/ui.js +69 -0
  1342. data/sproutcore/frameworks/foundation/tests/mixins/content_display.js +51 -0
  1343. data/sproutcore/frameworks/foundation/tests/mixins/control/content.js +168 -0
  1344. data/sproutcore/frameworks/foundation/tests/mixins/control/displayProperties.js +89 -0
  1345. data/sproutcore/frameworks/foundation/tests/mixins/editable/ui.js +44 -0
  1346. data/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/api.js +52 -0
  1347. data/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/beginEditing.js +238 -0
  1348. data/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/ui.js +64 -0
  1349. data/sproutcore/frameworks/foundation/tests/mixins/staticLayout.js +144 -0
  1350. data/sproutcore/frameworks/foundation/tests/mixins/string.js +28 -0
  1351. data/sproutcore/frameworks/foundation/tests/mixins/validatable/ui.js +74 -0
  1352. data/sproutcore/frameworks/foundation/tests/private/tree_item_observer/flat_case.js +325 -0
  1353. data/sproutcore/frameworks/foundation/tests/private/tree_item_observer/group_case.js +718 -0
  1354. data/sproutcore/frameworks/foundation/tests/private/tree_item_observer/outline_case.js +484 -0
  1355. data/sproutcore/frameworks/foundation/tests/system/cookie.js +179 -0
  1356. data/sproutcore/frameworks/foundation/tests/system/core_query/setClass.js +59 -0
  1357. data/sproutcore/frameworks/foundation/tests/system/math.js +39 -0
  1358. data/sproutcore/frameworks/foundation/tests/system/request.js +273 -0
  1359. data/sproutcore/frameworks/foundation/tests/system/routes.js +356 -0
  1360. data/sproutcore/frameworks/foundation/tests/system/task_queue.js +43 -0
  1361. data/sproutcore/frameworks/foundation/tests/system/user_defaults.js +24 -0
  1362. data/sproutcore/frameworks/foundation/tests/system/utils/pointInElement.js +235 -0
  1363. data/sproutcore/frameworks/foundation/tests/system/utils/range.js +62 -0
  1364. data/sproutcore/frameworks/foundation/tests/validators/credit_card.js +35 -0
  1365. data/sproutcore/frameworks/foundation/tests/validators/date.js +26 -0
  1366. data/sproutcore/frameworks/foundation/tests/validators/not_empty.js +56 -0
  1367. data/sproutcore/frameworks/foundation/tests/validators/number.js +47 -0
  1368. data/sproutcore/frameworks/foundation/tests/validators/password.js +13 -0
  1369. data/sproutcore/frameworks/foundation/tests/validators/validator.js +20 -0
  1370. data/sproutcore/frameworks/foundation/tests/views/container/methods.js +18 -0
  1371. data/sproutcore/frameworks/foundation/tests/views/container/ui.js +145 -0
  1372. data/sproutcore/frameworks/foundation/tests/views/image/ui.js +492 -0
  1373. data/sproutcore/frameworks/foundation/tests/views/label/ui.js +179 -0
  1374. data/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +87 -0
  1375. data/sproutcore/frameworks/foundation/tests/views/text_field/nextValidKeyView.js +110 -0
  1376. data/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +577 -0
  1377. data/sproutcore/frameworks/foundation/validators/credit_card.js +125 -0
  1378. data/sproutcore/frameworks/foundation/validators/date.js +52 -0
  1379. data/sproutcore/frameworks/foundation/validators/date_time.js +48 -0
  1380. data/sproutcore/frameworks/foundation/validators/email.js +45 -0
  1381. data/sproutcore/frameworks/foundation/validators/not_empty.js +37 -0
  1382. data/sproutcore/frameworks/foundation/validators/number.js +99 -0
  1383. data/sproutcore/frameworks/foundation/validators/password.js +86 -0
  1384. data/sproutcore/frameworks/foundation/validators/positive_integer.js +84 -0
  1385. data/sproutcore/frameworks/foundation/validators/validator.js +326 -0
  1386. data/sproutcore/frameworks/foundation/views/container.js +140 -0
  1387. data/sproutcore/frameworks/foundation/views/field.js +337 -0
  1388. data/sproutcore/frameworks/foundation/views/image.js +381 -0
  1389. data/sproutcore/frameworks/foundation/views/label.js +219 -0
  1390. data/sproutcore/frameworks/foundation/views/text_field.js +1073 -0
  1391. data/sproutcore/frameworks/handlebars/extensions.js +44 -0
  1392. data/sproutcore/frameworks/handlebars/extensions/bind.js +156 -0
  1393. data/sproutcore/frameworks/handlebars/extensions/collection.js +75 -0
  1394. data/sproutcore/frameworks/handlebars/extensions/localization.js +5 -0
  1395. data/sproutcore/frameworks/handlebars/extensions/view.js +115 -0
  1396. data/sproutcore/frameworks/handlebars/handlebars.js +1401 -0
  1397. data/sproutcore/frameworks/jquery/jquery-buffer.js +376 -0
  1398. data/sproutcore/frameworks/jquery/jquery-buffered.js +205 -0
  1399. data/sproutcore/frameworks/jquery/jquery-sc.js +7 -0
  1400. data/sproutcore/frameworks/jquery/jquery.js +7179 -0
  1401. data/sproutcore/frameworks/media/.greenhouseconf +29 -0
  1402. data/sproutcore/frameworks/media/resources/controls.png +0 -0
  1403. data/sproutcore/frameworks/media/resources/playeras3.fla +0 -0
  1404. data/sproutcore/frameworks/media/resources/video.css +124 -0
  1405. data/sproutcore/frameworks/media/resources/videoCanvas.swf +0 -0
  1406. data/sproutcore/frameworks/media/views/audio.js +741 -0
  1407. data/sproutcore/frameworks/media/views/controls.js +88 -0
  1408. data/sproutcore/frameworks/media/views/media_slider.js +243 -0
  1409. data/sproutcore/frameworks/media/views/mini_controls.js +63 -0
  1410. data/sproutcore/frameworks/media/views/simple_controls.js +54 -0
  1411. data/sproutcore/frameworks/media/views/video.js +832 -0
  1412. data/sproutcore/frameworks/mini/license.js +29 -0
  1413. data/sproutcore/frameworks/runtime/README +12 -0
  1414. data/sproutcore/frameworks/runtime/core.js +1102 -0
  1415. data/sproutcore/frameworks/runtime/debug/test_suites/array.js +14 -0
  1416. data/sproutcore/frameworks/runtime/debug/test_suites/array/base.js +397 -0
  1417. data/sproutcore/frameworks/runtime/debug/test_suites/array/indexOf.js +33 -0
  1418. data/sproutcore/frameworks/runtime/debug/test_suites/array/insertAt.js +121 -0
  1419. data/sproutcore/frameworks/runtime/debug/test_suites/array/objectAt.js +34 -0
  1420. data/sproutcore/frameworks/runtime/debug/test_suites/array/popObject.js +50 -0
  1421. data/sproutcore/frameworks/runtime/debug/test_suites/array/pushObject.js +46 -0
  1422. data/sproutcore/frameworks/runtime/debug/test_suites/array/rangeObserver.js +371 -0
  1423. data/sproutcore/frameworks/runtime/debug/test_suites/array/removeAt.js +100 -0
  1424. data/sproutcore/frameworks/runtime/debug/test_suites/array/removeObject.js +49 -0
  1425. data/sproutcore/frameworks/runtime/debug/test_suites/array/replace.js +94 -0
  1426. data/sproutcore/frameworks/runtime/debug/test_suites/array/shiftObject.js +50 -0
  1427. data/sproutcore/frameworks/runtime/debug/test_suites/array/unshiftObject.js +47 -0
  1428. data/sproutcore/frameworks/runtime/license.js +29 -0
  1429. data/sproutcore/frameworks/runtime/mixins/array.js +658 -0
  1430. data/sproutcore/frameworks/runtime/mixins/comparable.js +45 -0
  1431. data/sproutcore/frameworks/runtime/mixins/copyable.js +72 -0
  1432. data/sproutcore/frameworks/runtime/mixins/enumerable.js +1426 -0
  1433. data/sproutcore/frameworks/runtime/mixins/freezable.js +110 -0
  1434. data/sproutcore/frameworks/runtime/mixins/observable.js +1408 -0
  1435. data/sproutcore/frameworks/runtime/private/chain_observer.js +178 -0
  1436. data/sproutcore/frameworks/runtime/private/observer_queue.js +178 -0
  1437. data/sproutcore/frameworks/runtime/private/observer_set.js +123 -0
  1438. data/sproutcore/frameworks/runtime/system/binding.js +1000 -0
  1439. data/sproutcore/frameworks/runtime/system/enumerator.js +107 -0
  1440. data/sproutcore/frameworks/runtime/system/error.js +157 -0
  1441. data/sproutcore/frameworks/runtime/system/index_set.js +1199 -0
  1442. data/sproutcore/frameworks/runtime/system/logger.js +1582 -0
  1443. data/sproutcore/frameworks/runtime/system/object.js +947 -0
  1444. data/sproutcore/frameworks/runtime/system/range_observer.js +270 -0
  1445. data/sproutcore/frameworks/runtime/system/run_loop.js +308 -0
  1446. data/sproutcore/frameworks/runtime/system/set.js +536 -0
  1447. data/sproutcore/frameworks/runtime/tests/core/IsEqual.js +30 -0
  1448. data/sproutcore/frameworks/runtime/tests/core/beget.js +23 -0
  1449. data/sproutcore/frameworks/runtime/tests/core/clone.js +108 -0
  1450. data/sproutcore/frameworks/runtime/tests/core/compare.js +44 -0
  1451. data/sproutcore/frameworks/runtime/tests/core/console.js +16 -0
  1452. data/sproutcore/frameworks/runtime/tests/core/guidFor.js +109 -0
  1453. data/sproutcore/frameworks/runtime/tests/core/inspect.js +27 -0
  1454. data/sproutcore/frameworks/runtime/tests/core/itemType.js +71 -0
  1455. data/sproutcore/frameworks/runtime/tests/core/keys.js +20 -0
  1456. data/sproutcore/frameworks/runtime/tests/core/makeArray.js +44 -0
  1457. data/sproutcore/frameworks/runtime/tests/core/objectForPropertyPath.js +19 -0
  1458. data/sproutcore/frameworks/runtime/tests/core/tupleForPropertyPath.js +37 -0
  1459. data/sproutcore/frameworks/runtime/tests/mixins/array.js +59 -0
  1460. data/sproutcore/frameworks/runtime/tests/mixins/comparable.js +44 -0
  1461. data/sproutcore/frameworks/runtime/tests/mixins/enumerable.js +658 -0
  1462. data/sproutcore/frameworks/runtime/tests/mixins/observable/chained.js +37 -0
  1463. data/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +733 -0
  1464. data/sproutcore/frameworks/runtime/tests/mixins/observable/propertyChanges.js +155 -0
  1465. data/sproutcore/frameworks/runtime/tests/mixins/observable/registerDependentKeys.js +79 -0
  1466. data/sproutcore/frameworks/runtime/tests/mixins/propertyChanges.js +81 -0
  1467. data/sproutcore/frameworks/runtime/tests/private/observer_queue/isObservingSuspended.js +55 -0
  1468. data/sproutcore/frameworks/runtime/tests/system/binding.js +395 -0
  1469. data/sproutcore/frameworks/runtime/tests/system/error.js +53 -0
  1470. data/sproutcore/frameworks/runtime/tests/system/index_set/add.js +212 -0
  1471. data/sproutcore/frameworks/runtime/tests/system/index_set/addEach.js +49 -0
  1472. data/sproutcore/frameworks/runtime/tests/system/index_set/clone.js +43 -0
  1473. data/sproutcore/frameworks/runtime/tests/system/index_set/contains.js +74 -0
  1474. data/sproutcore/frameworks/runtime/tests/system/index_set/create.js +42 -0
  1475. data/sproutcore/frameworks/runtime/tests/system/index_set/indexAfter.js +38 -0
  1476. data/sproutcore/frameworks/runtime/tests/system/index_set/indexBefore.js +38 -0
  1477. data/sproutcore/frameworks/runtime/tests/system/index_set/intersects.js +74 -0
  1478. data/sproutcore/frameworks/runtime/tests/system/index_set/max.js +40 -0
  1479. data/sproutcore/frameworks/runtime/tests/system/index_set/min.js +50 -0
  1480. data/sproutcore/frameworks/runtime/tests/system/index_set/rangeStartForIndex.js +36 -0
  1481. data/sproutcore/frameworks/runtime/tests/system/index_set/remove.js +189 -0
  1482. data/sproutcore/frameworks/runtime/tests/system/index_set/removeEach.js +49 -0
  1483. data/sproutcore/frameworks/runtime/tests/system/index_set/without.js +89 -0
  1484. data/sproutcore/frameworks/runtime/tests/system/logger.js +260 -0
  1485. data/sproutcore/frameworks/runtime/tests/system/object/base.js +195 -0
  1486. data/sproutcore/frameworks/runtime/tests/system/object/bindings.js +374 -0
  1487. data/sproutcore/frameworks/runtime/tests/system/object/concatenated_properties.js +71 -0
  1488. data/sproutcore/frameworks/runtime/tests/system/object/enhance.js +177 -0
  1489. data/sproutcore/frameworks/runtime/tests/system/observer_set.js +50 -0
  1490. data/sproutcore/frameworks/runtime/tests/system/range_observer/create.js +59 -0
  1491. data/sproutcore/frameworks/runtime/tests/system/range_observer/destroy.js +75 -0
  1492. data/sproutcore/frameworks/runtime/tests/system/range_observer/objectPropertyDidChange.js +117 -0
  1493. data/sproutcore/frameworks/runtime/tests/system/range_observer/rangeDidChange.js +110 -0
  1494. data/sproutcore/frameworks/runtime/tests/system/range_observer/update.js +65 -0
  1495. data/sproutcore/frameworks/runtime/tests/system/run_loop.js +120 -0
  1496. data/sproutcore/frameworks/runtime/tests/system/set.js +318 -0
  1497. data/sproutcore/frameworks/statechart/core.js +5 -0
  1498. data/sproutcore/frameworks/statechart/debug/monitor.js +136 -0
  1499. data/sproutcore/frameworks/statechart/system/state.js +713 -0
  1500. data/sproutcore/frameworks/statechart/system/statechart.js +951 -0
  1501. data/sproutcore/frameworks/statechart/tests/async.js +94 -0
  1502. data/sproutcore/frameworks/statechart/tests/event_handling/advanced_event_handling.js +310 -0
  1503. data/sproutcore/frameworks/statechart/tests/namespace/access_substates.js +252 -0
  1504. data/sproutcore/frameworks/statechart/tests/state/is_current_state.js +64 -0
  1505. data/sproutcore/frameworks/statechart/tests/with_concurrent_states/goto_history_state.js +88 -0
  1506. data/sproutcore/frameworks/statechart/tests/with_concurrent_states/goto_state_advanced.js +234 -0
  1507. data/sproutcore/frameworks/statechart/tests/with_concurrent_states/goto_state_async.js +123 -0
  1508. data/sproutcore/frameworks/statechart/tests/with_concurrent_states/goto_state_basic.js +139 -0
  1509. data/sproutcore/frameworks/statechart/tests/with_concurrent_states/goto_state_intermediate.js +119 -0
  1510. data/sproutcore/frameworks/statechart/tests/with_concurrent_states/send_event.js +183 -0
  1511. data/sproutcore/frameworks/statechart/tests/without_concurrent_states/default_responder.js +90 -0
  1512. data/sproutcore/frameworks/statechart/tests/without_concurrent_states/goto_history_state.js +200 -0
  1513. data/sproutcore/frameworks/statechart/tests/without_concurrent_states/goto_state.js +256 -0
  1514. data/sproutcore/frameworks/statechart/tests/without_concurrent_states/goto_state_async.js +187 -0
  1515. data/sproutcore/frameworks/statechart/tests/without_concurrent_states/send_event.js +122 -0
  1516. data/sproutcore/frameworks/statechart/tests/without_concurrent_states/state_plugin.js +99 -0
  1517. data/sproutcore/frameworks/statechart/tests/without_concurrent_states/transient.js +162 -0
  1518. data/sproutcore/frameworks/table/mixins/table_delegate.js +41 -0
  1519. data/sproutcore/frameworks/table/system/table_column.js +125 -0
  1520. data/sproutcore/frameworks/table/views/table.js +440 -0
  1521. data/sproutcore/frameworks/table/views/table_cell.js +63 -0
  1522. data/sproutcore/frameworks/table/views/table_head.js +158 -0
  1523. data/sproutcore/frameworks/table/views/table_header.js +214 -0
  1524. data/sproutcore/frameworks/table/views/table_row.js +155 -0
  1525. data/sproutcore/frameworks/testing/core.js +196 -0
  1526. data/sproutcore/frameworks/testing/english.lproj/additions.css +8 -0
  1527. data/sproutcore/frameworks/testing/english.lproj/runner.css +128 -0
  1528. data/sproutcore/frameworks/testing/english.lproj/testsuite.css +136 -0
  1529. data/sproutcore/frameworks/testing/extras.js +17 -0
  1530. data/sproutcore/frameworks/testing/jquery.js +3559 -0
  1531. data/sproutcore/frameworks/testing/qunit.js +827 -0
  1532. data/sproutcore/frameworks/testing/system/dump.js +205 -0
  1533. data/sproutcore/frameworks/testing/system/equiv.js +201 -0
  1534. data/sproutcore/frameworks/testing/system/plan.js +703 -0
  1535. data/sproutcore/frameworks/testing/system/runner.js +220 -0
  1536. data/sproutcore/frameworks/testing/system/suite.js +228 -0
  1537. data/sproutcore/frameworks/testing/utils.js +62 -0
  1538. data/sproutcore/lib/index.rhtml +164 -0
  1539. data/sproutcore/license.js +31 -0
  1540. data/sproutcore/themes/ace/designs/dark.png +0 -0
  1541. data/sproutcore/themes/ace/designs/dark.psd +0 -0
  1542. data/sproutcore/themes/ace/designs/light.png +0 -0
  1543. data/sproutcore/themes/ace/designs/light.psd +0 -0
  1544. data/sproutcore/themes/ace/designs/psds/button/ace/18px/active_button.psd +0 -0
  1545. data/sproutcore/themes/ace/designs/psds/button/ace/18px/normal_button.psd +0 -0
  1546. data/sproutcore/themes/ace/designs/psds/button/ace/18px/selected_active_button.psd +0 -0
  1547. data/sproutcore/themes/ace/designs/psds/button/ace/18px/selected_button.psd +0 -0
  1548. data/sproutcore/themes/ace/designs/psds/button/ace/24px/active_button.psd +0 -0
  1549. data/sproutcore/themes/ace/designs/psds/button/ace/24px/active_button_capsule.psd +0 -0
  1550. data/sproutcore/themes/ace/designs/psds/button/ace/24px/active_button_pointer.psd +0 -0
  1551. data/sproutcore/themes/ace/designs/psds/button/ace/24px/normal_button.psd +0 -0
  1552. data/sproutcore/themes/ace/designs/psds/button/ace/24px/normal_button_capsule.psd +0 -0
  1553. data/sproutcore/themes/ace/designs/psds/button/ace/24px/normal_button_pointer.psd +0 -0
  1554. data/sproutcore/themes/ace/designs/psds/button/ace/24px/selected_active_button.psd +0 -0
  1555. data/sproutcore/themes/ace/designs/psds/button/ace/24px/selected_active_button_capsule.psd +0 -0
  1556. data/sproutcore/themes/ace/designs/psds/button/ace/24px/selected_active_button_pointer.psd +0 -0
  1557. data/sproutcore/themes/ace/designs/psds/button/ace/24px/selected_button.psd +0 -0
  1558. data/sproutcore/themes/ace/designs/psds/button/ace/24px/selected_button_capsule.psd +0 -0
  1559. data/sproutcore/themes/ace/designs/psds/button/ace/24px/selected_button_pointer.psd +0 -0
  1560. data/sproutcore/themes/ace/designs/psds/button/ace/30px/active_button.psd +0 -0
  1561. data/sproutcore/themes/ace/designs/psds/button/ace/30px/active_button_pointer.psd +0 -0
  1562. data/sproutcore/themes/ace/designs/psds/button/ace/30px/normal_button.psd +0 -0
  1563. data/sproutcore/themes/ace/designs/psds/button/ace/30px/normal_button_pointer.psd +0 -0
  1564. data/sproutcore/themes/ace/designs/psds/button/ace/30px/selected_active_button.psd +0 -0
  1565. data/sproutcore/themes/ace/designs/psds/button/ace/30px/selected_active_button_pointer.psd +0 -0
  1566. data/sproutcore/themes/ace/designs/psds/button/ace/30px/selected_button.psd +0 -0
  1567. data/sproutcore/themes/ace/designs/psds/button/ace/30px/selected_button_pointer.psd +0 -0
  1568. data/sproutcore/themes/ace/designs/psds/button/ace/44px/active_button.psd +0 -0
  1569. data/sproutcore/themes/ace/designs/psds/button/ace/44px/normal_button.psd +0 -0
  1570. data/sproutcore/themes/ace/designs/psds/button/ace/44px/selected_active_button.psd +0 -0
  1571. data/sproutcore/themes/ace/designs/psds/button/ace/44px/selected_button.psd +0 -0
  1572. data/sproutcore/themes/ace/designs/psds/button/dark/24px/active_button.psd +0 -0
  1573. data/sproutcore/themes/ace/designs/psds/button/dark/24px/active_button_capsule.psd +0 -0
  1574. data/sproutcore/themes/ace/designs/psds/button/dark/24px/active_button_pointer.psd +0 -0
  1575. data/sproutcore/themes/ace/designs/psds/button/dark/24px/normal_button.psd +0 -0
  1576. data/sproutcore/themes/ace/designs/psds/button/dark/24px/normal_button_capsule.psd +0 -0
  1577. data/sproutcore/themes/ace/designs/psds/button/dark/24px/normal_button_pointer.psd +0 -0
  1578. data/sproutcore/themes/ace/designs/psds/button/dark/24px/selected_active_button.psd +0 -0
  1579. data/sproutcore/themes/ace/designs/psds/button/dark/24px/selected_active_button_capsule.psd +0 -0
  1580. data/sproutcore/themes/ace/designs/psds/button/dark/24px/selected_active_button_pointer.psd +0 -0
  1581. data/sproutcore/themes/ace/designs/psds/button/dark/24px/selected_button.psd +0 -0
  1582. data/sproutcore/themes/ace/designs/psds/button/dark/24px/selected_button_capsule.psd +0 -0
  1583. data/sproutcore/themes/ace/designs/psds/button/dark/24px/selected_button_pointer.psd +0 -0
  1584. data/sproutcore/themes/ace/designs/psds/button/dark/30px/active_button.psd +0 -0
  1585. data/sproutcore/themes/ace/designs/psds/button/dark/30px/active_button_pointer.psd +0 -0
  1586. data/sproutcore/themes/ace/designs/psds/button/dark/30px/normal_button.psd +0 -0
  1587. data/sproutcore/themes/ace/designs/psds/button/dark/30px/normal_button_pointer.psd +0 -0
  1588. data/sproutcore/themes/ace/designs/psds/button/dark/30px/selected_active_button.psd +0 -0
  1589. data/sproutcore/themes/ace/designs/psds/button/dark/30px/selected_active_button_pointer.psd +0 -0
  1590. data/sproutcore/themes/ace/designs/psds/button/dark/30px/selected_button.psd +0 -0
  1591. data/sproutcore/themes/ace/designs/psds/button/dark/30px/selected_button_pointer.psd +0 -0
  1592. data/sproutcore/themes/ace/designs/psds/button/popup/active_select.psd +0 -0
  1593. data/sproutcore/themes/ace/designs/psds/button/popup/normal_select.psd +0 -0
  1594. data/sproutcore/themes/ace/designs/psds/checkbox/ace/14px/checkbox_checked.psd +0 -0
  1595. data/sproutcore/themes/ace/designs/psds/checkbox/ace/14px/checkbox_checked_active.psd +0 -0
  1596. data/sproutcore/themes/ace/designs/psds/checkbox/ace/14px/checkbox_mixed.psd +0 -0
  1597. data/sproutcore/themes/ace/designs/psds/checkbox/ace/14px/checkbox_mixed_active.psd +0 -0
  1598. data/sproutcore/themes/ace/designs/psds/checkbox/ace/14px/checkbox_unchecked.psd +0 -0
  1599. data/sproutcore/themes/ace/designs/psds/checkbox/ace/14px/checkbox_unchecked_active.psd +0 -0
  1600. data/sproutcore/themes/ace/designs/psds/checkbox/ace/16px/checkbox_checked.psd +0 -0
  1601. data/sproutcore/themes/ace/designs/psds/checkbox/ace/16px/checkbox_checked_active.psd +0 -0
  1602. data/sproutcore/themes/ace/designs/psds/checkbox/ace/16px/checkbox_mixed.psd +0 -0
  1603. data/sproutcore/themes/ace/designs/psds/checkbox/ace/16px/checkbox_mixed_active.psd +0 -0
  1604. data/sproutcore/themes/ace/designs/psds/checkbox/ace/16px/checkbox_unchecked.psd +0 -0
  1605. data/sproutcore/themes/ace/designs/psds/checkbox/ace/16px/checkbox_unchecked_active.psd +0 -0
  1606. data/sproutcore/themes/ace/designs/psds/collection/source-list/selection.psd +0 -0
  1607. data/sproutcore/themes/ace/designs/psds/disclosure/ace/disclosure_closed.psd +0 -0
  1608. data/sproutcore/themes/ace/designs/psds/disclosure/ace/disclosure_closed_active.psd +0 -0
  1609. data/sproutcore/themes/ace/designs/psds/disclosure/ace/disclosure_open.psd +0 -0
  1610. data/sproutcore/themes/ace/designs/psds/disclosure/ace/disclosure_open_active.psd +0 -0
  1611. data/sproutcore/themes/ace/designs/psds/menu/checkmark.psd +0 -0
  1612. data/sproutcore/themes/ace/designs/psds/menu/checkmark_active.psd +0 -0
  1613. data/sproutcore/themes/ace/designs/psds/menu/down.psd +0 -0
  1614. data/sproutcore/themes/ace/designs/psds/menu/menu.psd +0 -0
  1615. data/sproutcore/themes/ace/designs/psds/menu/menu_item.psd +0 -0
  1616. data/sproutcore/themes/ace/designs/psds/menu/up.psd +0 -0
  1617. data/sproutcore/themes/ace/designs/psds/panel/panel.psd +0 -0
  1618. data/sproutcore/themes/ace/designs/psds/panel/pointers.psd +0 -0
  1619. data/sproutcore/themes/ace/designs/psds/picker/popover/popover.psd +0 -0
  1620. data/sproutcore/themes/ace/designs/psds/picker/popover/popover_empty.psd +0 -0
  1621. data/sproutcore/themes/ace/designs/psds/picker/popover/popover_notoolbar.psd +0 -0
  1622. data/sproutcore/themes/ace/designs/psds/picker/popover/popover_pointers.psd +0 -0
  1623. data/sproutcore/themes/ace/designs/psds/picker/popover/popover_pointers_notoolbar.psd +0 -0
  1624. data/sproutcore/themes/ace/designs/psds/progress/ace/progress_view_content.psd +0 -0
  1625. data/sproutcore/themes/ace/designs/psds/progress/ace/progress_view_indeterminate_content.psd +0 -0
  1626. data/sproutcore/themes/ace/designs/psds/progress/ace/progress_view_track.psd +0 -0
  1627. data/sproutcore/themes/ace/designs/psds/radio/radio_active.psd +0 -0
  1628. data/sproutcore/themes/ace/designs/psds/radio/radio_mixed.psd +0 -0
  1629. data/sproutcore/themes/ace/designs/psds/radio/radio_mixed_active.psd +0 -0
  1630. data/sproutcore/themes/ace/designs/psds/radio/radio_selected.psd +0 -0
  1631. data/sproutcore/themes/ace/designs/psds/radio/radio_selected_active.psd +0 -0
  1632. data/sproutcore/themes/ace/designs/psds/radio/radio_unselected.psd +0 -0
  1633. data/sproutcore/themes/ace/designs/psds/scroller/horizontal/thumb.psd +0 -0
  1634. data/sproutcore/themes/ace/designs/psds/scroller/horizontal/track_and_arrows.psd +0 -0
  1635. data/sproutcore/themes/ace/designs/psds/scroller/horizontal/track_and_arrows_active.psd +0 -0
  1636. data/sproutcore/themes/ace/designs/psds/scroller/vertical/thumb.psd +0 -0
  1637. data/sproutcore/themes/ace/designs/psds/scroller/vertical/track_and_arrows.psd +0 -0
  1638. data/sproutcore/themes/ace/designs/psds/scroller/vertical/track_and_arrows_active.psd +0 -0
  1639. data/sproutcore/themes/ace/designs/psds/segmented/18px/segmented_active.psd +0 -0
  1640. data/sproutcore/themes/ace/designs/psds/segmented/18px/segmented_normal.psd +0 -0
  1641. data/sproutcore/themes/ace/designs/psds/segmented/18px/segmented_selected.psd +0 -0
  1642. data/sproutcore/themes/ace/designs/psds/segmented/18px/segmented_selected_active.psd +0 -0
  1643. data/sproutcore/themes/ace/designs/psds/segmented/24px/segmented_active.psd +0 -0
  1644. data/sproutcore/themes/ace/designs/psds/segmented/24px/segmented_normal.psd +0 -0
  1645. data/sproutcore/themes/ace/designs/psds/segmented/24px/segmented_selected.psd +0 -0
  1646. data/sproutcore/themes/ace/designs/psds/segmented/24px/segmented_selected_active.psd +0 -0
  1647. data/sproutcore/themes/ace/designs/psds/segmented/30px/segmented_active.psd +0 -0
  1648. data/sproutcore/themes/ace/designs/psds/segmented/30px/segmented_normal.psd +0 -0
  1649. data/sproutcore/themes/ace/designs/psds/segmented/30px/segmented_selected.psd +0 -0
  1650. data/sproutcore/themes/ace/designs/psds/segmented/30px/segmented_selected_active.psd +0 -0
  1651. data/sproutcore/themes/ace/designs/psds/segmented/44px/segmented_active.psd +0 -0
  1652. data/sproutcore/themes/ace/designs/psds/segmented/44px/segmented_normal.psd +0 -0
  1653. data/sproutcore/themes/ace/designs/psds/segmented/44px/segmented_selected.psd +0 -0
  1654. data/sproutcore/themes/ace/designs/psds/segmented/44px/segmented_selected_active.psd +0 -0
  1655. data/sproutcore/themes/ace/designs/psds/slider/ace/14px/knob.psd +0 -0
  1656. data/sproutcore/themes/ace/designs/psds/slider/ace/14px/knob_active.psd +0 -0
  1657. data/sproutcore/themes/ace/designs/psds/slider/ace/16px/knob.psd +0 -0
  1658. data/sproutcore/themes/ace/designs/psds/slider/ace/16px/knob_active.psd +0 -0
  1659. data/sproutcore/themes/ace/designs/psds/slider/ace/22px/knob.psd +0 -0
  1660. data/sproutcore/themes/ace/designs/psds/slider/ace/22px/knob_active.psd +0 -0
  1661. data/sproutcore/themes/ace/designs/psds/slider/ace/22px/track.psd +0 -0
  1662. data/sproutcore/themes/ace/designs/psds/slider/ace/track.psd +0 -0
  1663. data/sproutcore/themes/ace/designs/psds/toolbar/toolbar.psd +0 -0
  1664. data/sproutcore/themes/ace/designs/switch/switch.psd +0 -0
  1665. data/sproutcore/themes/ace/designs/switch/switch_handle.png +0 -0
  1666. data/sproutcore/themes/ace/designs/switch/switch_handle.psd +0 -0
  1667. data/sproutcore/themes/ace/designs/switch/switch_off.png +0 -0
  1668. data/sproutcore/themes/ace/designs/switch/switch_off.psd +0 -0
  1669. data/sproutcore/themes/ace/designs/switch/switch_on.png +0 -0
  1670. data/sproutcore/themes/ace/designs/switch/switch_on.psd +0 -0
  1671. data/sproutcore/themes/ace/resources/body.css +13 -0
  1672. data/sproutcore/themes/ace/resources/button/ace/18px/active_button.png +0 -0
  1673. data/sproutcore/themes/ace/resources/button/ace/18px/button.css +33 -0
  1674. data/sproutcore/themes/ace/resources/button/ace/18px/normal_button.png +0 -0
  1675. data/sproutcore/themes/ace/resources/button/ace/18px/selected_active_button.png +0 -0
  1676. data/sproutcore/themes/ace/resources/button/ace/18px/selected_button.png +0 -0
  1677. data/sproutcore/themes/ace/resources/button/ace/24px/active_button.png +0 -0
  1678. data/sproutcore/themes/ace/resources/button/ace/24px/active_button_capsule.png +0 -0
  1679. data/sproutcore/themes/ace/resources/button/ace/24px/active_button_pointer.png +0 -0
  1680. data/sproutcore/themes/ace/resources/button/ace/24px/button.css +98 -0
  1681. data/sproutcore/themes/ace/resources/button/ace/24px/normal_button.png +0 -0
  1682. data/sproutcore/themes/ace/resources/button/ace/24px/normal_button_capsule.png +0 -0
  1683. data/sproutcore/themes/ace/resources/button/ace/24px/normal_button_pointer.png +0 -0
  1684. data/sproutcore/themes/ace/resources/button/ace/24px/selected_active_button.png +0 -0
  1685. data/sproutcore/themes/ace/resources/button/ace/24px/selected_active_button_capsule.png +0 -0
  1686. data/sproutcore/themes/ace/resources/button/ace/24px/selected_active_button_pointer.png +0 -0
  1687. data/sproutcore/themes/ace/resources/button/ace/24px/selected_button.png +0 -0
  1688. data/sproutcore/themes/ace/resources/button/ace/24px/selected_button_capsule.png +0 -0
  1689. data/sproutcore/themes/ace/resources/button/ace/24px/selected_button_pointer.png +0 -0
  1690. data/sproutcore/themes/ace/resources/button/ace/30px/active_button.png +0 -0
  1691. data/sproutcore/themes/ace/resources/button/ace/30px/active_button_pointer.png +0 -0
  1692. data/sproutcore/themes/ace/resources/button/ace/30px/button.css +78 -0
  1693. data/sproutcore/themes/ace/resources/button/ace/30px/normal_button.png +0 -0
  1694. data/sproutcore/themes/ace/resources/button/ace/30px/normal_button_pointer.png +0 -0
  1695. data/sproutcore/themes/ace/resources/button/ace/30px/selected_active_button.png +0 -0
  1696. data/sproutcore/themes/ace/resources/button/ace/30px/selected_active_button_pointer.png +0 -0
  1697. data/sproutcore/themes/ace/resources/button/ace/30px/selected_button.png +0 -0
  1698. data/sproutcore/themes/ace/resources/button/ace/30px/selected_button_pointer.png +0 -0
  1699. data/sproutcore/themes/ace/resources/button/ace/44px/active_button.png +0 -0
  1700. data/sproutcore/themes/ace/resources/button/ace/44px/button.css +39 -0
  1701. data/sproutcore/themes/ace/resources/button/ace/44px/normal_button.png +0 -0
  1702. data/sproutcore/themes/ace/resources/button/ace/44px/selected_active_button.png +0 -0
  1703. data/sproutcore/themes/ace/resources/button/ace/44px/selected_button.png +0 -0
  1704. data/sproutcore/themes/ace/resources/button/ace/button.css +36 -0
  1705. data/sproutcore/themes/ace/resources/button/button.js +75 -0
  1706. data/sproutcore/themes/ace/resources/button/dark/24px/active_button.png +0 -0
  1707. data/sproutcore/themes/ace/resources/button/dark/24px/active_button_capsule.png +0 -0
  1708. data/sproutcore/themes/ace/resources/button/dark/24px/active_button_pointer.png +0 -0
  1709. data/sproutcore/themes/ace/resources/button/dark/24px/button.css +93 -0
  1710. data/sproutcore/themes/ace/resources/button/dark/24px/normal_button.png +0 -0
  1711. data/sproutcore/themes/ace/resources/button/dark/24px/normal_button_capsule.png +0 -0
  1712. data/sproutcore/themes/ace/resources/button/dark/24px/normal_button_pointer.png +0 -0
  1713. data/sproutcore/themes/ace/resources/button/dark/24px/selected_active_button.png +0 -0
  1714. data/sproutcore/themes/ace/resources/button/dark/24px/selected_active_button_capsule.png +0 -0
  1715. data/sproutcore/themes/ace/resources/button/dark/24px/selected_active_button_pointer.png +0 -0
  1716. data/sproutcore/themes/ace/resources/button/dark/24px/selected_button.png +0 -0
  1717. data/sproutcore/themes/ace/resources/button/dark/24px/selected_button_capsule.png +0 -0
  1718. data/sproutcore/themes/ace/resources/button/dark/24px/selected_button_pointer.png +0 -0
  1719. data/sproutcore/themes/ace/resources/button/dark/30px/active_button.png +0 -0
  1720. data/sproutcore/themes/ace/resources/button/dark/30px/active_button_pointer.png +0 -0
  1721. data/sproutcore/themes/ace/resources/button/dark/30px/button.css +72 -0
  1722. data/sproutcore/themes/ace/resources/button/dark/30px/normal_button.png +0 -0
  1723. data/sproutcore/themes/ace/resources/button/dark/30px/normal_button_pointer.png +0 -0
  1724. data/sproutcore/themes/ace/resources/button/dark/30px/selected_active_button.png +0 -0
  1725. data/sproutcore/themes/ace/resources/button/dark/30px/selected_active_button_pointer.png +0 -0
  1726. data/sproutcore/themes/ace/resources/button/dark/30px/selected_button.png +0 -0
  1727. data/sproutcore/themes/ace/resources/button/dark/30px/selected_button_pointer.png +0 -0
  1728. data/sproutcore/themes/ace/resources/button/dark/button.css +17 -0
  1729. data/sproutcore/themes/ace/resources/button/dark/button.js +3 -0
  1730. data/sproutcore/themes/ace/resources/button/popup/active_select.png +0 -0
  1731. data/sproutcore/themes/ace/resources/button/popup/normal_select.png +0 -0
  1732. data/sproutcore/themes/ace/resources/button/popup/select.css +20 -0
  1733. data/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox.css +40 -0
  1734. data/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_checked.png +0 -0
  1735. data/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_checked_active.png +0 -0
  1736. data/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_mixed.png +0 -0
  1737. data/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_mixed_active.png +0 -0
  1738. data/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_unchecked.png +0 -0
  1739. data/sproutcore/themes/ace/resources/checkbox/ace/14px/checkbox_unchecked_active.png +0 -0
  1740. data/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox.css +40 -0
  1741. data/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_checked.png +0 -0
  1742. data/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_checked_active.png +0 -0
  1743. data/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_mixed.png +0 -0
  1744. data/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_mixed_active.png +0 -0
  1745. data/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_unchecked.png +0 -0
  1746. data/sproutcore/themes/ace/resources/checkbox/ace/16px/checkbox_unchecked_active.png +0 -0
  1747. data/sproutcore/themes/ace/resources/checkbox/ace/checkbox.css +7 -0
  1748. data/sproutcore/themes/ace/resources/collection/normal/list.css +4 -0
  1749. data/sproutcore/themes/ace/resources/collection/normal/list_item.css +17 -0
  1750. data/sproutcore/themes/ace/resources/collection/source-list/selection.png +0 -0
  1751. data/sproutcore/themes/ace/resources/collection/source-list/source-list.js +3 -0
  1752. data/sproutcore/themes/ace/resources/collection/source-list/source_list_view.css +36 -0
  1753. data/sproutcore/themes/ace/resources/disclosure/ace/disclosure.css +24 -0
  1754. data/sproutcore/themes/ace/resources/disclosure/ace/disclosure_closed.png +0 -0
  1755. data/sproutcore/themes/ace/resources/disclosure/ace/disclosure_closed_active.png +0 -0
  1756. data/sproutcore/themes/ace/resources/disclosure/ace/disclosure_open.png +0 -0
  1757. data/sproutcore/themes/ace/resources/disclosure/ace/disclosure_open_active.png +0 -0
  1758. data/sproutcore/themes/ace/resources/imagebutton/ace/imagebutton.css +11 -0
  1759. data/sproutcore/themes/ace/resources/loading.css +50 -0
  1760. data/sproutcore/themes/ace/resources/master-detail/master-detail.css +27 -0
  1761. data/sproutcore/themes/ace/resources/menu/checkmark.png +0 -0
  1762. data/sproutcore/themes/ace/resources/menu/checkmark_active.png +0 -0
  1763. data/sproutcore/themes/ace/resources/menu/down.png +0 -0
  1764. data/sproutcore/themes/ace/resources/menu/menu.css +75 -0
  1765. data/sproutcore/themes/ace/resources/menu/menu.png +0 -0
  1766. data/sproutcore/themes/ace/resources/menu/menu_item.png +0 -0
  1767. data/sproutcore/themes/ace/resources/menu/up.png +0 -0
  1768. data/sproutcore/themes/ace/resources/pane/pane.css +3 -0
  1769. data/sproutcore/themes/ace/resources/panel/panel.css +13 -0
  1770. data/sproutcore/themes/ace/resources/panel/panel.js +20 -0
  1771. data/sproutcore/themes/ace/resources/panel/panel.png +0 -0
  1772. data/sproutcore/themes/ace/resources/picker/ace/panel.png +0 -0
  1773. data/sproutcore/themes/ace/resources/picker/ace/picker.css +41 -0
  1774. data/sproutcore/themes/ace/resources/picker/ace/picker.js +0 -0
  1775. data/sproutcore/themes/ace/resources/picker/ace/pointers.png +0 -0
  1776. data/sproutcore/themes/ace/resources/picker/popover/picker.js +32 -0
  1777. data/sproutcore/themes/ace/resources/picker/popover/popover.css +111 -0
  1778. data/sproutcore/themes/ace/resources/picker/popover/popover.js +12 -0
  1779. data/sproutcore/themes/ace/resources/picker/popover/popover.png +0 -0
  1780. data/sproutcore/themes/ace/resources/picker/popover/popover_empty.png +0 -0
  1781. data/sproutcore/themes/ace/resources/picker/popover/popover_notoolbar.png +0 -0
  1782. data/sproutcore/themes/ace/resources/picker/popover/popover_pointers.png +0 -0
  1783. data/sproutcore/themes/ace/resources/picker/popover/popover_pointers_notoolbar.png +0 -0
  1784. data/sproutcore/themes/ace/resources/picker/popover/workspace.js +28 -0
  1785. data/sproutcore/themes/ace/resources/progress/ace/progress.css +27 -0
  1786. data/sproutcore/themes/ace/resources/progress/ace/progress_view_content.png +0 -0
  1787. data/sproutcore/themes/ace/resources/progress/ace/progress_view_track.png +0 -0
  1788. data/sproutcore/themes/ace/resources/progress/progress.js +78 -0
  1789. data/sproutcore/themes/ace/resources/radio/radio.css +63 -0
  1790. data/sproutcore/themes/ace/resources/radio/radio_active.png +0 -0
  1791. data/sproutcore/themes/ace/resources/radio/radio_mixed.png +0 -0
  1792. data/sproutcore/themes/ace/resources/radio/radio_mixed_active.png +0 -0
  1793. data/sproutcore/themes/ace/resources/radio/radio_selected.png +0 -0
  1794. data/sproutcore/themes/ace/resources/radio/radio_selected_active.png +0 -0
  1795. data/sproutcore/themes/ace/resources/radio/radio_unselected.png +0 -0
  1796. data/sproutcore/themes/ace/resources/scroller/horizontal/horizontal.css +78 -0
  1797. data/sproutcore/themes/ace/resources/scroller/horizontal/horizontal_touch.css +91 -0
  1798. data/sproutcore/themes/ace/resources/scroller/horizontal/thumb.png +0 -0
  1799. data/sproutcore/themes/ace/resources/scroller/horizontal/track_and_arrows.png +0 -0
  1800. data/sproutcore/themes/ace/resources/scroller/horizontal/track_and_arrows_active.png +0 -0
  1801. data/sproutcore/themes/ace/resources/scroller/vertical/thumb.png +0 -0
  1802. data/sproutcore/themes/ace/resources/scroller/vertical/track_and_arrows.png +0 -0
  1803. data/sproutcore/themes/ace/resources/scroller/vertical/track_and_arrows_active.png +0 -0
  1804. data/sproutcore/themes/ace/resources/scroller/vertical/vertical.css +80 -0
  1805. data/sproutcore/themes/ace/resources/scroller/vertical/vertical_touch.css +92 -0
  1806. data/sproutcore/themes/ace/resources/segmented/18px/segmented.css +91 -0
  1807. data/sproutcore/themes/ace/resources/segmented/18px/segmented_active.png +0 -0
  1808. data/sproutcore/themes/ace/resources/segmented/18px/segmented_normal.png +0 -0
  1809. data/sproutcore/themes/ace/resources/segmented/18px/segmented_selected.png +0 -0
  1810. data/sproutcore/themes/ace/resources/segmented/18px/segmented_selected_active.png +0 -0
  1811. data/sproutcore/themes/ace/resources/segmented/24px/segmented.css +91 -0
  1812. data/sproutcore/themes/ace/resources/segmented/24px/segmented_active.png +0 -0
  1813. data/sproutcore/themes/ace/resources/segmented/24px/segmented_normal.png +0 -0
  1814. data/sproutcore/themes/ace/resources/segmented/24px/segmented_selected.png +0 -0
  1815. data/sproutcore/themes/ace/resources/segmented/24px/segmented_selected_active.png +0 -0
  1816. data/sproutcore/themes/ace/resources/segmented/30px/segmented.css +91 -0
  1817. data/sproutcore/themes/ace/resources/segmented/30px/segmented_active.png +0 -0
  1818. data/sproutcore/themes/ace/resources/segmented/30px/segmented_normal.png +0 -0
  1819. data/sproutcore/themes/ace/resources/segmented/30px/segmented_selected.png +0 -0
  1820. data/sproutcore/themes/ace/resources/segmented/30px/segmented_selected_active.png +0 -0
  1821. data/sproutcore/themes/ace/resources/segmented/44px/segmented.css +95 -0
  1822. data/sproutcore/themes/ace/resources/segmented/44px/segmented_active.png +0 -0
  1823. data/sproutcore/themes/ace/resources/segmented/44px/segmented_normal.png +0 -0
  1824. data/sproutcore/themes/ace/resources/segmented/44px/segmented_selected.png +0 -0
  1825. data/sproutcore/themes/ace/resources/segmented/44px/segmented_selected_active.png +0 -0
  1826. data/sproutcore/themes/ace/resources/segmented/segmented.css +83 -0
  1827. data/sproutcore/themes/ace/resources/slider/ace/14px/knob.png +0 -0
  1828. data/sproutcore/themes/ace/resources/slider/ace/14px/knob_active.png +0 -0
  1829. data/sproutcore/themes/ace/resources/slider/ace/14px/slider.css +27 -0
  1830. data/sproutcore/themes/ace/resources/slider/ace/16px/knob.png +0 -0
  1831. data/sproutcore/themes/ace/resources/slider/ace/16px/knob_active.png +0 -0
  1832. data/sproutcore/themes/ace/resources/slider/ace/16px/slider.css +27 -0
  1833. data/sproutcore/themes/ace/resources/slider/ace/22px/knob.png +0 -0
  1834. data/sproutcore/themes/ace/resources/slider/ace/22px/knob_active.png +0 -0
  1835. data/sproutcore/themes/ace/resources/slider/ace/22px/slider.css +27 -0
  1836. data/sproutcore/themes/ace/resources/slider/ace/22px/track.png +0 -0
  1837. data/sproutcore/themes/ace/resources/slider/ace/slider.css +7 -0
  1838. data/sproutcore/themes/ace/resources/slider/ace/slider.js +56 -0
  1839. data/sproutcore/themes/ace/resources/slider/ace/track.png +0 -0
  1840. data/sproutcore/themes/ace/resources/split/split.css +5 -0
  1841. data/sproutcore/themes/ace/resources/tab/tab.css +3 -0
  1842. data/sproutcore/themes/ace/resources/toolbar/toolbar.css +8 -0
  1843. data/sproutcore/themes/ace/resources/toolbar/toolbar.png +0 -0
  1844. data/sproutcore/themes/ace/resources/well/well.css +7 -0
  1845. data/sproutcore/themes/ace/resources/well/well.js +17 -0
  1846. data/sproutcore/themes/ace/theme.js +14 -0
  1847. data/sproutcore/themes/empty_theme/tests/mini_icons.rhtml +69 -0
  1848. data/sproutcore/themes/empty_theme/theme.js +16 -0
  1849. data/sproutcore/themes/iphone_theme/english.lproj/button.css +41 -0
  1850. data/sproutcore/themes/iphone_theme/english.lproj/core.css +8 -0
  1851. data/sproutcore/themes/iphone_theme/english.lproj/images/backButton.png +0 -0
  1852. data/sproutcore/themes/iphone_theme/english.lproj/images/blueButton.png +0 -0
  1853. data/sproutcore/themes/iphone_theme/english.lproj/images/cancel.png +0 -0
  1854. data/sproutcore/themes/iphone_theme/english.lproj/images/grayButton.png +0 -0
  1855. data/sproutcore/themes/iphone_theme/english.lproj/images/leftButton.png +0 -0
  1856. data/sproutcore/themes/iphone_theme/english.lproj/images/listArrow.png +0 -0
  1857. data/sproutcore/themes/iphone_theme/english.lproj/images/listArrowSel.png +0 -0
  1858. data/sproutcore/themes/iphone_theme/english.lproj/images/listGroup.png +0 -0
  1859. data/sproutcore/themes/iphone_theme/english.lproj/images/loading.gif +0 -0
  1860. data/sproutcore/themes/iphone_theme/english.lproj/images/pinstripes.png +0 -0
  1861. data/sproutcore/themes/iphone_theme/english.lproj/images/rightButton.png +0 -0
  1862. data/sproutcore/themes/iphone_theme/english.lproj/images/selection.png +0 -0
  1863. data/sproutcore/themes/iphone_theme/english.lproj/images/thumb.png +0 -0
  1864. data/sproutcore/themes/iphone_theme/english.lproj/images/toggle.png +0 -0
  1865. data/sproutcore/themes/iphone_theme/english.lproj/images/toggleOn.png +0 -0
  1866. data/sproutcore/themes/iphone_theme/english.lproj/images/toolButton.png +0 -0
  1867. data/sproutcore/themes/iphone_theme/english.lproj/images/toolbar.png +0 -0
  1868. data/sproutcore/themes/iphone_theme/english.lproj/images/whiteButton.png +0 -0
  1869. data/sproutcore/themes/iphone_theme/english.lproj/strings.js +15 -0
  1870. data/sproutcore/themes/standard_theme/Source/Panel.drawit/Data +0 -0
  1871. data/sproutcore/themes/standard_theme/Source/Panel.drawit/QuickLook/Preview.jpg +0 -0
  1872. data/sproutcore/themes/standard_theme/Source/Panel.drawit/QuickLook/Thumbnail.jpg +0 -0
  1873. data/sproutcore/themes/standard_theme/Source/SproutCore Theme Buttons.psd +0 -0
  1874. data/sproutcore/themes/standard_theme/Source/ToolbarView Pattern.drawit/Data +0 -0
  1875. data/sproutcore/themes/standard_theme/Source/ToolbarView Pattern.drawit/QuickLook/Preview.jpg +0 -0
  1876. data/sproutcore/themes/standard_theme/Source/ToolbarView Pattern.drawit/QuickLook/Thumbnail.jpg +0 -0
  1877. data/sproutcore/themes/standard_theme/Source/icons/16/10.png +0 -0
  1878. data/sproutcore/themes/standard_theme/Source/icons/16/100.png +0 -0
  1879. data/sproutcore/themes/standard_theme/Source/icons/16/102.png +0 -0
  1880. data/sproutcore/themes/standard_theme/Source/icons/16/110.png +0 -0
  1881. data/sproutcore/themes/standard_theme/Source/icons/16/120.png +0 -0
  1882. data/sproutcore/themes/standard_theme/Source/icons/16/127.png +0 -0
  1883. data/sproutcore/themes/standard_theme/Source/icons/16/18.png +0 -0
  1884. data/sproutcore/themes/standard_theme/Source/icons/16/19.png +0 -0
  1885. data/sproutcore/themes/standard_theme/Source/icons/16/2.png +0 -0
  1886. data/sproutcore/themes/standard_theme/Source/icons/16/24.png +0 -0
  1887. data/sproutcore/themes/standard_theme/Source/icons/16/26.png +0 -0
  1888. data/sproutcore/themes/standard_theme/Source/icons/16/27.png +0 -0
  1889. data/sproutcore/themes/standard_theme/Source/icons/16/28.png +0 -0
  1890. data/sproutcore/themes/standard_theme/Source/icons/16/29.png +0 -0
  1891. data/sproutcore/themes/standard_theme/Source/icons/16/30.png +0 -0
  1892. data/sproutcore/themes/standard_theme/Source/icons/16/31.png +0 -0
  1893. data/sproutcore/themes/standard_theme/Source/icons/16/33.png +0 -0
  1894. data/sproutcore/themes/standard_theme/Source/icons/16/37.png +0 -0
  1895. data/sproutcore/themes/standard_theme/Source/icons/16/41.png +0 -0
  1896. data/sproutcore/themes/standard_theme/Source/icons/16/99.png +0 -0
  1897. data/sproutcore/themes/standard_theme/Source/icons/24/10.png +0 -0
  1898. data/sproutcore/themes/standard_theme/Source/icons/24/100.png +0 -0
  1899. data/sproutcore/themes/standard_theme/Source/icons/24/102.png +0 -0
  1900. data/sproutcore/themes/standard_theme/Source/icons/24/110.png +0 -0
  1901. data/sproutcore/themes/standard_theme/Source/icons/24/120.png +0 -0
  1902. data/sproutcore/themes/standard_theme/Source/icons/24/127.png +0 -0
  1903. data/sproutcore/themes/standard_theme/Source/icons/24/18.png +0 -0
  1904. data/sproutcore/themes/standard_theme/Source/icons/24/19.png +0 -0
  1905. data/sproutcore/themes/standard_theme/Source/icons/24/2.png +0 -0
  1906. data/sproutcore/themes/standard_theme/Source/icons/24/24.png +0 -0
  1907. data/sproutcore/themes/standard_theme/Source/icons/24/26.png +0 -0
  1908. data/sproutcore/themes/standard_theme/Source/icons/24/27.png +0 -0
  1909. data/sproutcore/themes/standard_theme/Source/icons/24/28.png +0 -0
  1910. data/sproutcore/themes/standard_theme/Source/icons/24/29.png +0 -0
  1911. data/sproutcore/themes/standard_theme/Source/icons/24/30.png +0 -0
  1912. data/sproutcore/themes/standard_theme/Source/icons/24/31.png +0 -0
  1913. data/sproutcore/themes/standard_theme/Source/icons/24/33.png +0 -0
  1914. data/sproutcore/themes/standard_theme/Source/icons/24/37.png +0 -0
  1915. data/sproutcore/themes/standard_theme/Source/icons/24/41.png +0 -0
  1916. data/sproutcore/themes/standard_theme/Source/icons/24/99.png +0 -0
  1917. data/sproutcore/themes/standard_theme/Source/icons/32/10.png +0 -0
  1918. data/sproutcore/themes/standard_theme/Source/icons/32/100.png +0 -0
  1919. data/sproutcore/themes/standard_theme/Source/icons/32/102.png +0 -0
  1920. data/sproutcore/themes/standard_theme/Source/icons/32/110.png +0 -0
  1921. data/sproutcore/themes/standard_theme/Source/icons/32/120.png +0 -0
  1922. data/sproutcore/themes/standard_theme/Source/icons/32/127.png +0 -0
  1923. data/sproutcore/themes/standard_theme/Source/icons/32/18.png +0 -0
  1924. data/sproutcore/themes/standard_theme/Source/icons/32/19.png +0 -0
  1925. data/sproutcore/themes/standard_theme/Source/icons/32/2.png +0 -0
  1926. data/sproutcore/themes/standard_theme/Source/icons/32/24.png +0 -0
  1927. data/sproutcore/themes/standard_theme/Source/icons/32/26.png +0 -0
  1928. data/sproutcore/themes/standard_theme/Source/icons/32/27.png +0 -0
  1929. data/sproutcore/themes/standard_theme/Source/icons/32/28.png +0 -0
  1930. data/sproutcore/themes/standard_theme/Source/icons/32/29.png +0 -0
  1931. data/sproutcore/themes/standard_theme/Source/icons/32/30.png +0 -0
  1932. data/sproutcore/themes/standard_theme/Source/icons/32/31.png +0 -0
  1933. data/sproutcore/themes/standard_theme/Source/icons/32/33.png +0 -0
  1934. data/sproutcore/themes/standard_theme/Source/icons/32/37.png +0 -0
  1935. data/sproutcore/themes/standard_theme/Source/icons/32/41.png +0 -0
  1936. data/sproutcore/themes/standard_theme/Source/icons/32/99.png +0 -0
  1937. data/sproutcore/themes/standard_theme/Source/icons/48/10.png +0 -0
  1938. data/sproutcore/themes/standard_theme/Source/icons/48/18.png +0 -0
  1939. data/sproutcore/themes/standard_theme/Source/icons/48/19.png +0 -0
  1940. data/sproutcore/themes/standard_theme/Source/icons/48/2.png +0 -0
  1941. data/sproutcore/themes/standard_theme/Source/panel-sprite-x.drawit/Data +0 -0
  1942. data/sproutcore/themes/standard_theme/Source/panel-sprite-x.drawit/QuickLook/Preview.jpg +0 -0
  1943. data/sproutcore/themes/standard_theme/Source/panel-sprite-x.drawit/QuickLook/Thumbnail.jpg +0 -0
  1944. data/sproutcore/themes/standard_theme/Source/panel-sprite-y.drawit/Data +0 -0
  1945. data/sproutcore/themes/standard_theme/Source/panel-sprite-y.drawit/QuickLook/Preview.jpg +0 -0
  1946. data/sproutcore/themes/standard_theme/Source/panel-sprite-y.drawit/QuickLook/Thumbnail.jpg +0 -0
  1947. data/sproutcore/themes/standard_theme/Source/sc-theme-repeat-x-2.psd +0 -0
  1948. data/sproutcore/themes/standard_theme/Source/sc-theme-repeat-x.psd +0 -0
  1949. data/sproutcore/themes/standard_theme/Source/sc-theme-sprite.psd +0 -0
  1950. data/sproutcore/themes/standard_theme/Source/sc-theme-ysprite.psd +0 -0
  1951. data/sproutcore/themes/standard_theme/Source/shared-icons.psd +0 -0
  1952. data/sproutcore/themes/standard_theme/Source/sproutcore-logo.psd +0 -0
  1953. data/sproutcore/themes/standard_theme/Source/sticky-note.psd +0 -0
  1954. data/sproutcore/themes/standard_theme/english.lproj/button.css +399 -0
  1955. data/sproutcore/themes/standard_theme/english.lproj/checkbox.css +78 -0
  1956. data/sproutcore/themes/standard_theme/english.lproj/collection.css +135 -0
  1957. data/sproutcore/themes/standard_theme/english.lproj/core.css +76 -0
  1958. data/sproutcore/themes/standard_theme/english.lproj/disclosure.css +57 -0
  1959. data/sproutcore/themes/standard_theme/english.lproj/images/icons/mini_222222.png +0 -0
  1960. data/sproutcore/themes/standard_theme/english.lproj/images/icons/mini_454545.png +0 -0
  1961. data/sproutcore/themes/standard_theme/english.lproj/images/icons/mini_888888.png +0 -0
  1962. data/sproutcore/themes/standard_theme/english.lproj/images/icons/mini_ffffff.png +0 -0
  1963. data/sproutcore/themes/standard_theme/english.lproj/images/panels/sprite-x.png +0 -0
  1964. data/sproutcore/themes/standard_theme/english.lproj/images/panels/sprite-y.png +0 -0
  1965. data/sproutcore/themes/standard_theme/english.lproj/images/sc-scroller-repeat-x.png +0 -0
  1966. data/sproutcore/themes/standard_theme/english.lproj/images/sc-scroller-repeat-y.png +0 -0
  1967. data/sproutcore/themes/standard_theme/english.lproj/images/sc-scroller-sprite.png +0 -0
  1968. data/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-repeat-x.png +0 -0
  1969. data/sproutcore/themes/standard_theme/english.lproj/images/sc-theme-ysprite.png +0 -0
  1970. data/sproutcore/themes/standard_theme/english.lproj/images/sc-toolbar-view.png +0 -0
  1971. data/sproutcore/themes/standard_theme/english.lproj/label.css +11 -0
  1972. data/sproutcore/themes/standard_theme/english.lproj/list_item.css +82 -0
  1973. data/sproutcore/themes/standard_theme/english.lproj/menu.css +20 -0
  1974. data/sproutcore/themes/standard_theme/english.lproj/menu_item_view.css +36 -0
  1975. data/sproutcore/themes/standard_theme/english.lproj/pane.css +18 -0
  1976. data/sproutcore/themes/standard_theme/english.lproj/panel.css +33 -0
  1977. data/sproutcore/themes/standard_theme/english.lproj/picker.css +17 -0
  1978. data/sproutcore/themes/standard_theme/english.lproj/progress.css +27 -0
  1979. data/sproutcore/themes/standard_theme/english.lproj/radio.css +125 -0
  1980. data/sproutcore/themes/standard_theme/english.lproj/scroller.css +159 -0
  1981. data/sproutcore/themes/standard_theme/english.lproj/segmented.css +270 -0
  1982. data/sproutcore/themes/standard_theme/english.lproj/slider.css +94 -0
  1983. data/sproutcore/themes/standard_theme/english.lproj/split_view.css +11 -0
  1984. data/sproutcore/themes/standard_theme/english.lproj/tab.css +14 -0
  1985. data/sproutcore/themes/standard_theme/english.lproj/table.css +14 -0
  1986. data/sproutcore/themes/standard_theme/english.lproj/text_field.css +5 -0
  1987. data/sproutcore/themes/standard_theme/english.lproj/toolbar.css +7 -0
  1988. data/sproutcore/themes/standard_theme/english.lproj/well.css +36 -0
  1989. data/test-spade.html +8 -0
  1990. metadata +2111 -0
@@ -0,0 +1,399 @@
1
+ <!DOCTYPE html> <html> <head> <title>grammar.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="browser.html"> browser.coffee </a> <a class="source" href="cake.html"> cake.coffee </a> <a class="source" href="coffee-script.html"> coffee-script.coffee </a> <a class="source" href="command.html"> command.coffee </a> <a class="source" href="grammar.html"> grammar.coffee </a> <a class="source" href="helpers.html"> helpers.coffee </a> <a class="source" href="index.html"> index.coffee </a> <a class="source" href="lexer.html"> lexer.coffee </a> <a class="source" href="nodes.html"> nodes.coffee </a> <a class="source" href="optparse.html"> optparse.coffee </a> <a class="source" href="repl.html"> repl.coffee </a> <a class="source" href="rewriter.html"> rewriter.coffee </a> <a class="source" href="scope.html"> scope.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> grammar.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>The CoffeeScript parser is generated by <a href="http://github.com/zaach/jison">Jison</a>
2
+ from this grammar file. Jison is a bottom-up parser generator, similar in
3
+ style to <a href="http://www.gnu.org/software/bison">Bison</a>, implemented in JavaScript.
4
+ It can recognize <a href="http://en.wikipedia.org/wiki/LR_grammar">LALR(1), LR(0), SLR(1), and LR(1)</a>
5
+ type grammars. To create the Jison parser, we list the pattern to match
6
+ on the left-hand side, and the action to take (usually the creation of syntax
7
+ tree nodes) on the right. As the parser runs, it
8
+ shifts tokens from our token stream, from left to right, and
9
+ <a href="http://en.wikipedia.org/wiki/Bottom-up_parsing">attempts to match</a>
10
+ the token sequence against the rules below. When a match can be made, it
11
+ reduces into the <a href="http://en.wikipedia.org/wiki/Terminal_and_nonterminal_symbols">nonterminal</a>
12
+ (the enclosing name at the top), and we proceed from there.</p>
13
+
14
+ <p>If you run the <code>cake build:parser</code> command, Jison constructs a parse table
15
+ from our rules and saves it into <code>lib/parser.js</code>.</p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>The only dependency is on the <strong>Jison.Parser</strong>.</p> </td> <td class="code"> <div class="highlight"><pre><span class="p">{</span><span class="nx">Parser</span><span class="p">}</span> <span class="o">=</span> <span class="nx">require</span> <span class="s1">&#39;jison&#39;</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <h2>Jison DSL</h2> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>Since we're going to be wrapped in a function by Jison in any case, if our
16
+ action immediately returns a value, we can optimize by removing the function
17
+ wrapper and just returning the value directly.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">unwrap = </span><span class="sr">/^function\s*\(\)\s*\{\s*return\s*([\s\S]*);\s*\}/</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>Our handy DSL for Jison grammar generation, thanks to
18
+ <a href="http://github.com/creationix">Tim Caswell</a>. For every rule in the grammar,
19
+ we pass the pattern-defining string, the action to run, and extra options,
20
+ optionally. If no action is specified, we simply pass the value of the
21
+ previous nonterminal.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">o = </span><span class="p">(</span><span class="nx">patternString</span><span class="p">,</span> <span class="nx">action</span><span class="p">,</span> <span class="nx">options</span><span class="p">)</span> <span class="o">-&gt;</span>
22
+ <span class="nv">patternString = </span><span class="nx">patternString</span><span class="p">.</span><span class="nx">replace</span> <span class="sr">/\s{2,}/g</span><span class="p">,</span> <span class="s1">&#39; &#39;</span>
23
+ <span class="k">return</span> <span class="p">[</span><span class="nx">patternString</span><span class="p">,</span> <span class="s1">&#39;$$ = $1;&#39;</span><span class="p">,</span> <span class="nx">options</span><span class="p">]</span> <span class="nx">unless</span> <span class="nx">action</span>
24
+ <span class="nv">action = </span><span class="k">if</span> <span class="nv">match = </span><span class="nx">unwrap</span><span class="p">.</span><span class="nx">exec</span> <span class="nx">action</span> <span class="k">then</span> <span class="nx">match</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="k">else</span> <span class="s2">&quot;(#{action}())&quot;</span>
25
+ <span class="nv">action = </span><span class="nx">action</span><span class="p">.</span><span class="nx">replace</span> <span class="sr">/\bnew /g</span><span class="p">,</span> <span class="s1">&#39;$&amp;yy.&#39;</span>
26
+ <span class="nv">action = </span><span class="nx">action</span><span class="p">.</span><span class="nx">replace</span> <span class="sr">/\b(?:Expressions\.wrap|extend)\b/g</span><span class="p">,</span> <span class="s1">&#39;yy.$&amp;&#39;</span>
27
+ <span class="p">[</span><span class="nx">patternString</span><span class="p">,</span> <span class="s2">&quot;$$ = #{action};&quot;</span><span class="p">,</span> <span class="nx">options</span><span class="p">]</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <h2>Grammatical Rules</h2> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <p>In all of the rules that follow, you'll see the name of the nonterminal as
28
+ the key to a list of alternative matches. With each match's action, the
29
+ dollar-sign variables are provided by Jison as references to the value of
30
+ their numeric position, so in this rule:</p>
31
+
32
+ <pre><code>"Expression UNLESS Expression"
33
+ </code></pre>
34
+
35
+ <p><code>$1</code> would be the value of the first <code>Expression</code>, <code>$2</code> would be the token
36
+ for the <code>UNLESS</code> terminal, and <code>$3</code> would be the value of the second
37
+ <code>Expression</code>.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">grammar =</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <p>The <strong>Root</strong> is the top-level node in the syntax tree. Since we parse bottom-up,
38
+ all parsing must end here.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Root</span><span class="o">:</span> <span class="p">[</span>
39
+ <span class="nx">o</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Expressions</span>
40
+ <span class="nx">o</span> <span class="s1">&#39;Body&#39;</span>
41
+ <span class="nx">o</span> <span class="s1">&#39;Block TERMINATOR&#39;</span>
42
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#182;</a> </div> <p>Any list of statements and expressions, separated by line breaks or semicolons.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Body</span><span class="o">:</span> <span class="p">[</span>
43
+ <span class="nx">o</span> <span class="s1">&#39;Line&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">Expressions</span><span class="p">.</span><span class="nx">wrap</span> <span class="p">[</span><span class="nx">$1</span><span class="p">]</span>
44
+ <span class="nx">o</span> <span class="s1">&#39;Body TERMINATOR Line&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">$1</span><span class="p">.</span><span class="nx">push</span> <span class="nx">$3</span>
45
+ <span class="nx">o</span> <span class="s1">&#39;Body TERMINATOR&#39;</span>
46
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-10">&#182;</a> </div> <p>Expressions and statements, which make up a line in a body.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Line</span><span class="o">:</span> <span class="p">[</span>
47
+ <span class="nx">o</span> <span class="s1">&#39;Expression&#39;</span>
48
+ <span class="nx">o</span> <span class="s1">&#39;Statement&#39;</span>
49
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-11"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-11">&#182;</a> </div> <p>Pure statements which cannot be expressions.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Statement</span><span class="o">:</span> <span class="p">[</span>
50
+ <span class="nx">o</span> <span class="s1">&#39;Return&#39;</span>
51
+ <span class="nx">o</span> <span class="s1">&#39;Throw&#39;</span>
52
+ <span class="nx">o</span> <span class="s1">&#39;Comment&#39;</span>
53
+ <span class="nx">o</span> <span class="s1">&#39;STATEMENT&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Literal</span> <span class="nx">$1</span>
54
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-12"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-12">&#182;</a> </div> <p>All the different types of expressions in our language. The basic unit of
55
+ CoffeeScript is the <strong>Expression</strong> -- everything that can be an expression
56
+ is one. Expressions serve as the building blocks of many other rules, making
57
+ them somewhat circular.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Expression</span><span class="o">:</span> <span class="p">[</span>
58
+ <span class="nx">o</span> <span class="s1">&#39;Value&#39;</span>
59
+ <span class="nx">o</span> <span class="s1">&#39;Invocation&#39;</span>
60
+ <span class="nx">o</span> <span class="s1">&#39;Code&#39;</span>
61
+ <span class="nx">o</span> <span class="s1">&#39;Operation&#39;</span>
62
+ <span class="nx">o</span> <span class="s1">&#39;Assign&#39;</span>
63
+ <span class="nx">o</span> <span class="s1">&#39;If&#39;</span>
64
+ <span class="nx">o</span> <span class="s1">&#39;Try&#39;</span>
65
+ <span class="nx">o</span> <span class="s1">&#39;While&#39;</span>
66
+ <span class="nx">o</span> <span class="s1">&#39;For&#39;</span>
67
+ <span class="nx">o</span> <span class="s1">&#39;Switch&#39;</span>
68
+ <span class="nx">o</span> <span class="s1">&#39;Class&#39;</span>
69
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-13"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-13">&#182;</a> </div> <p>An indented block of expressions. Note that the <a href="rewriter.html">Rewriter</a>
70
+ will convert some postfix forms into blocks for us, by adjusting the
71
+ token stream.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Block</span><span class="o">:</span> <span class="p">[</span>
72
+ <span class="nx">o</span> <span class="s1">&#39;INDENT OUTDENT&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Expressions</span>
73
+ <span class="nx">o</span> <span class="s1">&#39;INDENT Body OUTDENT&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">$2</span>
74
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-14"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-14">&#182;</a> </div> <p>A literal identifier, a variable name or property.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Identifier</span><span class="o">:</span> <span class="p">[</span>
75
+ <span class="nx">o</span> <span class="s1">&#39;IDENTIFIER&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Literal</span> <span class="nx">$1</span>
76
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-15"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-15">&#182;</a> </div> <p>Alphanumerics are separated from the other <strong>Literal</strong> matchers because
77
+ they can also serve as keys in object literals.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">AlphaNumeric</span><span class="o">:</span> <span class="p">[</span>
78
+ <span class="nx">o</span> <span class="s1">&#39;NUMBER&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Literal</span> <span class="nx">$1</span>
79
+ <span class="nx">o</span> <span class="s1">&#39;STRING&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Literal</span> <span class="nx">$1</span>
80
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-16"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-16">&#182;</a> </div> <p>All of our immediate values. These can (in general), be passed straight
81
+ through and printed to JavaScript.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Literal</span><span class="o">:</span> <span class="p">[</span>
82
+ <span class="nx">o</span> <span class="s1">&#39;AlphaNumeric&#39;</span>
83
+ <span class="nx">o</span> <span class="s1">&#39;JS&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Literal</span> <span class="nx">$1</span>
84
+ <span class="nx">o</span> <span class="s1">&#39;REGEX&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Literal</span> <span class="nx">$1</span>
85
+ <span class="nx">o</span> <span class="s1">&#39;BOOL&#39;</span><span class="p">,</span> <span class="o">-&gt;</span>
86
+ <span class="k">new</span> <span class="nx">Literal</span> <span class="k">if</span> <span class="nx">$1</span> <span class="o">is</span> <span class="s1">&#39;undefined&#39;</span> <span class="k">then</span> <span class="s1">&#39;void 0&#39;</span> <span class="k">else</span> <span class="nx">$1</span>
87
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-17"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-17">&#182;</a> </div> <p>Assignment of a variable, property, or index to a value.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Assign</span><span class="o">:</span> <span class="p">[</span>
88
+ <span class="nx">o</span> <span class="s1">&#39;Assignable = Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Assign</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$3</span>
89
+ <span class="nx">o</span> <span class="s1">&#39;Assignable = INDENT Expression OUTDENT&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Assign</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$4</span>
90
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-18"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-18">&#182;</a> </div> <p>Assignment when it happens within an object literal. The difference from
91
+ the ordinary <strong>Assign</strong> is that these allow numbers and strings as keys.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">AssignObj</span><span class="o">:</span> <span class="p">[</span>
92
+ <span class="nx">o</span> <span class="s1">&#39;ObjAssignable&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Value</span> <span class="nx">$1</span>
93
+ <span class="nx">o</span> <span class="s1">&#39;ObjAssignable : Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Assign</span> <span class="k">new</span> <span class="nx">Value</span><span class="p">(</span><span class="nx">$1</span><span class="p">),</span> <span class="nx">$3</span><span class="p">,</span> <span class="s1">&#39;object&#39;</span>
94
+ <span class="nx">o</span> <span class="s1">&#39;ObjAssignable :</span>
95
+ <span class="s1"> INDENT Expression OUTDENT&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Assign</span> <span class="k">new</span> <span class="nx">Value</span><span class="p">(</span><span class="nx">$1</span><span class="p">),</span> <span class="nx">$4</span><span class="p">,</span> <span class="s1">&#39;object&#39;</span>
96
+ <span class="nx">o</span> <span class="s1">&#39;Comment&#39;</span>
97
+ <span class="p">]</span>
98
+
99
+ <span class="nx">ObjAssignable</span><span class="o">:</span> <span class="p">[</span>
100
+ <span class="nx">o</span> <span class="s1">&#39;Identifier&#39;</span>
101
+ <span class="nx">o</span> <span class="s1">&#39;AlphaNumeric&#39;</span>
102
+ <span class="nx">o</span> <span class="s1">&#39;ThisProperty&#39;</span>
103
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-19"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-19">&#182;</a> </div> <p>A return statement from a function body.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Return</span><span class="o">:</span> <span class="p">[</span>
104
+ <span class="nx">o</span> <span class="s1">&#39;RETURN Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Return</span> <span class="nx">$2</span>
105
+ <span class="nx">o</span> <span class="s1">&#39;RETURN&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Return</span>
106
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-20"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-20">&#182;</a> </div> <p>A block comment.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Comment</span><span class="o">:</span> <span class="p">[</span>
107
+ <span class="nx">o</span> <span class="s1">&#39;HERECOMMENT&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Comment</span> <span class="nx">$1</span>
108
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-21"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-21">&#182;</a> </div> <p>The <strong>Code</strong> node is the function literal. It's defined by an indented block
109
+ of <strong>Expressions</strong> preceded by a function arrow, with an optional parameter
110
+ list.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Code</span><span class="o">:</span> <span class="p">[</span>
111
+ <span class="nx">o</span> <span class="s1">&#39;PARAM_START ParamList PARAM_END FuncGlyph Block&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Code</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$5</span><span class="p">,</span> <span class="nx">$4</span>
112
+ <span class="nx">o</span> <span class="s1">&#39;FuncGlyph Block&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Code</span> <span class="p">[],</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$1</span>
113
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-22"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-22">&#182;</a> </div> <p>CoffeeScript has two different symbols for functions. <code>-&gt;</code> is for ordinary
114
+ functions, and <code>=&gt;</code> is for functions bound to the current value of <em>this</em>.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">FuncGlyph</span><span class="o">:</span> <span class="p">[</span>
115
+ <span class="nx">o</span> <span class="s1">&#39;-&gt;&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="s1">&#39;func&#39;</span>
116
+ <span class="nx">o</span> <span class="s1">&#39;=&gt;&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="s1">&#39;boundfunc&#39;</span>
117
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-23"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-23">&#182;</a> </div> <p>An optional, trailing comma.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">OptComma</span><span class="o">:</span> <span class="p">[</span>
118
+ <span class="nx">o</span> <span class="s1">&#39;&#39;</span>
119
+ <span class="nx">o</span> <span class="s1">&#39;,&#39;</span>
120
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-24"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-24">&#182;</a> </div> <p>The list of parameters that a function accepts can be of any length.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">ParamList</span><span class="o">:</span> <span class="p">[</span>
121
+ <span class="nx">o</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="p">[]</span>
122
+ <span class="nx">o</span> <span class="s1">&#39;Param&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="p">[</span><span class="nx">$1</span><span class="p">]</span>
123
+ <span class="nx">o</span> <span class="s1">&#39;ParamList , Param&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">$1</span><span class="p">.</span><span class="nx">concat</span> <span class="nx">$3</span>
124
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-25"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-25">&#182;</a> </div> <p>A single parameter in a function definition can be ordinary, or a splat
125
+ that hoovers up the remaining arguments.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Param</span><span class="o">:</span> <span class="p">[</span>
126
+ <span class="nx">o</span> <span class="s1">&#39;ParamVar&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Param</span> <span class="nx">$1</span>
127
+ <span class="nx">o</span> <span class="s1">&#39;ParamVar ...&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Param</span> <span class="nx">$1</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="kc">on</span>
128
+ <span class="nx">o</span> <span class="s1">&#39;ParamVar = Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Param</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$3</span>
129
+ <span class="p">]</span>
130
+
131
+ <span class="nx">ParamVar</span><span class="o">:</span> <span class="p">[</span>
132
+ <span class="nx">o</span> <span class="s1">&#39;Identifier&#39;</span>
133
+ <span class="nx">o</span> <span class="s1">&#39;ThisProperty&#39;</span>
134
+ <span class="nx">o</span> <span class="s1">&#39;Array&#39;</span>
135
+ <span class="nx">o</span> <span class="s1">&#39;Object&#39;</span>
136
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-26"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-26">&#182;</a> </div> <p>A splat that occurs outside of a parameter list.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Splat</span><span class="o">:</span> <span class="p">[</span>
137
+ <span class="nx">o</span> <span class="s1">&#39;Expression ...&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Splat</span> <span class="nx">$1</span>
138
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-27"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-27">&#182;</a> </div> <p>Variables and properties that can be assigned to.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">SimpleAssignable</span><span class="o">:</span> <span class="p">[</span>
139
+ <span class="nx">o</span> <span class="s1">&#39;Identifier&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Value</span> <span class="nx">$1</span>
140
+ <span class="nx">o</span> <span class="s1">&#39;Value Accessor&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">$1</span><span class="p">.</span><span class="nx">push</span> <span class="nx">$2</span>
141
+ <span class="nx">o</span> <span class="s1">&#39;Invocation Accessor&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Value</span> <span class="nx">$1</span><span class="p">,</span> <span class="p">[</span><span class="nx">$2</span><span class="p">]</span>
142
+ <span class="nx">o</span> <span class="s1">&#39;ThisProperty&#39;</span>
143
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-28"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-28">&#182;</a> </div> <p>Everything that can be assigned to.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Assignable</span><span class="o">:</span> <span class="p">[</span>
144
+ <span class="nx">o</span> <span class="s1">&#39;SimpleAssignable&#39;</span>
145
+ <span class="nx">o</span> <span class="s1">&#39;Array&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Value</span> <span class="nx">$1</span>
146
+ <span class="nx">o</span> <span class="s1">&#39;Object&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Value</span> <span class="nx">$1</span>
147
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-29"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-29">&#182;</a> </div> <p>The types of things that can be treated as values -- assigned to, invoked
148
+ as functions, indexed into, named as a class, etc.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Value</span><span class="o">:</span> <span class="p">[</span>
149
+ <span class="nx">o</span> <span class="s1">&#39;Assignable&#39;</span>
150
+ <span class="nx">o</span> <span class="s1">&#39;Literal&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Value</span> <span class="nx">$1</span>
151
+ <span class="nx">o</span> <span class="s1">&#39;Parenthetical&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Value</span> <span class="nx">$1</span>
152
+ <span class="nx">o</span> <span class="s1">&#39;Range&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Value</span> <span class="nx">$1</span>
153
+ <span class="nx">o</span> <span class="s1">&#39;This&#39;</span>
154
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-30"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-30">&#182;</a> </div> <p>The general group of accessors into an object, by property, by prototype
155
+ or by array index or slice.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Accessor</span><span class="o">:</span> <span class="p">[</span>
156
+ <span class="nx">o</span> <span class="s1">&#39;. Identifier&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Access</span> <span class="nx">$2</span>
157
+ <span class="nx">o</span> <span class="s1">&#39;?. Identifier&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Access</span> <span class="nx">$2</span><span class="p">,</span> <span class="s1">&#39;soak&#39;</span>
158
+ <span class="nx">o</span> <span class="s1">&#39;:: Identifier&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Access</span> <span class="nx">$2</span><span class="p">,</span> <span class="s1">&#39;proto&#39;</span>
159
+ <span class="nx">o</span> <span class="s1">&#39;::&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Access</span> <span class="k">new</span> <span class="nx">Literal</span> <span class="s1">&#39;prototype&#39;</span>
160
+ <span class="nx">o</span> <span class="s1">&#39;Index&#39;</span>
161
+ <span class="nx">o</span> <span class="s1">&#39;Slice&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Slice</span> <span class="nx">$1</span>
162
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-31"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-31">&#182;</a> </div> <p>Indexing into an object or array using bracket notation.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Index</span><span class="o">:</span> <span class="p">[</span>
163
+ <span class="nx">o</span> <span class="s1">&#39;INDEX_START Expression INDEX_END&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Index</span> <span class="nx">$2</span>
164
+ <span class="nx">o</span> <span class="s1">&#39;INDEX_SOAK Index&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">extend</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">soak</span> <span class="o">:</span> <span class="kc">yes</span>
165
+ <span class="nx">o</span> <span class="s1">&#39;INDEX_PROTO Index&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">extend</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">proto</span><span class="o">:</span> <span class="kc">yes</span>
166
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-32"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-32">&#182;</a> </div> <p>In CoffeeScript, an object literal is simply a list of assignments.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nb">Object</span><span class="o">:</span> <span class="p">[</span>
167
+ <span class="nx">o</span> <span class="s1">&#39;{ AssignList OptComma }&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Obj</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$1</span><span class="p">.</span><span class="nx">generated</span>
168
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-33"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-33">&#182;</a> </div> <p>Assignment of properties within an object literal can be separated by
169
+ comma, as in JavaScript, or simply by newline.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">AssignList</span><span class="o">:</span> <span class="p">[</span>
170
+ <span class="nx">o</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="p">[]</span>
171
+ <span class="nx">o</span> <span class="s1">&#39;AssignObj&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="p">[</span><span class="nx">$1</span><span class="p">]</span>
172
+ <span class="nx">o</span> <span class="s1">&#39;AssignList , AssignObj&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">$1</span><span class="p">.</span><span class="nx">concat</span> <span class="nx">$3</span>
173
+ <span class="nx">o</span> <span class="s1">&#39;AssignList OptComma TERMINATOR AssignObj&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">$1</span><span class="p">.</span><span class="nx">concat</span> <span class="nx">$4</span>
174
+ <span class="nx">o</span> <span class="s1">&#39;AssignList OptComma INDENT AssignList OptComma OUTDENT&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">$1</span><span class="p">.</span><span class="nx">concat</span> <span class="nx">$4</span>
175
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-34"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-34">&#182;</a> </div> <p>Class definitions have optional bodies of prototype property assignments,
176
+ and optional references to the superclass.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Class</span><span class="o">:</span> <span class="p">[</span>
177
+ <span class="nx">o</span> <span class="s1">&#39;CLASS&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Class</span>
178
+ <span class="nx">o</span> <span class="s1">&#39;CLASS Block&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Class</span> <span class="kc">null</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">$2</span>
179
+ <span class="nx">o</span> <span class="s1">&#39;CLASS EXTENDS Value&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Class</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">$3</span>
180
+ <span class="nx">o</span> <span class="s1">&#39;CLASS EXTENDS Value Block&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Class</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">$3</span><span class="p">,</span> <span class="nx">$4</span>
181
+ <span class="nx">o</span> <span class="s1">&#39;CLASS SimpleAssignable&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Class</span> <span class="nx">$2</span>
182
+ <span class="nx">o</span> <span class="s1">&#39;CLASS SimpleAssignable Block&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Class</span> <span class="nx">$2</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">$3</span>
183
+ <span class="nx">o</span> <span class="s1">&#39;CLASS SimpleAssignable EXTENDS Value&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Class</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$4</span>
184
+ <span class="nx">o</span> <span class="s1">&#39;CLASS SimpleAssignable EXTENDS Value Block&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Class</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$4</span><span class="p">,</span> <span class="nx">$5</span>
185
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-35"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-35">&#182;</a> </div> <p>Ordinary function invocation, or a chained series of calls.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Invocation</span><span class="o">:</span> <span class="p">[</span>
186
+ <span class="nx">o</span> <span class="s1">&#39;Value OptFuncExist Arguments&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Call</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$3</span><span class="p">,</span> <span class="nx">$2</span>
187
+ <span class="nx">o</span> <span class="s1">&#39;Invocation OptFuncExist Arguments&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Call</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$3</span><span class="p">,</span> <span class="nx">$2</span>
188
+ <span class="nx">o</span> <span class="s1">&#39;SUPER&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Call</span> <span class="s1">&#39;super&#39;</span><span class="p">,</span> <span class="p">[</span><span class="k">new</span> <span class="nx">Splat</span> <span class="k">new</span> <span class="nx">Literal</span> <span class="s1">&#39;arguments&#39;</span><span class="p">]</span>
189
+ <span class="nx">o</span> <span class="s1">&#39;SUPER Arguments&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Call</span> <span class="s1">&#39;super&#39;</span><span class="p">,</span> <span class="nx">$2</span>
190
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-36"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-36">&#182;</a> </div> <p>An optional existence check on a function.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">OptFuncExist</span><span class="o">:</span> <span class="p">[</span>
191
+ <span class="nx">o</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="kc">no</span>
192
+ <span class="nx">o</span> <span class="s1">&#39;FUNC_EXIST&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="kc">yes</span>
193
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-37"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-37">&#182;</a> </div> <p>The list of arguments to a function call.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Arguments</span><span class="o">:</span> <span class="p">[</span>
194
+ <span class="nx">o</span> <span class="s1">&#39;CALL_START CALL_END&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="p">[]</span>
195
+ <span class="nx">o</span> <span class="s1">&#39;CALL_START ArgList OptComma CALL_END&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">$2</span>
196
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-38"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-38">&#182;</a> </div> <p>A reference to the <em>this</em> current object.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">This</span><span class="o">:</span> <span class="p">[</span>
197
+ <span class="nx">o</span> <span class="s1">&#39;THIS&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Value</span> <span class="k">new</span> <span class="nx">Literal</span> <span class="s1">&#39;this&#39;</span>
198
+ <span class="nx">o</span> <span class="s1">&#39;@&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Value</span> <span class="k">new</span> <span class="nx">Literal</span> <span class="s1">&#39;this&#39;</span>
199
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-39"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-39">&#182;</a> </div> <p>A reference to a property on <em>this</em>.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">ThisProperty</span><span class="o">:</span> <span class="p">[</span>
200
+ <span class="nx">o</span> <span class="s1">&#39;@ Identifier&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Value</span> <span class="k">new</span> <span class="nx">Literal</span><span class="p">(</span><span class="s1">&#39;this&#39;</span><span class="p">),</span> <span class="p">[</span><span class="k">new</span> <span class="nx">Access</span><span class="p">(</span><span class="nx">$2</span><span class="p">)],</span> <span class="s1">&#39;this&#39;</span>
201
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-40"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-40">&#182;</a> </div> <p>The array literal.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nb">Array</span><span class="o">:</span> <span class="p">[</span>
202
+ <span class="nx">o</span> <span class="s1">&#39;[ ]&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Arr</span> <span class="p">[]</span>
203
+ <span class="nx">o</span> <span class="s1">&#39;[ ArgList OptComma ]&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Arr</span> <span class="nx">$2</span>
204
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-41"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-41">&#182;</a> </div> <p>Inclusive and exclusive range dots.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">RangeDots</span><span class="o">:</span> <span class="p">[</span>
205
+ <span class="nx">o</span> <span class="s1">&#39;..&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="s1">&#39;inclusive&#39;</span>
206
+ <span class="nx">o</span> <span class="s1">&#39;...&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="s1">&#39;exclusive&#39;</span>
207
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-42"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-42">&#182;</a> </div> <p>The CoffeeScript range literal.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Range</span><span class="o">:</span> <span class="p">[</span>
208
+ <span class="nx">o</span> <span class="s1">&#39;[ Expression RangeDots Expression ]&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Range</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$4</span><span class="p">,</span> <span class="nx">$3</span>
209
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-43"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-43">&#182;</a> </div> <p>Array slice literals.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Slice</span><span class="o">:</span> <span class="p">[</span>
210
+ <span class="nx">o</span> <span class="s1">&#39;INDEX_START Expression RangeDots Expression INDEX_END&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Range</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$4</span><span class="p">,</span> <span class="nx">$3</span>
211
+ <span class="nx">o</span> <span class="s1">&#39;INDEX_START Expression RangeDots INDEX_END&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Range</span> <span class="nx">$2</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">$3</span>
212
+ <span class="nx">o</span> <span class="s1">&#39;INDEX_START RangeDots Expression INDEX_END&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Range</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">$3</span><span class="p">,</span> <span class="nx">$2</span>
213
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-44"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-44">&#182;</a> </div> <p>The <strong>ArgList</strong> is both the list of objects passed into a function call,
214
+ as well as the contents of an array literal
215
+ (i.e. comma-separated expressions). Newlines work as well.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">ArgList</span><span class="o">:</span> <span class="p">[</span>
216
+ <span class="nx">o</span> <span class="s1">&#39;Arg&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="p">[</span><span class="nx">$1</span><span class="p">]</span>
217
+ <span class="nx">o</span> <span class="s1">&#39;ArgList , Arg&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">$1</span><span class="p">.</span><span class="nx">concat</span> <span class="nx">$3</span>
218
+ <span class="nx">o</span> <span class="s1">&#39;ArgList OptComma TERMINATOR Arg&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">$1</span><span class="p">.</span><span class="nx">concat</span> <span class="nx">$4</span>
219
+ <span class="nx">o</span> <span class="s1">&#39;INDENT ArgList OptComma OUTDENT&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">$2</span>
220
+ <span class="nx">o</span> <span class="s1">&#39;ArgList OptComma INDENT ArgList OptComma OUTDENT&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">$1</span><span class="p">.</span><span class="nx">concat</span> <span class="nx">$4</span>
221
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-45"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-45">&#182;</a> </div> <p>Valid arguments are Expressions or Splats.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Arg</span><span class="o">:</span> <span class="p">[</span>
222
+ <span class="nx">o</span> <span class="s1">&#39;Expression&#39;</span>
223
+ <span class="nx">o</span> <span class="s1">&#39;Splat&#39;</span>
224
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-46"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-46">&#182;</a> </div> <p>Just simple, comma-separated, required arguments (no fancy syntax). We need
225
+ this to be separate from the <strong>ArgList</strong> for use in <strong>Switch</strong> blocks, where
226
+ having the newlines wouldn't make sense.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">SimpleArgs</span><span class="o">:</span> <span class="p">[</span>
227
+ <span class="nx">o</span> <span class="s1">&#39;Expression&#39;</span>
228
+ <span class="nx">o</span> <span class="s1">&#39;SimpleArgs , Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="p">[].</span><span class="nx">concat</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$3</span>
229
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-47"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-47">&#182;</a> </div> <p>The variants of <em>try/catch/finally</em> exception handling blocks.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Try</span><span class="o">:</span> <span class="p">[</span>
230
+ <span class="nx">o</span> <span class="s1">&#39;TRY Block&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Try</span> <span class="nx">$2</span>
231
+ <span class="nx">o</span> <span class="s1">&#39;TRY Block Catch&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Try</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$3</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nx">$3</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
232
+ <span class="nx">o</span> <span class="s1">&#39;TRY Block FINALLY Block&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Try</span> <span class="nx">$2</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">$4</span>
233
+ <span class="nx">o</span> <span class="s1">&#39;TRY Block Catch FINALLY Block&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Try</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$3</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nx">$3</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="nx">$5</span>
234
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-48"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-48">&#182;</a> </div> <p>A catch clause names its error and runs a block of code.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Catch</span><span class="o">:</span> <span class="p">[</span>
235
+ <span class="nx">o</span> <span class="s1">&#39;CATCH Identifier Block&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="p">[</span><span class="nx">$2</span><span class="p">,</span> <span class="nx">$3</span><span class="p">]</span>
236
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-49"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-49">&#182;</a> </div> <p>Throw an exception object.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Throw</span><span class="o">:</span> <span class="p">[</span>
237
+ <span class="nx">o</span> <span class="s1">&#39;THROW Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Throw</span> <span class="nx">$2</span>
238
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-50"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-50">&#182;</a> </div> <p>Parenthetical expressions. Note that the <strong>Parenthetical</strong> is a <strong>Value</strong>,
239
+ not an <strong>Expression</strong>, so if you need to use an expression in a place
240
+ where only values are accepted, wrapping it in parentheses will always do
241
+ the trick.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Parenthetical</span><span class="o">:</span> <span class="p">[</span>
242
+ <span class="nx">o</span> <span class="s1">&#39;( Body )&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Parens</span> <span class="nx">$2</span>
243
+ <span class="nx">o</span> <span class="s1">&#39;( INDENT Body OUTDENT )&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Parens</span> <span class="nx">$3</span>
244
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-51"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-51">&#182;</a> </div> <p>The condition portion of a while loop.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">WhileSource</span><span class="o">:</span> <span class="p">[</span>
245
+ <span class="nx">o</span> <span class="s1">&#39;WHILE Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">While</span> <span class="nx">$2</span>
246
+ <span class="nx">o</span> <span class="s1">&#39;WHILE Expression WHEN Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">While</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">guard</span><span class="o">:</span> <span class="nx">$4</span>
247
+ <span class="nx">o</span> <span class="s1">&#39;UNTIL Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">While</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">invert</span><span class="o">:</span> <span class="kc">true</span>
248
+ <span class="nx">o</span> <span class="s1">&#39;UNTIL Expression WHEN Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">While</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">invert</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">guard</span><span class="o">:</span> <span class="nx">$4</span>
249
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-52"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-52">&#182;</a> </div> <p>The while loop can either be normal, with a block of expressions to execute,
250
+ or postfix, with a single expression. There is no do..while.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">While</span><span class="o">:</span> <span class="p">[</span>
251
+ <span class="nx">o</span> <span class="s1">&#39;WhileSource Block&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">$1</span><span class="p">.</span><span class="nx">addBody</span> <span class="nx">$2</span>
252
+ <span class="nx">o</span> <span class="s1">&#39;Statement WhileSource&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">$2</span><span class="p">.</span><span class="nx">addBody</span> <span class="nx">Expressions</span><span class="p">.</span><span class="nx">wrap</span> <span class="p">[</span><span class="nx">$1</span><span class="p">]</span>
253
+ <span class="nx">o</span> <span class="s1">&#39;Expression WhileSource&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">$2</span><span class="p">.</span><span class="nx">addBody</span> <span class="nx">Expressions</span><span class="p">.</span><span class="nx">wrap</span> <span class="p">[</span><span class="nx">$1</span><span class="p">]</span>
254
+ <span class="nx">o</span> <span class="s1">&#39;Loop&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">$1</span>
255
+ <span class="p">]</span>
256
+
257
+ <span class="nx">Loop</span><span class="o">:</span> <span class="p">[</span>
258
+ <span class="nx">o</span> <span class="s1">&#39;LOOP Block&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">While</span><span class="p">(</span><span class="k">new</span> <span class="nx">Literal</span> <span class="s1">&#39;true&#39;</span><span class="p">).</span><span class="nx">addBody</span> <span class="nx">$2</span>
259
+ <span class="nx">o</span> <span class="s1">&#39;LOOP Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">While</span><span class="p">(</span><span class="k">new</span> <span class="nx">Literal</span> <span class="s1">&#39;true&#39;</span><span class="p">).</span><span class="nx">addBody</span> <span class="nx">Expressions</span><span class="p">.</span><span class="nx">wrap</span> <span class="p">[</span><span class="nx">$2</span><span class="p">]</span>
260
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-53"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-53">&#182;</a> </div> <p>Array, object, and range comprehensions, at the most generic level.
261
+ Comprehensions can either be normal, with a block of expressions to execute,
262
+ or postfix, with a single expression.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">For</span><span class="o">:</span> <span class="p">[</span>
263
+ <span class="nx">o</span> <span class="s1">&#39;Statement ForBody&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">For</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$2</span>
264
+ <span class="nx">o</span> <span class="s1">&#39;Expression ForBody&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">For</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$2</span>
265
+ <span class="nx">o</span> <span class="s1">&#39;ForBody Block&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">For</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$1</span>
266
+ <span class="p">]</span>
267
+
268
+ <span class="nx">ForBody</span><span class="o">:</span> <span class="p">[</span>
269
+ <span class="nx">o</span> <span class="s1">&#39;FOR Range&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">source</span><span class="o">:</span> <span class="k">new</span> <span class="nx">Value</span><span class="p">(</span><span class="nx">$2</span><span class="p">)</span>
270
+ <span class="nx">o</span> <span class="s1">&#39;ForStart ForSource&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nv">$2.own = </span><span class="nx">$1</span><span class="p">.</span><span class="nx">own</span><span class="p">;</span> <span class="nv">$2.name = </span><span class="nx">$1</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span> <span class="nv">$2.index = </span><span class="nx">$1</span><span class="p">[</span><span class="mi">1</span><span class="p">];</span> <span class="nx">$2</span>
271
+ <span class="p">]</span>
272
+
273
+ <span class="nx">ForStart</span><span class="o">:</span> <span class="p">[</span>
274
+ <span class="nx">o</span> <span class="s1">&#39;FOR ForVariables&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">$2</span>
275
+ <span class="nx">o</span> <span class="s1">&#39;FOR OWN ForVariables&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nv">$3.own = </span><span class="kc">yes</span><span class="p">;</span> <span class="nx">$3</span>
276
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-54"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-54">&#182;</a> </div> <p>An array of all accepted values for a variable inside the loop.
277
+ This enables support for pattern matching.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">ForValue</span><span class="o">:</span> <span class="p">[</span>
278
+ <span class="nx">o</span> <span class="s1">&#39;Identifier&#39;</span>
279
+ <span class="nx">o</span> <span class="s1">&#39;Array&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Value</span> <span class="nx">$1</span>
280
+ <span class="nx">o</span> <span class="s1">&#39;Object&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Value</span> <span class="nx">$1</span>
281
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-55"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-55">&#182;</a> </div> <p>An array or range comprehension has variables for the current element
282
+ and (optional) reference to the current index. Or, <em>key, value</em>, in the case
283
+ of object comprehensions.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">ForVariables</span><span class="o">:</span> <span class="p">[</span>
284
+ <span class="nx">o</span> <span class="s1">&#39;ForValue&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="p">[</span><span class="nx">$1</span><span class="p">]</span>
285
+ <span class="nx">o</span> <span class="s1">&#39;ForValue , ForValue&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="p">[</span><span class="nx">$1</span><span class="p">,</span> <span class="nx">$3</span><span class="p">]</span>
286
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-56"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-56">&#182;</a> </div> <p>The source of a comprehension is an array or object with an optional guard
287
+ clause. If it's an array comprehension, you can also choose to step through
288
+ in fixed-size increments.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">ForSource</span><span class="o">:</span> <span class="p">[</span>
289
+ <span class="nx">o</span> <span class="s1">&#39;FORIN Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">source</span><span class="o">:</span> <span class="nx">$2</span>
290
+ <span class="nx">o</span> <span class="s1">&#39;FOROF Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">source</span><span class="o">:</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">object</span><span class="o">:</span> <span class="kc">yes</span>
291
+ <span class="nx">o</span> <span class="s1">&#39;FORIN Expression WHEN Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">source</span><span class="o">:</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">guard</span><span class="o">:</span> <span class="nx">$4</span>
292
+ <span class="nx">o</span> <span class="s1">&#39;FOROF Expression WHEN Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">source</span><span class="o">:</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">guard</span><span class="o">:</span> <span class="nx">$4</span><span class="p">,</span> <span class="nx">object</span><span class="o">:</span> <span class="kc">yes</span>
293
+ <span class="nx">o</span> <span class="s1">&#39;FORIN Expression BY Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">source</span><span class="o">:</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">step</span><span class="o">:</span> <span class="nx">$4</span>
294
+ <span class="nx">o</span> <span class="s1">&#39;FORIN Expression WHEN Expression BY Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">source</span><span class="o">:</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">guard</span><span class="o">:</span> <span class="nx">$4</span><span class="p">,</span> <span class="nx">step</span><span class="o">:</span> <span class="nx">$6</span>
295
+ <span class="nx">o</span> <span class="s1">&#39;FORIN Expression BY Expression WHEN Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">source</span><span class="o">:</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">step</span><span class="o">:</span> <span class="nx">$4</span><span class="p">,</span> <span class="nx">guard</span><span class="o">:</span> <span class="nx">$6</span>
296
+ <span class="p">]</span>
297
+
298
+ <span class="nx">Switch</span><span class="o">:</span> <span class="p">[</span>
299
+ <span class="nx">o</span> <span class="s1">&#39;SWITCH Expression INDENT Whens OUTDENT&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Switch</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$4</span>
300
+ <span class="nx">o</span> <span class="s1">&#39;SWITCH Expression INDENT Whens ELSE Block OUTDENT&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Switch</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$4</span><span class="p">,</span> <span class="nx">$6</span>
301
+ <span class="nx">o</span> <span class="s1">&#39;SWITCH INDENT Whens OUTDENT&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Switch</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">$3</span>
302
+ <span class="nx">o</span> <span class="s1">&#39;SWITCH INDENT Whens ELSE Block OUTDENT&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Switch</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">$3</span><span class="p">,</span> <span class="nx">$5</span>
303
+ <span class="p">]</span>
304
+
305
+ <span class="nx">Whens</span><span class="o">:</span> <span class="p">[</span>
306
+ <span class="nx">o</span> <span class="s1">&#39;When&#39;</span>
307
+ <span class="nx">o</span> <span class="s1">&#39;Whens When&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">$1</span><span class="p">.</span><span class="nx">concat</span> <span class="nx">$2</span>
308
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-57"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-57">&#182;</a> </div> <p>An individual <strong>When</strong> clause, with action.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">When</span><span class="o">:</span> <span class="p">[</span>
309
+ <span class="nx">o</span> <span class="s1">&#39;LEADING_WHEN SimpleArgs Block&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="p">[[</span><span class="nx">$2</span><span class="p">,</span> <span class="nx">$3</span><span class="p">]]</span>
310
+ <span class="nx">o</span> <span class="s1">&#39;LEADING_WHEN SimpleArgs Block TERMINATOR&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="p">[[</span><span class="nx">$2</span><span class="p">,</span> <span class="nx">$3</span><span class="p">]]</span>
311
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-58"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-58">&#182;</a> </div> <p>The most basic form of <em>if</em> is a condition and an action. The following
312
+ if-related rules are broken up along these lines in order to avoid
313
+ ambiguity.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">IfBlock</span><span class="o">:</span> <span class="p">[</span>
314
+ <span class="nx">o</span> <span class="s1">&#39;IF Expression Block&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">If</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$3</span><span class="p">,</span> <span class="nx">type</span><span class="o">:</span> <span class="nx">$1</span>
315
+ <span class="nx">o</span> <span class="s1">&#39;IfBlock ELSE IF Expression Block&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">$1</span><span class="p">.</span><span class="nx">addElse</span> <span class="k">new</span> <span class="nx">If</span> <span class="nx">$4</span><span class="p">,</span> <span class="nx">$5</span><span class="p">,</span> <span class="nx">type</span><span class="o">:</span> <span class="nx">$3</span>
316
+ <span class="nx">o</span> <span class="s1">&#39;IfBlock ELSE Block&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="nx">$1</span><span class="p">.</span><span class="nx">addElse</span> <span class="nx">$3</span>
317
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-59"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-59">&#182;</a> </div> <p>The full complement of <em>if</em> expressions, including postfix one-liner
318
+ <em>if</em> and <em>unless</em>.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">If</span><span class="o">:</span> <span class="p">[</span>
319
+ <span class="nx">o</span> <span class="s1">&#39;IfBlock&#39;</span>
320
+ <span class="nx">o</span> <span class="s1">&#39;Statement POST_IF Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">If</span> <span class="nx">$3</span><span class="p">,</span> <span class="nx">Expressions</span><span class="p">.</span><span class="nx">wrap</span><span class="p">([</span><span class="nx">$1</span><span class="p">]),</span> <span class="nx">type</span><span class="o">:</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">statement</span><span class="o">:</span> <span class="kc">true</span>
321
+ <span class="nx">o</span> <span class="s1">&#39;Expression POST_IF Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">If</span> <span class="nx">$3</span><span class="p">,</span> <span class="nx">Expressions</span><span class="p">.</span><span class="nx">wrap</span><span class="p">([</span><span class="nx">$1</span><span class="p">]),</span> <span class="nx">type</span><span class="o">:</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">statement</span><span class="o">:</span> <span class="kc">true</span>
322
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-60"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-60">&#182;</a> </div> <p>Arithmetic and logical operators, working on one or more operands.
323
+ Here they are grouped by order of precedence. The actual precedence rules
324
+ are defined at the bottom of the page. It would be shorter if we could
325
+ combine most of these rules into a single generic <em>Operand OpSymbol Operand</em>
326
+ -type rule, but in order to make the precedence binding possible, separate
327
+ rules are necessary.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">Operation</span><span class="o">:</span> <span class="p">[</span>
328
+ <span class="nx">o</span> <span class="s1">&#39;UNARY Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Op</span> <span class="nx">$1</span> <span class="p">,</span> <span class="nx">$2</span>
329
+ <span class="nx">o</span> <span class="s1">&#39;- Expression&#39;</span><span class="p">,</span> <span class="p">(</span><span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Op</span> <span class="s1">&#39;-&#39;</span><span class="p">,</span> <span class="nx">$2</span><span class="p">),</span> <span class="nx">prec</span><span class="o">:</span> <span class="s1">&#39;UNARY&#39;</span>
330
+ <span class="nx">o</span> <span class="s1">&#39;+ Expression&#39;</span><span class="p">,</span> <span class="p">(</span><span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Op</span> <span class="s1">&#39;+&#39;</span><span class="p">,</span> <span class="nx">$2</span><span class="p">),</span> <span class="nx">prec</span><span class="o">:</span> <span class="s1">&#39;UNARY&#39;</span>
331
+
332
+ <span class="nx">o</span> <span class="s1">&#39;-- SimpleAssignable&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Op</span> <span class="s1">&#39;--&#39;</span><span class="p">,</span> <span class="nx">$2</span>
333
+ <span class="nx">o</span> <span class="s1">&#39;++ SimpleAssignable&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Op</span> <span class="s1">&#39;++&#39;</span><span class="p">,</span> <span class="nx">$2</span>
334
+ <span class="nx">o</span> <span class="s1">&#39;SimpleAssignable --&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Op</span> <span class="s1">&#39;--&#39;</span><span class="p">,</span> <span class="nx">$1</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="kc">true</span>
335
+ <span class="nx">o</span> <span class="s1">&#39;SimpleAssignable ++&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Op</span> <span class="s1">&#39;++&#39;</span><span class="p">,</span> <span class="nx">$1</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="kc">true</span></pre></div> </td> </tr> <tr id="section-61"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-61">&#182;</a> </div> <p><a href="http://jashkenas.github.com/coffee-script/#existence">The existential operator</a>.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">o</span> <span class="s1">&#39;Expression ?&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Existence</span> <span class="nx">$1</span>
336
+
337
+ <span class="nx">o</span> <span class="s1">&#39;Expression + Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Op</span> <span class="s1">&#39;+&#39;</span> <span class="p">,</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$3</span>
338
+ <span class="nx">o</span> <span class="s1">&#39;Expression - Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Op</span> <span class="s1">&#39;-&#39;</span> <span class="p">,</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$3</span>
339
+
340
+ <span class="nx">o</span> <span class="s1">&#39;Expression MATH Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Op</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$3</span>
341
+ <span class="nx">o</span> <span class="s1">&#39;Expression SHIFT Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Op</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$3</span>
342
+ <span class="nx">o</span> <span class="s1">&#39;Expression COMPARE Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Op</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$3</span>
343
+ <span class="nx">o</span> <span class="s1">&#39;Expression LOGIC Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Op</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$3</span>
344
+ <span class="nx">o</span> <span class="s1">&#39;Expression RELATION Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span>
345
+ <span class="k">if</span> <span class="nx">$2</span><span class="p">.</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">is</span> <span class="s1">&#39;!&#39;</span>
346
+ <span class="k">new</span> <span class="nx">Op</span><span class="p">(</span><span class="nx">$2</span><span class="p">.</span><span class="nx">slice</span><span class="p">(</span><span class="mi">1</span><span class="p">),</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$3</span><span class="p">).</span><span class="nx">invert</span><span class="p">()</span>
347
+ <span class="k">else</span>
348
+ <span class="k">new</span> <span class="nx">Op</span> <span class="nx">$2</span><span class="p">,</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$3</span>
349
+
350
+ <span class="nx">o</span> <span class="s1">&#39;SimpleAssignable COMPOUND_ASSIGN</span>
351
+ <span class="s1"> Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Assign</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$3</span><span class="p">,</span> <span class="nx">$2</span>
352
+ <span class="nx">o</span> <span class="s1">&#39;SimpleAssignable COMPOUND_ASSIGN</span>
353
+ <span class="s1"> INDENT Expression OUTDENT&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Assign</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$4</span><span class="p">,</span> <span class="nx">$2</span>
354
+ <span class="nx">o</span> <span class="s1">&#39;SimpleAssignable EXTENDS Expression&#39;</span><span class="p">,</span> <span class="o">-&gt;</span> <span class="k">new</span> <span class="nx">Extends</span> <span class="nx">$1</span><span class="p">,</span> <span class="nx">$3</span>
355
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-62"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-62">&#182;</a> </div> <h2>Precedence</h2> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-63"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-63">&#182;</a> </div> <p>Operators at the top of this list have higher precedence than the ones lower
356
+ down. Following these rules is what makes <code>2 + 3 * 4</code> parse as:</p>
357
+
358
+ <pre><code>2 + (3 * 4)
359
+ </code></pre>
360
+
361
+ <p>And not:</p>
362
+
363
+ <pre><code>(2 + 3) * 4
364
+ </code></pre> </td> <td class="code"> <div class="highlight"><pre><span class="nv">operators = </span><span class="p">[</span>
365
+ <span class="p">[</span><span class="s1">&#39;left&#39;</span><span class="p">,</span> <span class="s1">&#39;.&#39;</span><span class="p">,</span> <span class="s1">&#39;?.&#39;</span><span class="p">,</span> <span class="s1">&#39;::&#39;</span><span class="p">]</span>
366
+ <span class="p">[</span><span class="s1">&#39;left&#39;</span><span class="p">,</span> <span class="s1">&#39;CALL_START&#39;</span><span class="p">,</span> <span class="s1">&#39;CALL_END&#39;</span><span class="p">]</span>
367
+ <span class="p">[</span><span class="s1">&#39;nonassoc&#39;</span><span class="p">,</span> <span class="s1">&#39;++&#39;</span><span class="p">,</span> <span class="s1">&#39;--&#39;</span><span class="p">]</span>
368
+ <span class="p">[</span><span class="s1">&#39;left&#39;</span><span class="p">,</span> <span class="s1">&#39;?&#39;</span><span class="p">]</span>
369
+ <span class="p">[</span><span class="s1">&#39;right&#39;</span><span class="p">,</span> <span class="s1">&#39;UNARY&#39;</span><span class="p">]</span>
370
+ <span class="p">[</span><span class="s1">&#39;left&#39;</span><span class="p">,</span> <span class="s1">&#39;MATH&#39;</span><span class="p">]</span>
371
+ <span class="p">[</span><span class="s1">&#39;left&#39;</span><span class="p">,</span> <span class="s1">&#39;+&#39;</span><span class="p">,</span> <span class="s1">&#39;-&#39;</span><span class="p">]</span>
372
+ <span class="p">[</span><span class="s1">&#39;left&#39;</span><span class="p">,</span> <span class="s1">&#39;SHIFT&#39;</span><span class="p">]</span>
373
+ <span class="p">[</span><span class="s1">&#39;left&#39;</span><span class="p">,</span> <span class="s1">&#39;RELATION&#39;</span><span class="p">]</span>
374
+ <span class="p">[</span><span class="s1">&#39;left&#39;</span><span class="p">,</span> <span class="s1">&#39;COMPARE&#39;</span><span class="p">]</span>
375
+ <span class="p">[</span><span class="s1">&#39;left&#39;</span><span class="p">,</span> <span class="s1">&#39;LOGIC&#39;</span><span class="p">]</span>
376
+ <span class="p">[</span><span class="s1">&#39;nonassoc&#39;</span><span class="p">,</span> <span class="s1">&#39;INDENT&#39;</span><span class="p">,</span> <span class="s1">&#39;OUTDENT&#39;</span><span class="p">]</span>
377
+ <span class="p">[</span><span class="s1">&#39;right&#39;</span><span class="p">,</span> <span class="s1">&#39;=&#39;</span><span class="p">,</span> <span class="s1">&#39;:&#39;</span><span class="p">,</span> <span class="s1">&#39;COMPOUND_ASSIGN&#39;</span><span class="p">,</span> <span class="s1">&#39;RETURN&#39;</span><span class="p">,</span> <span class="s1">&#39;THROW&#39;</span><span class="p">,</span> <span class="s1">&#39;EXTENDS&#39;</span><span class="p">]</span>
378
+ <span class="p">[</span><span class="s1">&#39;right&#39;</span><span class="p">,</span> <span class="s1">&#39;FORIN&#39;</span><span class="p">,</span> <span class="s1">&#39;FOROF&#39;</span><span class="p">,</span> <span class="s1">&#39;BY&#39;</span><span class="p">,</span> <span class="s1">&#39;WHEN&#39;</span><span class="p">]</span>
379
+ <span class="p">[</span><span class="s1">&#39;right&#39;</span><span class="p">,</span> <span class="s1">&#39;IF&#39;</span><span class="p">,</span> <span class="s1">&#39;ELSE&#39;</span><span class="p">,</span> <span class="s1">&#39;FOR&#39;</span><span class="p">,</span> <span class="s1">&#39;DO&#39;</span><span class="p">,</span> <span class="s1">&#39;WHILE&#39;</span><span class="p">,</span> <span class="s1">&#39;UNTIL&#39;</span><span class="p">,</span> <span class="s1">&#39;LOOP&#39;</span><span class="p">,</span> <span class="s1">&#39;SUPER&#39;</span><span class="p">,</span> <span class="s1">&#39;CLASS&#39;</span><span class="p">]</span>
380
+ <span class="p">[</span><span class="s1">&#39;right&#39;</span><span class="p">,</span> <span class="s1">&#39;POST_IF&#39;</span><span class="p">]</span>
381
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-64"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-64">&#182;</a> </div> <h2>Wrapping Up</h2> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-65"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-65">&#182;</a> </div> <p>Finally, now what we have our <strong>grammar</strong> and our <strong>operators</strong>, we can create
382
+ our <strong>Jison.Parser</strong>. We do this by processing all of our rules, recording all
383
+ terminals (every symbol which does not appear as the name of a rule above)
384
+ as "tokens".</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">tokens = </span><span class="p">[]</span>
385
+ <span class="k">for</span> <span class="nx">name</span><span class="p">,</span> <span class="nx">alternatives</span> <span class="k">of</span> <span class="nx">grammar</span>
386
+ <span class="nx">grammar</span><span class="p">[</span><span class="nx">name</span><span class="p">]</span> <span class="o">=</span> <span class="k">for</span> <span class="nx">alt</span> <span class="k">in</span> <span class="nx">alternatives</span>
387
+ <span class="k">for</span> <span class="nx">token</span> <span class="k">in</span> <span class="nx">alt</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">split</span> <span class="s1">&#39; &#39;</span>
388
+ <span class="nx">tokens</span><span class="p">.</span><span class="nx">push</span> <span class="nx">token</span> <span class="nx">unless</span> <span class="nx">grammar</span><span class="p">[</span><span class="nx">token</span><span class="p">]</span>
389
+ <span class="nx">alt</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;return #{alt[1]}&quot;</span> <span class="k">if</span> <span class="nx">name</span> <span class="o">is</span> <span class="s1">&#39;Root&#39;</span>
390
+ <span class="nx">alt</span></pre></div> </td> </tr> <tr id="section-66"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-66">&#182;</a> </div> <p>Initialize the <strong>Parser</strong> with our list of terminal <strong>tokens</strong>, our <strong>grammar</strong>
391
+ rules, and the name of the root. Reverse the operators because Jison orders
392
+ precedence from low to high, and we have it high to low
393
+ (as in <a href="http://dinosaur.compilertools.net/yacc/index.html">Yacc</a>).</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.parser = </span><span class="k">new</span> <span class="nx">Parser</span>
394
+ <span class="nx">tokens</span> <span class="o">:</span> <span class="nx">tokens</span><span class="p">.</span><span class="nx">join</span> <span class="s1">&#39; &#39;</span>
395
+ <span class="nx">bnf</span> <span class="o">:</span> <span class="nx">grammar</span>
396
+ <span class="nx">operators</span> <span class="o">:</span> <span class="nx">operators</span><span class="p">.</span><span class="nx">reverse</span><span class="p">()</span>
397
+ <span class="nx">startSymbol</span> <span class="o">:</span> <span class="s1">&#39;Root&#39;</span>
398
+
399
+ </pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
@@ -0,0 +1,31 @@
1
+ <!DOCTYPE html> <html> <head> <title>helpers.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="browser.html"> browser.coffee </a> <a class="source" href="cake.html"> cake.coffee </a> <a class="source" href="coffee-script.html"> coffee-script.coffee </a> <a class="source" href="command.html"> command.coffee </a> <a class="source" href="grammar.html"> grammar.coffee </a> <a class="source" href="helpers.html"> helpers.coffee </a> <a class="source" href="index.html"> index.coffee </a> <a class="source" href="lexer.html"> lexer.coffee </a> <a class="source" href="nodes.html"> nodes.coffee </a> <a class="source" href="optparse.html"> optparse.coffee </a> <a class="source" href="repl.html"> repl.coffee </a> <a class="source" href="rewriter.html"> rewriter.coffee </a> <a class="source" href="scope.html"> scope.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> helpers.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>This file contains the common helper functions that we'd like to share among
2
+ the <strong>Lexer</strong>, <strong>Rewriter</strong>, and the <strong>Nodes</strong>. Merge objects, flatten
3
+ arrays, count characters, that sort of thing.</p> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>Peek at the beginning of a given string to see if it matches a sequence.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.starts = </span><span class="p">(</span><span class="nx">string</span><span class="p">,</span> <span class="nx">literal</span><span class="p">,</span> <span class="nx">start</span><span class="p">)</span> <span class="o">-&gt;</span>
4
+ <span class="nx">literal</span> <span class="o">is</span> <span class="nx">string</span><span class="p">.</span><span class="nx">substr</span> <span class="nx">start</span><span class="p">,</span> <span class="nx">literal</span><span class="p">.</span><span class="nx">length</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>Peek at the end of a given string to see if it matches a sequence.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.ends = </span><span class="p">(</span><span class="nx">string</span><span class="p">,</span> <span class="nx">literal</span><span class="p">,</span> <span class="nx">back</span><span class="p">)</span> <span class="o">-&gt;</span>
5
+ <span class="nv">len = </span><span class="nx">literal</span><span class="p">.</span><span class="nx">length</span>
6
+ <span class="nx">literal</span> <span class="o">is</span> <span class="nx">string</span><span class="p">.</span><span class="nx">substr</span> <span class="nx">string</span><span class="p">.</span><span class="nx">length</span> <span class="o">-</span> <span class="nx">len</span> <span class="o">-</span> <span class="p">(</span><span class="nx">back</span> <span class="o">or</span> <span class="mi">0</span><span class="p">),</span> <span class="nx">len</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>Trim out all falsy values from an array.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.compact = </span><span class="p">(</span><span class="nx">array</span><span class="p">)</span> <span class="o">-&gt;</span>
7
+ <span class="nx">item</span> <span class="k">for</span> <span class="nx">item</span> <span class="k">in</span> <span class="nx">array</span> <span class="k">when</span> <span class="nx">item</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>Count the number of occurrences of a string in a string.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.count = </span><span class="p">(</span><span class="nx">string</span><span class="p">,</span> <span class="nx">substr</span><span class="p">)</span> <span class="o">-&gt;</span>
8
+ <span class="nv">num = pos = </span><span class="mi">0</span>
9
+ <span class="k">return</span> <span class="mi">1</span><span class="o">/</span><span class="mi">0</span> <span class="nx">unless</span> <span class="nx">substr</span><span class="p">.</span><span class="nx">length</span>
10
+ <span class="nx">num</span><span class="o">++</span> <span class="k">while</span> <span class="nv">pos = </span><span class="mi">1</span> <span class="o">+</span> <span class="nx">string</span><span class="p">.</span><span class="nx">indexOf</span> <span class="nx">substr</span><span class="p">,</span> <span class="nx">pos</span>
11
+ <span class="nx">num</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <p>Merge objects, returning a fresh copy with attributes from both sides.
12
+ Used every time <code>Base#compile</code> is called, to allow properties in the
13
+ options hash to propagate down the tree without polluting other branches.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.merge = </span><span class="p">(</span><span class="nx">options</span><span class="p">,</span> <span class="nx">overrides</span><span class="p">)</span> <span class="o">-&gt;</span>
14
+ <span class="nx">extend</span> <span class="p">(</span><span class="nx">extend</span> <span class="p">{},</span> <span class="nx">options</span><span class="p">),</span> <span class="nx">overrides</span></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <p>Extend a source object with the properties of another object (shallow copy).</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">extend = exports.extend = </span><span class="p">(</span><span class="nx">object</span><span class="p">,</span> <span class="nx">properties</span><span class="p">)</span> <span class="o">-&gt;</span>
15
+ <span class="k">for</span> <span class="nx">key</span><span class="p">,</span> <span class="nx">val</span> <span class="k">of</span> <span class="nx">properties</span>
16
+ <span class="nx">object</span><span class="p">[</span><span class="nx">key</span><span class="p">]</span> <span class="o">=</span> <span class="nx">val</span>
17
+ <span class="nx">object</span></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <p>Return a flattened version of an array.
18
+ Handy for getting a list of <code>children</code> from the nodes.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.flatten = flatten = </span><span class="p">(</span><span class="nx">array</span><span class="p">)</span> <span class="o">-&gt;</span>
19
+ <span class="nv">flattened = </span><span class="p">[]</span>
20
+ <span class="k">for</span> <span class="nx">element</span> <span class="k">in</span> <span class="nx">array</span>
21
+ <span class="k">if</span> <span class="nx">element</span> <span class="k">instanceof</span> <span class="nb">Array</span>
22
+ <span class="nv">flattened = </span><span class="nx">flattened</span><span class="p">.</span><span class="nx">concat</span> <span class="nx">flatten</span> <span class="nx">element</span>
23
+ <span class="k">else</span>
24
+ <span class="nx">flattened</span><span class="p">.</span><span class="nx">push</span> <span class="nx">element</span>
25
+ <span class="nx">flattened</span></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#182;</a> </div> <p>Delete a key from an object, returning the value. Useful when a node is
26
+ looking for a particular method in an options hash.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.del = </span><span class="p">(</span><span class="nx">obj</span><span class="p">,</span> <span class="nx">key</span><span class="p">)</span> <span class="o">-&gt;</span>
27
+ <span class="nv">val = </span> <span class="nx">obj</span><span class="p">[</span><span class="nx">key</span><span class="p">]</span>
28
+ <span class="k">delete</span> <span class="nx">obj</span><span class="p">[</span><span class="nx">key</span><span class="p">]</span>
29
+ <span class="nx">val</span></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-10">&#182;</a> </div> <p>Gets the last item of an array(-like) object.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.last = </span><span class="p">(</span><span class="nx">array</span><span class="p">,</span> <span class="nx">back</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nx">array</span><span class="p">[</span><span class="nx">array</span><span class="p">.</span><span class="nx">length</span> <span class="o">-</span> <span class="p">(</span><span class="nx">back</span> <span class="o">or</span> <span class="mi">0</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span>
30
+
31
+ </pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
@@ -0,0 +1,3 @@
1
+ <!DOCTYPE html> <html> <head> <title>index.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="browser.html"> browser.coffee </a> <a class="source" href="cake.html"> cake.coffee </a> <a class="source" href="coffee-script.html"> coffee-script.coffee </a> <a class="source" href="command.html"> command.coffee </a> <a class="source" href="grammar.html"> grammar.coffee </a> <a class="source" href="helpers.html"> helpers.coffee </a> <a class="source" href="index.html"> index.coffee </a> <a class="source" href="lexer.html"> lexer.coffee </a> <a class="source" href="nodes.html"> nodes.coffee </a> <a class="source" href="optparse.html"> optparse.coffee </a> <a class="source" href="repl.html"> repl.coffee </a> <a class="source" href="rewriter.html"> rewriter.coffee </a> <a class="source" href="scope.html"> scope.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> index.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Loader for CoffeeScript as a Node.js library.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nx">exports</span><span class="p">[</span><span class="nx">key</span><span class="p">]</span> <span class="o">=</span> <span class="nx">val</span> <span class="k">for</span> <span class="nx">key</span><span class="p">,</span> <span class="nx">val</span> <span class="k">of</span> <span class="nx">require</span> <span class="s1">&#39;./coffee-script&#39;</span>
2
+
3
+ </pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
@@ -0,0 +1,490 @@
1
+ <!DOCTYPE html> <html> <head> <title>lexer.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="browser.html"> browser.coffee </a> <a class="source" href="cake.html"> cake.coffee </a> <a class="source" href="coffee-script.html"> coffee-script.coffee </a> <a class="source" href="command.html"> command.coffee </a> <a class="source" href="grammar.html"> grammar.coffee </a> <a class="source" href="helpers.html"> helpers.coffee </a> <a class="source" href="index.html"> index.coffee </a> <a class="source" href="lexer.html"> lexer.coffee </a> <a class="source" href="nodes.html"> nodes.coffee </a> <a class="source" href="optparse.html"> optparse.coffee </a> <a class="source" href="repl.html"> repl.coffee </a> <a class="source" href="rewriter.html"> rewriter.coffee </a> <a class="source" href="scope.html"> scope.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> lexer.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>The CoffeeScript Lexer. Uses a series of token-matching regexes to attempt
2
+ matches against the beginning of the source code. When a match is found,
3
+ a token is produced, we consume the match, and start again. Tokens are in the
4
+ form:</p>
5
+
6
+ <pre><code>[tag, value, lineNumber]
7
+ </code></pre>
8
+
9
+ <p>Which is a format that can be fed directly into <a href="http://github.com/zaach/jison">Jison</a>.</p> </td> <td class="code"> <div class="highlight"><pre><span class="p">{</span><span class="nx">Rewriter</span><span class="p">}</span> <span class="o">=</span> <span class="nx">require</span> <span class="s1">&#39;./rewriter&#39;</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>Import the helpers we need.</p> </td> <td class="code"> <div class="highlight"><pre><span class="p">{</span><span class="nx">count</span><span class="p">,</span> <span class="nx">starts</span><span class="p">,</span> <span class="nx">compact</span><span class="p">,</span> <span class="nx">last</span><span class="p">}</span> <span class="o">=</span> <span class="nx">require</span> <span class="s1">&#39;./helpers&#39;</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <h2>The Lexer Class</h2> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>The Lexer class reads a stream of CoffeeScript and divvies it up into tagged
10
+ tokens. Some potential ambiguity in the grammar has been avoided by
11
+ pushing some extra smarts into the Lexer.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.Lexer = </span><span class="nx">class</span> <span class="nx">Lexer</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p><strong>tokenize</strong> is the Lexer's main method. Scan by attempting to match tokens
12
+ one at a time, using a regular expression anchored at the start of the
13
+ remaining code, or a custom recursive token-matching method
14
+ (for interpolations). When the next token has been recorded, we move forward
15
+ within the code past the token, and begin again.</p>
16
+
17
+ <p>Each tokenizing method is responsible for returning the number of characters
18
+ it has consumed.</p>
19
+
20
+ <p>Before returning the token stream, run it through the <a href="rewriter.html">Rewriter</a>
21
+ unless explicitly asked not to.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">tokenize</span><span class="o">:</span> <span class="p">(</span><span class="nx">code</span><span class="p">,</span> <span class="nv">opts = </span><span class="p">{})</span> <span class="o">-&gt;</span>
22
+ <span class="nv">code = </span><span class="nx">code</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\r/g</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">).</span><span class="nx">replace</span> <span class="nx">TRAILING_SPACES</span><span class="p">,</span> <span class="s1">&#39;&#39;</span>
23
+
24
+ <span class="vi">@code = </span><span class="nx">code</span> <span class="c1"># The remainder of the source code.</span>
25
+ <span class="vi">@line = </span><span class="nx">opts</span><span class="p">.</span><span class="nx">line</span> <span class="o">or</span> <span class="mi">0</span> <span class="c1"># The current line.</span>
26
+ <span class="vi">@indent = </span><span class="mi">0</span> <span class="c1"># The current indentation level.</span>
27
+ <span class="vi">@indebt = </span><span class="mi">0</span> <span class="c1"># The over-indentation at the current level.</span>
28
+ <span class="vi">@outdebt = </span><span class="mi">0</span> <span class="c1"># The under-outdentation at the current level.</span>
29
+ <span class="vi">@indents = </span><span class="p">[]</span> <span class="c1"># The stack of all current indentation levels.</span>
30
+ <span class="vi">@tokens = </span><span class="p">[]</span> <span class="c1"># Stream of parsed tokens in the form `[&#39;TYPE&#39;, value, line]`.</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <p>At every position, run through this list of attempted matches,
31
+ short-circuiting if any of them succeed. Their order determines precedence:
32
+ <code>@literalToken</code> is the fallback catch-all.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">i = </span><span class="mi">0</span>
33
+ <span class="k">while</span> <span class="vi">@chunk = </span><span class="nx">code</span><span class="p">.</span><span class="nx">slice</span> <span class="nx">i</span>
34
+ <span class="nx">i</span> <span class="o">+=</span> <span class="nx">@identifierToken</span><span class="p">()</span> <span class="o">or</span>
35
+ <span class="nx">@commentToken</span><span class="p">()</span> <span class="o">or</span>
36
+ <span class="nx">@whitespaceToken</span><span class="p">()</span> <span class="o">or</span>
37
+ <span class="nx">@lineToken</span><span class="p">()</span> <span class="o">or</span>
38
+ <span class="nx">@heredocToken</span><span class="p">()</span> <span class="o">or</span>
39
+ <span class="nx">@stringToken</span><span class="p">()</span> <span class="o">or</span>
40
+ <span class="nx">@numberToken</span><span class="p">()</span> <span class="o">or</span>
41
+ <span class="nx">@regexToken</span><span class="p">()</span> <span class="o">or</span>
42
+ <span class="nx">@jsToken</span><span class="p">()</span> <span class="o">or</span>
43
+ <span class="nx">@literalToken</span><span class="p">()</span>
44
+
45
+ <span class="nx">@closeIndentation</span><span class="p">()</span>
46
+ <span class="k">return</span> <span class="nx">@tokens</span> <span class="k">if</span> <span class="nx">opts</span><span class="p">.</span><span class="nx">rewrite</span> <span class="o">is</span> <span class="kc">off</span>
47
+ <span class="p">(</span><span class="k">new</span> <span class="nx">Rewriter</span><span class="p">).</span><span class="nx">rewrite</span> <span class="nx">@tokens</span></pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <h2>Tokenizers</h2> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <p>Matches identifying literals: variables, keywords, method names, etc.
48
+ Check to ensure that JavaScript reserved words aren't being used as
49
+ identifiers. Because CoffeeScript reserves a handful of keywords that are
50
+ allowed in JavaScript, we're careful not to tag them as keywords when
51
+ referenced as property names here, so you can still do <code>jQuery.is()</code> even
52
+ though <code>is</code> means <code>===</code> otherwise.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">identifierToken</span><span class="o">:</span> <span class="o">-&gt;</span>
53
+ <span class="k">return</span> <span class="mi">0</span> <span class="nx">unless</span> <span class="nv">match = </span><span class="nx">IDENTIFIER</span><span class="p">.</span><span class="nx">exec</span> <span class="nx">@chunk</span>
54
+ <span class="p">[</span><span class="nx">input</span><span class="p">,</span> <span class="nx">id</span><span class="p">,</span> <span class="nx">colon</span><span class="p">]</span> <span class="o">=</span> <span class="nx">match</span>
55
+
56
+ <span class="k">if</span> <span class="nx">id</span> <span class="o">is</span> <span class="s1">&#39;own&#39;</span> <span class="o">and</span> <span class="nx">@tag</span><span class="p">()</span> <span class="o">is</span> <span class="s1">&#39;FOR&#39;</span>
57
+ <span class="nx">@token</span> <span class="s1">&#39;OWN&#39;</span><span class="p">,</span> <span class="nx">id</span>
58
+ <span class="k">return</span> <span class="nx">id</span><span class="p">.</span><span class="nx">length</span>
59
+ <span class="nv">forcedIdentifier = </span><span class="nx">colon</span> <span class="o">or</span>
60
+ <span class="p">(</span><span class="nv">prev = </span><span class="nx">last</span> <span class="nx">@tokens</span><span class="p">)</span> <span class="o">and</span> <span class="o">not</span> <span class="nx">prev</span><span class="p">.</span><span class="nx">spaced</span> <span class="o">and</span> <span class="nx">prev</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="k">in</span> <span class="p">[</span><span class="s1">&#39;.&#39;</span><span class="p">,</span> <span class="s1">&#39;?.&#39;</span><span class="p">,</span> <span class="s1">&#39;@&#39;</span><span class="p">,</span> <span class="s1">&#39;::&#39;</span><span class="p">]</span>
61
+ <span class="nv">tag = </span><span class="s1">&#39;IDENTIFIER&#39;</span>
62
+
63
+ <span class="k">if</span> <span class="nx">id</span> <span class="k">in</span> <span class="nx">JS_KEYWORDS</span> <span class="o">or</span>
64
+ <span class="o">not</span> <span class="nx">forcedIdentifier</span> <span class="o">and</span> <span class="nx">id</span> <span class="k">in</span> <span class="nx">COFFEE_KEYWORDS</span>
65
+ <span class="nv">tag = </span><span class="nx">id</span><span class="p">.</span><span class="nx">toUpperCase</span><span class="p">()</span>
66
+ <span class="k">if</span> <span class="nx">tag</span> <span class="o">is</span> <span class="s1">&#39;WHEN&#39;</span> <span class="o">and</span> <span class="nx">@tag</span><span class="p">()</span> <span class="k">in</span> <span class="nx">LINE_BREAK</span>
67
+ <span class="nv">tag = </span><span class="s1">&#39;LEADING_WHEN&#39;</span>
68
+ <span class="k">else</span> <span class="k">if</span> <span class="nx">tag</span> <span class="o">is</span> <span class="s1">&#39;FOR&#39;</span>
69
+ <span class="vi">@seenFor = </span><span class="kc">yes</span>
70
+ <span class="k">else</span> <span class="k">if</span> <span class="nx">tag</span> <span class="o">is</span> <span class="s1">&#39;UNLESS&#39;</span>
71
+ <span class="nv">tag = </span><span class="s1">&#39;IF&#39;</span>
72
+ <span class="k">else</span> <span class="k">if</span> <span class="nx">tag</span> <span class="k">in</span> <span class="nx">UNARY</span>
73
+ <span class="nv">tag = </span><span class="s1">&#39;UNARY&#39;</span>
74
+ <span class="k">else</span> <span class="k">if</span> <span class="nx">tag</span> <span class="k">in</span> <span class="nx">RELATION</span>
75
+ <span class="k">if</span> <span class="nx">tag</span> <span class="o">isnt</span> <span class="s1">&#39;INSTANCEOF&#39;</span> <span class="o">and</span> <span class="nx">@seenFor</span>
76
+ <span class="nv">tag = </span><span class="s1">&#39;FOR&#39;</span> <span class="o">+</span> <span class="nx">tag</span>
77
+ <span class="vi">@seenFor = </span><span class="kc">no</span>
78
+ <span class="k">else</span>
79
+ <span class="nv">tag = </span><span class="s1">&#39;RELATION&#39;</span>
80
+ <span class="k">if</span> <span class="nx">@value</span><span class="p">()</span> <span class="o">is</span> <span class="s1">&#39;!&#39;</span>
81
+ <span class="nx">@tokens</span><span class="p">.</span><span class="nx">pop</span><span class="p">()</span>
82
+ <span class="nv">id = </span><span class="s1">&#39;!&#39;</span> <span class="o">+</span> <span class="nx">id</span>
83
+
84
+ <span class="k">if</span> <span class="nx">id</span> <span class="k">in</span> <span class="nx">JS_FORBIDDEN</span>
85
+ <span class="k">if</span> <span class="nx">forcedIdentifier</span>
86
+ <span class="nv">tag = </span><span class="s1">&#39;IDENTIFIER&#39;</span>
87
+ <span class="nv">id = </span><span class="k">new</span> <span class="nb">String</span> <span class="nx">id</span>
88
+ <span class="nv">id.reserved = </span><span class="kc">yes</span>
89
+ <span class="k">else</span> <span class="k">if</span> <span class="nx">id</span> <span class="k">in</span> <span class="nx">RESERVED</span>
90
+ <span class="nx">@identifierError</span> <span class="nx">id</span>
91
+
92
+ <span class="nx">unless</span> <span class="nx">forcedIdentifier</span>
93
+ <span class="nv">id = </span><span class="nx">COFFEE_ALIASES</span><span class="p">[</span><span class="nx">id</span><span class="p">]</span> <span class="k">if</span> <span class="nx">COFFEE_ALIASES</span><span class="p">.</span><span class="nx">hasOwnProperty</span> <span class="nx">id</span>
94
+ <span class="nv">tag = </span><span class="k">switch</span> <span class="nx">id</span>
95
+ <span class="k">when</span> <span class="s1">&#39;!&#39;</span> <span class="k">then</span> <span class="s1">&#39;UNARY&#39;</span>
96
+ <span class="k">when</span> <span class="s1">&#39;==&#39;</span><span class="p">,</span> <span class="s1">&#39;!=&#39;</span> <span class="k">then</span> <span class="s1">&#39;COMPARE&#39;</span>
97
+ <span class="k">when</span> <span class="s1">&#39;&amp;&amp;&#39;</span><span class="p">,</span> <span class="s1">&#39;||&#39;</span> <span class="k">then</span> <span class="s1">&#39;LOGIC&#39;</span>
98
+ <span class="k">when</span> <span class="s1">&#39;true&#39;</span><span class="p">,</span> <span class="s1">&#39;false&#39;</span><span class="p">,</span> <span class="s1">&#39;null&#39;</span><span class="p">,</span> <span class="s1">&#39;undefined&#39;</span> <span class="k">then</span> <span class="s1">&#39;BOOL&#39;</span>
99
+ <span class="k">when</span> <span class="s1">&#39;break&#39;</span><span class="p">,</span> <span class="s1">&#39;continue&#39;</span><span class="p">,</span> <span class="s1">&#39;debugger&#39;</span> <span class="k">then</span> <span class="s1">&#39;STATEMENT&#39;</span>
100
+ <span class="k">else</span> <span class="nx">tag</span>
101
+
102
+ <span class="nx">@token</span> <span class="nx">tag</span><span class="p">,</span> <span class="nx">id</span>
103
+ <span class="nx">@token</span> <span class="s1">&#39;:&#39;</span><span class="p">,</span> <span class="s1">&#39;:&#39;</span> <span class="k">if</span> <span class="nx">colon</span>
104
+ <span class="nx">input</span><span class="p">.</span><span class="nx">length</span></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#182;</a> </div> <p>Matches numbers, including decimals, hex, and exponential notation.
105
+ Be careful not to interfere with ranges-in-progress.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">numberToken</span><span class="o">:</span> <span class="o">-&gt;</span>
106
+ <span class="k">return</span> <span class="mi">0</span> <span class="nx">unless</span> <span class="nv">match = </span><span class="nx">NUMBER</span><span class="p">.</span><span class="nx">exec</span> <span class="nx">@chunk</span>
107
+ <span class="nv">number = </span><span class="nx">match</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
108
+ <span class="nx">@token</span> <span class="s1">&#39;NUMBER&#39;</span><span class="p">,</span> <span class="nx">number</span>
109
+ <span class="nx">number</span><span class="p">.</span><span class="nx">length</span></pre></div> </td> </tr> <tr id="section-10"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-10">&#182;</a> </div> <p>Matches strings, including multi-line strings. Ensures that quotation marks
110
+ are balanced within the string's contents, and within nested interpolations.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">stringToken</span><span class="o">:</span> <span class="o">-&gt;</span>
111
+ <span class="k">switch</span> <span class="nx">@chunk</span><span class="p">.</span><span class="nx">charAt</span> <span class="mi">0</span>
112
+ <span class="k">when</span> <span class="s2">&quot;&#39;&quot;</span>
113
+ <span class="k">return</span> <span class="mi">0</span> <span class="nx">unless</span> <span class="nv">match = </span><span class="nx">SIMPLESTR</span><span class="p">.</span><span class="nx">exec</span> <span class="nx">@chunk</span>
114
+ <span class="nx">@token</span> <span class="s1">&#39;STRING&#39;</span><span class="p">,</span> <span class="p">(</span><span class="nv">string = </span><span class="nx">match</span><span class="p">[</span><span class="mi">0</span><span class="p">]).</span><span class="nx">replace</span> <span class="nx">MULTILINER</span><span class="p">,</span> <span class="s1">&#39;\\\n&#39;</span>
115
+ <span class="k">when</span> <span class="s1">&#39;&quot;&#39;</span>
116
+ <span class="k">return</span> <span class="mi">0</span> <span class="nx">unless</span> <span class="nv">string = </span><span class="nx">@balancedString</span> <span class="nx">@chunk</span><span class="p">,</span> <span class="s1">&#39;&quot;&#39;</span>
117
+ <span class="k">if</span> <span class="mi">0</span> <span class="o">&lt;</span> <span class="nx">string</span><span class="p">.</span><span class="nx">indexOf</span> <span class="s1">&#39;#{&#39;</span><span class="p">,</span> <span class="mi">1</span>
118
+ <span class="nx">@interpolateString</span> <span class="nx">string</span><span class="p">.</span><span class="nx">slice</span> <span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span>
119
+ <span class="k">else</span>
120
+ <span class="nx">@token</span> <span class="s1">&#39;STRING&#39;</span><span class="p">,</span> <span class="nx">@escapeLines</span> <span class="nx">string</span>
121
+ <span class="k">else</span>
122
+ <span class="k">return</span> <span class="mi">0</span>
123
+ <span class="nx">@line</span> <span class="o">+=</span> <span class="nx">count</span> <span class="nx">string</span><span class="p">,</span> <span class="s1">&#39;\n&#39;</span>
124
+ <span class="nx">string</span><span class="p">.</span><span class="nx">length</span></pre></div> </td> </tr> <tr id="section-11"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-11">&#182;</a> </div> <p>Matches heredocs, adjusting indentation to the correct level, as heredocs
125
+ preserve whitespace, but ignore indentation to the left.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">heredocToken</span><span class="o">:</span> <span class="o">-&gt;</span>
126
+ <span class="k">return</span> <span class="mi">0</span> <span class="nx">unless</span> <span class="nv">match = </span><span class="nx">HEREDOC</span><span class="p">.</span><span class="nx">exec</span> <span class="nx">@chunk</span>
127
+ <span class="nv">heredoc = </span><span class="nx">match</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
128
+ <span class="nv">quote = </span><span class="nx">heredoc</span><span class="p">.</span><span class="nx">charAt</span> <span class="mi">0</span>
129
+ <span class="nv">doc = </span><span class="nx">@sanitizeHeredoc</span> <span class="nx">match</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="nx">quote</span><span class="o">:</span> <span class="nx">quote</span><span class="p">,</span> <span class="nx">indent</span><span class="o">:</span> <span class="kc">null</span>
130
+ <span class="k">if</span> <span class="nx">quote</span> <span class="o">is</span> <span class="s1">&#39;&quot;&#39;</span> <span class="o">and</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="nx">doc</span><span class="p">.</span><span class="nx">indexOf</span> <span class="s1">&#39;#{&#39;</span>
131
+ <span class="nx">@interpolateString</span> <span class="nx">doc</span><span class="p">,</span> <span class="nx">heredoc</span><span class="o">:</span> <span class="kc">yes</span>
132
+ <span class="k">else</span>
133
+ <span class="nx">@token</span> <span class="s1">&#39;STRING&#39;</span><span class="p">,</span> <span class="nx">@makeString</span> <span class="nx">doc</span><span class="p">,</span> <span class="nx">quote</span><span class="p">,</span> <span class="kc">yes</span>
134
+ <span class="nx">@line</span> <span class="o">+=</span> <span class="nx">count</span> <span class="nx">heredoc</span><span class="p">,</span> <span class="s1">&#39;\n&#39;</span>
135
+ <span class="nx">heredoc</span><span class="p">.</span><span class="nx">length</span></pre></div> </td> </tr> <tr id="section-12"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-12">&#182;</a> </div> <p>Matches and consumes comments.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">commentToken</span><span class="o">:</span> <span class="o">-&gt;</span>
136
+ <span class="k">return</span> <span class="mi">0</span> <span class="nx">unless</span> <span class="nv">match = </span><span class="nx">@chunk</span><span class="p">.</span><span class="nx">match</span> <span class="nx">COMMENT</span>
137
+ <span class="p">[</span><span class="nx">comment</span><span class="p">,</span> <span class="nx">here</span><span class="p">]</span> <span class="o">=</span> <span class="nx">match</span>
138
+ <span class="nx">@line</span> <span class="o">+=</span> <span class="nx">count</span> <span class="nx">comment</span><span class="p">,</span> <span class="s1">&#39;\n&#39;</span>
139
+ <span class="k">if</span> <span class="nx">here</span>
140
+ <span class="nx">@token</span> <span class="s1">&#39;HERECOMMENT&#39;</span><span class="p">,</span> <span class="nx">@sanitizeHeredoc</span> <span class="nx">here</span><span class="p">,</span>
141
+ <span class="nx">herecomment</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">indent</span><span class="o">:</span> <span class="nb">Array</span><span class="p">(</span><span class="nx">@indent</span> <span class="o">+</span> <span class="mi">1</span><span class="p">).</span><span class="nx">join</span><span class="p">(</span><span class="s1">&#39; &#39;</span><span class="p">)</span>
142
+ <span class="nx">@token</span> <span class="s1">&#39;TERMINATOR&#39;</span><span class="p">,</span> <span class="s1">&#39;\n&#39;</span>
143
+ <span class="nx">comment</span><span class="p">.</span><span class="nx">length</span></pre></div> </td> </tr> <tr id="section-13"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-13">&#182;</a> </div> <p>Matches JavaScript interpolated directly into the source via backticks.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">jsToken</span><span class="o">:</span> <span class="o">-&gt;</span>
144
+ <span class="k">return</span> <span class="mi">0</span> <span class="nx">unless</span> <span class="nx">@chunk</span><span class="p">.</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">is</span> <span class="s1">&#39;`&#39;</span> <span class="o">and</span> <span class="nv">match = </span><span class="nx">JSTOKEN</span><span class="p">.</span><span class="nx">exec</span> <span class="nx">@chunk</span>
145
+ <span class="nx">@token</span> <span class="s1">&#39;JS&#39;</span><span class="p">,</span> <span class="p">(</span><span class="nv">script = </span><span class="nx">match</span><span class="p">[</span><span class="mi">0</span><span class="p">]).</span><span class="nx">slice</span> <span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span>
146
+ <span class="nx">script</span><span class="p">.</span><span class="nx">length</span></pre></div> </td> </tr> <tr id="section-14"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-14">&#182;</a> </div> <p>Matches regular expression literals. Lexing regular expressions is difficult
147
+ to distinguish from division, so we borrow some basic heuristics from
148
+ JavaScript and Ruby.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">regexToken</span><span class="o">:</span> <span class="o">-&gt;</span>
149
+ <span class="k">return</span> <span class="mi">0</span> <span class="k">if</span> <span class="nx">@chunk</span><span class="p">.</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">isnt</span> <span class="s1">&#39;/&#39;</span>
150
+ <span class="k">return</span> <span class="nx">@heregexToken</span> <span class="nx">match</span> <span class="k">if</span> <span class="nv">match = </span><span class="nx">HEREGEX</span><span class="p">.</span><span class="nx">exec</span> <span class="nx">@chunk</span>
151
+ <span class="nv">prev = </span><span class="nx">last</span> <span class="nx">@tokens</span>
152
+ <span class="k">return</span> <span class="mi">0</span> <span class="k">if</span> <span class="nx">prev</span> <span class="o">and</span> <span class="p">(</span><span class="nx">prev</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="k">in</span> <span class="p">(</span><span class="k">if</span> <span class="nx">prev</span><span class="p">.</span><span class="nx">spaced</span> <span class="k">then</span> <span class="nx">NOT_REGEX</span> <span class="k">else</span> <span class="nx">NOT_SPACED_REGEX</span><span class="p">))</span>
153
+ <span class="k">return</span> <span class="mi">0</span> <span class="nx">unless</span> <span class="nv">match = </span><span class="nx">REGEX</span><span class="p">.</span><span class="nx">exec</span> <span class="nx">@chunk</span>
154
+ <span class="p">[</span><span class="nx">regex</span><span class="p">]</span> <span class="o">=</span> <span class="nx">match</span>
155
+ <span class="nx">@token</span> <span class="s1">&#39;REGEX&#39;</span><span class="p">,</span> <span class="k">if</span> <span class="nx">regex</span> <span class="o">is</span> <span class="s1">&#39;//&#39;</span> <span class="k">then</span> <span class="s1">&#39;/(?:)/&#39;</span> <span class="k">else</span> <span class="nx">regex</span>
156
+ <span class="nx">regex</span><span class="p">.</span><span class="nx">length</span></pre></div> </td> </tr> <tr id="section-15"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-15">&#182;</a> </div> <p>Matches multiline extended regular expressions.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">heregexToken</span><span class="o">:</span> <span class="p">(</span><span class="nx">match</span><span class="p">)</span> <span class="o">-&gt;</span>
157
+ <span class="p">[</span><span class="nx">heregex</span><span class="p">,</span> <span class="nx">body</span><span class="p">,</span> <span class="nx">flags</span><span class="p">]</span> <span class="o">=</span> <span class="nx">match</span>
158
+ <span class="k">if</span> <span class="mi">0</span> <span class="o">&gt;</span> <span class="nx">body</span><span class="p">.</span><span class="nx">indexOf</span> <span class="s1">&#39;#{&#39;</span>
159
+ <span class="nv">re = </span><span class="nx">body</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="nx">HEREGEX_OMIT</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">).</span><span class="nx">replace</span><span class="p">(</span><span class="sr">/\//g</span><span class="p">,</span> <span class="s1">&#39;\\/&#39;</span><span class="p">)</span>
160
+ <span class="nx">@token</span> <span class="s1">&#39;REGEX&#39;</span><span class="p">,</span> <span class="s2">&quot;/#{ re or &#39;(?:)&#39; }/#{flags}&quot;</span>
161
+ <span class="k">return</span> <span class="nx">heregex</span><span class="p">.</span><span class="nx">length</span>
162
+ <span class="nx">@token</span> <span class="s1">&#39;IDENTIFIER&#39;</span><span class="p">,</span> <span class="s1">&#39;RegExp&#39;</span>
163
+ <span class="nx">@tokens</span><span class="p">.</span><span class="nx">push</span> <span class="p">[</span><span class="s1">&#39;CALL_START&#39;</span><span class="p">,</span> <span class="s1">&#39;(&#39;</span><span class="p">]</span>
164
+ <span class="nv">tokens = </span><span class="p">[]</span>
165
+ <span class="k">for</span> <span class="p">[</span><span class="nx">tag</span><span class="p">,</span> <span class="nx">value</span><span class="p">]</span> <span class="k">in</span> <span class="nx">@interpolateString</span><span class="p">(</span><span class="nx">body</span><span class="p">,</span> <span class="nx">regex</span><span class="o">:</span> <span class="kc">yes</span><span class="p">)</span>
166
+ <span class="k">if</span> <span class="nx">tag</span> <span class="o">is</span> <span class="s1">&#39;TOKENS&#39;</span>
167
+ <span class="nx">tokens</span><span class="p">.</span><span class="nx">push</span> <span class="nx">value</span><span class="p">...</span>
168
+ <span class="k">else</span>
169
+ <span class="k">continue</span> <span class="nx">unless</span> <span class="nv">value = </span><span class="nx">value</span><span class="p">.</span><span class="nx">replace</span> <span class="nx">HEREGEX_OMIT</span><span class="p">,</span> <span class="s1">&#39;&#39;</span>
170
+ <span class="nv">value = </span><span class="nx">value</span><span class="p">.</span><span class="nx">replace</span> <span class="sr">/\\/g</span><span class="p">,</span> <span class="s1">&#39;\\\\&#39;</span>
171
+ <span class="nx">tokens</span><span class="p">.</span><span class="nx">push</span> <span class="p">[</span><span class="s1">&#39;STRING&#39;</span><span class="p">,</span> <span class="nx">@makeString</span><span class="p">(</span><span class="nx">value</span><span class="p">,</span> <span class="s1">&#39;&quot;&#39;</span><span class="p">,</span> <span class="kc">yes</span><span class="p">)]</span>
172
+ <span class="nx">tokens</span><span class="p">.</span><span class="nx">push</span> <span class="p">[</span><span class="s1">&#39;+&#39;</span><span class="p">,</span> <span class="s1">&#39;+&#39;</span><span class="p">]</span>
173
+ <span class="nx">tokens</span><span class="p">.</span><span class="nx">pop</span><span class="p">()</span>
174
+ <span class="nx">@tokens</span><span class="p">.</span><span class="nx">push</span> <span class="p">[</span><span class="s1">&#39;STRING&#39;</span><span class="p">,</span> <span class="s1">&#39;&quot;&quot;&#39;</span><span class="p">],</span> <span class="p">[</span><span class="s1">&#39;+&#39;</span><span class="p">,</span> <span class="s1">&#39;+&#39;</span><span class="p">]</span> <span class="nx">unless</span> <span class="nx">tokens</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">?</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">is</span> <span class="s1">&#39;STRING&#39;</span>
175
+ <span class="nx">@tokens</span><span class="p">.</span><span class="nx">push</span> <span class="nx">tokens</span><span class="p">...</span>
176
+ <span class="nx">@tokens</span><span class="p">.</span><span class="nx">push</span> <span class="p">[</span><span class="s1">&#39;,&#39;</span><span class="p">,</span> <span class="s1">&#39;,&#39;</span><span class="p">],</span> <span class="p">[</span><span class="s1">&#39;STRING&#39;</span><span class="p">,</span> <span class="s1">&#39;&quot;&#39;</span> <span class="o">+</span> <span class="nx">flags</span> <span class="o">+</span> <span class="s1">&#39;&quot;&#39;</span><span class="p">]</span> <span class="k">if</span> <span class="nx">flags</span>
177
+ <span class="nx">@token</span> <span class="s1">&#39;)&#39;</span><span class="p">,</span> <span class="s1">&#39;)&#39;</span>
178
+ <span class="nx">heregex</span><span class="p">.</span><span class="nx">length</span></pre></div> </td> </tr> <tr id="section-16"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-16">&#182;</a> </div> <p>Matches newlines, indents, and outdents, and determines which is which.
179
+ If we can detect that the current line is continued onto the the next line,
180
+ then the newline is suppressed:</p>
181
+
182
+ <pre><code>elements
183
+ .each( ... )
184
+ .map( ... )
185
+ </code></pre>
186
+
187
+ <p>Keeps track of the level of indentation, because a single outdent token
188
+ can close multiple indents, so we need to know how far in we happen to be.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">lineToken</span><span class="o">:</span> <span class="o">-&gt;</span>
189
+ <span class="k">return</span> <span class="mi">0</span> <span class="nx">unless</span> <span class="nv">match = </span><span class="nx">MULTI_DENT</span><span class="p">.</span><span class="nx">exec</span> <span class="nx">@chunk</span>
190
+ <span class="nv">indent = </span><span class="nx">match</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
191
+ <span class="nx">@line</span> <span class="o">+=</span> <span class="nx">count</span> <span class="nx">indent</span><span class="p">,</span> <span class="s1">&#39;\n&#39;</span>
192
+ <span class="nv">prev = </span><span class="nx">last</span> <span class="nx">@tokens</span><span class="p">,</span> <span class="mi">1</span>
193
+ <span class="nv">size = </span><span class="nx">indent</span><span class="p">.</span><span class="nx">length</span> <span class="o">-</span> <span class="mi">1</span> <span class="o">-</span> <span class="nx">indent</span><span class="p">.</span><span class="nx">lastIndexOf</span> <span class="s1">&#39;\n&#39;</span>
194
+ <span class="nv">noNewlines = </span><span class="nx">@unfinished</span><span class="p">()</span>
195
+ <span class="k">if</span> <span class="nx">size</span> <span class="o">-</span> <span class="nx">@indebt</span> <span class="o">is</span> <span class="nx">@indent</span>
196
+ <span class="k">if</span> <span class="nx">noNewlines</span> <span class="k">then</span> <span class="nx">@suppressNewlines</span><span class="p">()</span> <span class="k">else</span> <span class="nx">@newlineToken</span><span class="p">()</span>
197
+ <span class="k">return</span> <span class="nx">indent</span><span class="p">.</span><span class="nx">length</span>
198
+ <span class="k">if</span> <span class="nx">size</span> <span class="o">&gt;</span> <span class="nx">@indent</span>
199
+ <span class="k">if</span> <span class="nx">noNewlines</span>
200
+ <span class="vi">@indebt = </span><span class="nx">size</span> <span class="o">-</span> <span class="nx">@indent</span>
201
+ <span class="nx">@suppressNewlines</span><span class="p">()</span>
202
+ <span class="k">return</span> <span class="nx">indent</span><span class="p">.</span><span class="nx">length</span>
203
+ <span class="nv">diff = </span><span class="nx">size</span> <span class="o">-</span> <span class="nx">@indent</span> <span class="o">+</span> <span class="nx">@outdebt</span>
204
+ <span class="nx">@token</span> <span class="s1">&#39;INDENT&#39;</span><span class="p">,</span> <span class="nx">diff</span>
205
+ <span class="nx">@indents</span><span class="p">.</span><span class="nx">push</span> <span class="nx">diff</span>
206
+ <span class="vi">@outdebt = @indebt = </span><span class="mi">0</span>
207
+ <span class="k">else</span>
208
+ <span class="vi">@indebt = </span><span class="mi">0</span>
209
+ <span class="nx">@outdentToken</span> <span class="nx">@indent</span> <span class="o">-</span> <span class="nx">size</span><span class="p">,</span> <span class="nx">noNewlines</span>
210
+ <span class="vi">@indent = </span><span class="nx">size</span>
211
+ <span class="nx">indent</span><span class="p">.</span><span class="nx">length</span></pre></div> </td> </tr> <tr id="section-17"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-17">&#182;</a> </div> <p>Record an outdent token or multiple tokens, if we happen to be moving back
212
+ inwards past several recorded indents.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">outdentToken</span><span class="o">:</span> <span class="p">(</span><span class="nx">moveOut</span><span class="p">,</span> <span class="nx">noNewlines</span><span class="p">,</span> <span class="nx">close</span><span class="p">)</span> <span class="o">-&gt;</span>
213
+ <span class="k">while</span> <span class="nx">moveOut</span> <span class="o">&gt;</span> <span class="mi">0</span>
214
+ <span class="nv">len = </span><span class="nx">@indents</span><span class="p">.</span><span class="nx">length</span> <span class="o">-</span> <span class="mi">1</span>
215
+ <span class="k">if</span> <span class="nx">@indents</span><span class="p">[</span><span class="nx">len</span><span class="p">]</span> <span class="o">is</span> <span class="kc">undefined</span>
216
+ <span class="nv">moveOut = </span><span class="mi">0</span>
217
+ <span class="k">else</span> <span class="k">if</span> <span class="nx">@indents</span><span class="p">[</span><span class="nx">len</span><span class="p">]</span> <span class="o">is</span> <span class="nx">@outdebt</span>
218
+ <span class="nx">moveOut</span> <span class="o">-=</span> <span class="nx">@outdebt</span>
219
+ <span class="vi">@outdebt = </span><span class="mi">0</span>
220
+ <span class="k">else</span> <span class="k">if</span> <span class="nx">@indents</span><span class="p">[</span><span class="nx">len</span><span class="p">]</span> <span class="o">&lt;</span> <span class="nx">@outdebt</span>
221
+ <span class="nx">@outdebt</span> <span class="o">-=</span> <span class="nx">@indents</span><span class="p">[</span><span class="nx">len</span><span class="p">]</span>
222
+ <span class="nx">moveOut</span> <span class="o">-=</span> <span class="nx">@indents</span><span class="p">[</span><span class="nx">len</span><span class="p">]</span>
223
+ <span class="k">else</span>
224
+ <span class="nv">dent = </span><span class="nx">@indents</span><span class="p">.</span><span class="nx">pop</span><span class="p">()</span> <span class="o">-</span> <span class="nx">@outdebt</span>
225
+ <span class="nx">moveOut</span> <span class="o">-=</span> <span class="nx">dent</span>
226
+ <span class="vi">@outdebt = </span><span class="mi">0</span>
227
+ <span class="nx">@token</span> <span class="s1">&#39;OUTDENT&#39;</span><span class="p">,</span> <span class="nx">dent</span>
228
+ <span class="nx">@outdebt</span> <span class="o">-=</span> <span class="nx">moveOut</span> <span class="k">if</span> <span class="nx">dent</span>
229
+ <span class="nx">@token</span> <span class="s1">&#39;TERMINATOR&#39;</span><span class="p">,</span> <span class="s1">&#39;\n&#39;</span> <span class="nx">unless</span> <span class="nx">@tag</span><span class="p">()</span> <span class="o">is</span> <span class="s1">&#39;TERMINATOR&#39;</span> <span class="o">or</span> <span class="nx">noNewlines</span>
230
+ <span class="k">this</span></pre></div> </td> </tr> <tr id="section-18"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-18">&#182;</a> </div> <p>Matches and consumes non-meaningful whitespace. Tag the previous token
231
+ as being "spaced", because there are some cases where it makes a difference.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">whitespaceToken</span><span class="o">:</span> <span class="o">-&gt;</span>
232
+ <span class="k">return</span> <span class="mi">0</span> <span class="nx">unless</span> <span class="p">(</span><span class="nv">match = </span><span class="nx">WHITESPACE</span><span class="p">.</span><span class="nx">exec</span> <span class="nx">@chunk</span><span class="p">)</span> <span class="o">or</span>
233
+ <span class="p">(</span><span class="nv">nline = </span><span class="nx">@chunk</span><span class="p">.</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">is</span> <span class="s1">&#39;\n&#39;</span><span class="p">)</span>
234
+ <span class="nv">prev = </span><span class="nx">last</span> <span class="nx">@tokens</span>
235
+ <span class="nx">prev</span><span class="p">[</span><span class="k">if</span> <span class="nx">match</span> <span class="k">then</span> <span class="s1">&#39;spaced&#39;</span> <span class="k">else</span> <span class="s1">&#39;newLine&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="kc">true</span> <span class="k">if</span> <span class="nx">prev</span>
236
+ <span class="k">if</span> <span class="nx">match</span> <span class="k">then</span> <span class="nx">match</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">length</span> <span class="k">else</span> <span class="mi">0</span></pre></div> </td> </tr> <tr id="section-19"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-19">&#182;</a> </div> <p>Generate a newline token. Consecutive newlines get merged together.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">newlineToken</span><span class="o">:</span> <span class="o">-&gt;</span>
237
+ <span class="nx">@token</span> <span class="s1">&#39;TERMINATOR&#39;</span><span class="p">,</span> <span class="s1">&#39;\n&#39;</span> <span class="nx">unless</span> <span class="nx">@tag</span><span class="p">()</span> <span class="o">is</span> <span class="s1">&#39;TERMINATOR&#39;</span>
238
+ <span class="k">this</span></pre></div> </td> </tr> <tr id="section-20"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-20">&#182;</a> </div> <p>Use a <code>\</code> at a line-ending to suppress the newline.
239
+ The slash is removed here once its job is done.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">suppressNewlines</span><span class="o">:</span> <span class="o">-&gt;</span>
240
+ <span class="nx">@tokens</span><span class="p">.</span><span class="nx">pop</span><span class="p">()</span> <span class="k">if</span> <span class="nx">@value</span><span class="p">()</span> <span class="o">is</span> <span class="s1">&#39;\\&#39;</span>
241
+ <span class="k">this</span></pre></div> </td> </tr> <tr id="section-21"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-21">&#182;</a> </div> <p>We treat all other single characters as a token. E.g.: <code>( ) , . !</code>
242
+ Multi-character operators are also literal tokens, so that Jison can assign
243
+ the proper order of operations. There are some symbols that we tag specially
244
+ here. <code>;</code> and newlines are both treated as a <code>TERMINATOR</code>, we distinguish
245
+ parentheses that indicate a method call from regular parentheses, and so on.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">literalToken</span><span class="o">:</span> <span class="o">-&gt;</span>
246
+ <span class="k">if</span> <span class="nv">match = </span><span class="nx">OPERATOR</span><span class="p">.</span><span class="nx">exec</span> <span class="nx">@chunk</span>
247
+ <span class="p">[</span><span class="nx">value</span><span class="p">]</span> <span class="o">=</span> <span class="nx">match</span>
248
+ <span class="nx">@tagParameters</span><span class="p">()</span> <span class="k">if</span> <span class="nx">CODE</span><span class="p">.</span><span class="nx">test</span> <span class="nx">value</span>
249
+ <span class="k">else</span>
250
+ <span class="nv">value = </span><span class="nx">@chunk</span><span class="p">.</span><span class="nx">charAt</span> <span class="mi">0</span>
251
+ <span class="nv">tag = </span><span class="nx">value</span>
252
+ <span class="nv">prev = </span><span class="nx">last</span> <span class="nx">@tokens</span>
253
+ <span class="k">if</span> <span class="nx">value</span> <span class="o">is</span> <span class="s1">&#39;=&#39;</span> <span class="o">and</span> <span class="nx">prev</span>
254
+ <span class="nx">@assignmentError</span><span class="p">()</span> <span class="k">if</span> <span class="o">not</span> <span class="nx">prev</span><span class="p">[</span><span class="mi">1</span><span class="p">].</span><span class="nx">reserved</span> <span class="o">and</span> <span class="nx">prev</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="k">in</span> <span class="nx">JS_FORBIDDEN</span>
255
+ <span class="k">if</span> <span class="nx">prev</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="k">in</span> <span class="p">[</span><span class="s1">&#39;||&#39;</span><span class="p">,</span> <span class="s1">&#39;&amp;&amp;&#39;</span><span class="p">]</span>
256
+ <span class="nx">prev</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;COMPOUND_ASSIGN&#39;</span>
257
+ <span class="nx">prev</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">+=</span> <span class="s1">&#39;=&#39;</span>
258
+ <span class="k">return</span> <span class="nx">value</span><span class="p">.</span><span class="nx">length</span>
259
+ <span class="k">if</span> <span class="nx">value</span> <span class="o">is</span> <span class="s1">&#39;;&#39;</span> <span class="k">then</span> <span class="nv">tag = </span><span class="s1">&#39;TERMINATOR&#39;</span>
260
+ <span class="k">else</span> <span class="k">if</span> <span class="nx">value</span> <span class="k">in</span> <span class="nx">MATH</span> <span class="k">then</span> <span class="nv">tag = </span><span class="s1">&#39;MATH&#39;</span>
261
+ <span class="k">else</span> <span class="k">if</span> <span class="nx">value</span> <span class="k">in</span> <span class="nx">COMPARE</span> <span class="k">then</span> <span class="nv">tag = </span><span class="s1">&#39;COMPARE&#39;</span>
262
+ <span class="k">else</span> <span class="k">if</span> <span class="nx">value</span> <span class="k">in</span> <span class="nx">COMPOUND_ASSIGN</span> <span class="k">then</span> <span class="nv">tag = </span><span class="s1">&#39;COMPOUND_ASSIGN&#39;</span>
263
+ <span class="k">else</span> <span class="k">if</span> <span class="nx">value</span> <span class="k">in</span> <span class="nx">UNARY</span> <span class="k">then</span> <span class="nv">tag = </span><span class="s1">&#39;UNARY&#39;</span>
264
+ <span class="k">else</span> <span class="k">if</span> <span class="nx">value</span> <span class="k">in</span> <span class="nx">SHIFT</span> <span class="k">then</span> <span class="nv">tag = </span><span class="s1">&#39;SHIFT&#39;</span>
265
+ <span class="k">else</span> <span class="k">if</span> <span class="nx">value</span> <span class="k">in</span> <span class="nx">LOGIC</span> <span class="o">or</span> <span class="nx">value</span> <span class="o">is</span> <span class="s1">&#39;?&#39;</span> <span class="o">and</span> <span class="nx">prev</span><span class="o">?</span><span class="p">.</span><span class="nx">spaced</span> <span class="k">then</span> <span class="nv">tag = </span><span class="s1">&#39;LOGIC&#39;</span>
266
+ <span class="k">else</span> <span class="k">if</span> <span class="nx">prev</span> <span class="o">and</span> <span class="o">not</span> <span class="nx">prev</span><span class="p">.</span><span class="nx">spaced</span>
267
+ <span class="k">if</span> <span class="nx">value</span> <span class="o">is</span> <span class="s1">&#39;(&#39;</span> <span class="o">and</span> <span class="nx">prev</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="k">in</span> <span class="nx">CALLABLE</span>
268
+ <span class="nx">prev</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;FUNC_EXIST&#39;</span> <span class="k">if</span> <span class="nx">prev</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">is</span> <span class="s1">&#39;?&#39;</span>
269
+ <span class="nv">tag = </span><span class="s1">&#39;CALL_START&#39;</span>
270
+ <span class="k">else</span> <span class="k">if</span> <span class="nx">value</span> <span class="o">is</span> <span class="s1">&#39;[&#39;</span> <span class="o">and</span> <span class="nx">prev</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="k">in</span> <span class="nx">INDEXABLE</span>
271
+ <span class="nv">tag = </span><span class="s1">&#39;INDEX_START&#39;</span>
272
+ <span class="k">switch</span> <span class="nx">prev</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
273
+ <span class="k">when</span> <span class="s1">&#39;?&#39;</span> <span class="k">then</span> <span class="nx">prev</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;INDEX_SOAK&#39;</span>
274
+ <span class="k">when</span> <span class="s1">&#39;::&#39;</span> <span class="k">then</span> <span class="nx">prev</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;INDEX_PROTO&#39;</span>
275
+ <span class="nx">@token</span> <span class="nx">tag</span><span class="p">,</span> <span class="nx">value</span>
276
+ <span class="nx">value</span><span class="p">.</span><span class="nx">length</span></pre></div> </td> </tr> <tr id="section-22"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-22">&#182;</a> </div> <h2>Token Manipulators</h2> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-23"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-23">&#182;</a> </div> <p>Sanitize a heredoc or herecomment by
277
+ erasing all external indentation on the left-hand side.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">sanitizeHeredoc</span><span class="o">:</span> <span class="p">(</span><span class="nx">doc</span><span class="p">,</span> <span class="nx">options</span><span class="p">)</span> <span class="o">-&gt;</span>
278
+ <span class="p">{</span><span class="nx">indent</span><span class="p">,</span> <span class="nx">herecomment</span><span class="p">}</span> <span class="o">=</span> <span class="nx">options</span>
279
+ <span class="k">return</span> <span class="nx">doc</span> <span class="k">if</span> <span class="nx">herecomment</span> <span class="o">and</span> <span class="mi">0</span> <span class="o">&gt;</span> <span class="nx">doc</span><span class="p">.</span><span class="nx">indexOf</span> <span class="s1">&#39;\n&#39;</span>
280
+ <span class="nx">unless</span> <span class="nx">herecomment</span>
281
+ <span class="k">while</span> <span class="nv">match = </span><span class="nx">HEREDOC_INDENT</span><span class="p">.</span><span class="nx">exec</span> <span class="nx">doc</span>
282
+ <span class="nv">attempt = </span><span class="nx">match</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
283
+ <span class="nv">indent = </span><span class="nx">attempt</span> <span class="k">if</span> <span class="nx">indent</span> <span class="o">is</span> <span class="kc">null</span> <span class="o">or</span> <span class="mi">0</span> <span class="o">&lt;</span> <span class="nx">attempt</span><span class="p">.</span><span class="nx">length</span> <span class="o">&lt;</span> <span class="nx">indent</span><span class="p">.</span><span class="nx">length</span>
284
+ <span class="nv">doc = </span><span class="nx">doc</span><span class="p">.</span><span class="nx">replace</span> <span class="err">/// \n #{indent} ///g, &#39;\n&#39; if indent</span>
285
+ <span class="nv">doc = </span><span class="nx">doc</span><span class="p">.</span><span class="nx">replace</span> <span class="sr">/^\n/</span><span class="p">,</span> <span class="s1">&#39;&#39;</span> <span class="nx">unless</span> <span class="nx">herecomment</span>
286
+ <span class="nx">doc</span></pre></div> </td> </tr> <tr id="section-24"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-24">&#182;</a> </div> <p>A source of ambiguity in our grammar used to be parameter lists in function
287
+ definitions versus argument lists in function calls. Walk backwards, tagging
288
+ parameters specially in order to make things easier for the parser.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">tagParameters</span><span class="o">:</span> <span class="o">-&gt;</span>
289
+ <span class="k">return</span> <span class="k">this</span> <span class="k">if</span> <span class="nx">@tag</span><span class="p">()</span> <span class="o">isnt</span> <span class="s1">&#39;)&#39;</span>
290
+ <span class="nv">stack = </span><span class="p">[]</span>
291
+ <span class="p">{</span><span class="nx">tokens</span><span class="p">}</span> <span class="o">=</span> <span class="k">this</span>
292
+ <span class="nv">i = </span><span class="nx">tokens</span><span class="p">.</span><span class="nx">length</span>
293
+ <span class="nx">tokens</span><span class="p">[</span><span class="o">--</span><span class="nx">i</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;PARAM_END&#39;</span>
294
+ <span class="k">while</span> <span class="nv">tok = </span><span class="nx">tokens</span><span class="p">[</span><span class="o">--</span><span class="nx">i</span><span class="p">]</span>
295
+ <span class="k">switch</span> <span class="nx">tok</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
296
+ <span class="k">when</span> <span class="s1">&#39;)&#39;</span>
297
+ <span class="nx">stack</span><span class="p">.</span><span class="nx">push</span> <span class="nx">tok</span>
298
+ <span class="k">when</span> <span class="s1">&#39;(&#39;</span><span class="p">,</span> <span class="s1">&#39;CALL_START&#39;</span>
299
+ <span class="k">if</span> <span class="nx">stack</span><span class="p">.</span><span class="nx">length</span> <span class="k">then</span> <span class="nx">stack</span><span class="p">.</span><span class="nx">pop</span><span class="p">()</span>
300
+ <span class="k">else</span>
301
+ <span class="nx">tok</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;PARAM_START&#39;</span>
302
+ <span class="k">return</span> <span class="k">this</span>
303
+ <span class="k">this</span></pre></div> </td> </tr> <tr id="section-25"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-25">&#182;</a> </div> <p>Close up all remaining open blocks at the end of the file.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">closeIndentation</span><span class="o">:</span> <span class="o">-&gt;</span>
304
+ <span class="nx">@outdentToken</span> <span class="nx">@indent</span></pre></div> </td> </tr> <tr id="section-26"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-26">&#182;</a> </div> <p>The error for when you try to use a forbidden word in JavaScript as
305
+ an identifier.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">identifierError</span><span class="o">:</span> <span class="p">(</span><span class="nx">word</span><span class="p">)</span> <span class="o">-&gt;</span>
306
+ <span class="k">throw</span> <span class="nx">SyntaxError</span> <span class="s2">&quot;Reserved word \&quot;#{word}\&quot; on line #{@line + 1}&quot;</span></pre></div> </td> </tr> <tr id="section-27"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-27">&#182;</a> </div> <p>The error for when you try to assign to a reserved word in JavaScript,
307
+ like "function" or "default".</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">assignmentError</span><span class="o">:</span> <span class="o">-&gt;</span>
308
+ <span class="k">throw</span> <span class="nx">SyntaxError</span> <span class="s2">&quot;Reserved word \&quot;#{@value()}\&quot; on line #{@line + 1} can&#39;t be assigned&quot;</span></pre></div> </td> </tr> <tr id="section-28"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-28">&#182;</a> </div> <p>Matches a balanced group such as a single or double-quoted string. Pass in
309
+ a series of delimiters, all of which must be nested correctly within the
310
+ contents of the string. This method allows us to have strings within
311
+ interpolations within strings, ad infinitum.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">balancedString</span><span class="o">:</span> <span class="p">(</span><span class="nx">str</span><span class="p">,</span> <span class="nx">end</span><span class="p">)</span> <span class="o">-&gt;</span>
312
+ <span class="nv">stack = </span><span class="p">[</span><span class="nx">end</span><span class="p">]</span>
313
+ <span class="k">for</span> <span class="nx">i</span> <span class="k">in</span> <span class="p">[</span><span class="mi">1</span><span class="p">...</span><span class="nx">str</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span>
314
+ <span class="k">switch</span> <span class="nv">letter = </span><span class="nx">str</span><span class="p">.</span><span class="nx">charAt</span> <span class="nx">i</span>
315
+ <span class="k">when</span> <span class="s1">&#39;\\&#39;</span>
316
+ <span class="nx">i</span><span class="o">++</span>
317
+ <span class="k">continue</span>
318
+ <span class="k">when</span> <span class="nx">end</span>
319
+ <span class="nx">stack</span><span class="p">.</span><span class="nx">pop</span><span class="p">()</span>
320
+ <span class="nx">unless</span> <span class="nx">stack</span><span class="p">.</span><span class="nx">length</span>
321
+ <span class="k">return</span> <span class="nx">str</span><span class="p">.</span><span class="nx">slice</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">i</span> <span class="o">+</span> <span class="mi">1</span>
322
+ <span class="nv">end = </span><span class="nx">stack</span><span class="p">[</span><span class="nx">stack</span><span class="p">.</span><span class="nx">length</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span>
323
+ <span class="k">continue</span>
324
+ <span class="k">if</span> <span class="nx">end</span> <span class="o">is</span> <span class="s1">&#39;}&#39;</span> <span class="o">and</span> <span class="nx">letter</span> <span class="k">in</span> <span class="p">[</span><span class="s1">&#39;&quot;&#39;</span><span class="p">,</span> <span class="s2">&quot;&#39;&quot;</span><span class="p">]</span>
325
+ <span class="nx">stack</span><span class="p">.</span><span class="nx">push</span> <span class="nv">end = </span><span class="nx">letter</span>
326
+ <span class="k">else</span> <span class="k">if</span> <span class="nx">end</span> <span class="o">is</span> <span class="s1">&#39;}&#39;</span> <span class="o">and</span> <span class="nx">letter</span> <span class="o">is</span> <span class="s1">&#39;{&#39;</span>
327
+ <span class="nx">stack</span><span class="p">.</span><span class="nx">push</span> <span class="nv">end = </span><span class="s1">&#39;}&#39;</span>
328
+ <span class="k">else</span> <span class="k">if</span> <span class="nx">end</span> <span class="o">is</span> <span class="s1">&#39;&quot;&#39;</span> <span class="o">and</span> <span class="nx">prev</span> <span class="o">is</span> <span class="s1">&#39;#&#39;</span> <span class="o">and</span> <span class="nx">letter</span> <span class="o">is</span> <span class="s1">&#39;{&#39;</span>
329
+ <span class="nx">stack</span><span class="p">.</span><span class="nx">push</span> <span class="nv">end = </span><span class="s1">&#39;}&#39;</span>
330
+ <span class="nv">prev = </span><span class="nx">letter</span>
331
+ <span class="k">throw</span> <span class="k">new</span> <span class="nb">Error</span> <span class="s2">&quot;missing #{ stack.pop() }, starting on line #{ @line + 1 }&quot;</span></pre></div> </td> </tr> <tr id="section-29"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-29">&#182;</a> </div> <p>Expand variables and expressions inside double-quoted strings using
332
+ Ruby-like notation for substitution of arbitrary expressions.</p>
333
+
334
+ <pre><code>"Hello #{name.capitalize()}."
335
+ </code></pre>
336
+
337
+ <p>If it encounters an interpolation, this method will recursively create a
338
+ new Lexer, tokenize the interpolated contents, and merge them into the
339
+ token stream.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">interpolateString</span><span class="o">:</span> <span class="p">(</span><span class="nx">str</span><span class="p">,</span> <span class="nv">options = </span><span class="p">{})</span> <span class="o">-&gt;</span>
340
+ <span class="p">{</span><span class="nx">heredoc</span><span class="p">,</span> <span class="nx">regex</span><span class="p">}</span> <span class="o">=</span> <span class="nx">options</span>
341
+ <span class="nv">tokens = </span><span class="p">[]</span>
342
+ <span class="nv">pi = </span><span class="mi">0</span>
343
+ <span class="nv">i = </span><span class="o">-</span><span class="mi">1</span>
344
+ <span class="k">while</span> <span class="nv">letter = </span><span class="nx">str</span><span class="p">.</span><span class="nx">charAt</span> <span class="nx">i</span> <span class="o">+=</span> <span class="mi">1</span>
345
+ <span class="k">if</span> <span class="nx">letter</span> <span class="o">is</span> <span class="s1">&#39;\\&#39;</span>
346
+ <span class="nx">i</span> <span class="o">+=</span> <span class="mi">1</span>
347
+ <span class="k">continue</span>
348
+ <span class="nx">unless</span> <span class="nx">letter</span> <span class="o">is</span> <span class="s1">&#39;#&#39;</span> <span class="o">and</span> <span class="nx">str</span><span class="p">.</span><span class="nx">charAt</span><span class="p">(</span><span class="nx">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="o">is</span> <span class="s1">&#39;{&#39;</span> <span class="o">and</span>
349
+ <span class="p">(</span><span class="nv">expr = </span><span class="nx">@balancedString</span> <span class="nx">str</span><span class="p">.</span><span class="nx">slice</span><span class="p">(</span><span class="nx">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">),</span> <span class="s1">&#39;}&#39;</span><span class="p">)</span>
350
+ <span class="k">continue</span>
351
+ <span class="nx">tokens</span><span class="p">.</span><span class="nx">push</span> <span class="p">[</span><span class="s1">&#39;NEOSTRING&#39;</span><span class="p">,</span> <span class="nx">str</span><span class="p">.</span><span class="nx">slice</span><span class="p">(</span><span class="nx">pi</span><span class="p">,</span> <span class="nx">i</span><span class="p">)]</span> <span class="k">if</span> <span class="nx">pi</span> <span class="o">&lt;</span> <span class="nx">i</span>
352
+ <span class="nv">inner = </span><span class="nx">expr</span><span class="p">.</span><span class="nx">slice</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
353
+ <span class="k">if</span> <span class="nx">inner</span><span class="p">.</span><span class="nx">length</span>
354
+ <span class="nv">nested = </span><span class="k">new</span> <span class="nx">Lexer</span><span class="p">().</span><span class="nx">tokenize</span> <span class="nx">inner</span><span class="p">,</span> <span class="nx">line</span><span class="o">:</span> <span class="nx">@line</span><span class="p">,</span> <span class="nx">rewrite</span><span class="o">:</span> <span class="kc">off</span>
355
+ <span class="nx">nested</span><span class="p">.</span><span class="nx">pop</span><span class="p">()</span>
356
+ <span class="nx">nested</span><span class="p">.</span><span class="nx">shift</span><span class="p">()</span> <span class="k">if</span> <span class="nx">nested</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">?</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">is</span> <span class="s1">&#39;TERMINATOR&#39;</span>
357
+ <span class="k">if</span> <span class="nx">nested</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">1</span>
358
+ <span class="nx">nested</span><span class="p">.</span><span class="nx">unshift</span> <span class="p">[</span><span class="s1">&#39;(&#39;</span><span class="p">,</span> <span class="s1">&#39;(&#39;</span><span class="p">]</span>
359
+ <span class="nx">nested</span><span class="p">.</span><span class="nx">push</span> <span class="p">[</span><span class="s1">&#39;)&#39;</span><span class="p">,</span> <span class="s1">&#39;)&#39;</span><span class="p">]</span>
360
+ <span class="nx">tokens</span><span class="p">.</span><span class="nx">push</span> <span class="p">[</span><span class="s1">&#39;TOKENS&#39;</span><span class="p">,</span> <span class="nx">nested</span><span class="p">]</span>
361
+ <span class="nx">i</span> <span class="o">+=</span> <span class="nx">expr</span><span class="p">.</span><span class="nx">length</span>
362
+ <span class="nv">pi = </span><span class="nx">i</span> <span class="o">+</span> <span class="mi">1</span>
363
+ <span class="nx">tokens</span><span class="p">.</span><span class="nx">push</span> <span class="p">[</span><span class="s1">&#39;NEOSTRING&#39;</span><span class="p">,</span> <span class="nx">str</span><span class="p">.</span><span class="nx">slice</span> <span class="nx">pi</span><span class="p">]</span> <span class="k">if</span> <span class="nx">i</span> <span class="o">&gt;</span> <span class="nx">pi</span> <span class="o">&lt;</span> <span class="nx">str</span><span class="p">.</span><span class="nx">length</span>
364
+ <span class="k">return</span> <span class="nx">tokens</span> <span class="k">if</span> <span class="nx">regex</span>
365
+ <span class="k">return</span> <span class="nx">@token</span> <span class="s1">&#39;STRING&#39;</span><span class="p">,</span> <span class="s1">&#39;&quot;&quot;&#39;</span> <span class="nx">unless</span> <span class="nx">tokens</span><span class="p">.</span><span class="nx">length</span>
366
+ <span class="nx">tokens</span><span class="p">.</span><span class="nx">unshift</span> <span class="p">[</span><span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">]</span> <span class="nx">unless</span> <span class="nx">tokens</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">is</span> <span class="s1">&#39;NEOSTRING&#39;</span>
367
+ <span class="nx">@token</span> <span class="s1">&#39;(&#39;</span><span class="p">,</span> <span class="s1">&#39;(&#39;</span> <span class="k">if</span> <span class="nv">interpolated = </span><span class="nx">tokens</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">1</span>
368
+ <span class="k">for</span> <span class="p">[</span><span class="nx">tag</span><span class="p">,</span> <span class="nx">value</span><span class="p">],</span> <span class="nx">i</span> <span class="k">in</span> <span class="nx">tokens</span>
369
+ <span class="nx">@token</span> <span class="s1">&#39;+&#39;</span><span class="p">,</span> <span class="s1">&#39;+&#39;</span> <span class="k">if</span> <span class="nx">i</span>
370
+ <span class="k">if</span> <span class="nx">tag</span> <span class="o">is</span> <span class="s1">&#39;TOKENS&#39;</span>
371
+ <span class="nx">@tokens</span><span class="p">.</span><span class="nx">push</span> <span class="nx">value</span><span class="p">...</span>
372
+ <span class="k">else</span>
373
+ <span class="nx">@token</span> <span class="s1">&#39;STRING&#39;</span><span class="p">,</span> <span class="nx">@makeString</span> <span class="nx">value</span><span class="p">,</span> <span class="s1">&#39;&quot;&#39;</span><span class="p">,</span> <span class="nx">heredoc</span>
374
+ <span class="nx">@token</span> <span class="s1">&#39;)&#39;</span><span class="p">,</span> <span class="s1">&#39;)&#39;</span> <span class="k">if</span> <span class="nx">interpolated</span>
375
+ <span class="nx">tokens</span></pre></div> </td> </tr> <tr id="section-30"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-30">&#182;</a> </div> <h2>Helpers</h2> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-31"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-31">&#182;</a> </div> <p>Add a token to the results, taking note of the line number.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">token</span><span class="o">:</span> <span class="p">(</span><span class="nx">tag</span><span class="p">,</span> <span class="nx">value</span><span class="p">)</span> <span class="o">-&gt;</span>
376
+ <span class="nx">@tokens</span><span class="p">.</span><span class="nx">push</span> <span class="p">[</span><span class="nx">tag</span><span class="p">,</span> <span class="nx">value</span><span class="p">,</span> <span class="nx">@line</span><span class="p">]</span></pre></div> </td> </tr> <tr id="section-32"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-32">&#182;</a> </div> <p>Peek at a tag in the current token stream.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">tag</span><span class="o">:</span> <span class="p">(</span><span class="nx">index</span><span class="p">,</span> <span class="nx">tag</span><span class="p">)</span> <span class="o">-&gt;</span>
377
+ <span class="p">(</span><span class="nv">tok = </span><span class="nx">last</span> <span class="nx">@tokens</span><span class="p">,</span> <span class="nx">index</span><span class="p">)</span> <span class="o">and</span> <span class="k">if</span> <span class="nx">tag</span> <span class="k">then</span> <span class="nx">tok</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="nx">tag</span> <span class="k">else</span> <span class="nx">tok</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span></pre></div> </td> </tr> <tr id="section-33"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-33">&#182;</a> </div> <p>Peek at a value in the current token stream.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">value</span><span class="o">:</span> <span class="p">(</span><span class="nx">index</span><span class="p">,</span> <span class="nx">val</span><span class="p">)</span> <span class="o">-&gt;</span>
378
+ <span class="p">(</span><span class="nv">tok = </span><span class="nx">last</span> <span class="nx">@tokens</span><span class="p">,</span> <span class="nx">index</span><span class="p">)</span> <span class="o">and</span> <span class="k">if</span> <span class="nx">val</span> <span class="k">then</span> <span class="nx">tok</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="nx">val</span> <span class="k">else</span> <span class="nx">tok</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span></pre></div> </td> </tr> <tr id="section-34"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-34">&#182;</a> </div> <p>Are we in the midst of an unfinished expression?</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">unfinished</span><span class="o">:</span> <span class="o">-&gt;</span>
379
+ <span class="nx">LINE_CONTINUER</span><span class="p">.</span><span class="nx">test</span><span class="p">(</span><span class="nx">@chunk</span><span class="p">)</span> <span class="o">or</span>
380
+ <span class="p">(</span><span class="nv">prev = </span><span class="nx">last</span> <span class="nx">@tokens</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span> <span class="o">and</span> <span class="nx">prev</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">isnt</span> <span class="s1">&#39;.&#39;</span> <span class="o">and</span>
381
+ <span class="p">(</span><span class="nv">value = </span><span class="nx">@value</span><span class="p">())</span> <span class="o">and</span> <span class="o">not</span> <span class="nx">value</span><span class="p">.</span><span class="nx">reserved</span> <span class="o">and</span>
382
+ <span class="nx">NO_NEWLINE</span><span class="p">.</span><span class="nx">test</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="o">and</span> <span class="o">not</span> <span class="nx">CODE</span><span class="p">.</span><span class="nx">test</span><span class="p">(</span><span class="nx">value</span><span class="p">)</span> <span class="o">and</span> <span class="o">not</span> <span class="nx">ASSIGNED</span><span class="p">.</span><span class="nx">test</span><span class="p">(</span><span class="nx">@chunk</span><span class="p">)</span></pre></div> </td> </tr> <tr id="section-35"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-35">&#182;</a> </div> <p>Converts newlines for string literals.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">escapeLines</span><span class="o">:</span> <span class="p">(</span><span class="nx">str</span><span class="p">,</span> <span class="nx">heredoc</span><span class="p">)</span> <span class="o">-&gt;</span>
383
+ <span class="nx">str</span><span class="p">.</span><span class="nx">replace</span> <span class="nx">MULTILINER</span><span class="p">,</span> <span class="k">if</span> <span class="nx">heredoc</span> <span class="k">then</span> <span class="s1">&#39;\\n&#39;</span> <span class="k">else</span> <span class="s1">&#39;&#39;</span></pre></div> </td> </tr> <tr id="section-36"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-36">&#182;</a> </div> <p>Constructs a string token by escaping quotes and newlines.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nx">makeString</span><span class="o">:</span> <span class="p">(</span><span class="nx">body</span><span class="p">,</span> <span class="nx">quote</span><span class="p">,</span> <span class="nx">heredoc</span><span class="p">)</span> <span class="o">-&gt;</span>
384
+ <span class="k">return</span> <span class="nx">quote</span> <span class="o">+</span> <span class="nx">quote</span> <span class="nx">unless</span> <span class="nx">body</span>
385
+ <span class="nv">body = </span><span class="nx">body</span><span class="p">.</span><span class="nx">replace</span> <span class="sr">/\\([\s\S])/g</span><span class="p">,</span> <span class="p">(</span><span class="nx">match</span><span class="p">,</span> <span class="nx">contents</span><span class="p">)</span> <span class="o">-&gt;</span>
386
+ <span class="k">if</span> <span class="nx">contents</span> <span class="k">in</span> <span class="p">[</span><span class="s1">&#39;\n&#39;</span><span class="p">,</span> <span class="nx">quote</span><span class="p">]</span> <span class="k">then</span> <span class="nx">contents</span> <span class="k">else</span> <span class="nx">match</span>
387
+ <span class="nv">body = </span><span class="nx">body</span><span class="p">.</span><span class="nx">replace</span> <span class="err">/// #{quote} ///g, &#39;\\$&amp;&#39;</span>
388
+ <span class="nx">quote</span> <span class="o">+</span> <span class="nx">@escapeLines</span><span class="p">(</span><span class="nx">body</span><span class="p">,</span> <span class="nx">heredoc</span><span class="p">)</span> <span class="o">+</span> <span class="nx">quote</span></pre></div> </td> </tr> <tr id="section-37"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-37">&#182;</a> </div> <h2>Constants</h2> </td> <td class="code"> <div class="highlight"><pre></pre></div> </td> </tr> <tr id="section-38"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-38">&#182;</a> </div> <p>Keywords that CoffeeScript shares in common with JavaScript.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">JS_KEYWORDS = </span><span class="p">[</span>
389
+ <span class="s1">&#39;true&#39;</span><span class="p">,</span> <span class="s1">&#39;false&#39;</span><span class="p">,</span> <span class="s1">&#39;null&#39;</span><span class="p">,</span> <span class="s1">&#39;this&#39;</span>
390
+ <span class="s1">&#39;new&#39;</span><span class="p">,</span> <span class="s1">&#39;delete&#39;</span><span class="p">,</span> <span class="s1">&#39;typeof&#39;</span><span class="p">,</span> <span class="s1">&#39;in&#39;</span><span class="p">,</span> <span class="s1">&#39;instanceof&#39;</span>
391
+ <span class="s1">&#39;return&#39;</span><span class="p">,</span> <span class="s1">&#39;throw&#39;</span><span class="p">,</span> <span class="s1">&#39;break&#39;</span><span class="p">,</span> <span class="s1">&#39;continue&#39;</span><span class="p">,</span> <span class="s1">&#39;debugger&#39;</span>
392
+ <span class="s1">&#39;if&#39;</span><span class="p">,</span> <span class="s1">&#39;else&#39;</span><span class="p">,</span> <span class="s1">&#39;switch&#39;</span><span class="p">,</span> <span class="s1">&#39;for&#39;</span><span class="p">,</span> <span class="s1">&#39;while&#39;</span><span class="p">,</span> <span class="s1">&#39;do&#39;</span><span class="p">,</span> <span class="s1">&#39;try&#39;</span><span class="p">,</span> <span class="s1">&#39;catch&#39;</span><span class="p">,</span> <span class="s1">&#39;finally&#39;</span>
393
+ <span class="s1">&#39;class&#39;</span><span class="p">,</span> <span class="s1">&#39;extends&#39;</span><span class="p">,</span> <span class="s1">&#39;super&#39;</span>
394
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-39"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-39">&#182;</a> </div> <p>CoffeeScript-only keywords.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">COFFEE_KEYWORDS = </span><span class="p">[</span><span class="s1">&#39;undefined&#39;</span><span class="p">,</span> <span class="s1">&#39;then&#39;</span><span class="p">,</span> <span class="s1">&#39;unless&#39;</span><span class="p">,</span> <span class="s1">&#39;until&#39;</span><span class="p">,</span> <span class="s1">&#39;loop&#39;</span><span class="p">,</span> <span class="s1">&#39;of&#39;</span><span class="p">,</span> <span class="s1">&#39;by&#39;</span><span class="p">,</span> <span class="s1">&#39;when&#39;</span><span class="p">]</span>
395
+ <span class="nx">COFFEE_KEYWORDS</span><span class="p">.</span><span class="nx">push</span> <span class="nx">op</span> <span class="k">for</span> <span class="nx">op</span> <span class="k">of</span> <span class="nv">COFFEE_ALIASES =</span>
396
+ <span class="o">and</span> <span class="o">:</span> <span class="s1">&#39;&amp;&amp;&#39;</span>
397
+ <span class="o">or</span> <span class="o">:</span> <span class="s1">&#39;||&#39;</span>
398
+ <span class="o">is</span> <span class="o">:</span> <span class="s1">&#39;==&#39;</span>
399
+ <span class="o">isnt</span> <span class="o">:</span> <span class="s1">&#39;!=&#39;</span>
400
+ <span class="o">not</span> <span class="o">:</span> <span class="s1">&#39;!&#39;</span>
401
+ <span class="kc">yes</span> <span class="o">:</span> <span class="s1">&#39;true&#39;</span>
402
+ <span class="kc">no</span> <span class="o">:</span> <span class="s1">&#39;false&#39;</span>
403
+ <span class="kc">on</span> <span class="o">:</span> <span class="s1">&#39;true&#39;</span>
404
+ <span class="kc">off</span> <span class="o">:</span> <span class="s1">&#39;false&#39;</span></pre></div> </td> </tr> <tr id="section-40"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-40">&#182;</a> </div> <p>The list of keywords that are reserved by JavaScript, but not used, or are
405
+ used by CoffeeScript internally. We throw an error when these are encountered,
406
+ to avoid having a JavaScript error at runtime.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">RESERVED = </span><span class="p">[</span>
407
+ <span class="s1">&#39;case&#39;</span><span class="p">,</span> <span class="s1">&#39;default&#39;</span><span class="p">,</span> <span class="s1">&#39;function&#39;</span><span class="p">,</span> <span class="s1">&#39;var&#39;</span><span class="p">,</span> <span class="s1">&#39;void&#39;</span><span class="p">,</span> <span class="s1">&#39;with&#39;</span>
408
+ <span class="s1">&#39;const&#39;</span><span class="p">,</span> <span class="s1">&#39;let&#39;</span><span class="p">,</span> <span class="s1">&#39;enum&#39;</span><span class="p">,</span> <span class="s1">&#39;export&#39;</span><span class="p">,</span> <span class="s1">&#39;import&#39;</span><span class="p">,</span> <span class="s1">&#39;native&#39;</span>
409
+ <span class="s1">&#39;__hasProp&#39;</span><span class="p">,</span> <span class="s1">&#39;__extends&#39;</span><span class="p">,</span> <span class="s1">&#39;__slice&#39;</span><span class="p">,</span> <span class="s1">&#39;__bind&#39;</span><span class="p">,</span> <span class="s1">&#39;__indexOf&#39;</span>
410
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-41"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-41">&#182;</a> </div> <p>The superset of both JavaScript keywords and reserved words, none of which may
411
+ be used as identifiers or properties.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">JS_FORBIDDEN = </span><span class="nx">JS_KEYWORDS</span><span class="p">.</span><span class="nx">concat</span> <span class="nx">RESERVED</span>
412
+
413
+ <span class="nv">exports.RESERVED = </span><span class="nx">RESERVED</span><span class="p">.</span><span class="nx">concat</span><span class="p">(</span><span class="nx">JS_KEYWORDS</span><span class="p">).</span><span class="nx">concat</span><span class="p">(</span><span class="nx">COFFEE_KEYWORDS</span><span class="p">)</span></pre></div> </td> </tr> <tr id="section-42"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-42">&#182;</a> </div> <p>Token matching regexes.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">IDENTIFIER = </span><span class="err">/// ^</span>
414
+ <span class="p">(</span> <span class="p">[</span><span class="nx">$A</span><span class="o">-</span><span class="nx">Za</span><span class="o">-</span><span class="nx">z_</span><span class="p">][</span><span class="nx">$</span><span class="err">\</span><span class="nx">w</span><span class="p">]</span><span class="o">*</span> <span class="p">)</span>
415
+ <span class="p">(</span> <span class="p">[</span><span class="o">^</span><span class="err">\</span><span class="nx">n</span><span class="err">\</span><span class="nx">S</span><span class="p">]</span><span class="o">*</span> <span class="o">:</span> <span class="p">(</span><span class="o">?!:</span><span class="p">)</span> <span class="p">)</span><span class="o">?</span> <span class="c1"># Is this a property name?</span>
416
+ <span class="err">///</span>
417
+
418
+ <span class="nv">NUMBER = </span><span class="err">///</span>
419
+ <span class="o">^</span> <span class="mi">0</span><span class="nx">x</span><span class="p">[</span><span class="err">\</span><span class="nx">da</span><span class="o">-</span><span class="nx">f</span><span class="p">]</span><span class="o">+</span> <span class="o">|</span> <span class="c1"># hex</span>
420
+ <span class="o">^</span> <span class="p">(</span><span class="o">?:</span> <span class="err">\</span><span class="nx">d</span><span class="o">+</span><span class="p">(</span><span class="err">\</span><span class="p">.</span><span class="err">\</span><span class="nx">d</span><span class="o">+</span><span class="p">)</span><span class="o">?</span> <span class="o">|</span> <span class="err">\</span><span class="p">.</span><span class="err">\</span><span class="nx">d</span><span class="o">+</span> <span class="p">)</span> <span class="p">(</span><span class="o">?:</span><span class="nx">e</span><span class="p">[</span><span class="o">+-</span><span class="p">]</span><span class="o">?</span><span class="err">\</span><span class="nx">d</span><span class="o">+</span><span class="p">)</span><span class="o">?</span> <span class="c1"># decimal</span>
421
+ <span class="err">///i</span>
422
+
423
+ <span class="nv">HEREDOC = </span><span class="err">/// ^ (&quot;&quot;&quot;|&#39;&#39;&#39;) ([\s\S]*?) (?:\n[^\n\S]*)? \1 ///</span>
424
+
425
+ <span class="nv">OPERATOR = </span><span class="err">/// ^ (</span>
426
+ <span class="o">?:</span> <span class="p">[</span><span class="o">-=</span><span class="p">]</span><span class="o">&gt;</span> <span class="c1"># function</span>
427
+ <span class="o">|</span> <span class="p">[</span><span class="o">-+*</span><span class="sr">/%&lt;&gt;&amp;|^!?=]= # compound assign /</span> <span class="nx">compare</span>
428
+ <span class="o">|</span> <span class="o">&gt;&gt;&gt;=?</span> <span class="c1"># zero-fill right shift</span>
429
+ <span class="o">|</span> <span class="p">([</span><span class="o">-+:</span><span class="p">])</span><span class="err">\</span><span class="mi">1</span> <span class="c1"># doubles</span>
430
+ <span class="o">|</span> <span class="p">([</span><span class="o">&amp;|&lt;&gt;</span><span class="p">])</span><span class="err">\</span><span class="mi">2</span><span class="o">=?</span> <span class="c1"># logic / shift</span>
431
+ <span class="o">|</span> <span class="err">\</span><span class="o">?</span><span class="err">\</span><span class="p">.</span> <span class="c1"># soak access</span>
432
+ <span class="o">|</span> <span class="err">\</span><span class="p">.{</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">}</span> <span class="c1"># range or splat</span>
433
+ <span class="p">)</span> <span class="o">/</span><span class="err">//</span>
434
+
435
+ <span class="nv">WHITESPACE = </span><span class="sr">/^[^\n\S]+/</span>
436
+
437
+ <span class="nv">COMMENT = </span><span class="sr">/^###([^#][\s\S]*?)(?:###[^\n\S]*|(?:###)?$)|^(?:\s*#(?!##[^#]).*)+/</span>
438
+
439
+ <span class="nv">CODE = </span><span class="sr">/^[-=]&gt;/</span>
440
+
441
+ <span class="nv">MULTI_DENT = </span><span class="sr">/^(?:\n[^\n\S]*)+/</span>
442
+
443
+ <span class="nv">SIMPLESTR = </span><span class="sr">/^&#39;[^\\&#39;]*(?:\\.[^\\&#39;]*)*&#39;/</span>
444
+
445
+ <span class="nv">JSTOKEN = </span><span class="sr">/^`[^\\`]*(?:\\.[^\\`]*)*`/</span></pre></div> </td> </tr> <tr id="section-43"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-43">&#182;</a> </div> <p>Regex-matching-regexes.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">REGEX = </span><span class="err">/// ^</span>
446
+ <span class="o">/</span> <span class="p">(</span><span class="o">?!</span> <span class="err">\</span><span class="nx">s</span> <span class="p">)</span> <span class="c1"># disallow leading whitespace</span>
447
+ <span class="p">[</span><span class="o">^</span> <span class="p">[</span> <span class="err">/ \n \\ ]* # every other thing</span>
448
+ <span class="p">(</span><span class="o">?:</span>
449
+ <span class="p">(</span><span class="o">?:</span> <span class="err">\\</span><span class="p">[</span><span class="err">\</span><span class="nx">s</span><span class="err">\</span><span class="nx">S</span><span class="p">]</span> <span class="c1"># anything escaped</span>
450
+ <span class="o">|</span> <span class="err">\</span><span class="p">[</span> <span class="c1"># character class</span>
451
+ <span class="p">[</span><span class="o">^</span> <span class="err">\</span><span class="p">]</span> <span class="err">\</span><span class="nx">n</span> <span class="err">\\</span> <span class="p">]</span><span class="o">*</span>
452
+ <span class="p">(</span><span class="o">?:</span> <span class="err">\\</span><span class="p">[</span><span class="err">\</span><span class="nx">s</span><span class="err">\</span><span class="nx">S</span><span class="p">]</span> <span class="p">[</span><span class="o">^</span> <span class="err">\</span><span class="p">]</span> <span class="err">\</span><span class="nx">n</span> <span class="err">\\</span> <span class="p">]</span><span class="o">*</span> <span class="p">)</span><span class="o">*</span>
453
+ <span class="p">]</span>
454
+ <span class="p">)</span> <span class="p">[</span><span class="o">^</span> <span class="p">[</span> <span class="err">/ \n \\ ]*</span>
455
+ <span class="p">)</span><span class="o">*</span>
456
+ <span class="err">/ [imgy]{0,4} (?!\w)</span>
457
+ <span class="o">/</span><span class="err">//</span>
458
+
459
+ <span class="nv">HEREGEX = </span><span class="err">/// ^ /{3} ([\s\S]+?) /{3} ([imgy]{0,4}) (?!\w) ///</span>
460
+
461
+ <span class="nv">HEREGEX_OMIT = </span><span class="sr">/\s+(?:#.*)?/g</span></pre></div> </td> </tr> <tr id="section-44"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-44">&#182;</a> </div> <p>Token cleaning regexes.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">MULTILINER = </span><span class="sr">/\n/g</span>
462
+
463
+ <span class="nv">HEREDOC_INDENT = </span><span class="sr">/\n+([^\n\S]*)/g</span>
464
+
465
+ <span class="nv">ASSIGNED = </span><span class="sr">/^\s*@?([$A-Za-z_][$\w]*|[&#39;&quot;].*[&#39;&quot;])[^\n\S]*?[:=][^:=&gt;]/</span>
466
+
467
+ <span class="nv">LINE_CONTINUER = </span><span class="err">/// ^ \s* (?: , | \??\.(?!\.) | :: ) ///</span>
468
+
469
+ <span class="nv">TRAILING_SPACES = </span><span class="sr">/\s+$/</span>
470
+
471
+ <span class="nv">NO_NEWLINE = </span><span class="err">/// ^ (?: # non-capturing group</span>
472
+ <span class="p">[</span><span class="o">-+*&amp;|</span><span class="err">/%=&lt;&gt;!.\\][&lt;&gt;=&amp;|]* | # symbol operators</span>
473
+ <span class="o">and</span> <span class="o">|</span> <span class="o">or</span> <span class="o">|</span> <span class="o">is</span><span class="p">(</span><span class="o">?:</span><span class="nx">nt</span><span class="p">)</span><span class="o">?</span> <span class="o">|</span> <span class="nx">n</span><span class="p">(</span><span class="o">?:</span><span class="nx">ot</span><span class="o">|</span><span class="nx">ew</span><span class="p">)</span> <span class="o">|</span> <span class="c1"># word operators</span>
474
+ <span class="k">delete</span> <span class="o">|</span> <span class="k">typeof</span> <span class="o">|</span> <span class="k">instanceof</span>
475
+ <span class="p">)</span> <span class="nx">$</span> <span class="err">///</span></pre></div> </td> </tr> <tr id="section-45"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-45">&#182;</a> </div> <p>Compound assignment tokens.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">COMPOUND_ASSIGN = </span><span class="p">[</span>
476
+ <span class="s1">&#39;-=&#39;</span><span class="p">,</span> <span class="s1">&#39;+=&#39;</span><span class="p">,</span> <span class="s1">&#39;/=&#39;</span><span class="p">,</span> <span class="s1">&#39;*=&#39;</span><span class="p">,</span> <span class="s1">&#39;%=&#39;</span><span class="p">,</span> <span class="s1">&#39;||=&#39;</span><span class="p">,</span> <span class="s1">&#39;&amp;&amp;=&#39;</span><span class="p">,</span> <span class="s1">&#39;?=&#39;</span><span class="p">,</span> <span class="s1">&#39;&lt;&lt;=&#39;</span><span class="p">,</span> <span class="s1">&#39;&gt;&gt;=&#39;</span><span class="p">,</span> <span class="s1">&#39;&gt;&gt;&gt;=&#39;</span><span class="p">,</span> <span class="s1">&#39;&amp;=&#39;</span><span class="p">,</span> <span class="s1">&#39;^=&#39;</span><span class="p">,</span> <span class="s1">&#39;|=&#39;</span>
477
+ <span class="p">]</span></pre></div> </td> </tr> <tr id="section-46"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-46">&#182;</a> </div> <p>Unary tokens.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">UNARY = </span><span class="p">[</span><span class="s1">&#39;!&#39;</span><span class="p">,</span> <span class="s1">&#39;~&#39;</span><span class="p">,</span> <span class="s1">&#39;NEW&#39;</span><span class="p">,</span> <span class="s1">&#39;TYPEOF&#39;</span><span class="p">,</span> <span class="s1">&#39;DELETE&#39;</span><span class="p">,</span> <span class="s1">&#39;DO&#39;</span><span class="p">]</span></pre></div> </td> </tr> <tr id="section-47"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-47">&#182;</a> </div> <p>Logical tokens.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">LOGIC = </span><span class="p">[</span><span class="s1">&#39;&amp;&amp;&#39;</span><span class="p">,</span> <span class="s1">&#39;||&#39;</span><span class="p">,</span> <span class="s1">&#39;&amp;&#39;</span><span class="p">,</span> <span class="s1">&#39;|&#39;</span><span class="p">,</span> <span class="s1">&#39;^&#39;</span><span class="p">]</span></pre></div> </td> </tr> <tr id="section-48"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-48">&#182;</a> </div> <p>Bit-shifting tokens.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">SHIFT = </span><span class="p">[</span><span class="s1">&#39;&lt;&lt;&#39;</span><span class="p">,</span> <span class="s1">&#39;&gt;&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;&gt;&gt;&gt;&#39;</span><span class="p">]</span></pre></div> </td> </tr> <tr id="section-49"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-49">&#182;</a> </div> <p>Comparison tokens.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">COMPARE = </span><span class="p">[</span><span class="s1">&#39;==&#39;</span><span class="p">,</span> <span class="s1">&#39;!=&#39;</span><span class="p">,</span> <span class="s1">&#39;&lt;&#39;</span><span class="p">,</span> <span class="s1">&#39;&gt;&#39;</span><span class="p">,</span> <span class="s1">&#39;&lt;=&#39;</span><span class="p">,</span> <span class="s1">&#39;&gt;=&#39;</span><span class="p">]</span></pre></div> </td> </tr> <tr id="section-50"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-50">&#182;</a> </div> <p>Mathematical tokens.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">MATH = </span><span class="p">[</span><span class="s1">&#39;*&#39;</span><span class="p">,</span> <span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="s1">&#39;%&#39;</span><span class="p">]</span></pre></div> </td> </tr> <tr id="section-51"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-51">&#182;</a> </div> <p>Relational tokens that are negatable with <code>not</code> prefix.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">RELATION = </span><span class="p">[</span><span class="s1">&#39;IN&#39;</span><span class="p">,</span> <span class="s1">&#39;OF&#39;</span><span class="p">,</span> <span class="s1">&#39;INSTANCEOF&#39;</span><span class="p">]</span></pre></div> </td> </tr> <tr id="section-52"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-52">&#182;</a> </div> <p>Boolean tokens.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">BOOL = </span><span class="p">[</span><span class="s1">&#39;TRUE&#39;</span><span class="p">,</span> <span class="s1">&#39;FALSE&#39;</span><span class="p">,</span> <span class="s1">&#39;NULL&#39;</span><span class="p">,</span> <span class="s1">&#39;UNDEFINED&#39;</span><span class="p">]</span></pre></div> </td> </tr> <tr id="section-53"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-53">&#182;</a> </div> <p>Tokens which a regular expression will never immediately follow, but which
478
+ a division operator might.</p>
479
+
480
+ <p>See: http://www.mozilla.org/js/language/js20-2002-04/rationale/syntax.html#regular-expressions</p>
481
+
482
+ <p>Our list is shorter, due to sans-parentheses method calls.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">NOT_REGEX = </span><span class="p">[</span><span class="s1">&#39;NUMBER&#39;</span><span class="p">,</span> <span class="s1">&#39;REGEX&#39;</span><span class="p">,</span> <span class="s1">&#39;BOOL&#39;</span><span class="p">,</span> <span class="s1">&#39;++&#39;</span><span class="p">,</span> <span class="s1">&#39;--&#39;</span><span class="p">,</span> <span class="s1">&#39;]&#39;</span><span class="p">]</span></pre></div> </td> </tr> <tr id="section-54"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-54">&#182;</a> </div> <p>If the previous token is not spaced, there are more preceding tokens that
483
+ force a division parse:</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">NOT_SPACED_REGEX = </span><span class="nx">NOT_REGEX</span><span class="p">.</span><span class="nx">concat</span> <span class="s1">&#39;)&#39;</span><span class="p">,</span> <span class="s1">&#39;}&#39;</span><span class="p">,</span> <span class="s1">&#39;THIS&#39;</span><span class="p">,</span> <span class="s1">&#39;IDENTIFIER&#39;</span><span class="p">,</span> <span class="s1">&#39;STRING&#39;</span></pre></div> </td> </tr> <tr id="section-55"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-55">&#182;</a> </div> <p>Tokens which could legitimately be invoked or indexed. A opening
484
+ parentheses or bracket following these tokens will be recorded as the start
485
+ of a function invocation or indexing operation.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">CALLABLE = </span><span class="p">[</span><span class="s1">&#39;IDENTIFIER&#39;</span><span class="p">,</span> <span class="s1">&#39;STRING&#39;</span><span class="p">,</span> <span class="s1">&#39;REGEX&#39;</span><span class="p">,</span> <span class="s1">&#39;)&#39;</span><span class="p">,</span> <span class="s1">&#39;]&#39;</span><span class="p">,</span> <span class="s1">&#39;}&#39;</span><span class="p">,</span> <span class="s1">&#39;?&#39;</span><span class="p">,</span> <span class="s1">&#39;::&#39;</span><span class="p">,</span> <span class="s1">&#39;@&#39;</span><span class="p">,</span> <span class="s1">&#39;THIS&#39;</span><span class="p">,</span> <span class="s1">&#39;SUPER&#39;</span><span class="p">]</span>
486
+ <span class="nv">INDEXABLE = </span><span class="nx">CALLABLE</span><span class="p">.</span><span class="nx">concat</span> <span class="s1">&#39;NUMBER&#39;</span><span class="p">,</span> <span class="s1">&#39;BOOL&#39;</span></pre></div> </td> </tr> <tr id="section-56"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-56">&#182;</a> </div> <p>Tokens that, when immediately preceding a <code>WHEN</code>, indicate that the <code>WHEN</code>
487
+ occurs at the start of a line. We disambiguate these from trailing whens to
488
+ avoid an ambiguity in the grammar.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">LINE_BREAK = </span><span class="p">[</span><span class="s1">&#39;INDENT&#39;</span><span class="p">,</span> <span class="s1">&#39;OUTDENT&#39;</span><span class="p">,</span> <span class="s1">&#39;TERMINATOR&#39;</span><span class="p">]</span>
489
+
490
+ </pre></div> </td> </tr> </tbody> </table> </div> </body> </html>