snowball 0.1.21 → 0.1.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (589) hide show
  1. checksums.yaml +5 -13
  2. data/.gitignore +1 -3
  3. data/{lib/snowball → bin}/roll.js +0 -0
  4. data/lib/snowball/roller.rb +1 -1
  5. data/lib/snowball/version.rb +1 -1
  6. data/node_modules/.bin/browserify +161 -0
  7. data/node_modules/.bin/cake +7 -0
  8. data/node_modules/.bin/coffee +7 -0
  9. data/node_modules/.bin/jade +168 -0
  10. data/node_modules/browserify/.travis.yml +4 -0
  11. data/node_modules/browserify/LICENSE +63 -0
  12. data/node_modules/browserify/README.markdown +172 -0
  13. data/node_modules/browserify/bin/cmd.js +161 -0
  14. data/node_modules/browserify/builtins/__browserify_process.js +55 -0
  15. data/node_modules/browserify/builtins/assert.js +314 -0
  16. data/node_modules/browserify/builtins/child_process.js +2 -0
  17. data/node_modules/browserify/builtins/events.js +178 -0
  18. data/node_modules/browserify/builtins/fs.js +1 -0
  19. data/node_modules/browserify/builtins/https.js +1 -0
  20. data/node_modules/browserify/builtins/net.js +1 -0
  21. data/node_modules/browserify/builtins/path.js +175 -0
  22. data/node_modules/browserify/builtins/querystring.js +250 -0
  23. data/node_modules/browserify/builtins/stream.js +119 -0
  24. data/node_modules/browserify/builtins/string_decoder.js +161 -0
  25. data/node_modules/browserify/builtins/sys.js +1 -0
  26. data/node_modules/browserify/builtins/timers.js +39 -0
  27. data/node_modules/browserify/builtins/tls.js +1 -0
  28. data/node_modules/browserify/builtins/tty.js +2 -0
  29. data/node_modules/browserify/builtins/url.js +604 -0
  30. data/node_modules/browserify/builtins/util.js +351 -0
  31. data/node_modules/browserify/example/debug/browserify.js +219 -0
  32. data/node_modules/browserify/example/debug/build.sh +3 -0
  33. data/node_modules/browserify/example/debug/index.html +7 -0
  34. data/node_modules/browserify/example/debug/js/entry.js +2 -0
  35. data/node_modules/browserify/example/debug/js/thrower.js +3 -0
  36. data/node_modules/browserify/example/debug/server.js +9 -0
  37. data/node_modules/browserify/example/simple-build/browserify.js +368 -0
  38. data/node_modules/browserify/example/simple-build/build.sh +3 -0
  39. data/node_modules/browserify/example/simple-build/index.html +9 -0
  40. data/node_modules/browserify/example/simple-build/js/bar.js +3 -0
  41. data/node_modules/browserify/example/simple-build/js/entry.js +5 -0
  42. data/node_modules/browserify/example/simple-build/js/foo.js +5 -0
  43. data/node_modules/browserify/example/simple-build/server.js +9 -0
  44. data/node_modules/browserify/example/test/b.js +5 -0
  45. data/node_modules/browserify/example/test/bar.js +3 -0
  46. data/node_modules/browserify/example/test/foo.js +3 -0
  47. data/node_modules/browserify/example/test/m.js +3 -0
  48. data/node_modules/browserify/example/test/n.js +3 -0
  49. data/node_modules/browserify/example/using-http/bundle.js +813 -0
  50. data/node_modules/browserify/example/using-http/entry.js +25 -0
  51. data/node_modules/browserify/example/using-http/index.html +9 -0
  52. data/node_modules/browserify/example/using-http/server.js +28 -0
  53. data/node_modules/browserify/index.js +202 -0
  54. data/node_modules/browserify/lib/watch.js +75 -0
  55. data/node_modules/browserify/lib/wrap.js +580 -0
  56. data/node_modules/browserify/lib/wrappers.js +10 -0
  57. data/node_modules/browserify/node_modules/buffer-browserify/.npmignore +1 -0
  58. data/node_modules/browserify/node_modules/buffer-browserify/README.md +11 -0
  59. data/node_modules/browserify/node_modules/buffer-browserify/buffer_ieee754.js +84 -0
  60. data/node_modules/browserify/node_modules/buffer-browserify/index.js +1317 -0
  61. data/node_modules/browserify/node_modules/buffer-browserify/node_modules/base64-js/README.md +14 -0
  62. data/node_modules/browserify/node_modules/buffer-browserify/node_modules/base64-js/lib/b64.js +84 -0
  63. data/node_modules/browserify/node_modules/buffer-browserify/node_modules/base64-js/package.json +30 -0
  64. data/node_modules/browserify/node_modules/buffer-browserify/node_modules/base64-js/test/runner.js +50 -0
  65. data/node_modules/browserify/node_modules/buffer-browserify/package.json +46 -0
  66. data/node_modules/browserify/node_modules/buffer-browserify/test/buffer.js +218 -0
  67. data/node_modules/browserify/node_modules/commondir/README.markdown +45 -0
  68. data/node_modules/browserify/node_modules/commondir/example/base.js +3 -0
  69. data/node_modules/browserify/node_modules/commondir/example/dir.js +3 -0
  70. data/node_modules/browserify/node_modules/commondir/index.js +29 -0
  71. data/node_modules/browserify/node_modules/commondir/package.json +47 -0
  72. data/node_modules/browserify/node_modules/commondir/test/dirs.js +66 -0
  73. data/node_modules/browserify/node_modules/crypto-browserify/.travis.yml +4 -0
  74. data/node_modules/browserify/node_modules/crypto-browserify/example/bundle.js +637 -0
  75. data/node_modules/browserify/node_modules/crypto-browserify/example/index.html +12 -0
  76. data/node_modules/browserify/node_modules/crypto-browserify/example/test.js +4 -0
  77. data/node_modules/browserify/node_modules/crypto-browserify/index.js +74 -0
  78. data/node_modules/browserify/node_modules/crypto-browserify/md5.js +384 -0
  79. data/node_modules/browserify/node_modules/crypto-browserify/package.json +33 -0
  80. data/node_modules/browserify/node_modules/crypto-browserify/readme.markdown +20 -0
  81. data/node_modules/browserify/node_modules/crypto-browserify/rng.js +37 -0
  82. data/node_modules/browserify/node_modules/crypto-browserify/sha.js +210 -0
  83. data/node_modules/browserify/node_modules/crypto-browserify/test/simple.js +35 -0
  84. data/node_modules/browserify/node_modules/deputy/.travis.yml +4 -0
  85. data/node_modules/browserify/node_modules/deputy/README.markdown +55 -0
  86. data/node_modules/browserify/node_modules/deputy/example/cache.js +5 -0
  87. data/node_modules/browserify/node_modules/deputy/index.js +46 -0
  88. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/.npmignore +2 -0
  89. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/.travis.yml +5 -0
  90. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/LICENSE +21 -0
  91. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/examples/pow.js +6 -0
  92. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/index.js +82 -0
  93. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/package.json +34 -0
  94. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/readme.markdown +63 -0
  95. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/chmod.js +38 -0
  96. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/clobber.js +37 -0
  97. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/mkdirp.js +28 -0
  98. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/perm.js +32 -0
  99. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/perm_sync.js +39 -0
  100. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/race.js +41 -0
  101. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/rel.js +32 -0
  102. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/return.js +25 -0
  103. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/return_sync.js +24 -0
  104. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/root.js +18 -0
  105. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/sync.js +32 -0
  106. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/umask.js +28 -0
  107. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/umask_sync.js +32 -0
  108. data/node_modules/browserify/node_modules/deputy/package.json +47 -0
  109. data/node_modules/browserify/node_modules/deputy/test/cache.js +58 -0
  110. data/node_modules/browserify/node_modules/detective/.travis.yml +4 -0
  111. data/node_modules/browserify/node_modules/detective/README.markdown +66 -0
  112. data/node_modules/browserify/node_modules/detective/example/strings.js +6 -0
  113. data/node_modules/browserify/node_modules/detective/example/strings_src.js +3 -0
  114. data/node_modules/browserify/node_modules/detective/index.js +60 -0
  115. data/node_modules/browserify/node_modules/detective/node_modules/.bin/esparse +42 -0
  116. data/node_modules/browserify/node_modules/detective/node_modules/esprima/.travis.yml +5 -0
  117. data/node_modules/browserify/node_modules/detective/node_modules/esprima/LICENSE.BSD +19 -0
  118. data/node_modules/browserify/node_modules/detective/node_modules/esprima/README.md +74 -0
  119. data/node_modules/browserify/node_modules/detective/node_modules/esprima/assets/codemirror/codemirror.css +112 -0
  120. data/node_modules/browserify/node_modules/detective/node_modules/esprima/assets/codemirror/codemirror.js +2972 -0
  121. data/node_modules/browserify/node_modules/detective/node_modules/esprima/assets/codemirror/javascript.js +360 -0
  122. data/node_modules/browserify/node_modules/detective/node_modules/esprima/assets/json2.js +487 -0
  123. data/node_modules/browserify/node_modules/detective/node_modules/esprima/assets/style.css +164 -0
  124. data/node_modules/browserify/node_modules/detective/node_modules/esprima/assets/yui/treeview-min.js +12 -0
  125. data/node_modules/browserify/node_modules/detective/node_modules/esprima/assets/yui/treeview-sprite.gif +0 -0
  126. data/node_modules/browserify/node_modules/detective/node_modules/esprima/assets/yui/treeview.css +7 -0
  127. data/node_modules/browserify/node_modules/detective/node_modules/esprima/assets/yui/yahoo-dom-event.js +14 -0
  128. data/node_modules/browserify/node_modules/detective/node_modules/esprima/bin/esparse.js +42 -0
  129. data/node_modules/browserify/node_modules/detective/node_modules/esprima/changes +92 -0
  130. data/node_modules/browserify/node_modules/detective/node_modules/esprima/cm +696 -0
  131. data/node_modules/browserify/node_modules/detective/node_modules/esprima/demo/checkenv.js +42 -0
  132. data/node_modules/browserify/node_modules/detective/node_modules/esprima/demo/collector.html +82 -0
  133. data/node_modules/browserify/node_modules/detective/node_modules/esprima/demo/collector.js +170 -0
  134. data/node_modules/browserify/node_modules/detective/node_modules/esprima/demo/functiontrace.html +106 -0
  135. data/node_modules/browserify/node_modules/detective/node_modules/esprima/demo/functiontrace.js +123 -0
  136. data/node_modules/browserify/node_modules/detective/node_modules/esprima/demo/parse.css +82 -0
  137. data/node_modules/browserify/node_modules/detective/node_modules/esprima/demo/parse.html +352 -0
  138. data/node_modules/browserify/node_modules/detective/node_modules/esprima/demo/precedence.html +225 -0
  139. data/node_modules/browserify/node_modules/detective/node_modules/esprima/demo/rewrite.html +120 -0
  140. data/node_modules/browserify/node_modules/detective/node_modules/esprima/demo/rewrite.js +71 -0
  141. data/node_modules/browserify/node_modules/detective/node_modules/esprima/esprima.js +3577 -0
  142. data/node_modules/browserify/node_modules/detective/node_modules/esprima/index.html +103 -0
  143. data/node_modules/browserify/node_modules/detective/node_modules/esprima/package.json +42 -0
  144. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/Tokenizer.js +646 -0
  145. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/XMLHttpRequest.js +509 -0
  146. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/ZeParser.js +2185 -0
  147. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/backbone-0.5.3.js +1158 -0
  148. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/benchmark.js +3261 -0
  149. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/escodegen.js +906 -0
  150. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/esmorph.js +240 -0
  151. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/ext-core-3.0.0.js +6579 -0
  152. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/ext-core-3.1.0.js +10255 -0
  153. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/jquery-1.6.4.js +9046 -0
  154. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/jquery-1.7.1.js +9266 -0
  155. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/jquery.mobile-1.0.js +6951 -0
  156. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/jsdefs.js +731 -0
  157. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/jslex.js +588 -0
  158. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/jsparse.js +1921 -0
  159. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/mootools-1.3.2.js +5952 -0
  160. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/mootools-1.4.1.js +6297 -0
  161. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/parse-js.js +1342 -0
  162. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/platform.js +878 -0
  163. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/prototype-1.6.1.js +4874 -0
  164. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/prototype-1.7.0.0.js +6082 -0
  165. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/underscore-1.2.3.js +981 -0
  166. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/benchmarks.html +58 -0
  167. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/benchmarks.js +328 -0
  168. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/compare.html +140 -0
  169. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/compare.js +270 -0
  170. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/compat.html +40 -0
  171. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/compat.js +239 -0
  172. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/coverage.footer.html +3 -0
  173. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/coverage.header.html +37 -0
  174. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/coverage.html +3617 -0
  175. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/index.html +36 -0
  176. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/reflect.js +403 -0
  177. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/run.js +66 -0
  178. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/test.js +16659 -0
  179. data/node_modules/browserify/node_modules/detective/node_modules/esprima/tools/generate-unicode-regex.py +164 -0
  180. data/node_modules/browserify/node_modules/detective/node_modules/esprima/tools/update-coverage.sh +28 -0
  181. data/node_modules/browserify/node_modules/detective/package.json +47 -0
  182. data/node_modules/browserify/node_modules/detective/test/both.js +11 -0
  183. data/node_modules/browserify/node_modules/detective/test/chained.js +9 -0
  184. data/node_modules/browserify/node_modules/detective/test/files/both.js +4 -0
  185. data/node_modules/browserify/node_modules/detective/test/files/chained.js +5 -0
  186. data/node_modules/browserify/node_modules/detective/test/files/nested.js +22 -0
  187. data/node_modules/browserify/node_modules/detective/test/files/skip.js +7 -0
  188. data/node_modules/browserify/node_modules/detective/test/files/strings.js +13 -0
  189. data/node_modules/browserify/node_modules/detective/test/files/word.js +13 -0
  190. data/node_modules/browserify/node_modules/detective/test/nested.js +9 -0
  191. data/node_modules/browserify/node_modules/detective/test/skip.js +9 -0
  192. data/node_modules/browserify/node_modules/detective/test/strings.js +9 -0
  193. data/node_modules/browserify/node_modules/detective/test/word.js +12 -0
  194. data/node_modules/browserify/node_modules/http-browserify/.npmignore +1 -0
  195. data/node_modules/browserify/node_modules/http-browserify/example/get/index.html +9 -0
  196. data/node_modules/browserify/node_modules/http-browserify/example/get/main.js +14 -0
  197. data/node_modules/browserify/node_modules/http-browserify/example/get/server.js +12 -0
  198. data/node_modules/browserify/node_modules/http-browserify/example/headers/index.html +9 -0
  199. data/node_modules/browserify/node_modules/http-browserify/example/headers/main.js +18 -0
  200. data/node_modules/browserify/node_modules/http-browserify/example/headers/server.js +15 -0
  201. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/data.json +139 -0
  202. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/index.html +9 -0
  203. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/main.js +13 -0
  204. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/.npmignore +2 -0
  205. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/.travis.yml +4 -0
  206. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/LICENSE.APACHE2 +15 -0
  207. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/LICENSE.MIT +24 -0
  208. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/examples/all_docs.js +13 -0
  209. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/index.js +189 -0
  210. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/node_modules/jsonparse/LICENSE +24 -0
  211. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/node_modules/jsonparse/README.markdown +11 -0
  212. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/node_modules/jsonparse/bench.js +26 -0
  213. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/node_modules/jsonparse/examples/twitterfeed.js +30 -0
  214. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/node_modules/jsonparse/jsonparse.js +379 -0
  215. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/node_modules/jsonparse/package.json +36 -0
  216. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/node_modules/jsonparse/samplejson/basic.json +167 -0
  217. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/node_modules/jsonparse/samplejson/basic2.json +180 -0
  218. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/node_modules/jsonparse/test/primitives.js +54 -0
  219. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/node_modules/jsonparse/test/utf8.js +38 -0
  220. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/package.json +40 -0
  221. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/readme.markdown +145 -0
  222. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/bool.js +41 -0
  223. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/destroy_missing.js +22 -0
  224. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/empty.js +44 -0
  225. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/fixtures/all_npm.json +4030 -0
  226. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/fn.js +39 -0
  227. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/memory.js +69 -0
  228. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/multiple_objects.js +42 -0
  229. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/multiple_objects_error.js +35 -0
  230. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/parsejson.js +28 -0
  231. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/stringify.js +41 -0
  232. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/stringify_object.js +47 -0
  233. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/test.js +35 -0
  234. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/test2.js +29 -0
  235. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/two-ways.js +41 -0
  236. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/server.js +10 -0
  237. data/node_modules/browserify/node_modules/http-browserify/example/post/index.html +9 -0
  238. data/node_modules/browserify/node_modules/http-browserify/example/post/main.js +16 -0
  239. data/node_modules/browserify/node_modules/http-browserify/example/post/server.js +19 -0
  240. data/node_modules/browserify/node_modules/http-browserify/example/streaming/index.html +9 -0
  241. data/node_modules/browserify/node_modules/http-browserify/example/streaming/main.js +16 -0
  242. data/node_modules/browserify/node_modules/http-browserify/example/streaming/server.js +21 -0
  243. data/node_modules/browserify/node_modules/http-browserify/index.js +59 -0
  244. data/node_modules/browserify/node_modules/http-browserify/lib/request.js +128 -0
  245. data/node_modules/browserify/node_modules/http-browserify/lib/response.js +119 -0
  246. data/node_modules/browserify/node_modules/http-browserify/node_modules/concat-stream/index.js +48 -0
  247. data/node_modules/browserify/node_modules/http-browserify/node_modules/concat-stream/package.json +30 -0
  248. data/node_modules/browserify/node_modules/http-browserify/node_modules/concat-stream/readme.md +31 -0
  249. data/node_modules/browserify/node_modules/http-browserify/node_modules/concat-stream/test.js +34 -0
  250. data/node_modules/browserify/node_modules/http-browserify/package.json +46 -0
  251. data/node_modules/browserify/node_modules/http-browserify/readme.markdown +128 -0
  252. data/node_modules/browserify/node_modules/nub/README.markdown +23 -0
  253. data/node_modules/browserify/node_modules/nub/index.js +64 -0
  254. data/node_modules/browserify/node_modules/nub/package.json +46 -0
  255. data/node_modules/browserify/node_modules/nub/test/by.js +51 -0
  256. data/node_modules/browserify/node_modules/nub/test/nub.js +46 -0
  257. data/node_modules/browserify/node_modules/resolve/.travis.yml +4 -0
  258. data/node_modules/browserify/node_modules/resolve/LICENSE +18 -0
  259. data/node_modules/browserify/node_modules/resolve/README.markdown +47 -0
  260. data/node_modules/browserify/node_modules/resolve/index.js +106 -0
  261. data/node_modules/browserify/node_modules/resolve/package.json +45 -0
  262. data/node_modules/browserify/node_modules/resolve/test/core.js +12 -0
  263. data/node_modules/browserify/node_modules/resolve/test/filter.js +15 -0
  264. data/node_modules/browserify/node_modules/resolve/test/mock.js +64 -0
  265. data/node_modules/browserify/node_modules/resolve/test/resolver.js +157 -0
  266. data/node_modules/browserify/node_modules/resolve/test/resolver/bar/node_modules/foo/index.js +1 -0
  267. data/node_modules/browserify/node_modules/resolve/test/resolver/baz/doom.js +0 -0
  268. data/node_modules/browserify/node_modules/resolve/test/resolver/baz/package.json +3 -0
  269. data/node_modules/browserify/node_modules/resolve/test/resolver/baz/quux.js +1 -0
  270. data/node_modules/browserify/node_modules/resolve/test/resolver/biz/node_modules/grux/index.js +1 -0
  271. data/node_modules/browserify/node_modules/resolve/test/resolver/biz/node_modules/tiv/index.js +1 -0
  272. data/node_modules/browserify/node_modules/resolve/test/resolver/cup.coffee +1 -0
  273. data/node_modules/browserify/node_modules/resolve/test/resolver/foo.js +1 -0
  274. data/node_modules/browserify/node_modules/resolve/test/resolver/mug.coffee +0 -0
  275. data/node_modules/browserify/node_modules/resolve/test/resolver/mug.js +0 -0
  276. data/node_modules/browserify/node_modules/resolve/test/resolver/other_path/lib/other-lib.js +0 -0
  277. data/node_modules/browserify/node_modules/resolve/test/resolver/other_path/root.js +0 -0
  278. data/node_modules/browserify/node_modules/syntax-error/.travis.yml +4 -0
  279. data/node_modules/browserify/node_modules/syntax-error/LICENSE +18 -0
  280. data/node_modules/browserify/node_modules/syntax-error/example/check.js +12 -0
  281. data/node_modules/browserify/node_modules/syntax-error/example/src.js +9 -0
  282. data/node_modules/browserify/node_modules/syntax-error/index.js +54 -0
  283. data/node_modules/browserify/node_modules/syntax-error/node_modules/.bin/esparse +42 -0
  284. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/.travis.yml +5 -0
  285. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/LICENSE.BSD +19 -0
  286. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/README.md +74 -0
  287. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/assets/codemirror/codemirror.css +112 -0
  288. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/assets/codemirror/codemirror.js +2972 -0
  289. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/assets/codemirror/javascript.js +360 -0
  290. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/assets/json2.js +487 -0
  291. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/assets/style.css +164 -0
  292. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/assets/yui/treeview-min.js +12 -0
  293. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/assets/yui/treeview-sprite.gif +0 -0
  294. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/assets/yui/treeview.css +7 -0
  295. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/assets/yui/yahoo-dom-event.js +14 -0
  296. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/bin/esparse.js +42 -0
  297. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/changes +92 -0
  298. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/cm +696 -0
  299. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/checkenv.js +42 -0
  300. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/collector.html +82 -0
  301. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/collector.js +170 -0
  302. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/functiontrace.html +106 -0
  303. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/functiontrace.js +123 -0
  304. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/parse.css +82 -0
  305. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/parse.html +352 -0
  306. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/precedence.html +225 -0
  307. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/rewrite.html +120 -0
  308. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/rewrite.js +71 -0
  309. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/esprima.js +3577 -0
  310. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/index.html +103 -0
  311. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/package.json +42 -0
  312. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/Tokenizer.js +646 -0
  313. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/XMLHttpRequest.js +509 -0
  314. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/ZeParser.js +2185 -0
  315. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/backbone-0.5.3.js +1158 -0
  316. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/benchmark.js +3261 -0
  317. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/escodegen.js +906 -0
  318. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/esmorph.js +240 -0
  319. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/ext-core-3.0.0.js +6579 -0
  320. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/ext-core-3.1.0.js +10255 -0
  321. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/jquery-1.6.4.js +9046 -0
  322. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/jquery-1.7.1.js +9266 -0
  323. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/jquery.mobile-1.0.js +6951 -0
  324. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/jsdefs.js +731 -0
  325. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/jslex.js +588 -0
  326. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/jsparse.js +1921 -0
  327. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/mootools-1.3.2.js +5952 -0
  328. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/mootools-1.4.1.js +6297 -0
  329. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/parse-js.js +1342 -0
  330. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/platform.js +878 -0
  331. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/prototype-1.6.1.js +4874 -0
  332. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/prototype-1.7.0.0.js +6082 -0
  333. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/underscore-1.2.3.js +981 -0
  334. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/benchmarks.html +58 -0
  335. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/benchmarks.js +328 -0
  336. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/compare.html +140 -0
  337. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/compare.js +270 -0
  338. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/compat.html +40 -0
  339. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/compat.js +239 -0
  340. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/coverage.footer.html +3 -0
  341. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/coverage.header.html +37 -0
  342. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/coverage.html +3617 -0
  343. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/index.html +36 -0
  344. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/reflect.js +403 -0
  345. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/run.js +66 -0
  346. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/test.js +16659 -0
  347. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/tools/generate-unicode-regex.py +164 -0
  348. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/tools/update-coverage.sh +28 -0
  349. data/node_modules/browserify/node_modules/syntax-error/package.json +49 -0
  350. data/node_modules/browserify/node_modules/syntax-error/readme.markdown +87 -0
  351. data/node_modules/browserify/node_modules/syntax-error/test/check.js +17 -0
  352. data/node_modules/browserify/node_modules/syntax-error/test/sources/check.js +9 -0
  353. data/node_modules/browserify/node_modules/vm-browserify/README.markdown +103 -0
  354. data/node_modules/browserify/node_modules/vm-browserify/example/run/bundle.js +473 -0
  355. data/node_modules/browserify/node_modules/vm-browserify/example/run/entry.js +6 -0
  356. data/node_modules/browserify/node_modules/vm-browserify/example/run/index.html +9 -0
  357. data/node_modules/browserify/node_modules/vm-browserify/example/run/server.js +6 -0
  358. data/node_modules/browserify/node_modules/vm-browserify/index.js +85 -0
  359. data/node_modules/browserify/node_modules/vm-browserify/package.json +43 -0
  360. data/node_modules/browserify/node_modules/vm-browserify/testling/run.js +22 -0
  361. data/node_modules/browserify/node_modules/vm-browserify/testling/test.sh +11 -0
  362. data/node_modules/browserify/package.json +78 -0
  363. data/node_modules/browserify/test/alias.js +58 -0
  364. data/node_modules/browserify/test/backbone.js +21 -0
  365. data/node_modules/browserify/test/bin.js +39 -0
  366. data/node_modules/browserify/test/buffer.js +99 -0
  367. data/node_modules/browserify/test/bundle.js +32 -0
  368. data/node_modules/browserify/test/cache.js +28 -0
  369. data/node_modules/browserify/test/coffee.js +39 -0
  370. data/node_modules/browserify/test/coffee/bar.js +1 -0
  371. data/node_modules/browserify/test/coffee/baz.coffee +1 -0
  372. data/node_modules/browserify/test/coffee/entry.coffee +1 -0
  373. data/node_modules/browserify/test/coffee/foo.coffee +1 -0
  374. data/node_modules/browserify/test/coffee/index.coffee +5 -0
  375. data/node_modules/browserify/test/coffee/nested/nested.coffee +2 -0
  376. data/node_modules/browserify/test/comment.js +17 -0
  377. data/node_modules/browserify/test/comment/main.js +2 -0
  378. data/node_modules/browserify/test/crypto.js +37 -0
  379. data/node_modules/browserify/test/dnode.js +27 -0
  380. data/node_modules/browserify/test/dollar.js +19 -0
  381. data/node_modules/browserify/test/dollar/dollar/index.js +7 -0
  382. data/node_modules/browserify/test/entry.js +36 -0
  383. data/node_modules/browserify/test/entry/main.js +1 -0
  384. data/node_modules/browserify/test/entry/one.js +1 -0
  385. data/node_modules/browserify/test/entry/two.js +1 -0
  386. data/node_modules/browserify/test/error_code.js +24 -0
  387. data/node_modules/browserify/test/error_code/src.js +2 -0
  388. data/node_modules/browserify/test/export.js +52 -0
  389. data/node_modules/browserify/test/export/entry.js +1 -0
  390. data/node_modules/browserify/test/field.js +64 -0
  391. data/node_modules/browserify/test/field/miss.js +1 -0
  392. data/node_modules/browserify/test/field/node_modules/z-miss/browser.js +1 -0
  393. data/node_modules/browserify/test/field/node_modules/z-miss/main.js +1 -0
  394. data/node_modules/browserify/test/field/node_modules/z-miss/package.json +4 -0
  395. data/node_modules/browserify/test/field/node_modules/z-object/browser.js +1 -0
  396. data/node_modules/browserify/test/field/node_modules/z-object/main.js +1 -0
  397. data/node_modules/browserify/test/field/node_modules/z-object/package.json +6 -0
  398. data/node_modules/browserify/test/field/node_modules/z-string/browser.js +1 -0
  399. data/node_modules/browserify/test/field/node_modules/z-string/main.js +1 -0
  400. data/node_modules/browserify/test/field/node_modules/z-string/package.json +4 -0
  401. data/node_modules/browserify/test/field/node_modules/z-sub/browser/a.js +1 -0
  402. data/node_modules/browserify/test/field/node_modules/z-sub/browser/b.js +1 -0
  403. data/node_modules/browserify/test/field/node_modules/z-sub/main.js +1 -0
  404. data/node_modules/browserify/test/field/node_modules/z-sub/package.json +4 -0
  405. data/node_modules/browserify/test/field/object.js +1 -0
  406. data/node_modules/browserify/test/field/string.js +1 -0
  407. data/node_modules/browserify/test/field/sub.js +1 -0
  408. data/node_modules/browserify/test/global.js +19 -0
  409. data/node_modules/browserify/test/global/main.js +2 -0
  410. data/node_modules/browserify/test/jade.js +35 -0
  411. data/node_modules/browserify/test/json.js +17 -0
  412. data/node_modules/browserify/test/json/beep.json +4 -0
  413. data/node_modules/browserify/test/json/main.js +1 -0
  414. data/node_modules/browserify/test/maxlisteners.js +8 -0
  415. data/node_modules/browserify/test/module.js +22 -0
  416. data/node_modules/browserify/test/multi_entry.js +20 -0
  417. data/node_modules/browserify/test/multi_entry/a.js +2 -0
  418. data/node_modules/browserify/test/multi_entry/b.js +2 -0
  419. data/node_modules/browserify/test/multi_entry/c.js +3 -0
  420. data/node_modules/browserify/test/multi_ignore.js +23 -0
  421. data/node_modules/browserify/test/node_modules/beep/index.js +1 -0
  422. data/node_modules/browserify/test/require_cache.js +18 -0
  423. data/node_modules/browserify/test/retarget.js +27 -0
  424. data/node_modules/browserify/test/seq.js +47 -0
  425. data/node_modules/browserify/test/subdep.js +26 -0
  426. data/node_modules/browserify/test/subdep/index.js +1 -0
  427. data/node_modules/browserify/test/subdep/package.json +6 -0
  428. data/node_modules/browserify/test/util.js +48 -0
  429. data/node_modules/browserify/test/watch.js +91 -0
  430. data/node_modules/browserify/test/watch/a.js +1 -0
  431. data/node_modules/browserify/test/wrap.js +43 -0
  432. data/node_modules/browserify/test/wrap/a.js +2 -0
  433. data/node_modules/browserify/test/wrap/c.js +1 -0
  434. data/node_modules/browserify/test/wrap/node_modules/b/main.js +1 -0
  435. data/node_modules/browserify/test/wrap/node_modules/b/package.json +3 -0
  436. data/node_modules/browserify/test/wrap/node_modules/skipmetoo/index.js +1 -0
  437. data/node_modules/browserify/test/wrap/skipme.js +1 -0
  438. data/node_modules/browserify/test/wrap/x.js +0 -0
  439. data/node_modules/browserify/testling/README.markdown +29 -0
  440. data/node_modules/browserify/testling/test.sh +37 -0
  441. data/node_modules/browserify/testling/tick.js +9 -0
  442. data/node_modules/browserify/testling/timers.js +50 -0
  443. data/node_modules/browserify/testling/util.js +24 -0
  444. data/node_modules/browserify/v2.markdown +41 -0
  445. data/node_modules/browserify/wrappers/alias.js +1 -0
  446. data/node_modules/browserify/wrappers/body.js +2 -0
  447. data/node_modules/browserify/wrappers/body_debug.js +2 -0
  448. data/node_modules/browserify/wrappers/entry.js +3 -0
  449. data/node_modules/browserify/wrappers/entry_debug.js +3 -0
  450. data/node_modules/browserify/wrappers/package.js +3 -0
  451. data/node_modules/browserify/wrappers/prelude.js +196 -0
  452. data/node_modules/coffee-script/.npmignore +11 -0
  453. data/node_modules/coffee-script/CNAME +1 -0
  454. data/node_modules/coffee-script/CONTRIBUTING.md +9 -0
  455. data/node_modules/coffee-script/LICENSE +22 -0
  456. data/node_modules/coffee-script/README +51 -0
  457. data/node_modules/coffee-script/Rakefile +78 -0
  458. data/node_modules/coffee-script/bin/cake +7 -0
  459. data/node_modules/coffee-script/bin/coffee +7 -0
  460. data/node_modules/coffee-script/extras/jsl.conf +44 -0
  461. data/node_modules/coffee-script/lib/coffee-script/browser.js +92 -0
  462. data/node_modules/coffee-script/lib/coffee-script/cake.js +113 -0
  463. data/node_modules/coffee-script/lib/coffee-script/coffee-script.js +171 -0
  464. data/node_modules/coffee-script/lib/coffee-script/command.js +502 -0
  465. data/node_modules/coffee-script/lib/coffee-script/grammar.js +606 -0
  466. data/node_modules/coffee-script/lib/coffee-script/helpers.js +88 -0
  467. data/node_modules/coffee-script/lib/coffee-script/index.js +11 -0
  468. data/node_modules/coffee-script/lib/coffee-script/lexer.js +788 -0
  469. data/node_modules/coffee-script/lib/coffee-script/nodes.js +2971 -0
  470. data/node_modules/coffee-script/lib/coffee-script/optparse.js +138 -0
  471. data/node_modules/coffee-script/lib/coffee-script/parser.js +683 -0
  472. data/node_modules/coffee-script/lib/coffee-script/repl.js +276 -0
  473. data/node_modules/coffee-script/lib/coffee-script/rewriter.js +349 -0
  474. data/node_modules/coffee-script/lib/coffee-script/scope.js +146 -0
  475. data/node_modules/coffee-script/package.json +50 -0
  476. data/node_modules/jade-runtime/.npmignore +15 -0
  477. data/node_modules/jade-runtime/README.md +8 -0
  478. data/node_modules/jade-runtime/globals.js +32 -0
  479. data/node_modules/jade-runtime/index.js +2 -0
  480. data/node_modules/jade-runtime/jade-runtime.js +181 -0
  481. data/node_modules/jade-runtime/package.json +18 -0
  482. data/node_modules/jade/.npmignore +14 -0
  483. data/node_modules/jade/LICENSE +22 -0
  484. data/node_modules/jade/Readme.md +1299 -0
  485. data/node_modules/jade/bin/jade +168 -0
  486. data/node_modules/jade/index.js +4 -0
  487. data/node_modules/jade/jade.js +3586 -0
  488. data/node_modules/jade/jade.md +510 -0
  489. data/node_modules/jade/jade.min.js +2 -0
  490. data/node_modules/jade/lib/compiler.js +654 -0
  491. data/node_modules/jade/lib/doctypes.js +18 -0
  492. data/node_modules/jade/lib/filters.js +97 -0
  493. data/node_modules/jade/lib/inline-tags.js +28 -0
  494. data/node_modules/jade/lib/jade.js +253 -0
  495. data/node_modules/jade/lib/lexer.js +774 -0
  496. data/node_modules/jade/lib/nodes/attrs.js +77 -0
  497. data/node_modules/jade/lib/nodes/block-comment.js +33 -0
  498. data/node_modules/jade/lib/nodes/block.js +122 -0
  499. data/node_modules/jade/lib/nodes/case.js +43 -0
  500. data/node_modules/jade/lib/nodes/code.js +35 -0
  501. data/node_modules/jade/lib/nodes/comment.js +32 -0
  502. data/node_modules/jade/lib/nodes/doctype.js +29 -0
  503. data/node_modules/jade/lib/nodes/each.js +35 -0
  504. data/node_modules/jade/lib/nodes/filter.js +35 -0
  505. data/node_modules/jade/lib/nodes/index.js +20 -0
  506. data/node_modules/jade/lib/nodes/literal.js +32 -0
  507. data/node_modules/jade/lib/nodes/mixin.js +36 -0
  508. data/node_modules/jade/lib/nodes/node.js +25 -0
  509. data/node_modules/jade/lib/nodes/tag.js +95 -0
  510. data/node_modules/jade/lib/nodes/text.js +36 -0
  511. data/node_modules/jade/lib/parser.js +714 -0
  512. data/node_modules/jade/lib/runtime.js +174 -0
  513. data/node_modules/jade/lib/self-closing.js +19 -0
  514. data/node_modules/jade/lib/utils.js +49 -0
  515. data/node_modules/jade/node_modules/commander/.npmignore +4 -0
  516. data/node_modules/jade/node_modules/commander/.travis.yml +4 -0
  517. data/node_modules/jade/node_modules/commander/History.md +107 -0
  518. data/node_modules/jade/node_modules/commander/Makefile +7 -0
  519. data/node_modules/jade/node_modules/commander/Readme.md +262 -0
  520. data/node_modules/jade/node_modules/commander/index.js +2 -0
  521. data/node_modules/jade/node_modules/commander/lib/commander.js +1026 -0
  522. data/node_modules/jade/node_modules/commander/package.json +39 -0
  523. data/node_modules/jade/node_modules/mkdirp/.npmignore +2 -0
  524. data/node_modules/jade/node_modules/mkdirp/.travis.yml +4 -0
  525. data/node_modules/jade/node_modules/mkdirp/LICENSE +21 -0
  526. data/node_modules/jade/node_modules/mkdirp/README.markdown +61 -0
  527. data/node_modules/jade/node_modules/mkdirp/examples/pow.js +6 -0
  528. data/node_modules/jade/node_modules/mkdirp/index.js +82 -0
  529. data/node_modules/jade/node_modules/mkdirp/package.json +37 -0
  530. data/node_modules/jade/node_modules/mkdirp/test/chmod.js +38 -0
  531. data/node_modules/jade/node_modules/mkdirp/test/clobber.js +37 -0
  532. data/node_modules/jade/node_modules/mkdirp/test/mkdirp.js +28 -0
  533. data/node_modules/jade/node_modules/mkdirp/test/perm.js +32 -0
  534. data/node_modules/jade/node_modules/mkdirp/test/perm_sync.js +39 -0
  535. data/node_modules/jade/node_modules/mkdirp/test/race.js +41 -0
  536. data/node_modules/jade/node_modules/mkdirp/test/rel.js +32 -0
  537. data/node_modules/jade/node_modules/mkdirp/test/return.js +25 -0
  538. data/node_modules/jade/node_modules/mkdirp/test/return_sync.js +24 -0
  539. data/node_modules/jade/node_modules/mkdirp/test/root.js +18 -0
  540. data/node_modules/jade/node_modules/mkdirp/test/sync.js +32 -0
  541. data/node_modules/jade/node_modules/mkdirp/test/umask.js +28 -0
  542. data/node_modules/jade/node_modules/mkdirp/test/umask_sync.js +32 -0
  543. data/node_modules/jade/package.json +53 -0
  544. data/node_modules/jade/runtime.js +179 -0
  545. data/node_modules/jade/runtime.min.js +1 -0
  546. data/node_modules/jade/test.jade +7 -0
  547. data/node_modules/jade/testing/head.jade +5 -0
  548. data/node_modules/jade/testing/index.jade +1 -0
  549. data/node_modules/jade/testing/index.js +14 -0
  550. data/node_modules/jade/testing/layout.jade +10 -0
  551. data/node_modules/jade/testing/user.jade +7 -0
  552. data/node_modules/jade/testing/user.js +27 -0
  553. data/node_modules/optimist/.travis.yml +4 -0
  554. data/node_modules/optimist/LICENSE +21 -0
  555. data/node_modules/optimist/README.markdown +487 -0
  556. data/node_modules/optimist/example/bool.js +10 -0
  557. data/node_modules/optimist/example/boolean_double.js +7 -0
  558. data/node_modules/optimist/example/boolean_single.js +7 -0
  559. data/node_modules/optimist/example/default_hash.js +8 -0
  560. data/node_modules/optimist/example/default_singles.js +7 -0
  561. data/node_modules/optimist/example/divide.js +8 -0
  562. data/node_modules/optimist/example/line_count.js +20 -0
  563. data/node_modules/optimist/example/line_count_options.js +29 -0
  564. data/node_modules/optimist/example/line_count_wrap.js +29 -0
  565. data/node_modules/optimist/example/nonopt.js +4 -0
  566. data/node_modules/optimist/example/reflect.js +2 -0
  567. data/node_modules/optimist/example/short.js +3 -0
  568. data/node_modules/optimist/example/string.js +11 -0
  569. data/node_modules/optimist/example/usage-options.js +19 -0
  570. data/node_modules/optimist/example/xup.js +10 -0
  571. data/node_modules/optimist/index.js +475 -0
  572. data/node_modules/optimist/node_modules/wordwrap/.npmignore +1 -0
  573. data/node_modules/optimist/node_modules/wordwrap/README.markdown +70 -0
  574. data/node_modules/optimist/node_modules/wordwrap/example/center.js +10 -0
  575. data/node_modules/optimist/node_modules/wordwrap/example/meat.js +3 -0
  576. data/node_modules/optimist/node_modules/wordwrap/index.js +76 -0
  577. data/node_modules/optimist/node_modules/wordwrap/package.json +45 -0
  578. data/node_modules/optimist/node_modules/wordwrap/test/break.js +30 -0
  579. data/node_modules/optimist/node_modules/wordwrap/test/idleness.txt +63 -0
  580. data/node_modules/optimist/node_modules/wordwrap/test/wrap.js +31 -0
  581. data/node_modules/optimist/package.json +55 -0
  582. data/node_modules/optimist/test/_.js +71 -0
  583. data/node_modules/optimist/test/_/argv.js +2 -0
  584. data/node_modules/optimist/test/_/bin.js +3 -0
  585. data/node_modules/optimist/test/parse.js +420 -0
  586. data/node_modules/optimist/test/usage.js +292 -0
  587. data/snowball.gemspec +1 -2
  588. metadata +601 -21
  589. data/extconf.rb +0 -9
@@ -0,0 +1,2971 @@
1
+ // Generated by CoffeeScript 1.4.0
2
+ (function() {
3
+ var Access, Arr, Assign, Base, Block, Call, Class, Closure, Code, Comment, Existence, Extends, For, IDENTIFIER, IDENTIFIER_STR, IS_STRING, If, In, Index, LEVEL_ACCESS, LEVEL_COND, LEVEL_LIST, LEVEL_OP, LEVEL_PAREN, LEVEL_TOP, Literal, METHOD_DEF, NEGATE, NO, Obj, Op, Param, Parens, RESERVED, Range, Return, SIMPLENUM, STRICT_PROSCRIBED, Scope, Slice, Splat, Switch, TAB, THIS, Throw, Try, UTILITIES, Value, While, YES, compact, del, ends, extend, flatten, last, merge, multident, some, starts, unfoldSoak, utility, _ref, _ref1,
4
+ __hasProp = {}.hasOwnProperty,
5
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
6
+ __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
7
+
8
+ Scope = require('./scope').Scope;
9
+
10
+ _ref = require('./lexer'), RESERVED = _ref.RESERVED, STRICT_PROSCRIBED = _ref.STRICT_PROSCRIBED;
11
+
12
+ _ref1 = require('./helpers'), compact = _ref1.compact, flatten = _ref1.flatten, extend = _ref1.extend, merge = _ref1.merge, del = _ref1.del, starts = _ref1.starts, ends = _ref1.ends, last = _ref1.last, some = _ref1.some;
13
+
14
+ exports.extend = extend;
15
+
16
+ YES = function() {
17
+ return true;
18
+ };
19
+
20
+ NO = function() {
21
+ return false;
22
+ };
23
+
24
+ THIS = function() {
25
+ return this;
26
+ };
27
+
28
+ NEGATE = function() {
29
+ this.negated = !this.negated;
30
+ return this;
31
+ };
32
+
33
+ exports.Base = Base = (function() {
34
+
35
+ function Base() {}
36
+
37
+ Base.prototype.compile = function(o, lvl) {
38
+ var node;
39
+ o = extend({}, o);
40
+ if (lvl) {
41
+ o.level = lvl;
42
+ }
43
+ node = this.unfoldSoak(o) || this;
44
+ node.tab = o.indent;
45
+ if (o.level === LEVEL_TOP || !node.isStatement(o)) {
46
+ return node.compileNode(o);
47
+ } else {
48
+ return node.compileClosure(o);
49
+ }
50
+ };
51
+
52
+ Base.prototype.compileClosure = function(o) {
53
+ if (this.jumps()) {
54
+ throw SyntaxError('cannot use a pure statement in an expression.');
55
+ }
56
+ o.sharedScope = true;
57
+ return Closure.wrap(this).compileNode(o);
58
+ };
59
+
60
+ Base.prototype.cache = function(o, level, reused) {
61
+ var ref, sub;
62
+ if (!this.isComplex()) {
63
+ ref = level ? this.compile(o, level) : this;
64
+ return [ref, ref];
65
+ } else {
66
+ ref = new Literal(reused || o.scope.freeVariable('ref'));
67
+ sub = new Assign(ref, this);
68
+ if (level) {
69
+ return [sub.compile(o, level), ref.value];
70
+ } else {
71
+ return [sub, ref];
72
+ }
73
+ }
74
+ };
75
+
76
+ Base.prototype.compileLoopReference = function(o, name) {
77
+ var src, tmp;
78
+ src = tmp = this.compile(o, LEVEL_LIST);
79
+ if (!((-Infinity < +src && +src < Infinity) || IDENTIFIER.test(src) && o.scope.check(src, true))) {
80
+ src = "" + (tmp = o.scope.freeVariable(name)) + " = " + src;
81
+ }
82
+ return [src, tmp];
83
+ };
84
+
85
+ Base.prototype.makeReturn = function(res) {
86
+ var me;
87
+ me = this.unwrapAll();
88
+ if (res) {
89
+ return new Call(new Literal("" + res + ".push"), [me]);
90
+ } else {
91
+ return new Return(me);
92
+ }
93
+ };
94
+
95
+ Base.prototype.contains = function(pred) {
96
+ var contains;
97
+ contains = false;
98
+ this.traverseChildren(false, function(node) {
99
+ if (pred(node)) {
100
+ contains = true;
101
+ return false;
102
+ }
103
+ });
104
+ return contains;
105
+ };
106
+
107
+ Base.prototype.containsType = function(type) {
108
+ return this instanceof type || this.contains(function(node) {
109
+ return node instanceof type;
110
+ });
111
+ };
112
+
113
+ Base.prototype.lastNonComment = function(list) {
114
+ var i;
115
+ i = list.length;
116
+ while (i--) {
117
+ if (!(list[i] instanceof Comment)) {
118
+ return list[i];
119
+ }
120
+ }
121
+ return null;
122
+ };
123
+
124
+ Base.prototype.toString = function(idt, name) {
125
+ var tree;
126
+ if (idt == null) {
127
+ idt = '';
128
+ }
129
+ if (name == null) {
130
+ name = this.constructor.name;
131
+ }
132
+ tree = '\n' + idt + name;
133
+ if (this.soak) {
134
+ tree += '?';
135
+ }
136
+ this.eachChild(function(node) {
137
+ return tree += node.toString(idt + TAB);
138
+ });
139
+ return tree;
140
+ };
141
+
142
+ Base.prototype.eachChild = function(func) {
143
+ var attr, child, _i, _j, _len, _len1, _ref2, _ref3;
144
+ if (!this.children) {
145
+ return this;
146
+ }
147
+ _ref2 = this.children;
148
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
149
+ attr = _ref2[_i];
150
+ if (this[attr]) {
151
+ _ref3 = flatten([this[attr]]);
152
+ for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {
153
+ child = _ref3[_j];
154
+ if (func(child) === false) {
155
+ return this;
156
+ }
157
+ }
158
+ }
159
+ }
160
+ return this;
161
+ };
162
+
163
+ Base.prototype.traverseChildren = function(crossScope, func) {
164
+ return this.eachChild(function(child) {
165
+ if (func(child) === false) {
166
+ return false;
167
+ }
168
+ return child.traverseChildren(crossScope, func);
169
+ });
170
+ };
171
+
172
+ Base.prototype.invert = function() {
173
+ return new Op('!', this);
174
+ };
175
+
176
+ Base.prototype.unwrapAll = function() {
177
+ var node;
178
+ node = this;
179
+ while (node !== (node = node.unwrap())) {
180
+ continue;
181
+ }
182
+ return node;
183
+ };
184
+
185
+ Base.prototype.children = [];
186
+
187
+ Base.prototype.isStatement = NO;
188
+
189
+ Base.prototype.jumps = NO;
190
+
191
+ Base.prototype.isComplex = YES;
192
+
193
+ Base.prototype.isChainable = NO;
194
+
195
+ Base.prototype.isAssignable = NO;
196
+
197
+ Base.prototype.unwrap = THIS;
198
+
199
+ Base.prototype.unfoldSoak = NO;
200
+
201
+ Base.prototype.assigns = NO;
202
+
203
+ return Base;
204
+
205
+ })();
206
+
207
+ exports.Block = Block = (function(_super) {
208
+
209
+ __extends(Block, _super);
210
+
211
+ function Block(nodes) {
212
+ this.expressions = compact(flatten(nodes || []));
213
+ }
214
+
215
+ Block.prototype.children = ['expressions'];
216
+
217
+ Block.prototype.push = function(node) {
218
+ this.expressions.push(node);
219
+ return this;
220
+ };
221
+
222
+ Block.prototype.pop = function() {
223
+ return this.expressions.pop();
224
+ };
225
+
226
+ Block.prototype.unshift = function(node) {
227
+ this.expressions.unshift(node);
228
+ return this;
229
+ };
230
+
231
+ Block.prototype.unwrap = function() {
232
+ if (this.expressions.length === 1) {
233
+ return this.expressions[0];
234
+ } else {
235
+ return this;
236
+ }
237
+ };
238
+
239
+ Block.prototype.isEmpty = function() {
240
+ return !this.expressions.length;
241
+ };
242
+
243
+ Block.prototype.isStatement = function(o) {
244
+ var exp, _i, _len, _ref2;
245
+ _ref2 = this.expressions;
246
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
247
+ exp = _ref2[_i];
248
+ if (exp.isStatement(o)) {
249
+ return true;
250
+ }
251
+ }
252
+ return false;
253
+ };
254
+
255
+ Block.prototype.jumps = function(o) {
256
+ var exp, _i, _len, _ref2;
257
+ _ref2 = this.expressions;
258
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
259
+ exp = _ref2[_i];
260
+ if (exp.jumps(o)) {
261
+ return exp;
262
+ }
263
+ }
264
+ };
265
+
266
+ Block.prototype.makeReturn = function(res) {
267
+ var expr, len;
268
+ len = this.expressions.length;
269
+ while (len--) {
270
+ expr = this.expressions[len];
271
+ if (!(expr instanceof Comment)) {
272
+ this.expressions[len] = expr.makeReturn(res);
273
+ if (expr instanceof Return && !expr.expression) {
274
+ this.expressions.splice(len, 1);
275
+ }
276
+ break;
277
+ }
278
+ }
279
+ return this;
280
+ };
281
+
282
+ Block.prototype.compile = function(o, level) {
283
+ if (o == null) {
284
+ o = {};
285
+ }
286
+ if (o.scope) {
287
+ return Block.__super__.compile.call(this, o, level);
288
+ } else {
289
+ return this.compileRoot(o);
290
+ }
291
+ };
292
+
293
+ Block.prototype.compileNode = function(o) {
294
+ var code, codes, node, top, _i, _len, _ref2;
295
+ this.tab = o.indent;
296
+ top = o.level === LEVEL_TOP;
297
+ codes = [];
298
+ _ref2 = this.expressions;
299
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
300
+ node = _ref2[_i];
301
+ node = node.unwrapAll();
302
+ node = node.unfoldSoak(o) || node;
303
+ if (node instanceof Block) {
304
+ codes.push(node.compileNode(o));
305
+ } else if (top) {
306
+ node.front = true;
307
+ code = node.compile(o);
308
+ if (!node.isStatement(o)) {
309
+ code = "" + this.tab + code + ";";
310
+ if (node instanceof Literal) {
311
+ code = "" + code + "\n";
312
+ }
313
+ }
314
+ codes.push(code);
315
+ } else {
316
+ codes.push(node.compile(o, LEVEL_LIST));
317
+ }
318
+ }
319
+ if (top) {
320
+ if (this.spaced) {
321
+ return "\n" + (codes.join('\n\n')) + "\n";
322
+ } else {
323
+ return codes.join('\n');
324
+ }
325
+ }
326
+ code = codes.join(', ') || 'void 0';
327
+ if (codes.length > 1 && o.level >= LEVEL_LIST) {
328
+ return "(" + code + ")";
329
+ } else {
330
+ return code;
331
+ }
332
+ };
333
+
334
+ Block.prototype.compileRoot = function(o) {
335
+ var code, exp, i, prelude, preludeExps, rest;
336
+ o.indent = o.bare ? '' : TAB;
337
+ o.scope = new Scope(null, this, null);
338
+ o.level = LEVEL_TOP;
339
+ this.spaced = true;
340
+ prelude = "";
341
+ if (!o.bare) {
342
+ preludeExps = (function() {
343
+ var _i, _len, _ref2, _results;
344
+ _ref2 = this.expressions;
345
+ _results = [];
346
+ for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
347
+ exp = _ref2[i];
348
+ if (!(exp.unwrap() instanceof Comment)) {
349
+ break;
350
+ }
351
+ _results.push(exp);
352
+ }
353
+ return _results;
354
+ }).call(this);
355
+ rest = this.expressions.slice(preludeExps.length);
356
+ this.expressions = preludeExps;
357
+ if (preludeExps.length) {
358
+ prelude = "" + (this.compileNode(merge(o, {
359
+ indent: ''
360
+ }))) + "\n";
361
+ }
362
+ this.expressions = rest;
363
+ }
364
+ code = this.compileWithDeclarations(o);
365
+ if (o.bare) {
366
+ return code;
367
+ }
368
+ return "" + prelude + "(function() {\n" + code + "\n}).call(this);\n";
369
+ };
370
+
371
+ Block.prototype.compileWithDeclarations = function(o) {
372
+ var assigns, code, declars, exp, i, post, rest, scope, spaced, _i, _len, _ref2, _ref3, _ref4;
373
+ code = post = '';
374
+ _ref2 = this.expressions;
375
+ for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
376
+ exp = _ref2[i];
377
+ exp = exp.unwrap();
378
+ if (!(exp instanceof Comment || exp instanceof Literal)) {
379
+ break;
380
+ }
381
+ }
382
+ o = merge(o, {
383
+ level: LEVEL_TOP
384
+ });
385
+ if (i) {
386
+ rest = this.expressions.splice(i, 9e9);
387
+ _ref3 = [this.spaced, false], spaced = _ref3[0], this.spaced = _ref3[1];
388
+ _ref4 = [this.compileNode(o), spaced], code = _ref4[0], this.spaced = _ref4[1];
389
+ this.expressions = rest;
390
+ }
391
+ post = this.compileNode(o);
392
+ scope = o.scope;
393
+ if (scope.expressions === this) {
394
+ declars = o.scope.hasDeclarations();
395
+ assigns = scope.hasAssignments;
396
+ if (declars || assigns) {
397
+ if (i) {
398
+ code += '\n';
399
+ }
400
+ code += "" + this.tab + "var ";
401
+ if (declars) {
402
+ code += scope.declaredVariables().join(', ');
403
+ }
404
+ if (assigns) {
405
+ if (declars) {
406
+ code += ",\n" + (this.tab + TAB);
407
+ }
408
+ code += scope.assignedVariables().join(",\n" + (this.tab + TAB));
409
+ }
410
+ code += ';\n';
411
+ }
412
+ }
413
+ return code + post;
414
+ };
415
+
416
+ Block.wrap = function(nodes) {
417
+ if (nodes.length === 1 && nodes[0] instanceof Block) {
418
+ return nodes[0];
419
+ }
420
+ return new Block(nodes);
421
+ };
422
+
423
+ return Block;
424
+
425
+ })(Base);
426
+
427
+ exports.Literal = Literal = (function(_super) {
428
+
429
+ __extends(Literal, _super);
430
+
431
+ function Literal(value) {
432
+ this.value = value;
433
+ }
434
+
435
+ Literal.prototype.makeReturn = function() {
436
+ if (this.isStatement()) {
437
+ return this;
438
+ } else {
439
+ return Literal.__super__.makeReturn.apply(this, arguments);
440
+ }
441
+ };
442
+
443
+ Literal.prototype.isAssignable = function() {
444
+ return IDENTIFIER.test(this.value);
445
+ };
446
+
447
+ Literal.prototype.isStatement = function() {
448
+ var _ref2;
449
+ return (_ref2 = this.value) === 'break' || _ref2 === 'continue' || _ref2 === 'debugger';
450
+ };
451
+
452
+ Literal.prototype.isComplex = NO;
453
+
454
+ Literal.prototype.assigns = function(name) {
455
+ return name === this.value;
456
+ };
457
+
458
+ Literal.prototype.jumps = function(o) {
459
+ if (this.value === 'break' && !((o != null ? o.loop : void 0) || (o != null ? o.block : void 0))) {
460
+ return this;
461
+ }
462
+ if (this.value === 'continue' && !(o != null ? o.loop : void 0)) {
463
+ return this;
464
+ }
465
+ };
466
+
467
+ Literal.prototype.compileNode = function(o) {
468
+ var code, _ref2;
469
+ code = this.value === 'this' ? ((_ref2 = o.scope.method) != null ? _ref2.bound : void 0) ? o.scope.method.context : this.value : this.value.reserved ? "\"" + this.value + "\"" : this.value;
470
+ if (this.isStatement()) {
471
+ return "" + this.tab + code + ";";
472
+ } else {
473
+ return code;
474
+ }
475
+ };
476
+
477
+ Literal.prototype.toString = function() {
478
+ return ' "' + this.value + '"';
479
+ };
480
+
481
+ return Literal;
482
+
483
+ })(Base);
484
+
485
+ exports.Undefined = (function(_super) {
486
+
487
+ __extends(Undefined, _super);
488
+
489
+ function Undefined() {
490
+ return Undefined.__super__.constructor.apply(this, arguments);
491
+ }
492
+
493
+ Undefined.prototype.isAssignable = NO;
494
+
495
+ Undefined.prototype.isComplex = NO;
496
+
497
+ Undefined.prototype.compileNode = function(o) {
498
+ if (o.level >= LEVEL_ACCESS) {
499
+ return '(void 0)';
500
+ } else {
501
+ return 'void 0';
502
+ }
503
+ };
504
+
505
+ return Undefined;
506
+
507
+ })(Base);
508
+
509
+ exports.Null = (function(_super) {
510
+
511
+ __extends(Null, _super);
512
+
513
+ function Null() {
514
+ return Null.__super__.constructor.apply(this, arguments);
515
+ }
516
+
517
+ Null.prototype.isAssignable = NO;
518
+
519
+ Null.prototype.isComplex = NO;
520
+
521
+ Null.prototype.compileNode = function() {
522
+ return "null";
523
+ };
524
+
525
+ return Null;
526
+
527
+ })(Base);
528
+
529
+ exports.Bool = (function(_super) {
530
+
531
+ __extends(Bool, _super);
532
+
533
+ Bool.prototype.isAssignable = NO;
534
+
535
+ Bool.prototype.isComplex = NO;
536
+
537
+ Bool.prototype.compileNode = function() {
538
+ return this.val;
539
+ };
540
+
541
+ function Bool(val) {
542
+ this.val = val;
543
+ }
544
+
545
+ return Bool;
546
+
547
+ })(Base);
548
+
549
+ exports.Return = Return = (function(_super) {
550
+
551
+ __extends(Return, _super);
552
+
553
+ function Return(expr) {
554
+ if (expr && !expr.unwrap().isUndefined) {
555
+ this.expression = expr;
556
+ }
557
+ }
558
+
559
+ Return.prototype.children = ['expression'];
560
+
561
+ Return.prototype.isStatement = YES;
562
+
563
+ Return.prototype.makeReturn = THIS;
564
+
565
+ Return.prototype.jumps = THIS;
566
+
567
+ Return.prototype.compile = function(o, level) {
568
+ var expr, _ref2;
569
+ expr = (_ref2 = this.expression) != null ? _ref2.makeReturn() : void 0;
570
+ if (expr && !(expr instanceof Return)) {
571
+ return expr.compile(o, level);
572
+ } else {
573
+ return Return.__super__.compile.call(this, o, level);
574
+ }
575
+ };
576
+
577
+ Return.prototype.compileNode = function(o) {
578
+ return this.tab + ("return" + [this.expression ? " " + (this.expression.compile(o, LEVEL_PAREN)) : void 0] + ";");
579
+ };
580
+
581
+ return Return;
582
+
583
+ })(Base);
584
+
585
+ exports.Value = Value = (function(_super) {
586
+
587
+ __extends(Value, _super);
588
+
589
+ function Value(base, props, tag) {
590
+ if (!props && base instanceof Value) {
591
+ return base;
592
+ }
593
+ this.base = base;
594
+ this.properties = props || [];
595
+ if (tag) {
596
+ this[tag] = true;
597
+ }
598
+ return this;
599
+ }
600
+
601
+ Value.prototype.children = ['base', 'properties'];
602
+
603
+ Value.prototype.add = function(props) {
604
+ this.properties = this.properties.concat(props);
605
+ return this;
606
+ };
607
+
608
+ Value.prototype.hasProperties = function() {
609
+ return !!this.properties.length;
610
+ };
611
+
612
+ Value.prototype.isArray = function() {
613
+ return !this.properties.length && this.base instanceof Arr;
614
+ };
615
+
616
+ Value.prototype.isComplex = function() {
617
+ return this.hasProperties() || this.base.isComplex();
618
+ };
619
+
620
+ Value.prototype.isAssignable = function() {
621
+ return this.hasProperties() || this.base.isAssignable();
622
+ };
623
+
624
+ Value.prototype.isSimpleNumber = function() {
625
+ return this.base instanceof Literal && SIMPLENUM.test(this.base.value);
626
+ };
627
+
628
+ Value.prototype.isString = function() {
629
+ return this.base instanceof Literal && IS_STRING.test(this.base.value);
630
+ };
631
+
632
+ Value.prototype.isAtomic = function() {
633
+ var node, _i, _len, _ref2;
634
+ _ref2 = this.properties.concat(this.base);
635
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
636
+ node = _ref2[_i];
637
+ if (node.soak || node instanceof Call) {
638
+ return false;
639
+ }
640
+ }
641
+ return true;
642
+ };
643
+
644
+ Value.prototype.isStatement = function(o) {
645
+ return !this.properties.length && this.base.isStatement(o);
646
+ };
647
+
648
+ Value.prototype.assigns = function(name) {
649
+ return !this.properties.length && this.base.assigns(name);
650
+ };
651
+
652
+ Value.prototype.jumps = function(o) {
653
+ return !this.properties.length && this.base.jumps(o);
654
+ };
655
+
656
+ Value.prototype.isObject = function(onlyGenerated) {
657
+ if (this.properties.length) {
658
+ return false;
659
+ }
660
+ return (this.base instanceof Obj) && (!onlyGenerated || this.base.generated);
661
+ };
662
+
663
+ Value.prototype.isSplice = function() {
664
+ return last(this.properties) instanceof Slice;
665
+ };
666
+
667
+ Value.prototype.unwrap = function() {
668
+ if (this.properties.length) {
669
+ return this;
670
+ } else {
671
+ return this.base;
672
+ }
673
+ };
674
+
675
+ Value.prototype.cacheReference = function(o) {
676
+ var base, bref, name, nref;
677
+ name = last(this.properties);
678
+ if (this.properties.length < 2 && !this.base.isComplex() && !(name != null ? name.isComplex() : void 0)) {
679
+ return [this, this];
680
+ }
681
+ base = new Value(this.base, this.properties.slice(0, -1));
682
+ if (base.isComplex()) {
683
+ bref = new Literal(o.scope.freeVariable('base'));
684
+ base = new Value(new Parens(new Assign(bref, base)));
685
+ }
686
+ if (!name) {
687
+ return [base, bref];
688
+ }
689
+ if (name.isComplex()) {
690
+ nref = new Literal(o.scope.freeVariable('name'));
691
+ name = new Index(new Assign(nref, name.index));
692
+ nref = new Index(nref);
693
+ }
694
+ return [base.add(name), new Value(bref || base.base, [nref || name])];
695
+ };
696
+
697
+ Value.prototype.compileNode = function(o) {
698
+ var code, prop, props, _i, _len;
699
+ this.base.front = this.front;
700
+ props = this.properties;
701
+ code = this.base.compile(o, props.length ? LEVEL_ACCESS : null);
702
+ if ((this.base instanceof Parens || props.length) && SIMPLENUM.test(code)) {
703
+ code = "" + code + ".";
704
+ }
705
+ for (_i = 0, _len = props.length; _i < _len; _i++) {
706
+ prop = props[_i];
707
+ code += prop.compile(o);
708
+ }
709
+ return code;
710
+ };
711
+
712
+ Value.prototype.unfoldSoak = function(o) {
713
+ var result,
714
+ _this = this;
715
+ if (this.unfoldedSoak != null) {
716
+ return this.unfoldedSoak;
717
+ }
718
+ result = (function() {
719
+ var fst, i, ifn, prop, ref, snd, _i, _len, _ref2;
720
+ if (ifn = _this.base.unfoldSoak(o)) {
721
+ Array.prototype.push.apply(ifn.body.properties, _this.properties);
722
+ return ifn;
723
+ }
724
+ _ref2 = _this.properties;
725
+ for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
726
+ prop = _ref2[i];
727
+ if (!prop.soak) {
728
+ continue;
729
+ }
730
+ prop.soak = false;
731
+ fst = new Value(_this.base, _this.properties.slice(0, i));
732
+ snd = new Value(_this.base, _this.properties.slice(i));
733
+ if (fst.isComplex()) {
734
+ ref = new Literal(o.scope.freeVariable('ref'));
735
+ fst = new Parens(new Assign(ref, fst));
736
+ snd.base = ref;
737
+ }
738
+ return new If(new Existence(fst), snd, {
739
+ soak: true
740
+ });
741
+ }
742
+ return null;
743
+ })();
744
+ return this.unfoldedSoak = result || false;
745
+ };
746
+
747
+ return Value;
748
+
749
+ })(Base);
750
+
751
+ exports.Comment = Comment = (function(_super) {
752
+
753
+ __extends(Comment, _super);
754
+
755
+ function Comment(comment) {
756
+ this.comment = comment;
757
+ }
758
+
759
+ Comment.prototype.isStatement = YES;
760
+
761
+ Comment.prototype.makeReturn = THIS;
762
+
763
+ Comment.prototype.compileNode = function(o, level) {
764
+ var code;
765
+ code = '/*' + multident(this.comment, this.tab) + ("\n" + this.tab + "*/\n");
766
+ if ((level || o.level) === LEVEL_TOP) {
767
+ code = o.indent + code;
768
+ }
769
+ return code;
770
+ };
771
+
772
+ return Comment;
773
+
774
+ })(Base);
775
+
776
+ exports.Call = Call = (function(_super) {
777
+
778
+ __extends(Call, _super);
779
+
780
+ function Call(variable, args, soak) {
781
+ this.args = args != null ? args : [];
782
+ this.soak = soak;
783
+ this.isNew = false;
784
+ this.isSuper = variable === 'super';
785
+ this.variable = this.isSuper ? null : variable;
786
+ }
787
+
788
+ Call.prototype.children = ['variable', 'args'];
789
+
790
+ Call.prototype.newInstance = function() {
791
+ var base, _ref2;
792
+ base = ((_ref2 = this.variable) != null ? _ref2.base : void 0) || this.variable;
793
+ if (base instanceof Call && !base.isNew) {
794
+ base.newInstance();
795
+ } else {
796
+ this.isNew = true;
797
+ }
798
+ return this;
799
+ };
800
+
801
+ Call.prototype.superReference = function(o) {
802
+ var accesses, method, name;
803
+ method = o.scope.namedMethod();
804
+ if (!method) {
805
+ throw SyntaxError('cannot call super outside of a function.');
806
+ }
807
+ name = method.name;
808
+ if (name == null) {
809
+ throw SyntaxError('cannot call super on an anonymous function.');
810
+ }
811
+ if (method.klass) {
812
+ accesses = [new Access(new Literal('__super__'))];
813
+ if (method["static"]) {
814
+ accesses.push(new Access(new Literal('constructor')));
815
+ }
816
+ accesses.push(new Access(new Literal(name)));
817
+ return (new Value(new Literal(method.klass), accesses)).compile(o);
818
+ } else {
819
+ return "" + name + ".__super__.constructor";
820
+ }
821
+ };
822
+
823
+ Call.prototype.superThis = function(o) {
824
+ var method;
825
+ method = o.scope.method;
826
+ return (method && !method.klass && method.context) || "this";
827
+ };
828
+
829
+ Call.prototype.unfoldSoak = function(o) {
830
+ var call, ifn, left, list, rite, _i, _len, _ref2, _ref3;
831
+ if (this.soak) {
832
+ if (this.variable) {
833
+ if (ifn = unfoldSoak(o, this, 'variable')) {
834
+ return ifn;
835
+ }
836
+ _ref2 = new Value(this.variable).cacheReference(o), left = _ref2[0], rite = _ref2[1];
837
+ } else {
838
+ left = new Literal(this.superReference(o));
839
+ rite = new Value(left);
840
+ }
841
+ rite = new Call(rite, this.args);
842
+ rite.isNew = this.isNew;
843
+ left = new Literal("typeof " + (left.compile(o)) + " === \"function\"");
844
+ return new If(left, new Value(rite), {
845
+ soak: true
846
+ });
847
+ }
848
+ call = this;
849
+ list = [];
850
+ while (true) {
851
+ if (call.variable instanceof Call) {
852
+ list.push(call);
853
+ call = call.variable;
854
+ continue;
855
+ }
856
+ if (!(call.variable instanceof Value)) {
857
+ break;
858
+ }
859
+ list.push(call);
860
+ if (!((call = call.variable.base) instanceof Call)) {
861
+ break;
862
+ }
863
+ }
864
+ _ref3 = list.reverse();
865
+ for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
866
+ call = _ref3[_i];
867
+ if (ifn) {
868
+ if (call.variable instanceof Call) {
869
+ call.variable = ifn;
870
+ } else {
871
+ call.variable.base = ifn;
872
+ }
873
+ }
874
+ ifn = unfoldSoak(o, call, 'variable');
875
+ }
876
+ return ifn;
877
+ };
878
+
879
+ Call.prototype.filterImplicitObjects = function(list) {
880
+ var node, nodes, obj, prop, properties, _i, _j, _len, _len1, _ref2;
881
+ nodes = [];
882
+ for (_i = 0, _len = list.length; _i < _len; _i++) {
883
+ node = list[_i];
884
+ if (!((typeof node.isObject === "function" ? node.isObject() : void 0) && node.base.generated)) {
885
+ nodes.push(node);
886
+ continue;
887
+ }
888
+ obj = null;
889
+ _ref2 = node.base.properties;
890
+ for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
891
+ prop = _ref2[_j];
892
+ if (prop instanceof Assign || prop instanceof Comment) {
893
+ if (!obj) {
894
+ nodes.push(obj = new Obj(properties = [], true));
895
+ }
896
+ properties.push(prop);
897
+ } else {
898
+ nodes.push(prop);
899
+ obj = null;
900
+ }
901
+ }
902
+ }
903
+ return nodes;
904
+ };
905
+
906
+ Call.prototype.compileNode = function(o) {
907
+ var arg, args, code, _ref2;
908
+ if ((_ref2 = this.variable) != null) {
909
+ _ref2.front = this.front;
910
+ }
911
+ if (code = Splat.compileSplattedArray(o, this.args, true)) {
912
+ return this.compileSplat(o, code);
913
+ }
914
+ args = this.filterImplicitObjects(this.args);
915
+ args = ((function() {
916
+ var _i, _len, _results;
917
+ _results = [];
918
+ for (_i = 0, _len = args.length; _i < _len; _i++) {
919
+ arg = args[_i];
920
+ _results.push(arg.compile(o, LEVEL_LIST));
921
+ }
922
+ return _results;
923
+ })()).join(', ');
924
+ if (this.isSuper) {
925
+ return this.superReference(o) + (".call(" + (this.superThis(o)) + (args && ', ' + args) + ")");
926
+ } else {
927
+ return (this.isNew ? 'new ' : '') + this.variable.compile(o, LEVEL_ACCESS) + ("(" + args + ")");
928
+ }
929
+ };
930
+
931
+ Call.prototype.compileSuper = function(args, o) {
932
+ return "" + (this.superReference(o)) + ".call(" + (this.superThis(o)) + (args.length ? ', ' : '') + args + ")";
933
+ };
934
+
935
+ Call.prototype.compileSplat = function(o, splatArgs) {
936
+ var base, fun, idt, name, ref;
937
+ if (this.isSuper) {
938
+ return "" + (this.superReference(o)) + ".apply(" + (this.superThis(o)) + ", " + splatArgs + ")";
939
+ }
940
+ if (this.isNew) {
941
+ idt = this.tab + TAB;
942
+ return "(function(func, args, ctor) {\n" + idt + "ctor.prototype = func.prototype;\n" + idt + "var child = new ctor, result = func.apply(child, args);\n" + idt + "return Object(result) === result ? result : child;\n" + this.tab + "})(" + (this.variable.compile(o, LEVEL_LIST)) + ", " + splatArgs + ", function(){})";
943
+ }
944
+ base = new Value(this.variable);
945
+ if ((name = base.properties.pop()) && base.isComplex()) {
946
+ ref = o.scope.freeVariable('ref');
947
+ fun = "(" + ref + " = " + (base.compile(o, LEVEL_LIST)) + ")" + (name.compile(o));
948
+ } else {
949
+ fun = base.compile(o, LEVEL_ACCESS);
950
+ if (SIMPLENUM.test(fun)) {
951
+ fun = "(" + fun + ")";
952
+ }
953
+ if (name) {
954
+ ref = fun;
955
+ fun += name.compile(o);
956
+ } else {
957
+ ref = 'null';
958
+ }
959
+ }
960
+ return "" + fun + ".apply(" + ref + ", " + splatArgs + ")";
961
+ };
962
+
963
+ return Call;
964
+
965
+ })(Base);
966
+
967
+ exports.Extends = Extends = (function(_super) {
968
+
969
+ __extends(Extends, _super);
970
+
971
+ function Extends(child, parent) {
972
+ this.child = child;
973
+ this.parent = parent;
974
+ }
975
+
976
+ Extends.prototype.children = ['child', 'parent'];
977
+
978
+ Extends.prototype.compile = function(o) {
979
+ return new Call(new Value(new Literal(utility('extends'))), [this.child, this.parent]).compile(o);
980
+ };
981
+
982
+ return Extends;
983
+
984
+ })(Base);
985
+
986
+ exports.Access = Access = (function(_super) {
987
+
988
+ __extends(Access, _super);
989
+
990
+ function Access(name, tag) {
991
+ this.name = name;
992
+ this.name.asKey = true;
993
+ this.soak = tag === 'soak';
994
+ }
995
+
996
+ Access.prototype.children = ['name'];
997
+
998
+ Access.prototype.compile = function(o) {
999
+ var name;
1000
+ name = this.name.compile(o);
1001
+ if (IDENTIFIER.test(name)) {
1002
+ return "." + name;
1003
+ } else {
1004
+ return "[" + name + "]";
1005
+ }
1006
+ };
1007
+
1008
+ Access.prototype.isComplex = NO;
1009
+
1010
+ return Access;
1011
+
1012
+ })(Base);
1013
+
1014
+ exports.Index = Index = (function(_super) {
1015
+
1016
+ __extends(Index, _super);
1017
+
1018
+ function Index(index) {
1019
+ this.index = index;
1020
+ }
1021
+
1022
+ Index.prototype.children = ['index'];
1023
+
1024
+ Index.prototype.compile = function(o) {
1025
+ return "[" + (this.index.compile(o, LEVEL_PAREN)) + "]";
1026
+ };
1027
+
1028
+ Index.prototype.isComplex = function() {
1029
+ return this.index.isComplex();
1030
+ };
1031
+
1032
+ return Index;
1033
+
1034
+ })(Base);
1035
+
1036
+ exports.Range = Range = (function(_super) {
1037
+
1038
+ __extends(Range, _super);
1039
+
1040
+ Range.prototype.children = ['from', 'to'];
1041
+
1042
+ function Range(from, to, tag) {
1043
+ this.from = from;
1044
+ this.to = to;
1045
+ this.exclusive = tag === 'exclusive';
1046
+ this.equals = this.exclusive ? '' : '=';
1047
+ }
1048
+
1049
+ Range.prototype.compileVariables = function(o) {
1050
+ var step, _ref2, _ref3, _ref4, _ref5;
1051
+ o = merge(o, {
1052
+ top: true
1053
+ });
1054
+ _ref2 = this.from.cache(o, LEVEL_LIST), this.fromC = _ref2[0], this.fromVar = _ref2[1];
1055
+ _ref3 = this.to.cache(o, LEVEL_LIST), this.toC = _ref3[0], this.toVar = _ref3[1];
1056
+ if (step = del(o, 'step')) {
1057
+ _ref4 = step.cache(o, LEVEL_LIST), this.step = _ref4[0], this.stepVar = _ref4[1];
1058
+ }
1059
+ _ref5 = [this.fromVar.match(SIMPLENUM), this.toVar.match(SIMPLENUM)], this.fromNum = _ref5[0], this.toNum = _ref5[1];
1060
+ if (this.stepVar) {
1061
+ return this.stepNum = this.stepVar.match(SIMPLENUM);
1062
+ }
1063
+ };
1064
+
1065
+ Range.prototype.compileNode = function(o) {
1066
+ var cond, condPart, from, gt, idx, idxName, known, lt, namedIndex, stepPart, to, varPart, _ref2, _ref3;
1067
+ if (!this.fromVar) {
1068
+ this.compileVariables(o);
1069
+ }
1070
+ if (!o.index) {
1071
+ return this.compileArray(o);
1072
+ }
1073
+ known = this.fromNum && this.toNum;
1074
+ idx = del(o, 'index');
1075
+ idxName = del(o, 'name');
1076
+ namedIndex = idxName && idxName !== idx;
1077
+ varPart = "" + idx + " = " + this.fromC;
1078
+ if (this.toC !== this.toVar) {
1079
+ varPart += ", " + this.toC;
1080
+ }
1081
+ if (this.step !== this.stepVar) {
1082
+ varPart += ", " + this.step;
1083
+ }
1084
+ _ref2 = ["" + idx + " <" + this.equals, "" + idx + " >" + this.equals], lt = _ref2[0], gt = _ref2[1];
1085
+ condPart = this.stepNum ? +this.stepNum > 0 ? "" + lt + " " + this.toVar : "" + gt + " " + this.toVar : known ? ((_ref3 = [+this.fromNum, +this.toNum], from = _ref3[0], to = _ref3[1], _ref3), from <= to ? "" + lt + " " + to : "" + gt + " " + to) : (cond = "" + this.fromVar + " <= " + this.toVar, "" + cond + " ? " + lt + " " + this.toVar + " : " + gt + " " + this.toVar);
1086
+ stepPart = this.stepVar ? "" + idx + " += " + this.stepVar : known ? namedIndex ? from <= to ? "++" + idx : "--" + idx : from <= to ? "" + idx + "++" : "" + idx + "--" : namedIndex ? "" + cond + " ? ++" + idx + " : --" + idx : "" + cond + " ? " + idx + "++ : " + idx + "--";
1087
+ if (namedIndex) {
1088
+ varPart = "" + idxName + " = " + varPart;
1089
+ }
1090
+ if (namedIndex) {
1091
+ stepPart = "" + idxName + " = " + stepPart;
1092
+ }
1093
+ return "" + varPart + "; " + condPart + "; " + stepPart;
1094
+ };
1095
+
1096
+ Range.prototype.compileArray = function(o) {
1097
+ var args, body, cond, hasArgs, i, idt, post, pre, range, result, vars, _i, _ref2, _ref3, _results;
1098
+ if (this.fromNum && this.toNum && Math.abs(this.fromNum - this.toNum) <= 20) {
1099
+ range = (function() {
1100
+ _results = [];
1101
+ for (var _i = _ref2 = +this.fromNum, _ref3 = +this.toNum; _ref2 <= _ref3 ? _i <= _ref3 : _i >= _ref3; _ref2 <= _ref3 ? _i++ : _i--){ _results.push(_i); }
1102
+ return _results;
1103
+ }).apply(this);
1104
+ if (this.exclusive) {
1105
+ range.pop();
1106
+ }
1107
+ return "[" + (range.join(', ')) + "]";
1108
+ }
1109
+ idt = this.tab + TAB;
1110
+ i = o.scope.freeVariable('i');
1111
+ result = o.scope.freeVariable('results');
1112
+ pre = "\n" + idt + result + " = [];";
1113
+ if (this.fromNum && this.toNum) {
1114
+ o.index = i;
1115
+ body = this.compileNode(o);
1116
+ } else {
1117
+ vars = ("" + i + " = " + this.fromC) + (this.toC !== this.toVar ? ", " + this.toC : '');
1118
+ cond = "" + this.fromVar + " <= " + this.toVar;
1119
+ body = "var " + vars + "; " + cond + " ? " + i + " <" + this.equals + " " + this.toVar + " : " + i + " >" + this.equals + " " + this.toVar + "; " + cond + " ? " + i + "++ : " + i + "--";
1120
+ }
1121
+ post = "{ " + result + ".push(" + i + "); }\n" + idt + "return " + result + ";\n" + o.indent;
1122
+ hasArgs = function(node) {
1123
+ return node != null ? node.contains(function(n) {
1124
+ return n instanceof Literal && n.value === 'arguments' && !n.asKey;
1125
+ }) : void 0;
1126
+ };
1127
+ if (hasArgs(this.from) || hasArgs(this.to)) {
1128
+ args = ', arguments';
1129
+ }
1130
+ return "(function() {" + pre + "\n" + idt + "for (" + body + ")" + post + "}).apply(this" + (args != null ? args : '') + ")";
1131
+ };
1132
+
1133
+ return Range;
1134
+
1135
+ })(Base);
1136
+
1137
+ exports.Slice = Slice = (function(_super) {
1138
+
1139
+ __extends(Slice, _super);
1140
+
1141
+ Slice.prototype.children = ['range'];
1142
+
1143
+ function Slice(range) {
1144
+ this.range = range;
1145
+ Slice.__super__.constructor.call(this);
1146
+ }
1147
+
1148
+ Slice.prototype.compileNode = function(o) {
1149
+ var compiled, from, fromStr, to, toStr, _ref2;
1150
+ _ref2 = this.range, to = _ref2.to, from = _ref2.from;
1151
+ fromStr = from && from.compile(o, LEVEL_PAREN) || '0';
1152
+ compiled = to && to.compile(o, LEVEL_PAREN);
1153
+ if (to && !(!this.range.exclusive && +compiled === -1)) {
1154
+ toStr = ', ' + (this.range.exclusive ? compiled : SIMPLENUM.test(compiled) ? "" + (+compiled + 1) : (compiled = to.compile(o, LEVEL_ACCESS), "+" + compiled + " + 1 || 9e9"));
1155
+ }
1156
+ return ".slice(" + fromStr + (toStr || '') + ")";
1157
+ };
1158
+
1159
+ return Slice;
1160
+
1161
+ })(Base);
1162
+
1163
+ exports.Obj = Obj = (function(_super) {
1164
+
1165
+ __extends(Obj, _super);
1166
+
1167
+ function Obj(props, generated) {
1168
+ this.generated = generated != null ? generated : false;
1169
+ this.objects = this.properties = props || [];
1170
+ }
1171
+
1172
+ Obj.prototype.children = ['properties'];
1173
+
1174
+ Obj.prototype.compileNode = function(o) {
1175
+ var i, idt, indent, join, lastNoncom, node, obj, prop, props, _i, _len;
1176
+ props = this.properties;
1177
+ if (!props.length) {
1178
+ return (this.front ? '({})' : '{}');
1179
+ }
1180
+ if (this.generated) {
1181
+ for (_i = 0, _len = props.length; _i < _len; _i++) {
1182
+ node = props[_i];
1183
+ if (node instanceof Value) {
1184
+ throw new Error('cannot have an implicit value in an implicit object');
1185
+ }
1186
+ }
1187
+ }
1188
+ idt = o.indent += TAB;
1189
+ lastNoncom = this.lastNonComment(this.properties);
1190
+ props = (function() {
1191
+ var _j, _len1, _results;
1192
+ _results = [];
1193
+ for (i = _j = 0, _len1 = props.length; _j < _len1; i = ++_j) {
1194
+ prop = props[i];
1195
+ join = i === props.length - 1 ? '' : prop === lastNoncom || prop instanceof Comment ? '\n' : ',\n';
1196
+ indent = prop instanceof Comment ? '' : idt;
1197
+ if (prop instanceof Value && prop["this"]) {
1198
+ prop = new Assign(prop.properties[0].name, prop, 'object');
1199
+ }
1200
+ if (!(prop instanceof Comment)) {
1201
+ if (!(prop instanceof Assign)) {
1202
+ prop = new Assign(prop, prop, 'object');
1203
+ }
1204
+ (prop.variable.base || prop.variable).asKey = true;
1205
+ }
1206
+ _results.push(indent + prop.compile(o, LEVEL_TOP) + join);
1207
+ }
1208
+ return _results;
1209
+ })();
1210
+ props = props.join('');
1211
+ obj = "{" + (props && '\n' + props + '\n' + this.tab) + "}";
1212
+ if (this.front) {
1213
+ return "(" + obj + ")";
1214
+ } else {
1215
+ return obj;
1216
+ }
1217
+ };
1218
+
1219
+ Obj.prototype.assigns = function(name) {
1220
+ var prop, _i, _len, _ref2;
1221
+ _ref2 = this.properties;
1222
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
1223
+ prop = _ref2[_i];
1224
+ if (prop.assigns(name)) {
1225
+ return true;
1226
+ }
1227
+ }
1228
+ return false;
1229
+ };
1230
+
1231
+ return Obj;
1232
+
1233
+ })(Base);
1234
+
1235
+ exports.Arr = Arr = (function(_super) {
1236
+
1237
+ __extends(Arr, _super);
1238
+
1239
+ function Arr(objs) {
1240
+ this.objects = objs || [];
1241
+ }
1242
+
1243
+ Arr.prototype.children = ['objects'];
1244
+
1245
+ Arr.prototype.filterImplicitObjects = Call.prototype.filterImplicitObjects;
1246
+
1247
+ Arr.prototype.compileNode = function(o) {
1248
+ var code, obj, objs;
1249
+ if (!this.objects.length) {
1250
+ return '[]';
1251
+ }
1252
+ o.indent += TAB;
1253
+ objs = this.filterImplicitObjects(this.objects);
1254
+ if (code = Splat.compileSplattedArray(o, objs)) {
1255
+ return code;
1256
+ }
1257
+ code = ((function() {
1258
+ var _i, _len, _results;
1259
+ _results = [];
1260
+ for (_i = 0, _len = objs.length; _i < _len; _i++) {
1261
+ obj = objs[_i];
1262
+ _results.push(obj.compile(o, LEVEL_LIST));
1263
+ }
1264
+ return _results;
1265
+ })()).join(', ');
1266
+ if (code.indexOf('\n') >= 0) {
1267
+ return "[\n" + o.indent + code + "\n" + this.tab + "]";
1268
+ } else {
1269
+ return "[" + code + "]";
1270
+ }
1271
+ };
1272
+
1273
+ Arr.prototype.assigns = function(name) {
1274
+ var obj, _i, _len, _ref2;
1275
+ _ref2 = this.objects;
1276
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
1277
+ obj = _ref2[_i];
1278
+ if (obj.assigns(name)) {
1279
+ return true;
1280
+ }
1281
+ }
1282
+ return false;
1283
+ };
1284
+
1285
+ return Arr;
1286
+
1287
+ })(Base);
1288
+
1289
+ exports.Class = Class = (function(_super) {
1290
+
1291
+ __extends(Class, _super);
1292
+
1293
+ function Class(variable, parent, body) {
1294
+ this.variable = variable;
1295
+ this.parent = parent;
1296
+ this.body = body != null ? body : new Block;
1297
+ this.boundFuncs = [];
1298
+ this.body.classBody = true;
1299
+ }
1300
+
1301
+ Class.prototype.children = ['variable', 'parent', 'body'];
1302
+
1303
+ Class.prototype.determineName = function() {
1304
+ var decl, tail;
1305
+ if (!this.variable) {
1306
+ return null;
1307
+ }
1308
+ decl = (tail = last(this.variable.properties)) ? tail instanceof Access && tail.name.value : this.variable.base.value;
1309
+ if (__indexOf.call(STRICT_PROSCRIBED, decl) >= 0) {
1310
+ throw SyntaxError("variable name may not be " + decl);
1311
+ }
1312
+ return decl && (decl = IDENTIFIER.test(decl) && decl);
1313
+ };
1314
+
1315
+ Class.prototype.setContext = function(name) {
1316
+ return this.body.traverseChildren(false, function(node) {
1317
+ if (node.classBody) {
1318
+ return false;
1319
+ }
1320
+ if (node instanceof Literal && node.value === 'this') {
1321
+ return node.value = name;
1322
+ } else if (node instanceof Code) {
1323
+ node.klass = name;
1324
+ if (node.bound) {
1325
+ return node.context = name;
1326
+ }
1327
+ }
1328
+ });
1329
+ };
1330
+
1331
+ Class.prototype.addBoundFunctions = function(o) {
1332
+ var bvar, lhs, _i, _len, _ref2, _results;
1333
+ if (this.boundFuncs.length) {
1334
+ _ref2 = this.boundFuncs;
1335
+ _results = [];
1336
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
1337
+ bvar = _ref2[_i];
1338
+ lhs = (new Value(new Literal("this"), [new Access(bvar)])).compile(o);
1339
+ _results.push(this.ctor.body.unshift(new Literal("" + lhs + " = " + (utility('bind')) + "(" + lhs + ", this)")));
1340
+ }
1341
+ return _results;
1342
+ }
1343
+ };
1344
+
1345
+ Class.prototype.addProperties = function(node, name, o) {
1346
+ var assign, base, exprs, func, props;
1347
+ props = node.base.properties.slice(0);
1348
+ exprs = (function() {
1349
+ var _results;
1350
+ _results = [];
1351
+ while (assign = props.shift()) {
1352
+ if (assign instanceof Assign) {
1353
+ base = assign.variable.base;
1354
+ delete assign.context;
1355
+ func = assign.value;
1356
+ if (base.value === 'constructor') {
1357
+ if (this.ctor) {
1358
+ throw new Error('cannot define more than one constructor in a class');
1359
+ }
1360
+ if (func.bound) {
1361
+ throw new Error('cannot define a constructor as a bound function');
1362
+ }
1363
+ if (func instanceof Code) {
1364
+ assign = this.ctor = func;
1365
+ } else {
1366
+ this.externalCtor = o.scope.freeVariable('class');
1367
+ assign = new Assign(new Literal(this.externalCtor), func);
1368
+ }
1369
+ } else {
1370
+ if (assign.variable["this"]) {
1371
+ func["static"] = true;
1372
+ if (func.bound) {
1373
+ func.context = name;
1374
+ }
1375
+ } else {
1376
+ assign.variable = new Value(new Literal(name), [new Access(new Literal('prototype')), new Access(base)]);
1377
+ if (func instanceof Code && func.bound) {
1378
+ this.boundFuncs.push(base);
1379
+ func.bound = false;
1380
+ }
1381
+ }
1382
+ }
1383
+ }
1384
+ _results.push(assign);
1385
+ }
1386
+ return _results;
1387
+ }).call(this);
1388
+ return compact(exprs);
1389
+ };
1390
+
1391
+ Class.prototype.walkBody = function(name, o) {
1392
+ var _this = this;
1393
+ return this.traverseChildren(false, function(child) {
1394
+ var exps, i, node, _i, _len, _ref2;
1395
+ if (child instanceof Class) {
1396
+ return false;
1397
+ }
1398
+ if (child instanceof Block) {
1399
+ _ref2 = exps = child.expressions;
1400
+ for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
1401
+ node = _ref2[i];
1402
+ if (node instanceof Value && node.isObject(true)) {
1403
+ exps[i] = _this.addProperties(node, name, o);
1404
+ }
1405
+ }
1406
+ return child.expressions = exps = flatten(exps);
1407
+ }
1408
+ });
1409
+ };
1410
+
1411
+ Class.prototype.hoistDirectivePrologue = function() {
1412
+ var expressions, index, node;
1413
+ index = 0;
1414
+ expressions = this.body.expressions;
1415
+ while ((node = expressions[index]) && node instanceof Comment || node instanceof Value && node.isString()) {
1416
+ ++index;
1417
+ }
1418
+ return this.directives = expressions.splice(0, index);
1419
+ };
1420
+
1421
+ Class.prototype.ensureConstructor = function(name) {
1422
+ if (!this.ctor) {
1423
+ this.ctor = new Code;
1424
+ if (this.parent) {
1425
+ this.ctor.body.push(new Literal("" + name + ".__super__.constructor.apply(this, arguments)"));
1426
+ }
1427
+ if (this.externalCtor) {
1428
+ this.ctor.body.push(new Literal("" + this.externalCtor + ".apply(this, arguments)"));
1429
+ }
1430
+ this.ctor.body.makeReturn();
1431
+ this.body.expressions.unshift(this.ctor);
1432
+ }
1433
+ this.ctor.ctor = this.ctor.name = name;
1434
+ this.ctor.klass = null;
1435
+ return this.ctor.noReturn = true;
1436
+ };
1437
+
1438
+ Class.prototype.compileNode = function(o) {
1439
+ var call, decl, klass, lname, name, params, _ref2;
1440
+ decl = this.determineName();
1441
+ name = decl || '_Class';
1442
+ if (name.reserved) {
1443
+ name = "_" + name;
1444
+ }
1445
+ lname = new Literal(name);
1446
+ this.hoistDirectivePrologue();
1447
+ this.setContext(name);
1448
+ this.walkBody(name, o);
1449
+ this.ensureConstructor(name);
1450
+ this.body.spaced = true;
1451
+ if (!(this.ctor instanceof Code)) {
1452
+ this.body.expressions.unshift(this.ctor);
1453
+ }
1454
+ this.body.expressions.push(lname);
1455
+ (_ref2 = this.body.expressions).unshift.apply(_ref2, this.directives);
1456
+ this.addBoundFunctions(o);
1457
+ call = Closure.wrap(this.body);
1458
+ if (this.parent) {
1459
+ this.superClass = new Literal(o.scope.freeVariable('super', false));
1460
+ this.body.expressions.unshift(new Extends(lname, this.superClass));
1461
+ call.args.push(this.parent);
1462
+ params = call.variable.params || call.variable.base.params;
1463
+ params.push(new Param(this.superClass));
1464
+ }
1465
+ klass = new Parens(call, true);
1466
+ if (this.variable) {
1467
+ klass = new Assign(this.variable, klass);
1468
+ }
1469
+ return klass.compile(o);
1470
+ };
1471
+
1472
+ return Class;
1473
+
1474
+ })(Base);
1475
+
1476
+ exports.Assign = Assign = (function(_super) {
1477
+
1478
+ __extends(Assign, _super);
1479
+
1480
+ function Assign(variable, value, context, options) {
1481
+ var forbidden, name, _ref2;
1482
+ this.variable = variable;
1483
+ this.value = value;
1484
+ this.context = context;
1485
+ this.param = options && options.param;
1486
+ this.subpattern = options && options.subpattern;
1487
+ forbidden = (_ref2 = (name = this.variable.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0);
1488
+ if (forbidden && this.context !== 'object') {
1489
+ throw SyntaxError("variable name may not be \"" + name + "\"");
1490
+ }
1491
+ }
1492
+
1493
+ Assign.prototype.children = ['variable', 'value'];
1494
+
1495
+ Assign.prototype.isStatement = function(o) {
1496
+ return (o != null ? o.level : void 0) === LEVEL_TOP && (this.context != null) && __indexOf.call(this.context, "?") >= 0;
1497
+ };
1498
+
1499
+ Assign.prototype.assigns = function(name) {
1500
+ return this[this.context === 'object' ? 'value' : 'variable'].assigns(name);
1501
+ };
1502
+
1503
+ Assign.prototype.unfoldSoak = function(o) {
1504
+ return unfoldSoak(o, this, 'variable');
1505
+ };
1506
+
1507
+ Assign.prototype.compileNode = function(o) {
1508
+ var isValue, match, name, val, varBase, _ref2, _ref3, _ref4, _ref5;
1509
+ if (isValue = this.variable instanceof Value) {
1510
+ if (this.variable.isArray() || this.variable.isObject()) {
1511
+ return this.compilePatternMatch(o);
1512
+ }
1513
+ if (this.variable.isSplice()) {
1514
+ return this.compileSplice(o);
1515
+ }
1516
+ if ((_ref2 = this.context) === '||=' || _ref2 === '&&=' || _ref2 === '?=') {
1517
+ return this.compileConditional(o);
1518
+ }
1519
+ }
1520
+ name = this.variable.compile(o, LEVEL_LIST);
1521
+ if (!this.context) {
1522
+ if (!(varBase = this.variable.unwrapAll()).isAssignable()) {
1523
+ throw SyntaxError("\"" + (this.variable.compile(o)) + "\" cannot be assigned.");
1524
+ }
1525
+ if (!(typeof varBase.hasProperties === "function" ? varBase.hasProperties() : void 0)) {
1526
+ if (this.param) {
1527
+ o.scope.add(name, 'var');
1528
+ } else {
1529
+ o.scope.find(name);
1530
+ }
1531
+ }
1532
+ }
1533
+ if (this.value instanceof Code && (match = METHOD_DEF.exec(name))) {
1534
+ if (match[1]) {
1535
+ this.value.klass = match[1];
1536
+ }
1537
+ this.value.name = (_ref3 = (_ref4 = (_ref5 = match[2]) != null ? _ref5 : match[3]) != null ? _ref4 : match[4]) != null ? _ref3 : match[5];
1538
+ }
1539
+ val = this.value.compile(o, LEVEL_LIST);
1540
+ if (this.context === 'object') {
1541
+ return "" + name + ": " + val;
1542
+ }
1543
+ val = name + (" " + (this.context || '=') + " ") + val;
1544
+ if (o.level <= LEVEL_LIST) {
1545
+ return val;
1546
+ } else {
1547
+ return "(" + val + ")";
1548
+ }
1549
+ };
1550
+
1551
+ Assign.prototype.compilePatternMatch = function(o) {
1552
+ var acc, assigns, code, i, idx, isObject, ivar, name, obj, objects, olen, ref, rest, splat, top, val, value, vvar, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8;
1553
+ top = o.level === LEVEL_TOP;
1554
+ value = this.value;
1555
+ objects = this.variable.base.objects;
1556
+ if (!(olen = objects.length)) {
1557
+ code = value.compile(o);
1558
+ if (o.level >= LEVEL_OP) {
1559
+ return "(" + code + ")";
1560
+ } else {
1561
+ return code;
1562
+ }
1563
+ }
1564
+ isObject = this.variable.isObject();
1565
+ if (top && olen === 1 && !((obj = objects[0]) instanceof Splat)) {
1566
+ if (obj instanceof Assign) {
1567
+ _ref2 = obj, (_ref3 = _ref2.variable, idx = _ref3.base), obj = _ref2.value;
1568
+ } else {
1569
+ if (obj.base instanceof Parens) {
1570
+ _ref4 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref4[0], idx = _ref4[1];
1571
+ } else {
1572
+ idx = isObject ? obj["this"] ? obj.properties[0].name : obj : new Literal(0);
1573
+ }
1574
+ }
1575
+ acc = IDENTIFIER.test(idx.unwrap().value || 0);
1576
+ value = new Value(value);
1577
+ value.properties.push(new (acc ? Access : Index)(idx));
1578
+ if (_ref5 = obj.unwrap().value, __indexOf.call(RESERVED, _ref5) >= 0) {
1579
+ throw new SyntaxError("assignment to a reserved word: " + (obj.compile(o)) + " = " + (value.compile(o)));
1580
+ }
1581
+ return new Assign(obj, value, null, {
1582
+ param: this.param
1583
+ }).compile(o, LEVEL_TOP);
1584
+ }
1585
+ vvar = value.compile(o, LEVEL_LIST);
1586
+ assigns = [];
1587
+ splat = false;
1588
+ if (!IDENTIFIER.test(vvar) || this.variable.assigns(vvar)) {
1589
+ assigns.push("" + (ref = o.scope.freeVariable('ref')) + " = " + vvar);
1590
+ vvar = ref;
1591
+ }
1592
+ for (i = _i = 0, _len = objects.length; _i < _len; i = ++_i) {
1593
+ obj = objects[i];
1594
+ idx = i;
1595
+ if (isObject) {
1596
+ if (obj instanceof Assign) {
1597
+ _ref6 = obj, (_ref7 = _ref6.variable, idx = _ref7.base), obj = _ref6.value;
1598
+ } else {
1599
+ if (obj.base instanceof Parens) {
1600
+ _ref8 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref8[0], idx = _ref8[1];
1601
+ } else {
1602
+ idx = obj["this"] ? obj.properties[0].name : obj;
1603
+ }
1604
+ }
1605
+ }
1606
+ if (!splat && obj instanceof Splat) {
1607
+ name = obj.name.unwrap().value;
1608
+ obj = obj.unwrap();
1609
+ val = "" + olen + " <= " + vvar + ".length ? " + (utility('slice')) + ".call(" + vvar + ", " + i;
1610
+ if (rest = olen - i - 1) {
1611
+ ivar = o.scope.freeVariable('i');
1612
+ val += ", " + ivar + " = " + vvar + ".length - " + rest + ") : (" + ivar + " = " + i + ", [])";
1613
+ } else {
1614
+ val += ") : []";
1615
+ }
1616
+ val = new Literal(val);
1617
+ splat = "" + ivar + "++";
1618
+ } else {
1619
+ name = obj.unwrap().value;
1620
+ if (obj instanceof Splat) {
1621
+ obj = obj.name.compile(o);
1622
+ throw new SyntaxError("multiple splats are disallowed in an assignment: " + obj + "...");
1623
+ }
1624
+ if (typeof idx === 'number') {
1625
+ idx = new Literal(splat || idx);
1626
+ acc = false;
1627
+ } else {
1628
+ acc = isObject && IDENTIFIER.test(idx.unwrap().value || 0);
1629
+ }
1630
+ val = new Value(new Literal(vvar), [new (acc ? Access : Index)(idx)]);
1631
+ }
1632
+ if ((name != null) && __indexOf.call(RESERVED, name) >= 0) {
1633
+ throw new SyntaxError("assignment to a reserved word: " + (obj.compile(o)) + " = " + (val.compile(o)));
1634
+ }
1635
+ assigns.push(new Assign(obj, val, null, {
1636
+ param: this.param,
1637
+ subpattern: true
1638
+ }).compile(o, LEVEL_LIST));
1639
+ }
1640
+ if (!(top || this.subpattern)) {
1641
+ assigns.push(vvar);
1642
+ }
1643
+ code = assigns.join(', ');
1644
+ if (o.level < LEVEL_LIST) {
1645
+ return code;
1646
+ } else {
1647
+ return "(" + code + ")";
1648
+ }
1649
+ };
1650
+
1651
+ Assign.prototype.compileConditional = function(o) {
1652
+ var left, right, _ref2;
1653
+ _ref2 = this.variable.cacheReference(o), left = _ref2[0], right = _ref2[1];
1654
+ if (!left.properties.length && left.base instanceof Literal && left.base.value !== "this" && !o.scope.check(left.base.value)) {
1655
+ throw new Error("the variable \"" + left.base.value + "\" can't be assigned with " + this.context + " because it has not been defined.");
1656
+ }
1657
+ if (__indexOf.call(this.context, "?") >= 0) {
1658
+ o.isExistentialEquals = true;
1659
+ }
1660
+ return new Op(this.context.slice(0, -1), left, new Assign(right, this.value, '=')).compile(o);
1661
+ };
1662
+
1663
+ Assign.prototype.compileSplice = function(o) {
1664
+ var code, exclusive, from, fromDecl, fromRef, name, to, valDef, valRef, _ref2, _ref3, _ref4;
1665
+ _ref2 = this.variable.properties.pop().range, from = _ref2.from, to = _ref2.to, exclusive = _ref2.exclusive;
1666
+ name = this.variable.compile(o);
1667
+ _ref3 = (from != null ? from.cache(o, LEVEL_OP) : void 0) || ['0', '0'], fromDecl = _ref3[0], fromRef = _ref3[1];
1668
+ if (to) {
1669
+ if ((from != null ? from.isSimpleNumber() : void 0) && to.isSimpleNumber()) {
1670
+ to = +to.compile(o) - +fromRef;
1671
+ if (!exclusive) {
1672
+ to += 1;
1673
+ }
1674
+ } else {
1675
+ to = to.compile(o, LEVEL_ACCESS) + ' - ' + fromRef;
1676
+ if (!exclusive) {
1677
+ to += ' + 1';
1678
+ }
1679
+ }
1680
+ } else {
1681
+ to = "9e9";
1682
+ }
1683
+ _ref4 = this.value.cache(o, LEVEL_LIST), valDef = _ref4[0], valRef = _ref4[1];
1684
+ code = "[].splice.apply(" + name + ", [" + fromDecl + ", " + to + "].concat(" + valDef + ")), " + valRef;
1685
+ if (o.level > LEVEL_TOP) {
1686
+ return "(" + code + ")";
1687
+ } else {
1688
+ return code;
1689
+ }
1690
+ };
1691
+
1692
+ return Assign;
1693
+
1694
+ })(Base);
1695
+
1696
+ exports.Code = Code = (function(_super) {
1697
+
1698
+ __extends(Code, _super);
1699
+
1700
+ function Code(params, body, tag) {
1701
+ this.params = params || [];
1702
+ this.body = body || new Block;
1703
+ this.bound = tag === 'boundfunc';
1704
+ if (this.bound) {
1705
+ this.context = '_this';
1706
+ }
1707
+ }
1708
+
1709
+ Code.prototype.children = ['params', 'body'];
1710
+
1711
+ Code.prototype.isStatement = function() {
1712
+ return !!this.ctor;
1713
+ };
1714
+
1715
+ Code.prototype.jumps = NO;
1716
+
1717
+ Code.prototype.compileNode = function(o) {
1718
+ var code, exprs, i, idt, lit, name, p, param, params, ref, splats, uniqs, val, wasEmpty, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _m, _n, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8;
1719
+ o.scope = new Scope(o.scope, this.body, this);
1720
+ o.scope.shared = del(o, 'sharedScope');
1721
+ o.indent += TAB;
1722
+ delete o.bare;
1723
+ delete o.isExistentialEquals;
1724
+ params = [];
1725
+ exprs = [];
1726
+ _ref2 = this.paramNames();
1727
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
1728
+ name = _ref2[_i];
1729
+ if (!o.scope.check(name)) {
1730
+ o.scope.parameter(name);
1731
+ }
1732
+ }
1733
+ _ref3 = this.params;
1734
+ for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {
1735
+ param = _ref3[_j];
1736
+ if (!param.splat) {
1737
+ continue;
1738
+ }
1739
+ _ref4 = this.params;
1740
+ for (_k = 0, _len2 = _ref4.length; _k < _len2; _k++) {
1741
+ p = _ref4[_k].name;
1742
+ if (p["this"]) {
1743
+ p = p.properties[0].name;
1744
+ }
1745
+ if (p.value) {
1746
+ o.scope.add(p.value, 'var', true);
1747
+ }
1748
+ }
1749
+ splats = new Assign(new Value(new Arr((function() {
1750
+ var _l, _len3, _ref5, _results;
1751
+ _ref5 = this.params;
1752
+ _results = [];
1753
+ for (_l = 0, _len3 = _ref5.length; _l < _len3; _l++) {
1754
+ p = _ref5[_l];
1755
+ _results.push(p.asReference(o));
1756
+ }
1757
+ return _results;
1758
+ }).call(this))), new Value(new Literal('arguments')));
1759
+ break;
1760
+ }
1761
+ _ref5 = this.params;
1762
+ for (_l = 0, _len3 = _ref5.length; _l < _len3; _l++) {
1763
+ param = _ref5[_l];
1764
+ if (param.isComplex()) {
1765
+ val = ref = param.asReference(o);
1766
+ if (param.value) {
1767
+ val = new Op('?', ref, param.value);
1768
+ }
1769
+ exprs.push(new Assign(new Value(param.name), val, '=', {
1770
+ param: true
1771
+ }));
1772
+ } else {
1773
+ ref = param;
1774
+ if (param.value) {
1775
+ lit = new Literal(ref.name.value + ' == null');
1776
+ val = new Assign(new Value(param.name), param.value, '=');
1777
+ exprs.push(new If(lit, val));
1778
+ }
1779
+ }
1780
+ if (!splats) {
1781
+ params.push(ref);
1782
+ }
1783
+ }
1784
+ wasEmpty = this.body.isEmpty();
1785
+ if (splats) {
1786
+ exprs.unshift(splats);
1787
+ }
1788
+ if (exprs.length) {
1789
+ (_ref6 = this.body.expressions).unshift.apply(_ref6, exprs);
1790
+ }
1791
+ for (i = _m = 0, _len4 = params.length; _m < _len4; i = ++_m) {
1792
+ p = params[i];
1793
+ o.scope.parameter(params[i] = p.compile(o));
1794
+ }
1795
+ uniqs = [];
1796
+ _ref7 = this.paramNames();
1797
+ for (_n = 0, _len5 = _ref7.length; _n < _len5; _n++) {
1798
+ name = _ref7[_n];
1799
+ if (__indexOf.call(uniqs, name) >= 0) {
1800
+ throw SyntaxError("multiple parameters named '" + name + "'");
1801
+ }
1802
+ uniqs.push(name);
1803
+ }
1804
+ if (!(wasEmpty || this.noReturn)) {
1805
+ this.body.makeReturn();
1806
+ }
1807
+ if (this.bound) {
1808
+ if ((_ref8 = o.scope.parent.method) != null ? _ref8.bound : void 0) {
1809
+ this.bound = this.context = o.scope.parent.method.context;
1810
+ } else if (!this["static"]) {
1811
+ o.scope.parent.assign('_this', 'this');
1812
+ }
1813
+ }
1814
+ idt = o.indent;
1815
+ code = 'function';
1816
+ if (this.ctor) {
1817
+ code += ' ' + this.name;
1818
+ }
1819
+ code += '(' + params.join(', ') + ') {';
1820
+ if (!this.body.isEmpty()) {
1821
+ code += "\n" + (this.body.compileWithDeclarations(o)) + "\n" + this.tab;
1822
+ }
1823
+ code += '}';
1824
+ if (this.ctor) {
1825
+ return this.tab + code;
1826
+ }
1827
+ if (this.front || (o.level >= LEVEL_ACCESS)) {
1828
+ return "(" + code + ")";
1829
+ } else {
1830
+ return code;
1831
+ }
1832
+ };
1833
+
1834
+ Code.prototype.paramNames = function() {
1835
+ var names, param, _i, _len, _ref2;
1836
+ names = [];
1837
+ _ref2 = this.params;
1838
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
1839
+ param = _ref2[_i];
1840
+ names.push.apply(names, param.names());
1841
+ }
1842
+ return names;
1843
+ };
1844
+
1845
+ Code.prototype.traverseChildren = function(crossScope, func) {
1846
+ if (crossScope) {
1847
+ return Code.__super__.traverseChildren.call(this, crossScope, func);
1848
+ }
1849
+ };
1850
+
1851
+ return Code;
1852
+
1853
+ })(Base);
1854
+
1855
+ exports.Param = Param = (function(_super) {
1856
+
1857
+ __extends(Param, _super);
1858
+
1859
+ function Param(name, value, splat) {
1860
+ var _ref2;
1861
+ this.name = name;
1862
+ this.value = value;
1863
+ this.splat = splat;
1864
+ if (_ref2 = (name = this.name.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0) {
1865
+ throw SyntaxError("parameter name \"" + name + "\" is not allowed");
1866
+ }
1867
+ }
1868
+
1869
+ Param.prototype.children = ['name', 'value'];
1870
+
1871
+ Param.prototype.compile = function(o) {
1872
+ return this.name.compile(o, LEVEL_LIST);
1873
+ };
1874
+
1875
+ Param.prototype.asReference = function(o) {
1876
+ var node;
1877
+ if (this.reference) {
1878
+ return this.reference;
1879
+ }
1880
+ node = this.name;
1881
+ if (node["this"]) {
1882
+ node = node.properties[0].name;
1883
+ if (node.value.reserved) {
1884
+ node = new Literal(o.scope.freeVariable(node.value));
1885
+ }
1886
+ } else if (node.isComplex()) {
1887
+ node = new Literal(o.scope.freeVariable('arg'));
1888
+ }
1889
+ node = new Value(node);
1890
+ if (this.splat) {
1891
+ node = new Splat(node);
1892
+ }
1893
+ return this.reference = node;
1894
+ };
1895
+
1896
+ Param.prototype.isComplex = function() {
1897
+ return this.name.isComplex();
1898
+ };
1899
+
1900
+ Param.prototype.names = function(name) {
1901
+ var atParam, names, obj, _i, _len, _ref2;
1902
+ if (name == null) {
1903
+ name = this.name;
1904
+ }
1905
+ atParam = function(obj) {
1906
+ var value;
1907
+ value = obj.properties[0].name.value;
1908
+ if (value.reserved) {
1909
+ return [];
1910
+ } else {
1911
+ return [value];
1912
+ }
1913
+ };
1914
+ if (name instanceof Literal) {
1915
+ return [name.value];
1916
+ }
1917
+ if (name instanceof Value) {
1918
+ return atParam(name);
1919
+ }
1920
+ names = [];
1921
+ _ref2 = name.objects;
1922
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
1923
+ obj = _ref2[_i];
1924
+ if (obj instanceof Assign) {
1925
+ names.push(obj.value.unwrap().value);
1926
+ } else if (obj instanceof Splat) {
1927
+ names.push(obj.name.unwrap().value);
1928
+ } else if (obj instanceof Value) {
1929
+ if (obj.isArray() || obj.isObject()) {
1930
+ names.push.apply(names, this.names(obj.base));
1931
+ } else if (obj["this"]) {
1932
+ names.push.apply(names, atParam(obj));
1933
+ } else {
1934
+ names.push(obj.base.value);
1935
+ }
1936
+ } else {
1937
+ throw SyntaxError("illegal parameter " + (obj.compile()));
1938
+ }
1939
+ }
1940
+ return names;
1941
+ };
1942
+
1943
+ return Param;
1944
+
1945
+ })(Base);
1946
+
1947
+ exports.Splat = Splat = (function(_super) {
1948
+
1949
+ __extends(Splat, _super);
1950
+
1951
+ Splat.prototype.children = ['name'];
1952
+
1953
+ Splat.prototype.isAssignable = YES;
1954
+
1955
+ function Splat(name) {
1956
+ this.name = name.compile ? name : new Literal(name);
1957
+ }
1958
+
1959
+ Splat.prototype.assigns = function(name) {
1960
+ return this.name.assigns(name);
1961
+ };
1962
+
1963
+ Splat.prototype.compile = function(o) {
1964
+ if (this.index != null) {
1965
+ return this.compileParam(o);
1966
+ } else {
1967
+ return this.name.compile(o);
1968
+ }
1969
+ };
1970
+
1971
+ Splat.prototype.unwrap = function() {
1972
+ return this.name;
1973
+ };
1974
+
1975
+ Splat.compileSplattedArray = function(o, list, apply) {
1976
+ var args, base, code, i, index, node, _i, _len;
1977
+ index = -1;
1978
+ while ((node = list[++index]) && !(node instanceof Splat)) {
1979
+ continue;
1980
+ }
1981
+ if (index >= list.length) {
1982
+ return '';
1983
+ }
1984
+ if (list.length === 1) {
1985
+ code = list[0].compile(o, LEVEL_LIST);
1986
+ if (apply) {
1987
+ return code;
1988
+ }
1989
+ return "" + (utility('slice')) + ".call(" + code + ")";
1990
+ }
1991
+ args = list.slice(index);
1992
+ for (i = _i = 0, _len = args.length; _i < _len; i = ++_i) {
1993
+ node = args[i];
1994
+ code = node.compile(o, LEVEL_LIST);
1995
+ args[i] = node instanceof Splat ? "" + (utility('slice')) + ".call(" + code + ")" : "[" + code + "]";
1996
+ }
1997
+ if (index === 0) {
1998
+ return args[0] + (".concat(" + (args.slice(1).join(', ')) + ")");
1999
+ }
2000
+ base = (function() {
2001
+ var _j, _len1, _ref2, _results;
2002
+ _ref2 = list.slice(0, index);
2003
+ _results = [];
2004
+ for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
2005
+ node = _ref2[_j];
2006
+ _results.push(node.compile(o, LEVEL_LIST));
2007
+ }
2008
+ return _results;
2009
+ })();
2010
+ return "[" + (base.join(', ')) + "].concat(" + (args.join(', ')) + ")";
2011
+ };
2012
+
2013
+ return Splat;
2014
+
2015
+ })(Base);
2016
+
2017
+ exports.While = While = (function(_super) {
2018
+
2019
+ __extends(While, _super);
2020
+
2021
+ function While(condition, options) {
2022
+ this.condition = (options != null ? options.invert : void 0) ? condition.invert() : condition;
2023
+ this.guard = options != null ? options.guard : void 0;
2024
+ }
2025
+
2026
+ While.prototype.children = ['condition', 'guard', 'body'];
2027
+
2028
+ While.prototype.isStatement = YES;
2029
+
2030
+ While.prototype.makeReturn = function(res) {
2031
+ if (res) {
2032
+ return While.__super__.makeReturn.apply(this, arguments);
2033
+ } else {
2034
+ this.returns = !this.jumps({
2035
+ loop: true
2036
+ });
2037
+ return this;
2038
+ }
2039
+ };
2040
+
2041
+ While.prototype.addBody = function(body) {
2042
+ this.body = body;
2043
+ return this;
2044
+ };
2045
+
2046
+ While.prototype.jumps = function() {
2047
+ var expressions, node, _i, _len;
2048
+ expressions = this.body.expressions;
2049
+ if (!expressions.length) {
2050
+ return false;
2051
+ }
2052
+ for (_i = 0, _len = expressions.length; _i < _len; _i++) {
2053
+ node = expressions[_i];
2054
+ if (node.jumps({
2055
+ loop: true
2056
+ })) {
2057
+ return node;
2058
+ }
2059
+ }
2060
+ return false;
2061
+ };
2062
+
2063
+ While.prototype.compileNode = function(o) {
2064
+ var body, code, rvar, set;
2065
+ o.indent += TAB;
2066
+ set = '';
2067
+ body = this.body;
2068
+ if (body.isEmpty()) {
2069
+ body = '';
2070
+ } else {
2071
+ if (this.returns) {
2072
+ body.makeReturn(rvar = o.scope.freeVariable('results'));
2073
+ set = "" + this.tab + rvar + " = [];\n";
2074
+ }
2075
+ if (this.guard) {
2076
+ if (body.expressions.length > 1) {
2077
+ body.expressions.unshift(new If((new Parens(this.guard)).invert(), new Literal("continue")));
2078
+ } else {
2079
+ if (this.guard) {
2080
+ body = Block.wrap([new If(this.guard, body)]);
2081
+ }
2082
+ }
2083
+ }
2084
+ body = "\n" + (body.compile(o, LEVEL_TOP)) + "\n" + this.tab;
2085
+ }
2086
+ code = set + this.tab + ("while (" + (this.condition.compile(o, LEVEL_PAREN)) + ") {" + body + "}");
2087
+ if (this.returns) {
2088
+ code += "\n" + this.tab + "return " + rvar + ";";
2089
+ }
2090
+ return code;
2091
+ };
2092
+
2093
+ return While;
2094
+
2095
+ })(Base);
2096
+
2097
+ exports.Op = Op = (function(_super) {
2098
+ var CONVERSIONS, INVERSIONS;
2099
+
2100
+ __extends(Op, _super);
2101
+
2102
+ function Op(op, first, second, flip) {
2103
+ if (op === 'in') {
2104
+ return new In(first, second);
2105
+ }
2106
+ if (op === 'do') {
2107
+ return this.generateDo(first);
2108
+ }
2109
+ if (op === 'new') {
2110
+ if (first instanceof Call && !first["do"] && !first.isNew) {
2111
+ return first.newInstance();
2112
+ }
2113
+ if (first instanceof Code && first.bound || first["do"]) {
2114
+ first = new Parens(first);
2115
+ }
2116
+ }
2117
+ this.operator = CONVERSIONS[op] || op;
2118
+ this.first = first;
2119
+ this.second = second;
2120
+ this.flip = !!flip;
2121
+ return this;
2122
+ }
2123
+
2124
+ CONVERSIONS = {
2125
+ '==': '===',
2126
+ '!=': '!==',
2127
+ 'of': 'in'
2128
+ };
2129
+
2130
+ INVERSIONS = {
2131
+ '!==': '===',
2132
+ '===': '!=='
2133
+ };
2134
+
2135
+ Op.prototype.children = ['first', 'second'];
2136
+
2137
+ Op.prototype.isSimpleNumber = NO;
2138
+
2139
+ Op.prototype.isUnary = function() {
2140
+ return !this.second;
2141
+ };
2142
+
2143
+ Op.prototype.isComplex = function() {
2144
+ var _ref2;
2145
+ return !(this.isUnary() && ((_ref2 = this.operator) === '+' || _ref2 === '-')) || this.first.isComplex();
2146
+ };
2147
+
2148
+ Op.prototype.isChainable = function() {
2149
+ var _ref2;
2150
+ return (_ref2 = this.operator) === '<' || _ref2 === '>' || _ref2 === '>=' || _ref2 === '<=' || _ref2 === '===' || _ref2 === '!==';
2151
+ };
2152
+
2153
+ Op.prototype.invert = function() {
2154
+ var allInvertable, curr, fst, op, _ref2;
2155
+ if (this.isChainable() && this.first.isChainable()) {
2156
+ allInvertable = true;
2157
+ curr = this;
2158
+ while (curr && curr.operator) {
2159
+ allInvertable && (allInvertable = curr.operator in INVERSIONS);
2160
+ curr = curr.first;
2161
+ }
2162
+ if (!allInvertable) {
2163
+ return new Parens(this).invert();
2164
+ }
2165
+ curr = this;
2166
+ while (curr && curr.operator) {
2167
+ curr.invert = !curr.invert;
2168
+ curr.operator = INVERSIONS[curr.operator];
2169
+ curr = curr.first;
2170
+ }
2171
+ return this;
2172
+ } else if (op = INVERSIONS[this.operator]) {
2173
+ this.operator = op;
2174
+ if (this.first.unwrap() instanceof Op) {
2175
+ this.first.invert();
2176
+ }
2177
+ return this;
2178
+ } else if (this.second) {
2179
+ return new Parens(this).invert();
2180
+ } else if (this.operator === '!' && (fst = this.first.unwrap()) instanceof Op && ((_ref2 = fst.operator) === '!' || _ref2 === 'in' || _ref2 === 'instanceof')) {
2181
+ return fst;
2182
+ } else {
2183
+ return new Op('!', this);
2184
+ }
2185
+ };
2186
+
2187
+ Op.prototype.unfoldSoak = function(o) {
2188
+ var _ref2;
2189
+ return ((_ref2 = this.operator) === '++' || _ref2 === '--' || _ref2 === 'delete') && unfoldSoak(o, this, 'first');
2190
+ };
2191
+
2192
+ Op.prototype.generateDo = function(exp) {
2193
+ var call, func, param, passedParams, ref, _i, _len, _ref2;
2194
+ passedParams = [];
2195
+ func = exp instanceof Assign && (ref = exp.value.unwrap()) instanceof Code ? ref : exp;
2196
+ _ref2 = func.params || [];
2197
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
2198
+ param = _ref2[_i];
2199
+ if (param.value) {
2200
+ passedParams.push(param.value);
2201
+ delete param.value;
2202
+ } else {
2203
+ passedParams.push(param);
2204
+ }
2205
+ }
2206
+ call = new Call(exp, passedParams);
2207
+ call["do"] = true;
2208
+ return call;
2209
+ };
2210
+
2211
+ Op.prototype.compileNode = function(o) {
2212
+ var code, isChain, _ref2, _ref3;
2213
+ isChain = this.isChainable() && this.first.isChainable();
2214
+ if (!isChain) {
2215
+ this.first.front = this.front;
2216
+ }
2217
+ if (this.operator === 'delete' && o.scope.check(this.first.unwrapAll().value)) {
2218
+ throw SyntaxError('delete operand may not be argument or var');
2219
+ }
2220
+ if (((_ref2 = this.operator) === '--' || _ref2 === '++') && (_ref3 = this.first.unwrapAll().value, __indexOf.call(STRICT_PROSCRIBED, _ref3) >= 0)) {
2221
+ throw SyntaxError('prefix increment/decrement may not have eval or arguments operand');
2222
+ }
2223
+ if (this.isUnary()) {
2224
+ return this.compileUnary(o);
2225
+ }
2226
+ if (isChain) {
2227
+ return this.compileChain(o);
2228
+ }
2229
+ if (this.operator === '?') {
2230
+ return this.compileExistence(o);
2231
+ }
2232
+ code = this.first.compile(o, LEVEL_OP) + ' ' + this.operator + ' ' + this.second.compile(o, LEVEL_OP);
2233
+ if (o.level <= LEVEL_OP) {
2234
+ return code;
2235
+ } else {
2236
+ return "(" + code + ")";
2237
+ }
2238
+ };
2239
+
2240
+ Op.prototype.compileChain = function(o) {
2241
+ var code, fst, shared, _ref2;
2242
+ _ref2 = this.first.second.cache(o), this.first.second = _ref2[0], shared = _ref2[1];
2243
+ fst = this.first.compile(o, LEVEL_OP);
2244
+ code = "" + fst + " " + (this.invert ? '&&' : '||') + " " + (shared.compile(o)) + " " + this.operator + " " + (this.second.compile(o, LEVEL_OP));
2245
+ return "(" + code + ")";
2246
+ };
2247
+
2248
+ Op.prototype.compileExistence = function(o) {
2249
+ var fst, ref;
2250
+ if (this.first.isComplex()) {
2251
+ ref = new Literal(o.scope.freeVariable('ref'));
2252
+ fst = new Parens(new Assign(ref, this.first));
2253
+ } else {
2254
+ fst = this.first;
2255
+ ref = fst;
2256
+ }
2257
+ return new If(new Existence(fst), ref, {
2258
+ type: 'if'
2259
+ }).addElse(this.second).compile(o);
2260
+ };
2261
+
2262
+ Op.prototype.compileUnary = function(o) {
2263
+ var op, parts, plusMinus;
2264
+ if (o.level >= LEVEL_ACCESS) {
2265
+ return (new Parens(this)).compile(o);
2266
+ }
2267
+ parts = [op = this.operator];
2268
+ plusMinus = op === '+' || op === '-';
2269
+ if ((op === 'new' || op === 'typeof' || op === 'delete') || plusMinus && this.first instanceof Op && this.first.operator === op) {
2270
+ parts.push(' ');
2271
+ }
2272
+ if ((plusMinus && this.first instanceof Op) || (op === 'new' && this.first.isStatement(o))) {
2273
+ this.first = new Parens(this.first);
2274
+ }
2275
+ parts.push(this.first.compile(o, LEVEL_OP));
2276
+ if (this.flip) {
2277
+ parts.reverse();
2278
+ }
2279
+ return parts.join('');
2280
+ };
2281
+
2282
+ Op.prototype.toString = function(idt) {
2283
+ return Op.__super__.toString.call(this, idt, this.constructor.name + ' ' + this.operator);
2284
+ };
2285
+
2286
+ return Op;
2287
+
2288
+ })(Base);
2289
+
2290
+ exports.In = In = (function(_super) {
2291
+
2292
+ __extends(In, _super);
2293
+
2294
+ function In(object, array) {
2295
+ this.object = object;
2296
+ this.array = array;
2297
+ }
2298
+
2299
+ In.prototype.children = ['object', 'array'];
2300
+
2301
+ In.prototype.invert = NEGATE;
2302
+
2303
+ In.prototype.compileNode = function(o) {
2304
+ var hasSplat, obj, _i, _len, _ref2;
2305
+ if (this.array instanceof Value && this.array.isArray()) {
2306
+ _ref2 = this.array.base.objects;
2307
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
2308
+ obj = _ref2[_i];
2309
+ if (!(obj instanceof Splat)) {
2310
+ continue;
2311
+ }
2312
+ hasSplat = true;
2313
+ break;
2314
+ }
2315
+ if (!hasSplat) {
2316
+ return this.compileOrTest(o);
2317
+ }
2318
+ }
2319
+ return this.compileLoopTest(o);
2320
+ };
2321
+
2322
+ In.prototype.compileOrTest = function(o) {
2323
+ var cmp, cnj, i, item, ref, sub, tests, _ref2, _ref3;
2324
+ if (this.array.base.objects.length === 0) {
2325
+ return "" + (!!this.negated);
2326
+ }
2327
+ _ref2 = this.object.cache(o, LEVEL_OP), sub = _ref2[0], ref = _ref2[1];
2328
+ _ref3 = this.negated ? [' !== ', ' && '] : [' === ', ' || '], cmp = _ref3[0], cnj = _ref3[1];
2329
+ tests = (function() {
2330
+ var _i, _len, _ref4, _results;
2331
+ _ref4 = this.array.base.objects;
2332
+ _results = [];
2333
+ for (i = _i = 0, _len = _ref4.length; _i < _len; i = ++_i) {
2334
+ item = _ref4[i];
2335
+ _results.push((i ? ref : sub) + cmp + item.compile(o, LEVEL_ACCESS));
2336
+ }
2337
+ return _results;
2338
+ }).call(this);
2339
+ tests = tests.join(cnj);
2340
+ if (o.level < LEVEL_OP) {
2341
+ return tests;
2342
+ } else {
2343
+ return "(" + tests + ")";
2344
+ }
2345
+ };
2346
+
2347
+ In.prototype.compileLoopTest = function(o) {
2348
+ var code, ref, sub, _ref2;
2349
+ _ref2 = this.object.cache(o, LEVEL_LIST), sub = _ref2[0], ref = _ref2[1];
2350
+ code = utility('indexOf') + (".call(" + (this.array.compile(o, LEVEL_LIST)) + ", " + ref + ") ") + (this.negated ? '< 0' : '>= 0');
2351
+ if (sub === ref) {
2352
+ return code;
2353
+ }
2354
+ code = sub + ', ' + code;
2355
+ if (o.level < LEVEL_LIST) {
2356
+ return code;
2357
+ } else {
2358
+ return "(" + code + ")";
2359
+ }
2360
+ };
2361
+
2362
+ In.prototype.toString = function(idt) {
2363
+ return In.__super__.toString.call(this, idt, this.constructor.name + (this.negated ? '!' : ''));
2364
+ };
2365
+
2366
+ return In;
2367
+
2368
+ })(Base);
2369
+
2370
+ exports.Try = Try = (function(_super) {
2371
+
2372
+ __extends(Try, _super);
2373
+
2374
+ function Try(attempt, error, recovery, ensure) {
2375
+ this.attempt = attempt;
2376
+ this.error = error;
2377
+ this.recovery = recovery;
2378
+ this.ensure = ensure;
2379
+ }
2380
+
2381
+ Try.prototype.children = ['attempt', 'recovery', 'ensure'];
2382
+
2383
+ Try.prototype.isStatement = YES;
2384
+
2385
+ Try.prototype.jumps = function(o) {
2386
+ var _ref2;
2387
+ return this.attempt.jumps(o) || ((_ref2 = this.recovery) != null ? _ref2.jumps(o) : void 0);
2388
+ };
2389
+
2390
+ Try.prototype.makeReturn = function(res) {
2391
+ if (this.attempt) {
2392
+ this.attempt = this.attempt.makeReturn(res);
2393
+ }
2394
+ if (this.recovery) {
2395
+ this.recovery = this.recovery.makeReturn(res);
2396
+ }
2397
+ return this;
2398
+ };
2399
+
2400
+ Try.prototype.compileNode = function(o) {
2401
+ var catchPart, ensurePart, errorPart, tryPart;
2402
+ o.indent += TAB;
2403
+ errorPart = this.error ? " (" + (this.error.compile(o)) + ") " : ' ';
2404
+ tryPart = this.attempt.compile(o, LEVEL_TOP);
2405
+ catchPart = (function() {
2406
+ var _ref2;
2407
+ if (this.recovery) {
2408
+ if (_ref2 = this.error.value, __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0) {
2409
+ throw SyntaxError("catch variable may not be \"" + this.error.value + "\"");
2410
+ }
2411
+ if (!o.scope.check(this.error.value)) {
2412
+ o.scope.add(this.error.value, 'param');
2413
+ }
2414
+ return " catch" + errorPart + "{\n" + (this.recovery.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}";
2415
+ } else if (!(this.ensure || this.recovery)) {
2416
+ return ' catch (_error) {}';
2417
+ }
2418
+ }).call(this);
2419
+ ensurePart = this.ensure ? " finally {\n" + (this.ensure.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}" : '';
2420
+ return "" + this.tab + "try {\n" + tryPart + "\n" + this.tab + "}" + (catchPart || '') + ensurePart;
2421
+ };
2422
+
2423
+ return Try;
2424
+
2425
+ })(Base);
2426
+
2427
+ exports.Throw = Throw = (function(_super) {
2428
+
2429
+ __extends(Throw, _super);
2430
+
2431
+ function Throw(expression) {
2432
+ this.expression = expression;
2433
+ }
2434
+
2435
+ Throw.prototype.children = ['expression'];
2436
+
2437
+ Throw.prototype.isStatement = YES;
2438
+
2439
+ Throw.prototype.jumps = NO;
2440
+
2441
+ Throw.prototype.makeReturn = THIS;
2442
+
2443
+ Throw.prototype.compileNode = function(o) {
2444
+ return this.tab + ("throw " + (this.expression.compile(o)) + ";");
2445
+ };
2446
+
2447
+ return Throw;
2448
+
2449
+ })(Base);
2450
+
2451
+ exports.Existence = Existence = (function(_super) {
2452
+
2453
+ __extends(Existence, _super);
2454
+
2455
+ function Existence(expression) {
2456
+ this.expression = expression;
2457
+ }
2458
+
2459
+ Existence.prototype.children = ['expression'];
2460
+
2461
+ Existence.prototype.invert = NEGATE;
2462
+
2463
+ Existence.prototype.compileNode = function(o) {
2464
+ var cmp, cnj, code, _ref2;
2465
+ this.expression.front = this.front;
2466
+ code = this.expression.compile(o, LEVEL_OP);
2467
+ if (IDENTIFIER.test(code) && !o.scope.check(code)) {
2468
+ _ref2 = this.negated ? ['===', '||'] : ['!==', '&&'], cmp = _ref2[0], cnj = _ref2[1];
2469
+ code = "typeof " + code + " " + cmp + " \"undefined\" " + cnj + " " + code + " " + cmp + " null";
2470
+ } else {
2471
+ code = "" + code + " " + (this.negated ? '==' : '!=') + " null";
2472
+ }
2473
+ if (o.level <= LEVEL_COND) {
2474
+ return code;
2475
+ } else {
2476
+ return "(" + code + ")";
2477
+ }
2478
+ };
2479
+
2480
+ return Existence;
2481
+
2482
+ })(Base);
2483
+
2484
+ exports.Parens = Parens = (function(_super) {
2485
+
2486
+ __extends(Parens, _super);
2487
+
2488
+ function Parens(body) {
2489
+ this.body = body;
2490
+ }
2491
+
2492
+ Parens.prototype.children = ['body'];
2493
+
2494
+ Parens.prototype.unwrap = function() {
2495
+ return this.body;
2496
+ };
2497
+
2498
+ Parens.prototype.isComplex = function() {
2499
+ return this.body.isComplex();
2500
+ };
2501
+
2502
+ Parens.prototype.compileNode = function(o) {
2503
+ var bare, code, expr;
2504
+ expr = this.body.unwrap();
2505
+ if (expr instanceof Value && expr.isAtomic()) {
2506
+ expr.front = this.front;
2507
+ return expr.compile(o);
2508
+ }
2509
+ code = expr.compile(o, LEVEL_PAREN);
2510
+ bare = o.level < LEVEL_OP && (expr instanceof Op || expr instanceof Call || (expr instanceof For && expr.returns));
2511
+ if (bare) {
2512
+ return code;
2513
+ } else {
2514
+ return "(" + code + ")";
2515
+ }
2516
+ };
2517
+
2518
+ return Parens;
2519
+
2520
+ })(Base);
2521
+
2522
+ exports.For = For = (function(_super) {
2523
+
2524
+ __extends(For, _super);
2525
+
2526
+ function For(body, source) {
2527
+ var _ref2;
2528
+ this.source = source.source, this.guard = source.guard, this.step = source.step, this.name = source.name, this.index = source.index;
2529
+ this.body = Block.wrap([body]);
2530
+ this.own = !!source.own;
2531
+ this.object = !!source.object;
2532
+ if (this.object) {
2533
+ _ref2 = [this.index, this.name], this.name = _ref2[0], this.index = _ref2[1];
2534
+ }
2535
+ if (this.index instanceof Value) {
2536
+ throw SyntaxError('index cannot be a pattern matching expression');
2537
+ }
2538
+ this.range = this.source instanceof Value && this.source.base instanceof Range && !this.source.properties.length;
2539
+ this.pattern = this.name instanceof Value;
2540
+ if (this.range && this.index) {
2541
+ throw SyntaxError('indexes do not apply to range loops');
2542
+ }
2543
+ if (this.range && this.pattern) {
2544
+ throw SyntaxError('cannot pattern match over range loops');
2545
+ }
2546
+ this.returns = false;
2547
+ }
2548
+
2549
+ For.prototype.children = ['body', 'source', 'guard', 'step'];
2550
+
2551
+ For.prototype.compileNode = function(o) {
2552
+ var body, defPart, forPart, forVarPart, guardPart, idt1, index, ivar, kvar, kvarAssign, lastJumps, lvar, name, namePart, ref, resultPart, returnResult, rvar, scope, source, stepPart, stepvar, svar, varPart, _ref2;
2553
+ body = Block.wrap([this.body]);
2554
+ lastJumps = (_ref2 = last(body.expressions)) != null ? _ref2.jumps() : void 0;
2555
+ if (lastJumps && lastJumps instanceof Return) {
2556
+ this.returns = false;
2557
+ }
2558
+ source = this.range ? this.source.base : this.source;
2559
+ scope = o.scope;
2560
+ name = this.name && this.name.compile(o, LEVEL_LIST);
2561
+ index = this.index && this.index.compile(o, LEVEL_LIST);
2562
+ if (name && !this.pattern) {
2563
+ scope.find(name);
2564
+ }
2565
+ if (index) {
2566
+ scope.find(index);
2567
+ }
2568
+ if (this.returns) {
2569
+ rvar = scope.freeVariable('results');
2570
+ }
2571
+ ivar = (this.object && index) || scope.freeVariable('i');
2572
+ kvar = (this.range && name) || index || ivar;
2573
+ kvarAssign = kvar !== ivar ? "" + kvar + " = " : "";
2574
+ if (this.step && !this.range) {
2575
+ stepvar = scope.freeVariable("step");
2576
+ }
2577
+ if (this.pattern) {
2578
+ name = ivar;
2579
+ }
2580
+ varPart = '';
2581
+ guardPart = '';
2582
+ defPart = '';
2583
+ idt1 = this.tab + TAB;
2584
+ if (this.range) {
2585
+ forPart = source.compile(merge(o, {
2586
+ index: ivar,
2587
+ name: name,
2588
+ step: this.step
2589
+ }));
2590
+ } else {
2591
+ svar = this.source.compile(o, LEVEL_LIST);
2592
+ if ((name || this.own) && !IDENTIFIER.test(svar)) {
2593
+ defPart = "" + this.tab + (ref = scope.freeVariable('ref')) + " = " + svar + ";\n";
2594
+ svar = ref;
2595
+ }
2596
+ if (name && !this.pattern) {
2597
+ namePart = "" + name + " = " + svar + "[" + kvar + "]";
2598
+ }
2599
+ if (!this.object) {
2600
+ lvar = scope.freeVariable('len');
2601
+ forVarPart = "" + kvarAssign + ivar + " = 0, " + lvar + " = " + svar + ".length";
2602
+ if (this.step) {
2603
+ forVarPart += ", " + stepvar + " = " + (this.step.compile(o, LEVEL_OP));
2604
+ }
2605
+ stepPart = "" + kvarAssign + (this.step ? "" + ivar + " += " + stepvar : (kvar !== ivar ? "++" + ivar : "" + ivar + "++"));
2606
+ forPart = "" + forVarPart + "; " + ivar + " < " + lvar + "; " + stepPart;
2607
+ }
2608
+ }
2609
+ if (this.returns) {
2610
+ resultPart = "" + this.tab + rvar + " = [];\n";
2611
+ returnResult = "\n" + this.tab + "return " + rvar + ";";
2612
+ body.makeReturn(rvar);
2613
+ }
2614
+ if (this.guard) {
2615
+ if (body.expressions.length > 1) {
2616
+ body.expressions.unshift(new If((new Parens(this.guard)).invert(), new Literal("continue")));
2617
+ } else {
2618
+ if (this.guard) {
2619
+ body = Block.wrap([new If(this.guard, body)]);
2620
+ }
2621
+ }
2622
+ }
2623
+ if (this.pattern) {
2624
+ body.expressions.unshift(new Assign(this.name, new Literal("" + svar + "[" + kvar + "]")));
2625
+ }
2626
+ defPart += this.pluckDirectCall(o, body);
2627
+ if (namePart) {
2628
+ varPart = "\n" + idt1 + namePart + ";";
2629
+ }
2630
+ if (this.object) {
2631
+ forPart = "" + kvar + " in " + svar;
2632
+ if (this.own) {
2633
+ guardPart = "\n" + idt1 + "if (!" + (utility('hasProp')) + ".call(" + svar + ", " + kvar + ")) continue;";
2634
+ }
2635
+ }
2636
+ body = body.compile(merge(o, {
2637
+ indent: idt1
2638
+ }), LEVEL_TOP);
2639
+ if (body) {
2640
+ body = '\n' + body + '\n';
2641
+ }
2642
+ return "" + defPart + (resultPart || '') + this.tab + "for (" + forPart + ") {" + guardPart + varPart + body + this.tab + "}" + (returnResult || '');
2643
+ };
2644
+
2645
+ For.prototype.pluckDirectCall = function(o, body) {
2646
+ var base, defs, expr, fn, idx, ref, val, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
2647
+ defs = '';
2648
+ _ref2 = body.expressions;
2649
+ for (idx = _i = 0, _len = _ref2.length; _i < _len; idx = ++_i) {
2650
+ expr = _ref2[idx];
2651
+ expr = expr.unwrapAll();
2652
+ if (!(expr instanceof Call)) {
2653
+ continue;
2654
+ }
2655
+ val = expr.variable.unwrapAll();
2656
+ if (!((val instanceof Code) || (val instanceof Value && ((_ref3 = val.base) != null ? _ref3.unwrapAll() : void 0) instanceof Code && val.properties.length === 1 && ((_ref4 = (_ref5 = val.properties[0].name) != null ? _ref5.value : void 0) === 'call' || _ref4 === 'apply')))) {
2657
+ continue;
2658
+ }
2659
+ fn = ((_ref6 = val.base) != null ? _ref6.unwrapAll() : void 0) || val;
2660
+ ref = new Literal(o.scope.freeVariable('fn'));
2661
+ base = new Value(ref);
2662
+ if (val.base) {
2663
+ _ref7 = [base, val], val.base = _ref7[0], base = _ref7[1];
2664
+ }
2665
+ body.expressions[idx] = new Call(base, expr.args);
2666
+ defs += this.tab + new Assign(ref, fn).compile(o, LEVEL_TOP) + ';\n';
2667
+ }
2668
+ return defs;
2669
+ };
2670
+
2671
+ return For;
2672
+
2673
+ })(While);
2674
+
2675
+ exports.Switch = Switch = (function(_super) {
2676
+
2677
+ __extends(Switch, _super);
2678
+
2679
+ function Switch(subject, cases, otherwise) {
2680
+ this.subject = subject;
2681
+ this.cases = cases;
2682
+ this.otherwise = otherwise;
2683
+ }
2684
+
2685
+ Switch.prototype.children = ['subject', 'cases', 'otherwise'];
2686
+
2687
+ Switch.prototype.isStatement = YES;
2688
+
2689
+ Switch.prototype.jumps = function(o) {
2690
+ var block, conds, _i, _len, _ref2, _ref3, _ref4;
2691
+ if (o == null) {
2692
+ o = {
2693
+ block: true
2694
+ };
2695
+ }
2696
+ _ref2 = this.cases;
2697
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
2698
+ _ref3 = _ref2[_i], conds = _ref3[0], block = _ref3[1];
2699
+ if (block.jumps(o)) {
2700
+ return block;
2701
+ }
2702
+ }
2703
+ return (_ref4 = this.otherwise) != null ? _ref4.jumps(o) : void 0;
2704
+ };
2705
+
2706
+ Switch.prototype.makeReturn = function(res) {
2707
+ var pair, _i, _len, _ref2, _ref3;
2708
+ _ref2 = this.cases;
2709
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
2710
+ pair = _ref2[_i];
2711
+ pair[1].makeReturn(res);
2712
+ }
2713
+ if (res) {
2714
+ this.otherwise || (this.otherwise = new Block([new Literal('void 0')]));
2715
+ }
2716
+ if ((_ref3 = this.otherwise) != null) {
2717
+ _ref3.makeReturn(res);
2718
+ }
2719
+ return this;
2720
+ };
2721
+
2722
+ Switch.prototype.compileNode = function(o) {
2723
+ var block, body, code, cond, conditions, expr, i, idt1, idt2, _i, _j, _len, _len1, _ref2, _ref3, _ref4, _ref5;
2724
+ idt1 = o.indent + TAB;
2725
+ idt2 = o.indent = idt1 + TAB;
2726
+ code = this.tab + ("switch (" + (((_ref2 = this.subject) != null ? _ref2.compile(o, LEVEL_PAREN) : void 0) || false) + ") {\n");
2727
+ _ref3 = this.cases;
2728
+ for (i = _i = 0, _len = _ref3.length; _i < _len; i = ++_i) {
2729
+ _ref4 = _ref3[i], conditions = _ref4[0], block = _ref4[1];
2730
+ _ref5 = flatten([conditions]);
2731
+ for (_j = 0, _len1 = _ref5.length; _j < _len1; _j++) {
2732
+ cond = _ref5[_j];
2733
+ if (!this.subject) {
2734
+ cond = cond.invert();
2735
+ }
2736
+ code += idt1 + ("case " + (cond.compile(o, LEVEL_PAREN)) + ":\n");
2737
+ }
2738
+ if (body = block.compile(o, LEVEL_TOP)) {
2739
+ code += body + '\n';
2740
+ }
2741
+ if (i === this.cases.length - 1 && !this.otherwise) {
2742
+ break;
2743
+ }
2744
+ expr = this.lastNonComment(block.expressions);
2745
+ if (expr instanceof Return || (expr instanceof Literal && expr.jumps() && expr.value !== 'debugger')) {
2746
+ continue;
2747
+ }
2748
+ code += idt2 + 'break;\n';
2749
+ }
2750
+ if (this.otherwise && this.otherwise.expressions.length) {
2751
+ code += idt1 + ("default:\n" + (this.otherwise.compile(o, LEVEL_TOP)) + "\n");
2752
+ }
2753
+ return code + this.tab + '}';
2754
+ };
2755
+
2756
+ return Switch;
2757
+
2758
+ })(Base);
2759
+
2760
+ exports.If = If = (function(_super) {
2761
+
2762
+ __extends(If, _super);
2763
+
2764
+ function If(condition, body, options) {
2765
+ this.body = body;
2766
+ if (options == null) {
2767
+ options = {};
2768
+ }
2769
+ this.condition = options.type === 'unless' ? condition.invert() : condition;
2770
+ this.elseBody = null;
2771
+ this.isChain = false;
2772
+ this.soak = options.soak;
2773
+ }
2774
+
2775
+ If.prototype.children = ['condition', 'body', 'elseBody'];
2776
+
2777
+ If.prototype.bodyNode = function() {
2778
+ var _ref2;
2779
+ return (_ref2 = this.body) != null ? _ref2.unwrap() : void 0;
2780
+ };
2781
+
2782
+ If.prototype.elseBodyNode = function() {
2783
+ var _ref2;
2784
+ return (_ref2 = this.elseBody) != null ? _ref2.unwrap() : void 0;
2785
+ };
2786
+
2787
+ If.prototype.addElse = function(elseBody) {
2788
+ if (this.isChain) {
2789
+ this.elseBodyNode().addElse(elseBody);
2790
+ } else {
2791
+ this.isChain = elseBody instanceof If;
2792
+ this.elseBody = this.ensureBlock(elseBody);
2793
+ }
2794
+ return this;
2795
+ };
2796
+
2797
+ If.prototype.isStatement = function(o) {
2798
+ var _ref2;
2799
+ return (o != null ? o.level : void 0) === LEVEL_TOP || this.bodyNode().isStatement(o) || ((_ref2 = this.elseBodyNode()) != null ? _ref2.isStatement(o) : void 0);
2800
+ };
2801
+
2802
+ If.prototype.jumps = function(o) {
2803
+ var _ref2;
2804
+ return this.body.jumps(o) || ((_ref2 = this.elseBody) != null ? _ref2.jumps(o) : void 0);
2805
+ };
2806
+
2807
+ If.prototype.compileNode = function(o) {
2808
+ if (this.isStatement(o)) {
2809
+ return this.compileStatement(o);
2810
+ } else {
2811
+ return this.compileExpression(o);
2812
+ }
2813
+ };
2814
+
2815
+ If.prototype.makeReturn = function(res) {
2816
+ if (res) {
2817
+ this.elseBody || (this.elseBody = new Block([new Literal('void 0')]));
2818
+ }
2819
+ this.body && (this.body = new Block([this.body.makeReturn(res)]));
2820
+ this.elseBody && (this.elseBody = new Block([this.elseBody.makeReturn(res)]));
2821
+ return this;
2822
+ };
2823
+
2824
+ If.prototype.ensureBlock = function(node) {
2825
+ if (node instanceof Block) {
2826
+ return node;
2827
+ } else {
2828
+ return new Block([node]);
2829
+ }
2830
+ };
2831
+
2832
+ If.prototype.compileStatement = function(o) {
2833
+ var body, child, cond, exeq, ifPart;
2834
+ child = del(o, 'chainChild');
2835
+ exeq = del(o, 'isExistentialEquals');
2836
+ if (exeq) {
2837
+ return new If(this.condition.invert(), this.elseBodyNode(), {
2838
+ type: 'if'
2839
+ }).compile(o);
2840
+ }
2841
+ cond = this.condition.compile(o, LEVEL_PAREN);
2842
+ o.indent += TAB;
2843
+ body = this.ensureBlock(this.body);
2844
+ ifPart = "if (" + cond + ") {\n" + (body.compile(o)) + "\n" + this.tab + "}";
2845
+ if (!child) {
2846
+ ifPart = this.tab + ifPart;
2847
+ }
2848
+ if (!this.elseBody) {
2849
+ return ifPart;
2850
+ }
2851
+ return ifPart + ' else ' + (this.isChain ? (o.indent = this.tab, o.chainChild = true, this.elseBody.unwrap().compile(o, LEVEL_TOP)) : "{\n" + (this.elseBody.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}");
2852
+ };
2853
+
2854
+ If.prototype.compileExpression = function(o) {
2855
+ var alt, body, code, cond;
2856
+ cond = this.condition.compile(o, LEVEL_COND);
2857
+ body = this.bodyNode().compile(o, LEVEL_LIST);
2858
+ alt = this.elseBodyNode() ? this.elseBodyNode().compile(o, LEVEL_LIST) : 'void 0';
2859
+ code = "" + cond + " ? " + body + " : " + alt;
2860
+ if (o.level >= LEVEL_COND) {
2861
+ return "(" + code + ")";
2862
+ } else {
2863
+ return code;
2864
+ }
2865
+ };
2866
+
2867
+ If.prototype.unfoldSoak = function() {
2868
+ return this.soak && this;
2869
+ };
2870
+
2871
+ return If;
2872
+
2873
+ })(Base);
2874
+
2875
+ Closure = {
2876
+ wrap: function(expressions, statement, noReturn) {
2877
+ var args, call, func, mentionsArgs, meth;
2878
+ if (expressions.jumps()) {
2879
+ return expressions;
2880
+ }
2881
+ func = new Code([], Block.wrap([expressions]));
2882
+ args = [];
2883
+ if ((mentionsArgs = expressions.contains(this.literalArgs)) || expressions.contains(this.literalThis)) {
2884
+ meth = new Literal(mentionsArgs ? 'apply' : 'call');
2885
+ args = [new Literal('this')];
2886
+ if (mentionsArgs) {
2887
+ args.push(new Literal('arguments'));
2888
+ }
2889
+ func = new Value(func, [new Access(meth)]);
2890
+ }
2891
+ func.noReturn = noReturn;
2892
+ call = new Call(func, args);
2893
+ if (statement) {
2894
+ return Block.wrap([call]);
2895
+ } else {
2896
+ return call;
2897
+ }
2898
+ },
2899
+ literalArgs: function(node) {
2900
+ return node instanceof Literal && node.value === 'arguments' && !node.asKey;
2901
+ },
2902
+ literalThis: function(node) {
2903
+ return (node instanceof Literal && node.value === 'this' && !node.asKey) || (node instanceof Code && node.bound) || (node instanceof Call && node.isSuper);
2904
+ }
2905
+ };
2906
+
2907
+ unfoldSoak = function(o, parent, name) {
2908
+ var ifn;
2909
+ if (!(ifn = parent[name].unfoldSoak(o))) {
2910
+ return;
2911
+ }
2912
+ parent[name] = ifn.body;
2913
+ ifn.body = new Value(parent);
2914
+ return ifn;
2915
+ };
2916
+
2917
+ UTILITIES = {
2918
+ "extends": function() {
2919
+ return "function(child, parent) { for (var key in parent) { if (" + (utility('hasProp')) + ".call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }";
2920
+ },
2921
+ bind: function() {
2922
+ return 'function(fn, me){ return function(){ return fn.apply(me, arguments); }; }';
2923
+ },
2924
+ indexOf: function() {
2925
+ return "[].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }";
2926
+ },
2927
+ hasProp: function() {
2928
+ return '{}.hasOwnProperty';
2929
+ },
2930
+ slice: function() {
2931
+ return '[].slice';
2932
+ }
2933
+ };
2934
+
2935
+ LEVEL_TOP = 1;
2936
+
2937
+ LEVEL_PAREN = 2;
2938
+
2939
+ LEVEL_LIST = 3;
2940
+
2941
+ LEVEL_COND = 4;
2942
+
2943
+ LEVEL_OP = 5;
2944
+
2945
+ LEVEL_ACCESS = 6;
2946
+
2947
+ TAB = ' ';
2948
+
2949
+ IDENTIFIER_STR = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*";
2950
+
2951
+ IDENTIFIER = RegExp("^" + IDENTIFIER_STR + "$");
2952
+
2953
+ SIMPLENUM = /^[+-]?\d+$/;
2954
+
2955
+ METHOD_DEF = RegExp("^(?:(" + IDENTIFIER_STR + ")\\.prototype(?:\\.(" + IDENTIFIER_STR + ")|\\[(\"(?:[^\\\\\"\\r\\n]|\\\\.)*\"|'(?:[^\\\\'\\r\\n]|\\\\.)*')\\]|\\[(0x[\\da-fA-F]+|\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\]))|(" + IDENTIFIER_STR + ")$");
2956
+
2957
+ IS_STRING = /^['"]/;
2958
+
2959
+ utility = function(name) {
2960
+ var ref;
2961
+ ref = "__" + name;
2962
+ Scope.root.assign(ref, UTILITIES[name]());
2963
+ return ref;
2964
+ };
2965
+
2966
+ multident = function(code, tab) {
2967
+ code = code.replace(/\n/g, '$&' + tab);
2968
+ return code.replace(/\s+$/, '');
2969
+ };
2970
+
2971
+ }).call(this);