gollum 3.1.2 → 3.1.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of gollum might be problematic. Click here for more details.

Files changed (911) hide show
  1. checksums.yaml +13 -5
  2. data/README.md +4 -5
  3. data/gollum.gemspec +560 -28
  4. data/lib/gollum.rb +1 -1
  5. data/lib/gollum/app.rb +16 -10
  6. data/lib/gollum/public/gollum/javascript/editor/gollum.editor.js +1 -1
  7. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ace.js +33 -11
  8. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/anchor.js +77 -80
  9. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/anchor_test.js +46 -0
  10. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete.js +497 -0
  11. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete/popup.js +341 -0
  12. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete/text_completer.js +78 -0
  13. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete/util.js +74 -0
  14. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer.js +28 -32
  15. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer_test.js +5 -5
  16. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager.js +17 -20
  17. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager_test.js +1 -1
  18. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/default_commands.js +312 -58
  19. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/incremental_search_commands.js +232 -0
  20. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/multi_select_commands.js +17 -1
  21. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/occur_commands.js +110 -0
  22. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/config.js +70 -7
  23. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/config_test.js +67 -3
  24. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/css/editor.css +123 -69
  25. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/document.js +118 -71
  26. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session.js +507 -392
  27. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/bracket_match.js +4 -2
  28. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold.js +37 -5
  29. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold_line.js +30 -29
  30. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/folding.js +210 -102
  31. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session_test.js +82 -8
  32. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor.js +1006 -465
  33. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_highlight_selected_word_test.js +2 -2
  34. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_text_edit_test.js +36 -34
  35. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/beautify.js +57 -0
  36. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/beautify/php_rules.js +366 -0
  37. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/chromevox.js +980 -0
  38. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/elastic_tabstops_lite.js +319 -0
  39. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/emmet.js +434 -0
  40. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/error_marker.js +214 -0
  41. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/keybinding_menu.js +86 -0
  42. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/language_tools.js +226 -0
  43. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/linking.js +78 -0
  44. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/add_editor_menu_options.js +109 -0
  45. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/element_generator.js +148 -0
  46. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/generate_settings_menu.js +264 -0
  47. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/get_editor_keyboard_shortcuts.js +91 -0
  48. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/get_set_functions.js +141 -0
  49. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/overlay_page.js +116 -0
  50. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/settings_menu.css +48 -0
  51. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/modelist.js +195 -0
  52. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/old_ie.js +114 -0
  53. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/old_ie_test.js +77 -0
  54. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/searchbox.css +153 -0
  55. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/searchbox.js +308 -0
  56. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/settings_menu.js +76 -0
  57. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/spellcheck.js +69 -0
  58. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/{keyboard/vim/registers.js → ext/split.js} +8 -10
  59. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static.css +18 -9
  60. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight.js +128 -26
  61. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight_test.js +56 -36
  62. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/statusbar.js +48 -0
  63. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/textarea.js +112 -117
  64. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/themelist.js +100 -0
  65. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/whitespace.js +213 -0
  66. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/whitespace_test.js +116 -0
  67. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/incremental_search.js +317 -0
  68. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/incremental_search_test.js +213 -0
  69. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs.js +369 -92
  70. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs_test.js +151 -0
  71. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/hash_handler.js +109 -41
  72. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding.js +35 -24
  73. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding_test.js +69 -0
  74. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/state_handler.js +1 -2
  75. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/textarea.js +82 -0
  76. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/textinput.js +337 -208
  77. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim.js +5987 -120
  78. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim_test.js +3866 -0
  79. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/cursor.js +48 -25
  80. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/font_metrics.js +176 -0
  81. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/gutter.js +110 -44
  82. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/marker.js +29 -14
  83. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/text.js +69 -150
  84. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/text_test.js +11 -10
  85. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/app_config.js +157 -0
  86. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/dom.js +33 -31
  87. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/es5-shim.js +284 -304
  88. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/event.js +147 -95
  89. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter.js +64 -23
  90. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/keys.js +35 -9
  91. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/lang.js +30 -13
  92. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/net.js +21 -39
  93. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/oop.js +12 -9
  94. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/useragent.js +8 -4
  95. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/line_widgets.js +297 -0
  96. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/Readme.md +9 -0
  97. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/highlight_rules_test.js +210 -0
  98. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_asciidoc.txt +111 -0
  99. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_coffee.txt +57 -0
  100. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_curly.txt +9 -0
  101. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_html.txt +10 -0
  102. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_javascript.txt +34 -0
  103. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_livescript.txt +1 -0
  104. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_lucene.txt +16 -0
  105. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_markdown.txt +22 -0
  106. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_php.txt +24 -0
  107. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_ruby.txt +34 -0
  108. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_xml.txt +7 -0
  109. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_abap.json +189 -0
  110. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_abc.json +2207 -0
  111. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_actionscript.json +263 -0
  112. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ada.json +39 -0
  113. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_asciidoc.json +422 -0
  114. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_assembly_x86.json +114 -0
  115. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_autohotkey.json +261 -0
  116. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_batchfile.json +70 -0
  117. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c9search.json +131 -175
  118. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c_cpp.json +190 -124
  119. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_cirru.json +267 -0
  120. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_clojure.json +162 -248
  121. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_cobol.json +4 -0
  122. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coffee.json +545 -188
  123. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coldfusion.json +26 -41
  124. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_csharp.json +31 -42
  125. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_css.json +148 -231
  126. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_curly.json +56 -0
  127. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_d.json +111 -0
  128. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_dart.json +368 -0
  129. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_diff.json +262 -732
  130. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_dot.json +2254 -0
  131. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_eiffel.json +141 -0
  132. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ejs.json +296 -0
  133. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_elixir.json +196 -0
  134. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_elm.json +198 -0
  135. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_erlang.json +166 -0
  136. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_forth.json +219 -0
  137. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ftl.json +341 -0
  138. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_gcode.json +296 -0
  139. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_gherkin.json +142 -0
  140. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_gitignore.json +33 -0
  141. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_glsl.json +127 -185
  142. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_golang.json +256 -362
  143. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_groovy.json +410 -529
  144. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haml.json +174 -0
  145. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_handlebars.json +81 -0
  146. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haskell.json +156 -0
  147. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haxe.json +143 -195
  148. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_html.json +63 -150
  149. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_html_ruby.json +257 -0
  150. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ini.json +23 -0
  151. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_io.json +49 -0
  152. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jack.json +1786 -0
  153. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jade.json +188 -0
  154. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_java.json +95 -139
  155. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_javascript.json +593 -555
  156. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_json.json +412 -611
  157. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsoniq.json +4 -0
  158. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsp.json +435 -0
  159. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsx.json +51 -79
  160. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_julia.json +111 -0
  161. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_latex.json +127 -196
  162. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_less.json +204 -292
  163. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_liquid.json +551 -698
  164. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lisp.json +248 -0
  165. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_livescript.json +6 -0
  166. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_logiql.json +190 -0
  167. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lsl.json +503 -0
  168. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lua.json +348 -451
  169. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_luapage.json +633 -824
  170. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lucene.json +92 -0
  171. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_markdown.json +114 -1202
  172. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mask.json +302 -0
  173. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_matlab.json +90 -0
  174. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mel.json +257 -0
  175. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mushcode.json +790 -0
  176. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mysql.json +4 -0
  177. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_nix.json +360 -0
  178. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_objectivec.json +793 -0
  179. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ocaml.json +200 -260
  180. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_pascal.json +297 -0
  181. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_perl.json +227 -311
  182. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_pgsql.json +889 -1020
  183. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_php.json +171 -238
  184. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_powershell.json +184 -255
  185. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_prolog.json +245 -0
  186. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_properties.json +68 -0
  187. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_protobuf.json +136 -0
  188. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_python.json +152 -205
  189. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_r.json +235 -0
  190. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_rdoc.json +441 -0
  191. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_rhtml.json +106 -0
  192. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ruby.json +242 -104
  193. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_rust.json +136 -0
  194. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sass.json +229 -0
  195. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scad.json +194 -267
  196. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scala.json +542 -748
  197. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scheme.json +216 -0
  198. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scss.json +123 -181
  199. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sh.json +334 -434
  200. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sjs.json +276 -0
  201. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_smarty.json +98 -0
  202. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_snippets.json +159 -0
  203. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_soy_template.json +286 -0
  204. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_space.json +322 -0
  205. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sql.json +54 -73
  206. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_stylus.json +271 -0
  207. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_svg.json +684 -931
  208. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_tcl.json +385 -536
  209. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_tex.json +130 -0
  210. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_text.json +29 -58
  211. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_textile.json +113 -195
  212. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_toml.json +131 -0
  213. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_twig.json +288 -0
  214. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_typescript.json +559 -0
  215. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_vala.json +158 -0
  216. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_vbscript.json +205 -0
  217. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_velocity.json +285 -0
  218. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_verilog.json +113 -0
  219. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_vhdl.json +271 -0
  220. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xml.json +43 -705
  221. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xquery.json +44 -64
  222. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_yaml.json +150 -260
  223. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abap.js +2 -2
  224. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abap_highlight_rules.js +7 -6
  225. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abc.js +58 -0
  226. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abc_highlight_rules.js +114 -0
  227. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/actionscript.js +58 -0
  228. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/actionscript_highlight_rules.js +141 -0
  229. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ada.js +54 -0
  230. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ada_highlight_rules.js +93 -0
  231. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/apache_conf.js +62 -0
  232. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/apache_conf_highlight_rules.js +231 -0
  233. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/applescript.js +55 -0
  234. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/applescript_highlight_rules.js +139 -0
  235. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc.js +3 -3
  236. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc_highlight_rules.js +11 -11
  237. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/assembly_x86.js +56 -0
  238. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/assembly_x86_highlight_rules.js +114 -0
  239. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/autohotkey.js +57 -0
  240. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/autohotkey_highlight_rules.js +107 -0
  241. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/batchfile.js +61 -0
  242. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/batchfile_highlight_rules.js +97 -0
  243. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/behaviour_test.js +139 -0
  244. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/css.js +108 -0
  245. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/cstyle.js +164 -137
  246. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/html.js +4 -48
  247. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xml.js +141 -44
  248. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xquery.js +76 -52
  249. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c9search.js +2 -2
  250. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c9search_highlight_rules.js +127 -4
  251. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp.js +7 -30
  252. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp_highlight_rules.js +60 -51
  253. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cirru.js +51 -0
  254. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cirru_highlight_rules.js +125 -0
  255. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/clojure.js +62 -46
  256. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/clojure_highlight_rules.js +4 -21
  257. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cobol.js +53 -0
  258. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cobol_highlight_rules.js +100 -0
  259. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee.js +28 -7
  260. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/coffee-script.js +13 -7
  261. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/helpers.js +160 -4
  262. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/lexer.js +228 -108
  263. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/nodes.js +778 -670
  264. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser.js +377 -347
  265. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser_test.js +33 -6
  266. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/rewriter.js +275 -135
  267. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/scope.js +5 -4
  268. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules.js +72 -167
  269. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_worker.js +12 -24
  270. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion.js +11 -14
  271. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_highlight_rules.js +5 -84
  272. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_test.js +3 -3
  273. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/csharp.js +7 -4
  274. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js +13 -10
  275. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css.js +7 -6
  276. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css/csslint.js +2325 -1216
  277. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules.js +72 -102
  278. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css_test.js +2 -2
  279. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker.js +11 -5
  280. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/curly.js +63 -0
  281. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/curly_highlight_rules.js +66 -0
  282. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/d.js +56 -0
  283. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/d_highlight_rules.js +334 -0
  284. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dart.js +8 -8
  285. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dart_highlight_rules.js +70 -76
  286. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/diff.js +2 -2
  287. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/diff_highlight_rules.js +24 -18
  288. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/django.js +119 -0
  289. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/doc_comment_highlight_rules.js +12 -19
  290. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dockerfile.js +52 -0
  291. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dockerfile_highlight_rules.js +57 -0
  292. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dot.js +55 -0
  293. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dot_highlight_rules.js +126 -0
  294. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/eiffel.js +52 -0
  295. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/eiffel_highlight_rules.js +136 -0
  296. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ejs.js +109 -0
  297. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/elixir.js +58 -0
  298. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/elixir_highlight_rules.js +433 -0
  299. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/elm.js +58 -0
  300. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/elm_highlight_rules.js +162 -0
  301. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/erlang.js +57 -0
  302. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/erlang_highlight_rules.js +876 -0
  303. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/c9search.js +12 -6
  304. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/csharp.js +137 -0
  305. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle.js +118 -6
  306. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle_test.js +24 -0
  307. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/fold_mode.js +1 -1
  308. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html.js +2 -33
  309. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html_test.js +30 -6
  310. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/ini.js +80 -0
  311. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/latex.js +9 -9
  312. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/lua.js +4 -4
  313. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/mixed.js +2 -0
  314. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/velocity.js +120 -0
  315. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml.js +110 -87
  316. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/forth.js +58 -0
  317. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/forth_highlight_rules.js +164 -0
  318. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ftl.js +49 -0
  319. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ftl_highlight_rules.js +195 -0
  320. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/gcode.js +51 -0
  321. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/gcode_highlight_rules.js +94 -0
  322. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/gherkin.js +80 -0
  323. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/gherkin_highlight_rules.js +113 -0
  324. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/gitignore.js +20 -0
  325. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/gitignore_highlight_rules.js +31 -0
  326. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/glsl.js +6 -2
  327. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/golang.js +42 -67
  328. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/golang_highlight_rules.js +25 -39
  329. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/groovy.js +2 -2
  330. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/groovy_highlight_rules.js +0 -2
  331. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haml.js +5 -6
  332. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haml_highlight_rules.js +43 -43
  333. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/handlebars.js +29 -0
  334. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/handlebars_highlight_rules.js +72 -0
  335. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haskell.js +62 -0
  336. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haskell_highlight_rules.js +246 -0
  337. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haxe.js +7 -4
  338. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haxe_highlight_rules.js +0 -2
  339. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html.js +42 -12
  340. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html/saxparser.js +10430 -0
  341. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_completions.js +305 -0
  342. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules.js +43 -85
  343. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_ruby.js +59 -0
  344. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_ruby_highlight_rules.js +84 -0
  345. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_test.js +3 -3
  346. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/{lib/browser_focus.js → mode/html_worker.js} +48 -51
  347. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ini.js +53 -0
  348. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ini_highlight_rules.js +112 -0
  349. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/io.js +58 -0
  350. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/io_highlight_rules.js +120 -0
  351. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jack.js +79 -0
  352. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jack_highlight_rules.js +142 -0
  353. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jade.js +4 -5
  354. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jade_highlight_rules.js +94 -100
  355. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/java.js +2 -3
  356. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/java_highlight_rules.js +0 -5
  357. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript.js +15 -40
  358. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript/jshint.js +10824 -4816
  359. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules.js +113 -97
  360. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_test.js +61 -6
  361. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker.js +5 -7
  362. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker_test.js +11 -2
  363. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/js_regex_highlight_rules.js +94 -0
  364. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json.js +5 -5
  365. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json_highlight_rules.js +3 -6
  366. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker.js +6 -35
  367. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker_test.js +12 -11
  368. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsoniq.js +203 -0
  369. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsp.js +2 -3
  370. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsp_highlight_rules.js +36 -30
  371. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsx.js +26 -23
  372. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsx_highlight_rules.js +113 -115
  373. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/julia.js +62 -0
  374. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/julia_highlight_rules.js +170 -0
  375. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/latex.js +5 -37
  376. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/latex_highlight_rules.js +44 -9
  377. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/less.js +8 -3
  378. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/less_highlight_rules.js +2 -2
  379. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/liquid.js +4 -31
  380. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules.js +15 -89
  381. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lisp.js +5 -9
  382. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lisp_highlight_rules.js +25 -28
  383. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/livescript.js +246 -0
  384. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/logiql.js +139 -0
  385. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/logiql_highlight_rules.js +119 -0
  386. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/logiql_test.js +98 -0
  387. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lsl.js +92 -0
  388. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lsl_highlight_rules.js +123 -0
  389. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lua.js +27 -6
  390. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lua/luaparse.js +1989 -0
  391. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lua_highlight_rules.js +55 -272
  392. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lua_worker.js +70 -0
  393. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/luapage.js +6 -4
  394. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/luapage_highlight_rules.js +21 -14
  395. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lucene.js +5 -2
  396. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/makefile.js +6 -10
  397. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/makefile_highlight_rules.js +22 -22
  398. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/markdown.js +12 -11
  399. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules.js +130 -89
  400. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mask.js +84 -0
  401. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mask_highlight_rules.js +309 -0
  402. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/matching_brace_outdent.js +1 -6
  403. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/matlab.js +55 -0
  404. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/matlab_highlight_rules.js +262 -0
  405. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mel.js +56 -0
  406. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mel_highlight_rules.js +133 -0
  407. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mushcode.js +116 -0
  408. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mushcode_highlight_rules.js +569 -0
  409. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mysql.js +51 -0
  410. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mysql_highlight_rules.js +122 -0
  411. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/nix.js +62 -0
  412. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/nix_highlight_rules.js +119 -0
  413. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/objectivec.js +4 -5
  414. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/objectivec_highlight_rules.js +137 -149
  415. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml.js +4 -3
  416. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml_highlight_rules.js +0 -4
  417. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/pascal.js +67 -0
  418. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/pascal_highlight_rules.js +127 -0
  419. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/perl.js +10 -30
  420. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/perl_highlight_rules.js +17 -7
  421. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql.js +23 -51
  422. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql_highlight_rules.js +334 -302
  423. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/php.js +59 -38
  424. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/php/php.js +5031 -0
  425. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/php_highlight_rules.js +72 -52
  426. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/php_test.js +65 -0
  427. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/php_worker.js +77 -0
  428. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/plain_text.js +55 -0
  429. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/{keyboard/vim/maps/aliases.js → mode/plain_text_test.js} +21 -59
  430. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/powershell.js +7 -4
  431. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/powershell_highlight_rules.js +0 -3
  432. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/{xquery/JSONParseTreeHandler.js → praat.js} +45 -53
  433. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/praat_highlight_rules.js +262 -0
  434. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/prolog.js +62 -0
  435. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/prolog_highlight_rules.js +238 -0
  436. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/properties.js +48 -0
  437. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/properties_highlight_rules.js +86 -0
  438. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/protobuf.js +63 -0
  439. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/protobuf_highlight_rules.js +66 -0
  440. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/python.js +5 -31
  441. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/python_highlight_rules.js +50 -24
  442. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/r.js +37 -18
  443. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/r_highlight_rules.js +29 -11
  444. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rdoc.js +36 -11
  445. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rdoc_highlight_rules.js +27 -7
  446. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rhtml.js +31 -11
  447. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rhtml_highlight_rules.js +31 -14
  448. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ruby.js +26 -36
  449. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules.js +153 -33
  450. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/{css_highlight_rules_test.js → ruby_test.js} +24 -39
  451. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rust.js +58 -0
  452. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rust_highlight_rules.js +158 -0
  453. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sass.js +52 -0
  454. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sass_highlight_rules.js +79 -0
  455. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scad.js +5 -30
  456. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scad_highlight_rules.js +0 -4
  457. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scala.js +2 -2
  458. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scala_highlight_rules.js +1 -6
  459. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scheme.js +56 -0
  460. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scheme_highlight_rules.js +123 -0
  461. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scss.js +9 -4
  462. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scss_highlight_rules.js +7 -8
  463. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sh.js +10 -31
  464. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sh_highlight_rules.js +85 -11
  465. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sjs.js +56 -0
  466. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sjs_highlight_rules.js +233 -0
  467. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/smarty.js +51 -0
  468. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/smarty_highlight_rules.js +139 -0
  469. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/snippets.js +113 -0
  470. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/soy_template.js +60 -0
  471. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/soy_template_highlight_rules.js +356 -0
  472. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/space.js +21 -0
  473. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/space_highlight_rules.js +56 -0
  474. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sql.js +3 -30
  475. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sql_highlight_rules.js +6 -1
  476. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/stylus.js +5 -5
  477. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/stylus_highlight_rules.js +32 -42
  478. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/svg.js +3 -5
  479. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/svg_highlight_rules.js +3 -18
  480. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/tcl.js +4 -30
  481. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/tcl_highlight_rules.js +5 -13
  482. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/tex.js +30 -10
  483. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/tex_highlight_rules.js +27 -7
  484. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/text.js +266 -29
  485. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/text_highlight_rules.js +129 -15
  486. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/text_test.js +2 -2
  487. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/textile.js +3 -2
  488. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/toml.js +56 -0
  489. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/toml_highlight_rules.js +103 -0
  490. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/twig.js +81 -0
  491. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/twig_highlight_rules.js +166 -0
  492. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/typescript.js +2 -8
  493. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/typescript_highlight_rules.js +16 -16
  494. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/vala.js +105 -0
  495. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/vala_highlight_rules.js +457 -0
  496. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/vbscript.js +60 -0
  497. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/vbscript_highlight_rules.js +246 -0
  498. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/velocity.js +58 -0
  499. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/velocity_highlight_rules.js +177 -0
  500. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/verilog.js +54 -0
  501. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/verilog_highlight_rules.js +101 -0
  502. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/vhdl.js +52 -0
  503. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/vhdl_highlight_rules.js +115 -0
  504. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml.js +25 -8
  505. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml/dom-parser.js +260 -0
  506. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml/dom.js +1138 -0
  507. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml/sax.js +592 -0
  508. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules.js +185 -45
  509. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_test.js +3 -3
  510. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_worker.js +92 -0
  511. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery.js +107 -88
  512. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/Readme.md +1 -6
  513. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/jsoniq_lexer.js +4453 -0
  514. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/xqlint.js +78911 -0
  515. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/xquery_lexer.js +4422 -0
  516. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_worker.js +66 -29
  517. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/yaml.js +5 -3
  518. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/yaml_highlight_rules.js +2 -13
  519. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/default_gutter_handler.js +50 -28
  520. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/default_handlers.js +70 -137
  521. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/dragdrop_handler.js +428 -0
  522. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/fold_handler.js +6 -23
  523. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_event.js +6 -9
  524. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_handler.js +83 -39
  525. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/{mode/liquid_highlight_rules_test.js → mouse/mouse_handler_test.js} +27 -34
  526. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/multi_select_handler.js +94 -38
  527. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/multi_select.js +192 -115
  528. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/multi_select_test.js +124 -18
  529. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/occur.js +193 -0
  530. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/occur_test.js +154 -0
  531. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/placeholder.js +9 -4
  532. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/placeholder_test.js +2 -1
  533. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/range.js +81 -102
  534. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/range_list.js +38 -21
  535. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/range_list_test.js +20 -1
  536. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/range_test.js +1 -1
  537. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/renderloop.js +1 -1
  538. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/requirejs/text.js +9 -8
  539. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/requirejs/text_build.js +60 -0
  540. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/scrollbar.js +163 -32
  541. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/search.js +38 -19
  542. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/search_highlight.js +1 -3
  543. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/search_test.js +33 -0
  544. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/selection.js +167 -83
  545. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/selection_test.js +22 -7
  546. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets.js +949 -0
  547. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/_.snippets +240 -0
  548. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/_all_modes.js +7 -0
  549. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/_all_modes.snippets +0 -0
  550. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/abap.js +7 -0
  551. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/abap.snippets +0 -0
  552. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/abc.js +7 -0
  553. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/abc.snippets +31 -0
  554. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/actionscript.js +7 -0
  555. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/actionscript.snippets +157 -0
  556. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ada.js +7 -0
  557. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ada.snippets +0 -0
  558. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/all_modes.js +7 -0
  559. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/all_modes.snippets +0 -0
  560. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/apache.snippets +35 -0
  561. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/apache_conf.js +7 -0
  562. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/apache_conf.snippets +0 -0
  563. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/applescript.js +7 -0
  564. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/applescript.snippets +0 -0
  565. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/asciidoc.js +7 -0
  566. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/asciidoc.snippets +0 -0
  567. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/assembly_x86.js +7 -0
  568. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/assembly_x86.snippets +0 -0
  569. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/autohotkey.js +7 -0
  570. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/autohotkey.snippets +0 -0
  571. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/autoit.snippets +66 -0
  572. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/batchfile.js +7 -0
  573. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/batchfile.snippets +0 -0
  574. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/c.snippets +235 -0
  575. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/c9search.js +7 -0
  576. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/c9search.snippets +0 -0
  577. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/c_cpp.js +7 -0
  578. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/c_cpp.snippets +131 -0
  579. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/chef.snippets +204 -0
  580. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/cirru.js +7 -0
  581. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/cirru.snippets +0 -0
  582. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/clojure.js +7 -0
  583. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/clojure.snippets +90 -0
  584. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/cmake.snippets +58 -0
  585. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/cobol.js +7 -0
  586. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/cobol.snippets +0 -0
  587. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/coffee.js +7 -0
  588. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/coffee.snippets +95 -0
  589. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/coldfusion.js +7 -0
  590. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/coldfusion.snippets +0 -0
  591. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/cs.snippets +374 -0
  592. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/csharp.js +7 -0
  593. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/csharp.snippets +0 -0
  594. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/css.js +7 -0
  595. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/css.snippets +967 -0
  596. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/curly.js +7 -0
  597. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/curly.snippets +0 -0
  598. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/d.js +7 -0
  599. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/d.snippets +0 -0
  600. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dart.js +7 -0
  601. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dart.snippets +83 -0
  602. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/diff.js +7 -0
  603. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/diff.snippets +11 -0
  604. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/django.js +7 -0
  605. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/django.snippets +108 -0
  606. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dockerfile.js +7 -0
  607. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dockerfile.snippets +0 -0
  608. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dot.js +7 -0
  609. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dot.snippets +0 -0
  610. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dummy.js +7 -0
  611. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dummy_syntax.js +7 -0
  612. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/eiffel.js +7 -0
  613. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/eiffel.snippets +0 -0
  614. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ejs.js +7 -0
  615. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ejs.snippets +0 -0
  616. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/elixir.js +7 -0
  617. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/elixir.snippets +0 -0
  618. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/elm.js +7 -0
  619. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/elm.snippets +0 -0
  620. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/erlang.js +7 -0
  621. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/erlang.snippets +160 -0
  622. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/eruby.snippets +113 -0
  623. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/falcon.snippets +71 -0
  624. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/forth.js +7 -0
  625. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/forth.snippets +0 -0
  626. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ftl.js +7 -0
  627. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ftl.snippets +0 -0
  628. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/gcode.js +7 -0
  629. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/gcode.snippets +0 -0
  630. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/gherkin.js +7 -0
  631. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/gherkin.snippets +0 -0
  632. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/gitignore.js +7 -0
  633. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/gitignore.snippets +0 -0
  634. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/glsl.js +7 -0
  635. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/glsl.snippets +0 -0
  636. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/go.snippets +201 -0
  637. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/golang.js +7 -0
  638. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/golang.snippets +0 -0
  639. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/groovy.js +7 -0
  640. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/groovy.snippets +0 -0
  641. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/haml.js +7 -0
  642. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/haml.snippets +20 -0
  643. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/handlebars.js +7 -0
  644. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/handlebars.snippets +0 -0
  645. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/haskell.js +7 -0
  646. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/haskell.snippets +82 -0
  647. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/haxe.js +7 -0
  648. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/haxe.snippets +0 -0
  649. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/html.js +7 -0
  650. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/html.snippets +828 -0
  651. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/html_ruby.js +7 -0
  652. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/html_ruby.snippets +0 -0
  653. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/htmldjango.snippets +136 -0
  654. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/htmltornado.snippets +55 -0
  655. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ini.js +7 -0
  656. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ini.snippets +0 -0
  657. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/io.js +69 -0
  658. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/io.snippets +0 -0
  659. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jack.js +7 -0
  660. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jack.snippets +0 -0
  661. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jade.js +7 -0
  662. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jade.snippets +0 -0
  663. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/java.js +7 -0
  664. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/java.snippets +240 -0
  665. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/javascript-jquery.snippets +589 -0
  666. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/javascript.js +7 -0
  667. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/javascript.snippets +195 -0
  668. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/json.js +7 -0
  669. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/json.snippets +0 -0
  670. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsoniq.js +7 -0
  671. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsoniq.snippets +61 -0
  672. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsp.js +7 -0
  673. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsp.snippets +99 -0
  674. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsx.js +7 -0
  675. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsx.snippets +0 -0
  676. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/julia.js +7 -0
  677. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/julia.snippets +0 -0
  678. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/latex.js +7 -0
  679. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/latex.snippets +0 -0
  680. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ledger.snippets +5 -0
  681. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/less.js +7 -0
  682. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/less.snippets +0 -0
  683. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/liquid.js +7 -0
  684. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/liquid.snippets +0 -0
  685. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lisp.js +7 -0
  686. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lisp.snippets +0 -0
  687. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/livescript.js +7 -0
  688. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/livescript.snippets +0 -0
  689. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/logiql.js +7 -0
  690. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/logiql.snippets +0 -0
  691. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lsl.js +7 -0
  692. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lsl.snippets +1066 -0
  693. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lua.js +7 -0
  694. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lua.snippets +21 -0
  695. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/luapage.js +7 -0
  696. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/luapage.snippets +0 -0
  697. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lucene.js +7 -0
  698. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lucene.snippets +0 -0
  699. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/makefile.js +7 -0
  700. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/makefile.snippets +4 -0
  701. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mako.snippets +54 -0
  702. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/markdown.js +7 -0
  703. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/markdown.snippets +88 -0
  704. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/matlab.js +7 -0
  705. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/matlab.snippets +0 -0
  706. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mel.js +7 -0
  707. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mel.snippets +0 -0
  708. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode.js +7 -0
  709. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode.snippets +0 -0
  710. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode_high_rules.js +7 -0
  711. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode_high_rules.snippets +0 -0
  712. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mysql.js +7 -0
  713. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mysql.snippets +0 -0
  714. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/nix.js +7 -0
  715. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/nix.snippets +0 -0
  716. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/objc.snippets +247 -0
  717. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/objectivec.js +7 -0
  718. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/objectivec.snippets +0 -0
  719. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ocaml.js +7 -0
  720. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ocaml.snippets +0 -0
  721. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pascal.js +7 -0
  722. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pascal.snippets +0 -0
  723. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/perl.js +7 -0
  724. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/perl.snippets +347 -0
  725. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pgsql.js +7 -0
  726. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pgsql.snippets +0 -0
  727. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/php.js +7 -0
  728. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/php.snippets +377 -0
  729. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/plain_text.js +7 -0
  730. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/plain_text.snippets +0 -0
  731. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/powershell.js +7 -0
  732. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/powershell.snippets +0 -0
  733. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/praat.js +7 -0
  734. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/praat.snippets +0 -0
  735. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/prolog.js +7 -0
  736. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/prolog.snippets +0 -0
  737. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/properties.js +7 -0
  738. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/properties.snippets +0 -0
  739. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/protobuf.js +7 -0
  740. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/protobuf.snippets +0 -0
  741. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/python.js +7 -0
  742. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/python.snippets +158 -0
  743. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/r.js +7 -0
  744. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/r.snippets +121 -0
  745. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rdoc.js +7 -0
  746. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rdoc.snippets +0 -0
  747. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rhtml.js +7 -0
  748. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rhtml.snippets +0 -0
  749. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rst.snippets +22 -0
  750. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ruby.js +7 -0
  751. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ruby.snippets +928 -0
  752. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rust.js +7 -0
  753. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rust.snippets +0 -0
  754. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sass.js +7 -0
  755. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sass.snippets +0 -0
  756. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scad.js +7 -0
  757. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scad.snippets +0 -0
  758. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scala.js +7 -0
  759. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scala.snippets +0 -0
  760. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scheme.js +7 -0
  761. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scheme.snippets +0 -0
  762. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scss.js +7 -0
  763. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scss.snippets +0 -0
  764. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sh.js +7 -0
  765. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sh.snippets +83 -0
  766. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sjs.js +7 -0
  767. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sjs.snippets +0 -0
  768. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/smarty.js +7 -0
  769. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/smarty.snippets +0 -0
  770. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/snippets.js +7 -0
  771. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/snippets.snippets +9 -0
  772. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/soy_template.js +7 -0
  773. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/soy_template.snippets +0 -0
  774. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/space.js +7 -0
  775. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/space.snippets +0 -0
  776. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sql.js +7 -0
  777. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sql.snippets +26 -0
  778. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/stylus.js +7 -0
  779. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/stylus.snippets +0 -0
  780. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/svg.js +7 -0
  781. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/svg.snippets +0 -0
  782. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tcl.js +7 -0
  783. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tcl.snippets +92 -0
  784. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tex.js +7 -0
  785. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tex.snippets +191 -0
  786. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/text.js +7 -0
  787. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/text.snippets +0 -0
  788. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/textile.js +7 -0
  789. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/textile.snippets +30 -0
  790. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tmsnippet.snippets +0 -0
  791. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/toml.js +7 -0
  792. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/toml.snippets +0 -0
  793. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/twig.js +7 -0
  794. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/twig.snippets +0 -0
  795. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/typescript.js +7 -0
  796. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/typescript.snippets +0 -0
  797. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vala.js +195 -0
  798. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vala.snippets +0 -0
  799. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vbscript.js +7 -0
  800. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vbscript.snippets +0 -0
  801. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/velocity.js +8 -0
  802. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/velocity.snippets +28 -0
  803. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/verilog.js +7 -0
  804. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/verilog.snippets +0 -0
  805. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vhdl.js +7 -0
  806. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vhdl.snippets +0 -0
  807. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xml.js +7 -0
  808. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xml.snippets +0 -0
  809. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xquery.js +7 -0
  810. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xquery.snippets +61 -0
  811. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xslt.snippets +97 -0
  812. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/yaml.js +7 -0
  813. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/yaml.snippets +0 -0
  814. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets_test.js +131 -0
  815. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/split.js +3 -3
  816. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/all_browser.js +20 -7
  817. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/assert.js +2 -2
  818. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/mockrenderer.js +8 -0
  819. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.css +6 -2
  820. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chaos.css +154 -0
  821. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chaos.js +33 -0
  822. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.css +5 -9
  823. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.css +3 -15
  824. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.js +1 -1
  825. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.css +4 -16
  826. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.js +1 -1
  827. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.css +16 -26
  828. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.js +1 -1
  829. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.css +2 -10
  830. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.css +10 -20
  831. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.js +1 -1
  832. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.css +9 -12
  833. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.css +16 -9
  834. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/github.css +3 -10
  835. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.css +5 -17
  836. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.js +1 -1
  837. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/katzenmilch.css +140 -0
  838. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/katzenmilch.js +39 -0
  839. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.css +9 -20
  840. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.js +1 -1
  841. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kuroir.css +67 -0
  842. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kuroir.js +39 -0
  843. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.css +4 -16
  844. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.js +1 -1
  845. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.css +4 -16
  846. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.js +1 -1
  847. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.css +5 -17
  848. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.js +1 -1
  849. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.css +14 -20
  850. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.js +1 -1
  851. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.css +4 -16
  852. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.js +1 -1
  853. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.css +8 -20
  854. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.js +1 -1
  855. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.css +6 -18
  856. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.js +1 -1
  857. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/terminal.css +132 -0
  858. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/terminal.js +39 -0
  859. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.css +5 -9
  860. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.css +4 -15
  861. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.js +1 -1
  862. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.css +5 -16
  863. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.js +1 -1
  864. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.css +6 -17
  865. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.js +1 -1
  866. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.css +21 -16
  867. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.js +1 -1
  868. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.css +10 -17
  869. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.js +1 -1
  870. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.css +6 -16
  871. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.js +1 -1
  872. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.css +4 -12
  873. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.js +1 -1
  874. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.css +4 -12
  875. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.js +1 -1
  876. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/token_iterator.js +4 -3
  877. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tokenizer.js +246 -78
  878. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tokenizer_dev.js +71 -93
  879. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tokenizer_test.js +97 -0
  880. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tooltip.js +138 -0
  881. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/undomanager.js +63 -30
  882. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer.js +788 -403
  883. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/mirror.js +9 -3
  884. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker.js +92 -55
  885. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker_client.js +90 -52
  886. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker_test.js +125 -0
  887. data/lib/gollum/public/gollum/livepreview/js/livepreview.js +18 -12
  888. data/lib/gollum/public/gollum/livepreview/readme.md +1 -1
  889. data/lib/gollum/templates/layout.mustache +1 -1
  890. data/lib/gollum/{public/gollum/livepreview/index.html → templates/livepreview.mustache} +23 -1
  891. data/lib/gollum/views/livepreview.rb +13 -0
  892. metadata +569 -37
  893. data/lib/gollum/editing_auth.rb +0 -34
  894. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/commands.js +0 -561
  895. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/motions.js +0 -593
  896. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/operators.js +0 -196
  897. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/util.js +0 -134
  898. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/test_highlight_rules.js +0 -144
  899. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules_test.js +0 -266
  900. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules_test.js +0 -186
  901. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules_test.js +0 -218
  902. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lucene_highlight_rules_test.js +0 -99
  903. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules_test.js +0 -100
  904. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules_test.js +0 -108
  905. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules_test.js +0 -208
  906. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_util.js +0 -112
  907. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryParser.js +0 -32982
  908. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/visitors/SyntaxHighlighter.js +0 -316
  909. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_highlight_rules.js +0 -145
  910. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/dragdrop.js +0 -98
  911. data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker_sourcemint.js +0 -73
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2009-2012 Jeremy Ashkenas
2
+ * Copyright (c) 2009-2013 Jeremy Ashkenas
3
3
  *
4
4
  * Permission is hereby granted, free of charge, to any person
5
5
  * obtaining a copy of this software and associated documentation
@@ -21,24 +21,30 @@
21
21
  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
22
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
23
  * OTHER DEALINGS IN THE SOFTWARE.
24
+ *
24
25
  */
25
26
 
26
27
  define(function(require, exports, module) {
27
- // Generated by CoffeeScript 1.3.3
28
+ // Generated by CoffeeScript 1.6.3
28
29
 
29
- 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,
30
+ var Access, Arr, Assign, Base, Block, Call, Class, Code, CodeFragment, Comment, Existence, Extends, For, HEXNUM, IDENTIFIER, IDENTIFIER_STR, IS_REGEX, IS_STRING, If, In, Index, LEVEL_ACCESS, LEVEL_COND, LEVEL_LIST, LEVEL_OP, LEVEL_PAREN, LEVEL_TOP, Literal, METHOD_DEF, NEGATE, NO, NUMBER, Obj, Op, Param, Parens, RESERVED, Range, Return, SIMPLENUM, STRICT_PROSCRIBED, Scope, Slice, Splat, Switch, TAB, THIS, Throw, Try, UTILITIES, Value, While, YES, addLocationDataFn, compact, del, ends, extend, flatten, fragmentsToText, isLiteralArguments, isLiteralThis, last, locationDataToString, merge, multident, parseNum, some, starts, throwSyntaxError, unfoldSoak, utility, _ref, _ref1,
30
31
  __hasProp = {}.hasOwnProperty,
31
32
  __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; },
32
- __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; };
33
+ __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; },
34
+ __slice = [].slice;
35
+
36
+ Error.stackTraceLimit = Infinity;
33
37
 
34
38
  Scope = require('./scope').Scope;
35
39
 
36
40
  _ref = require('./lexer'), RESERVED = _ref.RESERVED, STRICT_PROSCRIBED = _ref.STRICT_PROSCRIBED;
37
41
 
38
- _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;
42
+ _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, addLocationDataFn = _ref1.addLocationDataFn, locationDataToString = _ref1.locationDataToString, throwSyntaxError = _ref1.throwSyntaxError;
39
43
 
40
44
  exports.extend = extend;
41
45
 
46
+ exports.addLocationDataFn = addLocationDataFn;
47
+
42
48
  YES = function() {
43
49
  return true;
44
50
  };
@@ -56,11 +62,43 @@ define(function(require, exports, module) {
56
62
  return this;
57
63
  };
58
64
 
59
- exports.Base = Base = (function() {
65
+ exports.CodeFragment = CodeFragment = (function() {
66
+ function CodeFragment(parent, code) {
67
+ var _ref2;
68
+ this.code = "" + code;
69
+ this.locationData = parent != null ? parent.locationData : void 0;
70
+ this.type = (parent != null ? (_ref2 = parent.constructor) != null ? _ref2.name : void 0 : void 0) || 'unknown';
71
+ }
72
+
73
+ CodeFragment.prototype.toString = function() {
74
+ return "" + this.code + (this.locationData ? ": " + locationDataToString(this.locationData) : '');
75
+ };
76
+
77
+ return CodeFragment;
60
78
 
79
+ })();
80
+
81
+ fragmentsToText = function(fragments) {
82
+ var fragment;
83
+ return ((function() {
84
+ var _i, _len, _results;
85
+ _results = [];
86
+ for (_i = 0, _len = fragments.length; _i < _len; _i++) {
87
+ fragment = fragments[_i];
88
+ _results.push(fragment.code);
89
+ }
90
+ return _results;
91
+ })()).join('');
92
+ };
93
+
94
+ exports.Base = Base = (function() {
61
95
  function Base() {}
62
96
 
63
97
  Base.prototype.compile = function(o, lvl) {
98
+ return fragmentsToText(this.compileToFragments(o, lvl));
99
+ };
100
+
101
+ Base.prototype.compileToFragments = function(o, lvl) {
64
102
  var node;
65
103
  o = extend({}, o);
66
104
  if (lvl) {
@@ -76,36 +114,44 @@ define(function(require, exports, module) {
76
114
  };
77
115
 
78
116
  Base.prototype.compileClosure = function(o) {
79
- if (this.jumps()) {
80
- throw SyntaxError('cannot use a pure statement in an expression.');
117
+ var args, argumentsNode, func, jumpNode, meth;
118
+ if (jumpNode = this.jumps()) {
119
+ jumpNode.error('cannot use a pure statement in an expression');
81
120
  }
82
121
  o.sharedScope = true;
83
- return Closure.wrap(this).compileNode(o);
122
+ func = new Code([], Block.wrap([this]));
123
+ args = [];
124
+ if ((argumentsNode = this.contains(isLiteralArguments)) || this.contains(isLiteralThis)) {
125
+ args = [new Literal('this')];
126
+ if (argumentsNode) {
127
+ meth = 'apply';
128
+ args.push(new Literal('arguments'));
129
+ } else {
130
+ meth = 'call';
131
+ }
132
+ func = new Value(func, [new Access(new Literal(meth))]);
133
+ }
134
+ return (new Call(func, args)).compileNode(o);
84
135
  };
85
136
 
86
137
  Base.prototype.cache = function(o, level, reused) {
87
138
  var ref, sub;
88
139
  if (!this.isComplex()) {
89
- ref = level ? this.compile(o, level) : this;
140
+ ref = level ? this.compileToFragments(o, level) : this;
90
141
  return [ref, ref];
91
142
  } else {
92
143
  ref = new Literal(reused || o.scope.freeVariable('ref'));
93
144
  sub = new Assign(ref, this);
94
145
  if (level) {
95
- return [sub.compile(o, level), ref.value];
146
+ return [sub.compileToFragments(o, level), [this.makeCode(ref.value)]];
96
147
  } else {
97
148
  return [sub, ref];
98
149
  }
99
150
  }
100
151
  };
101
152
 
102
- Base.prototype.compileLoopReference = function(o, name) {
103
- var src, tmp;
104
- src = tmp = this.compile(o, LEVEL_LIST);
105
- if (!((-Infinity < +src && +src < Infinity) || IDENTIFIER.test(src) && o.scope.check(src, true))) {
106
- src = "" + (tmp = o.scope.freeVariable(name)) + " = " + src;
107
- }
108
- return [src, tmp];
153
+ Base.prototype.cacheToCodeFragments = function(cacheValues) {
154
+ return [fragmentsToText(cacheValues[0]), fragmentsToText(cacheValues[1])];
109
155
  };
110
156
 
111
157
  Base.prototype.makeReturn = function(res) {
@@ -119,21 +165,15 @@ define(function(require, exports, module) {
119
165
  };
120
166
 
121
167
  Base.prototype.contains = function(pred) {
122
- var contains;
123
- contains = false;
124
- this.traverseChildren(false, function(node) {
125
- if (pred(node)) {
126
- contains = true;
168
+ var node;
169
+ node = void 0;
170
+ this.traverseChildren(false, function(n) {
171
+ if (pred(n)) {
172
+ node = n;
127
173
  return false;
128
174
  }
129
175
  });
130
- return contains;
131
- };
132
-
133
- Base.prototype.containsType = function(type) {
134
- return this instanceof type || this.contains(function(node) {
135
- return node instanceof type;
136
- });
176
+ return node;
137
177
  };
138
178
 
139
179
  Base.prototype.lastNonComment = function(list) {
@@ -188,10 +228,11 @@ define(function(require, exports, module) {
188
228
 
189
229
  Base.prototype.traverseChildren = function(crossScope, func) {
190
230
  return this.eachChild(function(child) {
191
- if (func(child) === false) {
192
- return false;
231
+ var recur;
232
+ recur = func(child);
233
+ if (recur !== false) {
234
+ return child.traverseChildren(crossScope, func);
193
235
  }
194
- return child.traverseChildren(crossScope, func);
195
236
  });
196
237
  };
197
238
 
@@ -226,12 +267,46 @@ define(function(require, exports, module) {
226
267
 
227
268
  Base.prototype.assigns = NO;
228
269
 
270
+ Base.prototype.updateLocationDataIfMissing = function(locationData) {
271
+ if (this.locationData) {
272
+ return this;
273
+ }
274
+ this.locationData = locationData;
275
+ return this.eachChild(function(child) {
276
+ return child.updateLocationDataIfMissing(locationData);
277
+ });
278
+ };
279
+
280
+ Base.prototype.error = function(message) {
281
+ return throwSyntaxError(message, this.locationData);
282
+ };
283
+
284
+ Base.prototype.makeCode = function(code) {
285
+ return new CodeFragment(this, code);
286
+ };
287
+
288
+ Base.prototype.wrapInBraces = function(fragments) {
289
+ return [].concat(this.makeCode('('), fragments, this.makeCode(')'));
290
+ };
291
+
292
+ Base.prototype.joinFragmentArrays = function(fragmentsList, joinStr) {
293
+ var answer, fragments, i, _i, _len;
294
+ answer = [];
295
+ for (i = _i = 0, _len = fragmentsList.length; _i < _len; i = ++_i) {
296
+ fragments = fragmentsList[i];
297
+ if (i) {
298
+ answer.push(this.makeCode(joinStr));
299
+ }
300
+ answer = answer.concat(fragments);
301
+ }
302
+ return answer;
303
+ };
304
+
229
305
  return Base;
230
306
 
231
307
  })();
232
308
 
233
309
  exports.Block = Block = (function(_super) {
234
-
235
310
  __extends(Block, _super);
236
311
 
237
312
  function Block(nodes) {
@@ -279,12 +354,12 @@ define(function(require, exports, module) {
279
354
  };
280
355
 
281
356
  Block.prototype.jumps = function(o) {
282
- var exp, _i, _len, _ref2;
357
+ var exp, jumpNode, _i, _len, _ref2;
283
358
  _ref2 = this.expressions;
284
359
  for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
285
360
  exp = _ref2[_i];
286
- if (exp.jumps(o)) {
287
- return exp;
361
+ if (jumpNode = exp.jumps(o)) {
362
+ return jumpNode;
288
363
  }
289
364
  }
290
365
  };
@@ -305,72 +380,79 @@ define(function(require, exports, module) {
305
380
  return this;
306
381
  };
307
382
 
308
- Block.prototype.compile = function(o, level) {
383
+ Block.prototype.compileToFragments = function(o, level) {
309
384
  if (o == null) {
310
385
  o = {};
311
386
  }
312
387
  if (o.scope) {
313
- return Block.__super__.compile.call(this, o, level);
388
+ return Block.__super__.compileToFragments.call(this, o, level);
314
389
  } else {
315
390
  return this.compileRoot(o);
316
391
  }
317
392
  };
318
393
 
319
394
  Block.prototype.compileNode = function(o) {
320
- var code, codes, node, top, _i, _len, _ref2;
395
+ var answer, compiledNodes, fragments, index, node, top, _i, _len, _ref2;
321
396
  this.tab = o.indent;
322
397
  top = o.level === LEVEL_TOP;
323
- codes = [];
398
+ compiledNodes = [];
324
399
  _ref2 = this.expressions;
325
- for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
326
- node = _ref2[_i];
400
+ for (index = _i = 0, _len = _ref2.length; _i < _len; index = ++_i) {
401
+ node = _ref2[index];
327
402
  node = node.unwrapAll();
328
403
  node = node.unfoldSoak(o) || node;
329
404
  if (node instanceof Block) {
330
- codes.push(node.compileNode(o));
405
+ compiledNodes.push(node.compileNode(o));
331
406
  } else if (top) {
332
407
  node.front = true;
333
- code = node.compile(o);
408
+ fragments = node.compileToFragments(o);
334
409
  if (!node.isStatement(o)) {
335
- code = "" + this.tab + code + ";";
336
- if (node instanceof Literal) {
337
- code = "" + code + "\n";
338
- }
410
+ fragments.unshift(this.makeCode("" + this.tab));
411
+ fragments.push(this.makeCode(";"));
339
412
  }
340
- codes.push(code);
413
+ compiledNodes.push(fragments);
341
414
  } else {
342
- codes.push(node.compile(o, LEVEL_LIST));
415
+ compiledNodes.push(node.compileToFragments(o, LEVEL_LIST));
343
416
  }
344
417
  }
345
418
  if (top) {
346
419
  if (this.spaced) {
347
- return "\n" + (codes.join('\n\n')) + "\n";
420
+ return [].concat(this.joinFragmentArrays(compiledNodes, '\n\n'), this.makeCode("\n"));
348
421
  } else {
349
- return codes.join('\n');
422
+ return this.joinFragmentArrays(compiledNodes, '\n');
350
423
  }
351
424
  }
352
- code = codes.join(', ') || 'void 0';
353
- if (codes.length > 1 && o.level >= LEVEL_LIST) {
354
- return "(" + code + ")";
425
+ if (compiledNodes.length) {
426
+ answer = this.joinFragmentArrays(compiledNodes, ', ');
427
+ } else {
428
+ answer = [this.makeCode("void 0")];
429
+ }
430
+ if (compiledNodes.length > 1 && o.level >= LEVEL_LIST) {
431
+ return this.wrapInBraces(answer);
355
432
  } else {
356
- return code;
433
+ return answer;
357
434
  }
358
435
  };
359
436
 
360
437
  Block.prototype.compileRoot = function(o) {
361
- var code, exp, i, prelude, preludeExps, rest;
438
+ var exp, fragments, i, name, prelude, preludeExps, rest, _i, _len, _ref2;
362
439
  o.indent = o.bare ? '' : TAB;
363
- o.scope = new Scope(null, this, null);
364
440
  o.level = LEVEL_TOP;
365
441
  this.spaced = true;
366
- prelude = "";
442
+ o.scope = new Scope(null, this, null);
443
+ _ref2 = o.locals || [];
444
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
445
+ name = _ref2[_i];
446
+ o.scope.parameter(name);
447
+ }
448
+ prelude = [];
367
449
  if (!o.bare) {
368
450
  preludeExps = (function() {
369
- var _i, _len, _ref2, _results;
370
- _ref2 = this.expressions;
451
+ var _j, _len1, _ref3, _results;
452
+ _ref3 = this.expressions;
371
453
  _results = [];
372
- for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
373
- exp = _ref2[i];
454
+ for (i = _j = 0, _len1 = _ref3.length; _j < _len1; i = ++_j) {
455
+ exp = _ref3[i];
374
456
  if (!(exp.unwrap() instanceof Comment)) {
375
457
  break;
376
458
  }
@@ -381,22 +463,24 @@ define(function(require, exports, module) {
381
463
  rest = this.expressions.slice(preludeExps.length);
382
464
  this.expressions = preludeExps;
383
465
  if (preludeExps.length) {
384
- prelude = "" + (this.compileNode(merge(o, {
466
+ prelude = this.compileNode(merge(o, {
385
467
  indent: ''
386
- }))) + "\n";
468
+ }));
469
+ prelude.push(this.makeCode("\n"));
387
470
  }
388
471
  this.expressions = rest;
389
472
  }
390
- code = this.compileWithDeclarations(o);
473
+ fragments = this.compileWithDeclarations(o);
391
474
  if (o.bare) {
392
- return code;
475
+ return fragments;
393
476
  }
394
- return "" + prelude + "(function() {\n" + code + "\n}).call(this);\n";
477
+ return [].concat(prelude, this.makeCode("(function() {\n"), fragments, this.makeCode("\n}).call(this);\n"));
395
478
  };
396
479
 
397
480
  Block.prototype.compileWithDeclarations = function(o) {
398
- var assigns, code, declars, exp, i, post, rest, scope, spaced, _i, _len, _ref2, _ref3, _ref4;
399
- code = post = '';
481
+ var assigns, declars, exp, fragments, i, post, rest, scope, spaced, _i, _len, _ref2, _ref3, _ref4;
482
+ fragments = [];
483
+ post = [];
400
484
  _ref2 = this.expressions;
401
485
  for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
402
486
  exp = _ref2[i];
@@ -411,7 +495,7 @@ define(function(require, exports, module) {
411
495
  if (i) {
412
496
  rest = this.expressions.splice(i, 9e9);
413
497
  _ref3 = [this.spaced, false], spaced = _ref3[0], this.spaced = _ref3[1];
414
- _ref4 = [this.compileNode(o), spaced], code = _ref4[0], this.spaced = _ref4[1];
498
+ _ref4 = [this.compileNode(o), spaced], fragments = _ref4[0], this.spaced = _ref4[1];
415
499
  this.expressions = rest;
416
500
  }
417
501
  post = this.compileNode(o);
@@ -421,22 +505,24 @@ define(function(require, exports, module) {
421
505
  assigns = scope.hasAssignments;
422
506
  if (declars || assigns) {
423
507
  if (i) {
424
- code += '\n';
508
+ fragments.push(this.makeCode('\n'));
425
509
  }
426
- code += "" + this.tab + "var ";
510
+ fragments.push(this.makeCode("" + this.tab + "var "));
427
511
  if (declars) {
428
- code += scope.declaredVariables().join(', ');
512
+ fragments.push(this.makeCode(scope.declaredVariables().join(', ')));
429
513
  }
430
514
  if (assigns) {
431
515
  if (declars) {
432
- code += ",\n" + (this.tab + TAB);
516
+ fragments.push(this.makeCode(",\n" + (this.tab + TAB)));
433
517
  }
434
- code += scope.assignedVariables().join(",\n" + (this.tab + TAB));
518
+ fragments.push(this.makeCode(scope.assignedVariables().join(",\n" + (this.tab + TAB))));
435
519
  }
436
- code += ';\n';
520
+ fragments.push(this.makeCode(";\n" + (this.spaced ? '\n' : '')));
521
+ } else if (fragments.length && post.length) {
522
+ fragments.push(this.makeCode("\n"));
437
523
  }
438
524
  }
439
- return code + post;
525
+ return fragments.concat(post);
440
526
  };
441
527
 
442
528
  Block.wrap = function(nodes) {
@@ -451,7 +537,6 @@ define(function(require, exports, module) {
451
537
  })(Base);
452
538
 
453
539
  exports.Literal = Literal = (function(_super) {
454
-
455
540
  __extends(Literal, _super);
456
541
 
457
542
  function Literal(value) {
@@ -491,13 +576,10 @@ define(function(require, exports, module) {
491
576
  };
492
577
 
493
578
  Literal.prototype.compileNode = function(o) {
494
- var code, _ref2;
579
+ var answer, code, _ref2;
495
580
  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;
496
- if (this.isStatement()) {
497
- return "" + this.tab + code + ";";
498
- } else {
499
- return code;
500
- }
581
+ answer = this.isStatement() ? "" + this.tab + code + ";" : code;
582
+ return [this.makeCode(answer)];
501
583
  };
502
584
 
503
585
  Literal.prototype.toString = function() {
@@ -509,7 +591,6 @@ define(function(require, exports, module) {
509
591
  })(Base);
510
592
 
511
593
  exports.Undefined = (function(_super) {
512
-
513
594
  __extends(Undefined, _super);
514
595
 
515
596
  function Undefined() {
@@ -521,11 +602,7 @@ define(function(require, exports, module) {
521
602
  Undefined.prototype.isComplex = NO;
522
603
 
523
604
  Undefined.prototype.compileNode = function(o) {
524
- if (o.level >= LEVEL_ACCESS) {
525
- return '(void 0)';
526
- } else {
527
- return 'void 0';
528
- }
605
+ return [this.makeCode(o.level >= LEVEL_ACCESS ? '(void 0)' : 'void 0')];
529
606
  };
530
607
 
531
608
  return Undefined;
@@ -533,7 +610,6 @@ define(function(require, exports, module) {
533
610
  })(Base);
534
611
 
535
612
  exports.Null = (function(_super) {
536
-
537
613
  __extends(Null, _super);
538
614
 
539
615
  function Null() {
@@ -545,7 +621,7 @@ define(function(require, exports, module) {
545
621
  Null.prototype.isComplex = NO;
546
622
 
547
623
  Null.prototype.compileNode = function() {
548
- return "null";
624
+ return [this.makeCode("null")];
549
625
  };
550
626
 
551
627
  return Null;
@@ -553,7 +629,6 @@ define(function(require, exports, module) {
553
629
  })(Base);
554
630
 
555
631
  exports.Bool = (function(_super) {
556
-
557
632
  __extends(Bool, _super);
558
633
 
559
634
  Bool.prototype.isAssignable = NO;
@@ -561,7 +636,7 @@ define(function(require, exports, module) {
561
636
  Bool.prototype.isComplex = NO;
562
637
 
563
638
  Bool.prototype.compileNode = function() {
564
- return this.val;
639
+ return [this.makeCode(this.val)];
565
640
  };
566
641
 
567
642
  function Bool(val) {
@@ -573,7 +648,6 @@ define(function(require, exports, module) {
573
648
  })(Base);
574
649
 
575
650
  exports.Return = Return = (function(_super) {
576
-
577
651
  __extends(Return, _super);
578
652
 
579
653
  function Return(expr) {
@@ -590,18 +664,25 @@ define(function(require, exports, module) {
590
664
 
591
665
  Return.prototype.jumps = THIS;
592
666
 
593
- Return.prototype.compile = function(o, level) {
667
+ Return.prototype.compileToFragments = function(o, level) {
594
668
  var expr, _ref2;
595
669
  expr = (_ref2 = this.expression) != null ? _ref2.makeReturn() : void 0;
596
670
  if (expr && !(expr instanceof Return)) {
597
- return expr.compile(o, level);
671
+ return expr.compileToFragments(o, level);
598
672
  } else {
599
- return Return.__super__.compile.call(this, o, level);
673
+ return Return.__super__.compileToFragments.call(this, o, level);
600
674
  }
601
675
  };
602
676
 
603
677
  Return.prototype.compileNode = function(o) {
604
- return this.tab + ("return" + [this.expression ? " " + (this.expression.compile(o, LEVEL_PAREN)) : void 0] + ";");
678
+ var answer;
679
+ answer = [];
680
+ answer.push(this.makeCode(this.tab + ("return" + (this.expression ? " " : ""))));
681
+ if (this.expression) {
682
+ answer = answer.concat(this.expression.compileToFragments(o, LEVEL_PAREN));
683
+ }
684
+ answer.push(this.makeCode(";"));
685
+ return answer;
605
686
  };
606
687
 
607
688
  return Return;
@@ -609,7 +690,6 @@ define(function(require, exports, module) {
609
690
  })(Base);
610
691
 
611
692
  exports.Value = Value = (function(_super) {
612
-
613
693
  __extends(Value, _super);
614
694
 
615
695
  function Value(base, props, tag) {
@@ -635,8 +715,16 @@ define(function(require, exports, module) {
635
715
  return !!this.properties.length;
636
716
  };
637
717
 
718
+ Value.prototype.bareLiteral = function(type) {
719
+ return !this.properties.length && this.base instanceof type;
720
+ };
721
+
638
722
  Value.prototype.isArray = function() {
639
- return !this.properties.length && this.base instanceof Arr;
723
+ return this.bareLiteral(Arr);
724
+ };
725
+
726
+ Value.prototype.isRange = function() {
727
+ return this.bareLiteral(Range);
640
728
  };
641
729
 
642
730
  Value.prototype.isComplex = function() {
@@ -648,11 +736,15 @@ define(function(require, exports, module) {
648
736
  };
649
737
 
650
738
  Value.prototype.isSimpleNumber = function() {
651
- return this.base instanceof Literal && SIMPLENUM.test(this.base.value);
739
+ return this.bareLiteral(Literal) && SIMPLENUM.test(this.base.value);
652
740
  };
653
741
 
654
742
  Value.prototype.isString = function() {
655
- return this.base instanceof Literal && IS_STRING.test(this.base.value);
743
+ return this.bareLiteral(Literal) && IS_STRING.test(this.base.value);
744
+ };
745
+
746
+ Value.prototype.isRegex = function() {
747
+ return this.bareLiteral(Literal) && IS_REGEX.test(this.base.value);
656
748
  };
657
749
 
658
750
  Value.prototype.isAtomic = function() {
@@ -667,6 +759,10 @@ define(function(require, exports, module) {
667
759
  return true;
668
760
  };
669
761
 
762
+ Value.prototype.isNotCallable = function() {
763
+ return this.isSimpleNumber() || this.isString() || this.isRegex() || this.isArray() || this.isRange() || this.isSplice() || this.isObject();
764
+ };
765
+
670
766
  Value.prototype.isStatement = function(o) {
671
767
  return !this.properties.length && this.base.isStatement(o);
672
768
  };
@@ -690,6 +786,11 @@ define(function(require, exports, module) {
690
786
  return last(this.properties) instanceof Slice;
691
787
  };
692
788
 
789
+ Value.prototype.looksStatic = function(className) {
790
+ var _ref2;
791
+ return this.base.value === className && this.properties.length && ((_ref2 = this.properties[0].name) != null ? _ref2.value : void 0) !== 'prototype';
792
+ };
793
+
693
794
  Value.prototype.unwrap = function() {
694
795
  if (this.properties.length) {
695
796
  return this;
@@ -721,53 +822,49 @@ define(function(require, exports, module) {
721
822
  };
722
823
 
723
824
  Value.prototype.compileNode = function(o) {
724
- var code, prop, props, _i, _len;
825
+ var fragments, prop, props, _i, _len;
725
826
  this.base.front = this.front;
726
827
  props = this.properties;
727
- code = this.base.compile(o, props.length ? LEVEL_ACCESS : null);
728
- if ((this.base instanceof Parens || props.length) && SIMPLENUM.test(code)) {
729
- code = "" + code + ".";
828
+ fragments = this.base.compileToFragments(o, (props.length ? LEVEL_ACCESS : null));
829
+ if ((this.base instanceof Parens || props.length) && SIMPLENUM.test(fragmentsToText(fragments))) {
830
+ fragments.push(this.makeCode('.'));
730
831
  }
731
832
  for (_i = 0, _len = props.length; _i < _len; _i++) {
732
833
  prop = props[_i];
733
- code += prop.compile(o);
834
+ fragments.push.apply(fragments, prop.compileToFragments(o));
734
835
  }
735
- return code;
836
+ return fragments;
736
837
  };
737
838
 
738
839
  Value.prototype.unfoldSoak = function(o) {
739
- var result,
740
- _this = this;
741
- if (this.unfoldedSoak != null) {
742
- return this.unfoldedSoak;
743
- }
744
- result = (function() {
745
- var fst, i, ifn, prop, ref, snd, _i, _len, _ref2;
746
- if (ifn = _this.base.unfoldSoak(o)) {
747
- Array.prototype.push.apply(ifn.body.properties, _this.properties);
748
- return ifn;
749
- }
750
- _ref2 = _this.properties;
751
- for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
752
- prop = _ref2[i];
753
- if (!prop.soak) {
754
- continue;
840
+ return this.unfoldedSoak != null ? this.unfoldedSoak : this.unfoldedSoak = (function(_this) {
841
+ return function() {
842
+ var fst, i, ifn, prop, ref, snd, _i, _len, _ref2, _ref3;
843
+ if (ifn = _this.base.unfoldSoak(o)) {
844
+ (_ref2 = ifn.body.properties).push.apply(_ref2, _this.properties);
845
+ return ifn;
755
846
  }
756
- prop.soak = false;
757
- fst = new Value(_this.base, _this.properties.slice(0, i));
758
- snd = new Value(_this.base, _this.properties.slice(i));
759
- if (fst.isComplex()) {
760
- ref = new Literal(o.scope.freeVariable('ref'));
761
- fst = new Parens(new Assign(ref, fst));
762
- snd.base = ref;
847
+ _ref3 = _this.properties;
848
+ for (i = _i = 0, _len = _ref3.length; _i < _len; i = ++_i) {
849
+ prop = _ref3[i];
850
+ if (!prop.soak) {
851
+ continue;
852
+ }
853
+ prop.soak = false;
854
+ fst = new Value(_this.base, _this.properties.slice(0, i));
855
+ snd = new Value(_this.base, _this.properties.slice(i));
856
+ if (fst.isComplex()) {
857
+ ref = new Literal(o.scope.freeVariable('ref'));
858
+ fst = new Parens(new Assign(ref, fst));
859
+ snd.base = ref;
860
+ }
861
+ return new If(new Existence(fst), snd, {
862
+ soak: true
863
+ });
763
864
  }
764
- return new If(new Existence(fst), snd, {
765
- soak: true
766
- });
767
- }
768
- return null;
769
- })();
770
- return this.unfoldedSoak = result || false;
865
+ return false;
866
+ };
867
+ })(this)();
771
868
  };
772
869
 
773
870
  return Value;
@@ -775,7 +872,6 @@ define(function(require, exports, module) {
775
872
  })(Base);
776
873
 
777
874
  exports.Comment = Comment = (function(_super) {
778
-
779
875
  __extends(Comment, _super);
780
876
 
781
877
  function Comment(comment) {
@@ -787,12 +883,13 @@ define(function(require, exports, module) {
787
883
  Comment.prototype.makeReturn = THIS;
788
884
 
789
885
  Comment.prototype.compileNode = function(o, level) {
790
- var code;
791
- code = '/*' + multident(this.comment, this.tab) + ("\n" + this.tab + "*/\n");
886
+ var code, comment;
887
+ comment = this.comment.replace(/^(\s*)#/gm, "$1 *");
888
+ code = "/*" + (multident(comment, this.tab)) + (__indexOf.call(comment, '\n') >= 0 ? "\n" + this.tab : '') + " */";
792
889
  if ((level || o.level) === LEVEL_TOP) {
793
890
  code = o.indent + code;
794
891
  }
795
- return code;
892
+ return [this.makeCode("\n"), this.makeCode(code)];
796
893
  };
797
894
 
798
895
  return Comment;
@@ -800,7 +897,6 @@ define(function(require, exports, module) {
800
897
  })(Base);
801
898
 
802
899
  exports.Call = Call = (function(_super) {
803
-
804
900
  __extends(Call, _super);
805
901
 
806
902
  function Call(variable, args, soak) {
@@ -809,6 +905,9 @@ define(function(require, exports, module) {
809
905
  this.isNew = false;
810
906
  this.isSuper = variable === 'super';
811
907
  this.variable = this.isSuper ? null : variable;
908
+ if (variable instanceof Value && variable.isNotCallable()) {
909
+ variable.error("literal is not a function");
910
+ }
812
911
  }
813
912
 
814
913
  Call.prototype.children = ['variable', 'args'];
@@ -825,24 +924,19 @@ define(function(require, exports, module) {
825
924
  };
826
925
 
827
926
  Call.prototype.superReference = function(o) {
828
- var accesses, method, name;
927
+ var accesses, method;
829
928
  method = o.scope.namedMethod();
830
- if (!method) {
831
- throw SyntaxError('cannot call super outside of a function.');
832
- }
833
- name = method.name;
834
- if (name == null) {
835
- throw SyntaxError('cannot call super on an anonymous function.');
836
- }
837
- if (method.klass) {
929
+ if (method != null ? method.klass : void 0) {
838
930
  accesses = [new Access(new Literal('__super__'))];
839
931
  if (method["static"]) {
840
932
  accesses.push(new Access(new Literal('constructor')));
841
933
  }
842
- accesses.push(new Access(new Literal(name)));
934
+ accesses.push(new Access(new Literal(method.name)));
843
935
  return (new Value(new Literal(method.klass), accesses)).compile(o);
936
+ } else if (method != null ? method.ctor : void 0) {
937
+ return "" + method.name + ".__super__.constructor";
844
938
  } else {
845
- return "" + name + ".__super__.constructor";
939
+ return this.error('cannot call super outside of an instance method.');
846
940
  }
847
941
  };
848
942
 
@@ -902,88 +996,71 @@ define(function(require, exports, module) {
902
996
  return ifn;
903
997
  };
904
998
 
905
- Call.prototype.filterImplicitObjects = function(list) {
906
- var node, nodes, obj, prop, properties, _i, _j, _len, _len1, _ref2;
907
- nodes = [];
908
- for (_i = 0, _len = list.length; _i < _len; _i++) {
909
- node = list[_i];
910
- if (!((typeof node.isObject === "function" ? node.isObject() : void 0) && node.base.generated)) {
911
- nodes.push(node);
912
- continue;
913
- }
914
- obj = null;
915
- _ref2 = node.base.properties;
916
- for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
917
- prop = _ref2[_j];
918
- if (prop instanceof Assign || prop instanceof Comment) {
919
- if (!obj) {
920
- nodes.push(obj = new Obj(properties = [], true));
921
- }
922
- properties.push(prop);
923
- } else {
924
- nodes.push(prop);
925
- obj = null;
926
- }
927
- }
928
- }
929
- return nodes;
930
- };
931
-
932
999
  Call.prototype.compileNode = function(o) {
933
- var arg, args, code, _ref2;
1000
+ var arg, argIndex, compiledArgs, compiledArray, fragments, preface, _i, _len, _ref2, _ref3;
934
1001
  if ((_ref2 = this.variable) != null) {
935
1002
  _ref2.front = this.front;
936
1003
  }
937
- if (code = Splat.compileSplattedArray(o, this.args, true)) {
938
- return this.compileSplat(o, code);
1004
+ compiledArray = Splat.compileSplattedArray(o, this.args, true);
1005
+ if (compiledArray.length) {
1006
+ return this.compileSplat(o, compiledArray);
939
1007
  }
940
- args = this.filterImplicitObjects(this.args);
941
- args = ((function() {
942
- var _i, _len, _results;
943
- _results = [];
944
- for (_i = 0, _len = args.length; _i < _len; _i++) {
945
- arg = args[_i];
946
- _results.push(arg.compile(o, LEVEL_LIST));
1008
+ compiledArgs = [];
1009
+ _ref3 = this.args;
1010
+ for (argIndex = _i = 0, _len = _ref3.length; _i < _len; argIndex = ++_i) {
1011
+ arg = _ref3[argIndex];
1012
+ if (argIndex) {
1013
+ compiledArgs.push(this.makeCode(", "));
947
1014
  }
948
- return _results;
949
- })()).join(', ');
1015
+ compiledArgs.push.apply(compiledArgs, arg.compileToFragments(o, LEVEL_LIST));
1016
+ }
1017
+ fragments = [];
950
1018
  if (this.isSuper) {
951
- return this.superReference(o) + (".call(" + (this.superThis(o)) + (args && ', ' + args) + ")");
1019
+ preface = this.superReference(o) + (".call(" + (this.superThis(o)));
1020
+ if (compiledArgs.length) {
1021
+ preface += ", ";
1022
+ }
1023
+ fragments.push(this.makeCode(preface));
952
1024
  } else {
953
- return (this.isNew ? 'new ' : '') + this.variable.compile(o, LEVEL_ACCESS) + ("(" + args + ")");
1025
+ if (this.isNew) {
1026
+ fragments.push(this.makeCode('new '));
1027
+ }
1028
+ fragments.push.apply(fragments, this.variable.compileToFragments(o, LEVEL_ACCESS));
1029
+ fragments.push(this.makeCode("("));
954
1030
  }
955
- };
956
-
957
- Call.prototype.compileSuper = function(args, o) {
958
- return "" + (this.superReference(o)) + ".call(" + (this.superThis(o)) + (args.length ? ', ' : '') + args + ")";
1031
+ fragments.push.apply(fragments, compiledArgs);
1032
+ fragments.push(this.makeCode(")"));
1033
+ return fragments;
959
1034
  };
960
1035
 
961
1036
  Call.prototype.compileSplat = function(o, splatArgs) {
962
- var base, fun, idt, name, ref;
1037
+ var answer, base, fun, idt, name, ref;
963
1038
  if (this.isSuper) {
964
- return "" + (this.superReference(o)) + ".apply(" + (this.superThis(o)) + ", " + splatArgs + ")";
1039
+ return [].concat(this.makeCode("" + (this.superReference(o)) + ".apply(" + (this.superThis(o)) + ", "), splatArgs, this.makeCode(")"));
965
1040
  }
966
1041
  if (this.isNew) {
967
1042
  idt = this.tab + TAB;
968
- return "(function(func, args, ctor) {\n" + idt + "ctor.prototype = func.prototype;\n" + idt + "var child = new ctor, result = func.apply(child, args), t = typeof result;\n" + idt + "return t == \"object\" || t == \"function\" ? result || child : child;\n" + this.tab + "})(" + (this.variable.compile(o, LEVEL_LIST)) + ", " + splatArgs + ", function(){})";
1043
+ return [].concat(this.makeCode("(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.compileToFragments(o, LEVEL_LIST), this.makeCode(", "), splatArgs, this.makeCode(", function(){})"));
969
1044
  }
1045
+ answer = [];
970
1046
  base = new Value(this.variable);
971
1047
  if ((name = base.properties.pop()) && base.isComplex()) {
972
1048
  ref = o.scope.freeVariable('ref');
973
- fun = "(" + ref + " = " + (base.compile(o, LEVEL_LIST)) + ")" + (name.compile(o));
1049
+ answer = answer.concat(this.makeCode("(" + ref + " = "), base.compileToFragments(o, LEVEL_LIST), this.makeCode(")"), name.compileToFragments(o));
974
1050
  } else {
975
- fun = base.compile(o, LEVEL_ACCESS);
976
- if (SIMPLENUM.test(fun)) {
977
- fun = "(" + fun + ")";
1051
+ fun = base.compileToFragments(o, LEVEL_ACCESS);
1052
+ if (SIMPLENUM.test(fragmentsToText(fun))) {
1053
+ fun = this.wrapInBraces(fun);
978
1054
  }
979
1055
  if (name) {
980
- ref = fun;
981
- fun += name.compile(o);
1056
+ ref = fragmentsToText(fun);
1057
+ fun.push.apply(fun, name.compileToFragments(o));
982
1058
  } else {
983
1059
  ref = 'null';
984
1060
  }
1061
+ answer = answer.concat(fun);
985
1062
  }
986
- return "" + fun + ".apply(" + ref + ", " + splatArgs + ")";
1063
+ return answer = answer.concat(this.makeCode(".apply(" + ref + ", "), splatArgs, this.makeCode(")"));
987
1064
  };
988
1065
 
989
1066
  return Call;
@@ -991,7 +1068,6 @@ define(function(require, exports, module) {
991
1068
  })(Base);
992
1069
 
993
1070
  exports.Extends = Extends = (function(_super) {
994
-
995
1071
  __extends(Extends, _super);
996
1072
 
997
1073
  function Extends(child, parent) {
@@ -1001,8 +1077,8 @@ define(function(require, exports, module) {
1001
1077
 
1002
1078
  Extends.prototype.children = ['child', 'parent'];
1003
1079
 
1004
- Extends.prototype.compile = function(o) {
1005
- return new Call(new Value(new Literal(utility('extends'))), [this.child, this.parent]).compile(o);
1080
+ Extends.prototype.compileToFragments = function(o) {
1081
+ return new Call(new Value(new Literal(utility('extends'))), [this.child, this.parent]).compileToFragments(o);
1006
1082
  };
1007
1083
 
1008
1084
  return Extends;
@@ -1010,7 +1086,6 @@ define(function(require, exports, module) {
1010
1086
  })(Base);
1011
1087
 
1012
1088
  exports.Access = Access = (function(_super) {
1013
-
1014
1089
  __extends(Access, _super);
1015
1090
 
1016
1091
  function Access(name, tag) {
@@ -1021,14 +1096,16 @@ define(function(require, exports, module) {
1021
1096
 
1022
1097
  Access.prototype.children = ['name'];
1023
1098
 
1024
- Access.prototype.compile = function(o) {
1099
+ Access.prototype.compileToFragments = function(o) {
1025
1100
  var name;
1026
- name = this.name.compile(o);
1027
- if (IDENTIFIER.test(name)) {
1028
- return "." + name;
1101
+ name = this.name.compileToFragments(o);
1102
+ if (IDENTIFIER.test(fragmentsToText(name))) {
1103
+ name.unshift(this.makeCode("."));
1029
1104
  } else {
1030
- return "[" + name + "]";
1105
+ name.unshift(this.makeCode("["));
1106
+ name.push(this.makeCode("]"));
1031
1107
  }
1108
+ return name;
1032
1109
  };
1033
1110
 
1034
1111
  Access.prototype.isComplex = NO;
@@ -1038,7 +1115,6 @@ define(function(require, exports, module) {
1038
1115
  })(Base);
1039
1116
 
1040
1117
  exports.Index = Index = (function(_super) {
1041
-
1042
1118
  __extends(Index, _super);
1043
1119
 
1044
1120
  function Index(index) {
@@ -1047,8 +1123,8 @@ define(function(require, exports, module) {
1047
1123
 
1048
1124
  Index.prototype.children = ['index'];
1049
1125
 
1050
- Index.prototype.compile = function(o) {
1051
- return "[" + (this.index.compile(o, LEVEL_PAREN)) + "]";
1126
+ Index.prototype.compileToFragments = function(o) {
1127
+ return [].concat(this.makeCode("["), this.index.compileToFragments(o, LEVEL_PAREN), this.makeCode("]"));
1052
1128
  };
1053
1129
 
1054
1130
  Index.prototype.isComplex = function() {
@@ -1060,7 +1136,6 @@ define(function(require, exports, module) {
1060
1136
  })(Base);
1061
1137
 
1062
1138
  exports.Range = Range = (function(_super) {
1063
-
1064
1139
  __extends(Range, _super);
1065
1140
 
1066
1141
  Range.prototype.children = ['from', 'to'];
@@ -1077,14 +1152,14 @@ define(function(require, exports, module) {
1077
1152
  o = merge(o, {
1078
1153
  top: true
1079
1154
  });
1080
- _ref2 = this.from.cache(o, LEVEL_LIST), this.fromC = _ref2[0], this.fromVar = _ref2[1];
1081
- _ref3 = this.to.cache(o, LEVEL_LIST), this.toC = _ref3[0], this.toVar = _ref3[1];
1155
+ _ref2 = this.cacheToCodeFragments(this.from.cache(o, LEVEL_LIST)), this.fromC = _ref2[0], this.fromVar = _ref2[1];
1156
+ _ref3 = this.cacheToCodeFragments(this.to.cache(o, LEVEL_LIST)), this.toC = _ref3[0], this.toVar = _ref3[1];
1082
1157
  if (step = del(o, 'step')) {
1083
- _ref4 = step.cache(o, LEVEL_LIST), this.step = _ref4[0], this.stepVar = _ref4[1];
1158
+ _ref4 = this.cacheToCodeFragments(step.cache(o, LEVEL_LIST)), this.step = _ref4[0], this.stepVar = _ref4[1];
1084
1159
  }
1085
- _ref5 = [this.fromVar.match(SIMPLENUM), this.toVar.match(SIMPLENUM)], this.fromNum = _ref5[0], this.toNum = _ref5[1];
1160
+ _ref5 = [this.fromVar.match(NUMBER), this.toVar.match(NUMBER)], this.fromNum = _ref5[0], this.toNum = _ref5[1];
1086
1161
  if (this.stepVar) {
1087
- return this.stepNum = this.stepVar.match(SIMPLENUM);
1162
+ return this.stepNum = this.stepVar.match(NUMBER);
1088
1163
  }
1089
1164
  };
1090
1165
 
@@ -1108,7 +1183,7 @@ define(function(require, exports, module) {
1108
1183
  varPart += ", " + this.step;
1109
1184
  }
1110
1185
  _ref2 = ["" + idx + " <" + this.equals, "" + idx + " >" + this.equals], lt = _ref2[0], gt = _ref2[1];
1111
- 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);
1186
+ condPart = this.stepNum ? parseNum(this.stepNum[0]) > 0 ? "" + lt + " " + this.toVar : "" + gt + " " + this.toVar : known ? ((_ref3 = [parseNum(this.fromNum[0]), parseNum(this.toNum[0])], from = _ref3[0], to = _ref3[1], _ref3), from <= to ? "" + lt + " " + to : "" + gt + " " + to) : (cond = this.stepVar ? "" + this.stepVar + " > 0" : "" + this.fromVar + " <= " + this.toVar, "" + cond + " ? " + lt + " " + this.toVar + " : " + gt + " " + this.toVar);
1112
1187
  stepPart = this.stepVar ? "" + idx + " += " + this.stepVar : known ? namedIndex ? from <= to ? "++" + idx : "--" + idx : from <= to ? "" + idx + "++" : "" + idx + "--" : namedIndex ? "" + cond + " ? ++" + idx + " : --" + idx : "" + cond + " ? " + idx + "++ : " + idx + "--";
1113
1188
  if (namedIndex) {
1114
1189
  varPart = "" + idxName + " = " + varPart;
@@ -1116,7 +1191,7 @@ define(function(require, exports, module) {
1116
1191
  if (namedIndex) {
1117
1192
  stepPart = "" + idxName + " = " + stepPart;
1118
1193
  }
1119
- return "" + varPart + "; " + condPart + "; " + stepPart;
1194
+ return [this.makeCode("" + varPart + "; " + condPart + "; " + stepPart)];
1120
1195
  };
1121
1196
 
1122
1197
  Range.prototype.compileArray = function(o) {
@@ -1130,7 +1205,7 @@ define(function(require, exports, module) {
1130
1205
  if (this.exclusive) {
1131
1206
  range.pop();
1132
1207
  }
1133
- return "[" + (range.join(', ')) + "]";
1208
+ return [this.makeCode("[" + (range.join(', ')) + "]")];
1134
1209
  }
1135
1210
  idt = this.tab + TAB;
1136
1211
  i = o.scope.freeVariable('i');
@@ -1138,7 +1213,7 @@ define(function(require, exports, module) {
1138
1213
  pre = "\n" + idt + result + " = [];";
1139
1214
  if (this.fromNum && this.toNum) {
1140
1215
  o.index = i;
1141
- body = this.compileNode(o);
1216
+ body = fragmentsToText(this.compileNode(o));
1142
1217
  } else {
1143
1218
  vars = ("" + i + " = " + this.fromC) + (this.toC !== this.toVar ? ", " + this.toC : '');
1144
1219
  cond = "" + this.fromVar + " <= " + this.toVar;
@@ -1146,14 +1221,12 @@ define(function(require, exports, module) {
1146
1221
  }
1147
1222
  post = "{ " + result + ".push(" + i + "); }\n" + idt + "return " + result + ";\n" + o.indent;
1148
1223
  hasArgs = function(node) {
1149
- return node != null ? node.contains(function(n) {
1150
- return n instanceof Literal && n.value === 'arguments' && !n.asKey;
1151
- }) : void 0;
1224
+ return node != null ? node.contains(isLiteralArguments) : void 0;
1152
1225
  };
1153
1226
  if (hasArgs(this.from) || hasArgs(this.to)) {
1154
1227
  args = ', arguments';
1155
1228
  }
1156
- return "(function() {" + pre + "\n" + idt + "for (" + body + ")" + post + "}).apply(this" + (args != null ? args : '') + ")";
1229
+ return [this.makeCode("(function() {" + pre + "\n" + idt + "for (" + body + ")" + post + "}).apply(this" + (args != null ? args : '') + ")")];
1157
1230
  };
1158
1231
 
1159
1232
  return Range;
@@ -1161,7 +1234,6 @@ define(function(require, exports, module) {
1161
1234
  })(Base);
1162
1235
 
1163
1236
  exports.Slice = Slice = (function(_super) {
1164
-
1165
1237
  __extends(Slice, _super);
1166
1238
 
1167
1239
  Slice.prototype.children = ['range'];
@@ -1172,14 +1244,17 @@ define(function(require, exports, module) {
1172
1244
  }
1173
1245
 
1174
1246
  Slice.prototype.compileNode = function(o) {
1175
- var compiled, from, fromStr, to, toStr, _ref2;
1247
+ var compiled, compiledText, from, fromCompiled, to, toStr, _ref2;
1176
1248
  _ref2 = this.range, to = _ref2.to, from = _ref2.from;
1177
- fromStr = from && from.compile(o, LEVEL_PAREN) || '0';
1178
- compiled = to && to.compile(o, LEVEL_PAREN);
1179
- if (to && !(!this.range.exclusive && +compiled === -1)) {
1180
- toStr = ', ' + (this.range.exclusive ? compiled : SIMPLENUM.test(compiled) ? "" + (+compiled + 1) : (compiled = to.compile(o, LEVEL_ACCESS), "+" + compiled + " + 1 || 9e9"));
1249
+ fromCompiled = from && from.compileToFragments(o, LEVEL_PAREN) || [this.makeCode('0')];
1250
+ if (to) {
1251
+ compiled = to.compileToFragments(o, LEVEL_PAREN);
1252
+ compiledText = fragmentsToText(compiled);
1253
+ if (!(!this.range.exclusive && +compiledText === -1)) {
1254
+ toStr = ', ' + (this.range.exclusive ? compiledText : SIMPLENUM.test(compiledText) ? "" + (+compiledText + 1) : (compiled = to.compileToFragments(o, LEVEL_ACCESS), "+" + (fragmentsToText(compiled)) + " + 1 || 9e9"));
1255
+ }
1181
1256
  }
1182
- return ".slice(" + fromStr + (toStr || '') + ")";
1257
+ return [this.makeCode(".slice(" + (fragmentsToText(fromCompiled)) + (toStr || '') + ")")];
1183
1258
  };
1184
1259
 
1185
1260
  return Slice;
@@ -1187,7 +1262,6 @@ define(function(require, exports, module) {
1187
1262
  })(Base);
1188
1263
 
1189
1264
  exports.Obj = Obj = (function(_super) {
1190
-
1191
1265
  __extends(Obj, _super);
1192
1266
 
1193
1267
  function Obj(props, generated) {
@@ -1198,47 +1272,52 @@ define(function(require, exports, module) {
1198
1272
  Obj.prototype.children = ['properties'];
1199
1273
 
1200
1274
  Obj.prototype.compileNode = function(o) {
1201
- var i, idt, indent, join, lastNoncom, node, obj, prop, props, _i, _len;
1275
+ var answer, i, idt, indent, join, lastNoncom, node, prop, props, _i, _j, _len, _len1;
1202
1276
  props = this.properties;
1203
1277
  if (!props.length) {
1204
- return (this.front ? '({})' : '{}');
1278
+ return [this.makeCode(this.front ? '({})' : '{}')];
1205
1279
  }
1206
1280
  if (this.generated) {
1207
1281
  for (_i = 0, _len = props.length; _i < _len; _i++) {
1208
1282
  node = props[_i];
1209
1283
  if (node instanceof Value) {
1210
- throw new Error('cannot have an implicit value in an implicit object');
1284
+ node.error('cannot have an implicit value in an implicit object');
1211
1285
  }
1212
1286
  }
1213
1287
  }
1214
1288
  idt = o.indent += TAB;
1215
1289
  lastNoncom = this.lastNonComment(this.properties);
1216
- props = (function() {
1217
- var _j, _len1, _results;
1218
- _results = [];
1219
- for (i = _j = 0, _len1 = props.length; _j < _len1; i = ++_j) {
1220
- prop = props[i];
1221
- join = i === props.length - 1 ? '' : prop === lastNoncom || prop instanceof Comment ? '\n' : ',\n';
1222
- indent = prop instanceof Comment ? '' : idt;
1223
- if (prop instanceof Value && prop["this"]) {
1224
- prop = new Assign(prop.properties[0].name, prop, 'object');
1225
- }
1226
- if (!(prop instanceof Comment)) {
1227
- if (!(prop instanceof Assign)) {
1228
- prop = new Assign(prop, prop, 'object');
1229
- }
1230
- (prop.variable.base || prop.variable).asKey = true;
1290
+ answer = [];
1291
+ for (i = _j = 0, _len1 = props.length; _j < _len1; i = ++_j) {
1292
+ prop = props[i];
1293
+ join = i === props.length - 1 ? '' : prop === lastNoncom || prop instanceof Comment ? '\n' : ',\n';
1294
+ indent = prop instanceof Comment ? '' : idt;
1295
+ if (prop instanceof Assign && prop.variable instanceof Value && prop.variable.hasProperties()) {
1296
+ prop.variable.error('Invalid object key');
1297
+ }
1298
+ if (prop instanceof Value && prop["this"]) {
1299
+ prop = new Assign(prop.properties[0].name, prop, 'object');
1300
+ }
1301
+ if (!(prop instanceof Comment)) {
1302
+ if (!(prop instanceof Assign)) {
1303
+ prop = new Assign(prop, prop, 'object');
1231
1304
  }
1232
- _results.push(indent + prop.compile(o, LEVEL_TOP) + join);
1305
+ (prop.variable.base || prop.variable).asKey = true;
1233
1306
  }
1234
- return _results;
1235
- })();
1236
- props = props.join('');
1237
- obj = "{" + (props && '\n' + props + '\n' + this.tab) + "}";
1307
+ if (indent) {
1308
+ answer.push(this.makeCode(indent));
1309
+ }
1310
+ answer.push.apply(answer, prop.compileToFragments(o, LEVEL_TOP));
1311
+ if (join) {
1312
+ answer.push(this.makeCode(join));
1313
+ }
1314
+ }
1315
+ answer.unshift(this.makeCode("{" + (props.length && '\n')));
1316
+ answer.push(this.makeCode("" + (props.length && '\n' + this.tab) + "}"));
1238
1317
  if (this.front) {
1239
- return "(" + obj + ")";
1318
+ return this.wrapInBraces(answer);
1240
1319
  } else {
1241
- return obj;
1320
+ return answer;
1242
1321
  }
1243
1322
  };
1244
1323
 
@@ -1259,7 +1338,6 @@ define(function(require, exports, module) {
1259
1338
  })(Base);
1260
1339
 
1261
1340
  exports.Arr = Arr = (function(_super) {
1262
-
1263
1341
  __extends(Arr, _super);
1264
1342
 
1265
1343
  function Arr(objs) {
@@ -1268,32 +1346,42 @@ define(function(require, exports, module) {
1268
1346
 
1269
1347
  Arr.prototype.children = ['objects'];
1270
1348
 
1271
- Arr.prototype.filterImplicitObjects = Call.prototype.filterImplicitObjects;
1272
-
1273
1349
  Arr.prototype.compileNode = function(o) {
1274
- var code, obj, objs;
1350
+ var answer, compiledObjs, fragments, index, obj, _i, _len;
1275
1351
  if (!this.objects.length) {
1276
- return '[]';
1352
+ return [this.makeCode('[]')];
1277
1353
  }
1278
1354
  o.indent += TAB;
1279
- objs = this.filterImplicitObjects(this.objects);
1280
- if (code = Splat.compileSplattedArray(o, objs)) {
1281
- return code;
1282
- }
1283
- code = ((function() {
1284
- var _i, _len, _results;
1355
+ answer = Splat.compileSplattedArray(o, this.objects);
1356
+ if (answer.length) {
1357
+ return answer;
1358
+ }
1359
+ answer = [];
1360
+ compiledObjs = (function() {
1361
+ var _i, _len, _ref2, _results;
1362
+ _ref2 = this.objects;
1285
1363
  _results = [];
1286
- for (_i = 0, _len = objs.length; _i < _len; _i++) {
1287
- obj = objs[_i];
1288
- _results.push(obj.compile(o, LEVEL_LIST));
1364
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
1365
+ obj = _ref2[_i];
1366
+ _results.push(obj.compileToFragments(o, LEVEL_LIST));
1289
1367
  }
1290
1368
  return _results;
1291
- })()).join(', ');
1292
- if (code.indexOf('\n') >= 0) {
1293
- return "[\n" + o.indent + code + "\n" + this.tab + "]";
1369
+ }).call(this);
1370
+ for (index = _i = 0, _len = compiledObjs.length; _i < _len; index = ++_i) {
1371
+ fragments = compiledObjs[index];
1372
+ if (index) {
1373
+ answer.push(this.makeCode(", "));
1374
+ }
1375
+ answer.push.apply(answer, fragments);
1376
+ }
1377
+ if (fragmentsToText(answer).indexOf('\n') >= 0) {
1378
+ answer.unshift(this.makeCode("[\n" + o.indent));
1379
+ answer.push(this.makeCode("\n" + this.tab + "]"));
1294
1380
  } else {
1295
- return "[" + code + "]";
1381
+ answer.unshift(this.makeCode("["));
1382
+ answer.push(this.makeCode("]"));
1296
1383
  }
1384
+ return answer;
1297
1385
  };
1298
1386
 
1299
1387
  Arr.prototype.assigns = function(name) {
@@ -1313,7 +1401,6 @@ define(function(require, exports, module) {
1313
1401
  })(Base);
1314
1402
 
1315
1403
  exports.Class = Class = (function(_super) {
1316
-
1317
1404
  __extends(Class, _super);
1318
1405
 
1319
1406
  function Class(variable, parent, body) {
@@ -1333,7 +1420,7 @@ define(function(require, exports, module) {
1333
1420
  }
1334
1421
  decl = (tail = last(this.variable.properties)) ? tail instanceof Access && tail.name.value : this.variable.base.value;
1335
1422
  if (__indexOf.call(STRICT_PROSCRIBED, decl) >= 0) {
1336
- throw SyntaxError("variable name may not be " + decl);
1423
+ this.variable.error("class variable name may not be " + decl);
1337
1424
  }
1338
1425
  return decl && (decl = IDENTIFIER.test(decl) && decl);
1339
1426
  };
@@ -1355,16 +1442,12 @@ define(function(require, exports, module) {
1355
1442
  };
1356
1443
 
1357
1444
  Class.prototype.addBoundFunctions = function(o) {
1358
- var bvar, lhs, _i, _len, _ref2, _results;
1359
- if (this.boundFuncs.length) {
1360
- _ref2 = this.boundFuncs;
1361
- _results = [];
1362
- for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
1363
- bvar = _ref2[_i];
1364
- lhs = (new Value(new Literal("this"), [new Access(bvar)])).compile(o);
1365
- _results.push(this.ctor.body.unshift(new Literal("" + lhs + " = " + (utility('bind')) + "(" + lhs + ", this)")));
1366
- }
1367
- return _results;
1445
+ var bvar, lhs, _i, _len, _ref2;
1446
+ _ref2 = this.boundFuncs;
1447
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
1448
+ bvar = _ref2[_i];
1449
+ lhs = (new Value(new Literal("this"), [new Access(bvar)])).compile(o);
1450
+ this.ctor.body.unshift(new Literal("" + lhs + " = " + (utility('bind')) + "(" + lhs + ", this)"));
1368
1451
  }
1369
1452
  };
1370
1453
 
@@ -1381,23 +1464,20 @@ define(function(require, exports, module) {
1381
1464
  func = assign.value;
1382
1465
  if (base.value === 'constructor') {
1383
1466
  if (this.ctor) {
1384
- throw new Error('cannot define more than one constructor in a class');
1467
+ assign.error('cannot define more than one constructor in a class');
1385
1468
  }
1386
1469
  if (func.bound) {
1387
- throw new Error('cannot define a constructor as a bound function');
1470
+ assign.error('cannot define a constructor as a bound function');
1388
1471
  }
1389
1472
  if (func instanceof Code) {
1390
1473
  assign = this.ctor = func;
1391
1474
  } else {
1392
- this.externalCtor = o.scope.freeVariable('class');
1475
+ this.externalCtor = o.classScope.freeVariable('class');
1393
1476
  assign = new Assign(new Literal(this.externalCtor), func);
1394
1477
  }
1395
1478
  } else {
1396
1479
  if (assign.variable["this"]) {
1397
1480
  func["static"] = true;
1398
- if (func.bound) {
1399
- func.context = name;
1400
- }
1401
1481
  } else {
1402
1482
  assign.variable = new Value(new Literal(name), [new Access(new Literal('prototype')), new Access(base)]);
1403
1483
  if (func instanceof Code && func.bound) {
@@ -1415,23 +1495,29 @@ define(function(require, exports, module) {
1415
1495
  };
1416
1496
 
1417
1497
  Class.prototype.walkBody = function(name, o) {
1418
- var _this = this;
1419
- return this.traverseChildren(false, function(child) {
1420
- var exps, i, node, _i, _len, _ref2;
1421
- if (child instanceof Class) {
1422
- return false;
1423
- }
1424
- if (child instanceof Block) {
1425
- _ref2 = exps = child.expressions;
1426
- for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
1427
- node = _ref2[i];
1428
- if (node instanceof Value && node.isObject(true)) {
1429
- exps[i] = _this.addProperties(node, name, o);
1498
+ return this.traverseChildren(false, (function(_this) {
1499
+ return function(child) {
1500
+ var cont, exps, i, node, _i, _len, _ref2;
1501
+ cont = true;
1502
+ if (child instanceof Class) {
1503
+ return false;
1504
+ }
1505
+ if (child instanceof Block) {
1506
+ _ref2 = exps = child.expressions;
1507
+ for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
1508
+ node = _ref2[i];
1509
+ if (node instanceof Assign && node.variable.looksStatic(name)) {
1510
+ node.value["static"] = true;
1511
+ } else if (node instanceof Value && node.isObject(true)) {
1512
+ cont = false;
1513
+ exps[i] = _this.addProperties(node, name, o);
1514
+ }
1430
1515
  }
1516
+ child.expressions = exps = flatten(exps);
1431
1517
  }
1432
- return child.expressions = exps = flatten(exps);
1433
- }
1434
- });
1518
+ return cont && !(child instanceof Class);
1519
+ };
1520
+ })(this));
1435
1521
  };
1436
1522
 
1437
1523
  Class.prototype.hoistDirectivePrologue = function() {
@@ -1447,11 +1533,10 @@ define(function(require, exports, module) {
1447
1533
  Class.prototype.ensureConstructor = function(name) {
1448
1534
  if (!this.ctor) {
1449
1535
  this.ctor = new Code;
1450
- if (this.parent) {
1451
- this.ctor.body.push(new Literal("" + name + ".__super__.constructor.apply(this, arguments)"));
1452
- }
1453
1536
  if (this.externalCtor) {
1454
1537
  this.ctor.body.push(new Literal("" + this.externalCtor + ".apply(this, arguments)"));
1538
+ } else if (this.parent) {
1539
+ this.ctor.body.push(new Literal("" + name + ".__super__.constructor.apply(this, arguments)"));
1455
1540
  }
1456
1541
  this.ctor.body.makeReturn();
1457
1542
  this.body.expressions.unshift(this.ctor);
@@ -1462,37 +1547,40 @@ define(function(require, exports, module) {
1462
1547
  };
1463
1548
 
1464
1549
  Class.prototype.compileNode = function(o) {
1465
- var call, decl, klass, lname, name, params, _ref2;
1466
- decl = this.determineName();
1467
- name = decl || '_Class';
1550
+ var args, argumentsNode, func, jumpNode, klass, lname, name, superClass, _ref2;
1551
+ if (jumpNode = this.body.jumps()) {
1552
+ jumpNode.error('Class bodies cannot contain pure statements');
1553
+ }
1554
+ if (argumentsNode = this.body.contains(isLiteralArguments)) {
1555
+ argumentsNode.error("Class bodies shouldn't reference arguments");
1556
+ }
1557
+ name = this.determineName() || '_Class';
1468
1558
  if (name.reserved) {
1469
1559
  name = "_" + name;
1470
1560
  }
1471
1561
  lname = new Literal(name);
1562
+ func = new Code([], Block.wrap([this.body]));
1563
+ args = [];
1564
+ o.classScope = func.makeScope(o.scope);
1472
1565
  this.hoistDirectivePrologue();
1473
1566
  this.setContext(name);
1474
1567
  this.walkBody(name, o);
1475
1568
  this.ensureConstructor(name);
1569
+ this.addBoundFunctions(o);
1476
1570
  this.body.spaced = true;
1477
- if (!(this.ctor instanceof Code)) {
1478
- this.body.expressions.unshift(this.ctor);
1479
- }
1480
1571
  this.body.expressions.push(lname);
1481
- (_ref2 = this.body.expressions).unshift.apply(_ref2, this.directives);
1482
- this.addBoundFunctions(o);
1483
- call = Closure.wrap(this.body);
1484
1572
  if (this.parent) {
1485
- this.superClass = new Literal(o.scope.freeVariable('super', false));
1486
- this.body.expressions.unshift(new Extends(lname, this.superClass));
1487
- call.args.push(this.parent);
1488
- params = call.variable.params || call.variable.base.params;
1489
- params.push(new Param(this.superClass));
1573
+ superClass = new Literal(o.classScope.freeVariable('super', false));
1574
+ this.body.expressions.unshift(new Extends(lname, superClass));
1575
+ func.params.push(new Param(superClass));
1576
+ args.push(this.parent);
1490
1577
  }
1491
- klass = new Parens(call, true);
1578
+ (_ref2 = this.body.expressions).unshift.apply(_ref2, this.directives);
1579
+ klass = new Parens(new Call(func, args));
1492
1580
  if (this.variable) {
1493
1581
  klass = new Assign(this.variable, klass);
1494
1582
  }
1495
- return klass.compile(o);
1583
+ return klass.compileToFragments(o);
1496
1584
  };
1497
1585
 
1498
1586
  return Class;
@@ -1500,7 +1588,6 @@ define(function(require, exports, module) {
1500
1588
  })(Base);
1501
1589
 
1502
1590
  exports.Assign = Assign = (function(_super) {
1503
-
1504
1591
  __extends(Assign, _super);
1505
1592
 
1506
1593
  function Assign(variable, value, context, options) {
@@ -1512,7 +1599,7 @@ define(function(require, exports, module) {
1512
1599
  this.subpattern = options && options.subpattern;
1513
1600
  forbidden = (_ref2 = (name = this.variable.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0);
1514
1601
  if (forbidden && this.context !== 'object') {
1515
- throw SyntaxError("variable name may not be \"" + name + "\"");
1602
+ this.variable.error("variable name may not be \"" + name + "\"");
1516
1603
  }
1517
1604
  }
1518
1605
 
@@ -1531,7 +1618,7 @@ define(function(require, exports, module) {
1531
1618
  };
1532
1619
 
1533
1620
  Assign.prototype.compileNode = function(o) {
1534
- var isValue, match, name, val, varBase, _ref2, _ref3, _ref4, _ref5;
1621
+ var answer, compiledName, isValue, match, name, val, varBase, _ref2, _ref3, _ref4;
1535
1622
  if (isValue = this.variable instanceof Value) {
1536
1623
  if (this.variable.isArray() || this.variable.isObject()) {
1537
1624
  return this.compilePatternMatch(o);
@@ -1543,10 +1630,12 @@ define(function(require, exports, module) {
1543
1630
  return this.compileConditional(o);
1544
1631
  }
1545
1632
  }
1546
- name = this.variable.compile(o, LEVEL_LIST);
1633
+ compiledName = this.variable.compileToFragments(o, LEVEL_LIST);
1634
+ name = fragmentsToText(compiledName);
1547
1635
  if (!this.context) {
1548
- if (!(varBase = this.variable.unwrapAll()).isAssignable()) {
1549
- throw SyntaxError("\"" + (this.variable.compile(o)) + "\" cannot be assigned.");
1636
+ varBase = this.variable.unwrapAll();
1637
+ if (!varBase.isAssignable()) {
1638
+ this.variable.error("\"" + (this.variable.compile(o)) + "\" cannot be assigned");
1550
1639
  }
1551
1640
  if (!(typeof varBase.hasProperties === "function" ? varBase.hasProperties() : void 0)) {
1552
1641
  if (this.param) {
@@ -1557,32 +1646,32 @@ define(function(require, exports, module) {
1557
1646
  }
1558
1647
  }
1559
1648
  if (this.value instanceof Code && (match = METHOD_DEF.exec(name))) {
1560
- if (match[1]) {
1649
+ if (match[2]) {
1561
1650
  this.value.klass = match[1];
1562
1651
  }
1563
- this.value.name = (_ref3 = (_ref4 = (_ref5 = match[2]) != null ? _ref5 : match[3]) != null ? _ref4 : match[4]) != null ? _ref3 : match[5];
1652
+ this.value.name = (_ref3 = (_ref4 = match[3]) != null ? _ref4 : match[4]) != null ? _ref3 : match[5];
1564
1653
  }
1565
- val = this.value.compile(o, LEVEL_LIST);
1654
+ val = this.value.compileToFragments(o, LEVEL_LIST);
1566
1655
  if (this.context === 'object') {
1567
- return "" + name + ": " + val;
1656
+ return compiledName.concat(this.makeCode(": "), val);
1568
1657
  }
1569
- val = name + (" " + (this.context || '=') + " ") + val;
1658
+ answer = compiledName.concat(this.makeCode(" " + (this.context || '=') + " "), val);
1570
1659
  if (o.level <= LEVEL_LIST) {
1571
- return val;
1660
+ return answer;
1572
1661
  } else {
1573
- return "(" + val + ")";
1662
+ return this.wrapInBraces(answer);
1574
1663
  }
1575
1664
  };
1576
1665
 
1577
1666
  Assign.prototype.compilePatternMatch = function(o) {
1578
- 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;
1667
+ var acc, assigns, code, fragments, i, idx, isObject, ivar, name, obj, objects, olen, ref, rest, splat, top, val, value, vvar, vvarText, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
1579
1668
  top = o.level === LEVEL_TOP;
1580
1669
  value = this.value;
1581
1670
  objects = this.variable.base.objects;
1582
1671
  if (!(olen = objects.length)) {
1583
- code = value.compile(o);
1672
+ code = value.compileToFragments(o);
1584
1673
  if (o.level >= LEVEL_OP) {
1585
- return "(" + code + ")";
1674
+ return this.wrapInBraces(code);
1586
1675
  } else {
1587
1676
  return code;
1588
1677
  }
@@ -1592,38 +1681,36 @@ define(function(require, exports, module) {
1592
1681
  if (obj instanceof Assign) {
1593
1682
  _ref2 = obj, (_ref3 = _ref2.variable, idx = _ref3.base), obj = _ref2.value;
1594
1683
  } else {
1595
- if (obj.base instanceof Parens) {
1596
- _ref4 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref4[0], idx = _ref4[1];
1597
- } else {
1598
- idx = isObject ? obj["this"] ? obj.properties[0].name : obj : new Literal(0);
1599
- }
1684
+ idx = isObject ? obj["this"] ? obj.properties[0].name : obj : new Literal(0);
1600
1685
  }
1601
1686
  acc = IDENTIFIER.test(idx.unwrap().value || 0);
1602
1687
  value = new Value(value);
1603
1688
  value.properties.push(new (acc ? Access : Index)(idx));
1604
- if (_ref5 = obj.unwrap().value, __indexOf.call(RESERVED, _ref5) >= 0) {
1605
- throw new SyntaxError("assignment to a reserved word: " + (obj.compile(o)) + " = " + (value.compile(o)));
1689
+ if (_ref4 = obj.unwrap().value, __indexOf.call(RESERVED, _ref4) >= 0) {
1690
+ obj.error("assignment to a reserved word: " + (obj.compile(o)));
1606
1691
  }
1607
1692
  return new Assign(obj, value, null, {
1608
1693
  param: this.param
1609
- }).compile(o, LEVEL_TOP);
1694
+ }).compileToFragments(o, LEVEL_TOP);
1610
1695
  }
1611
- vvar = value.compile(o, LEVEL_LIST);
1696
+ vvar = value.compileToFragments(o, LEVEL_LIST);
1697
+ vvarText = fragmentsToText(vvar);
1612
1698
  assigns = [];
1613
1699
  splat = false;
1614
- if (!IDENTIFIER.test(vvar) || this.variable.assigns(vvar)) {
1615
- assigns.push("" + (ref = o.scope.freeVariable('ref')) + " = " + vvar);
1616
- vvar = ref;
1700
+ if (!IDENTIFIER.test(vvarText) || this.variable.assigns(vvarText)) {
1701
+ assigns.push([this.makeCode("" + (ref = o.scope.freeVariable('ref')) + " = ")].concat(__slice.call(vvar)));
1702
+ vvar = [this.makeCode(ref)];
1703
+ vvarText = ref;
1617
1704
  }
1618
1705
  for (i = _i = 0, _len = objects.length; _i < _len; i = ++_i) {
1619
1706
  obj = objects[i];
1620
1707
  idx = i;
1621
1708
  if (isObject) {
1622
1709
  if (obj instanceof Assign) {
1623
- _ref6 = obj, (_ref7 = _ref6.variable, idx = _ref7.base), obj = _ref6.value;
1710
+ _ref5 = obj, (_ref6 = _ref5.variable, idx = _ref6.base), obj = _ref5.value;
1624
1711
  } else {
1625
1712
  if (obj.base instanceof Parens) {
1626
- _ref8 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref8[0], idx = _ref8[1];
1713
+ _ref7 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref7[0], idx = _ref7[1];
1627
1714
  } else {
1628
1715
  idx = obj["this"] ? obj.properties[0].name : obj;
1629
1716
  }
@@ -1632,10 +1719,10 @@ define(function(require, exports, module) {
1632
1719
  if (!splat && obj instanceof Splat) {
1633
1720
  name = obj.name.unwrap().value;
1634
1721
  obj = obj.unwrap();
1635
- val = "" + olen + " <= " + vvar + ".length ? " + (utility('slice')) + ".call(" + vvar + ", " + i;
1722
+ val = "" + olen + " <= " + vvarText + ".length ? " + (utility('slice')) + ".call(" + vvarText + ", " + i;
1636
1723
  if (rest = olen - i - 1) {
1637
1724
  ivar = o.scope.freeVariable('i');
1638
- val += ", " + ivar + " = " + vvar + ".length - " + rest + ") : (" + ivar + " = " + i + ", [])";
1725
+ val += ", " + ivar + " = " + vvarText + ".length - " + rest + ") : (" + ivar + " = " + i + ", [])";
1639
1726
  } else {
1640
1727
  val += ") : []";
1641
1728
  }
@@ -1644,8 +1731,7 @@ define(function(require, exports, module) {
1644
1731
  } else {
1645
1732
  name = obj.unwrap().value;
1646
1733
  if (obj instanceof Splat) {
1647
- obj = obj.name.compile(o);
1648
- throw new SyntaxError("multiple splats are disallowed in an assignment: " + obj + "...");
1734
+ obj.error("multiple splats are disallowed in an assignment");
1649
1735
  }
1650
1736
  if (typeof idx === 'number') {
1651
1737
  idx = new Literal(splat || idx);
@@ -1653,47 +1739,60 @@ define(function(require, exports, module) {
1653
1739
  } else {
1654
1740
  acc = isObject && IDENTIFIER.test(idx.unwrap().value || 0);
1655
1741
  }
1656
- val = new Value(new Literal(vvar), [new (acc ? Access : Index)(idx)]);
1742
+ val = new Value(new Literal(vvarText), [new (acc ? Access : Index)(idx)]);
1657
1743
  }
1658
1744
  if ((name != null) && __indexOf.call(RESERVED, name) >= 0) {
1659
- throw new SyntaxError("assignment to a reserved word: " + (obj.compile(o)) + " = " + (val.compile(o)));
1745
+ obj.error("assignment to a reserved word: " + (obj.compile(o)));
1660
1746
  }
1661
1747
  assigns.push(new Assign(obj, val, null, {
1662
1748
  param: this.param,
1663
1749
  subpattern: true
1664
- }).compile(o, LEVEL_LIST));
1750
+ }).compileToFragments(o, LEVEL_LIST));
1665
1751
  }
1666
1752
  if (!(top || this.subpattern)) {
1667
1753
  assigns.push(vvar);
1668
1754
  }
1669
- code = assigns.join(', ');
1755
+ fragments = this.joinFragmentArrays(assigns, ', ');
1670
1756
  if (o.level < LEVEL_LIST) {
1671
- return code;
1757
+ return fragments;
1672
1758
  } else {
1673
- return "(" + code + ")";
1759
+ return this.wrapInBraces(fragments);
1674
1760
  }
1675
1761
  };
1676
1762
 
1677
1763
  Assign.prototype.compileConditional = function(o) {
1678
- var left, right, _ref2;
1764
+ var fragments, left, right, _ref2;
1679
1765
  _ref2 = this.variable.cacheReference(o), left = _ref2[0], right = _ref2[1];
1680
1766
  if (!left.properties.length && left.base instanceof Literal && left.base.value !== "this" && !o.scope.check(left.base.value)) {
1681
- throw new Error("the variable \"" + left.base.value + "\" can't be assigned with " + this.context + " because it has not been defined.");
1767
+ this.variable.error("the variable \"" + left.base.value + "\" can't be assigned with " + this.context + " because it has not been declared before");
1682
1768
  }
1683
1769
  if (__indexOf.call(this.context, "?") >= 0) {
1684
1770
  o.isExistentialEquals = true;
1771
+ return new If(new Existence(left), right, {
1772
+ type: 'if'
1773
+ }).addElse(new Assign(right, this.value, '=')).compileToFragments(o);
1774
+ } else {
1775
+ fragments = new Op(this.context.slice(0, -1), left, new Assign(right, this.value, '=')).compileToFragments(o);
1776
+ if (o.level <= LEVEL_LIST) {
1777
+ return fragments;
1778
+ } else {
1779
+ return this.wrapInBraces(fragments);
1780
+ }
1685
1781
  }
1686
- return new Op(this.context.slice(0, -1), left, new Assign(right, this.value, '=')).compile(o);
1687
1782
  };
1688
1783
 
1689
1784
  Assign.prototype.compileSplice = function(o) {
1690
- var code, exclusive, from, fromDecl, fromRef, name, to, valDef, valRef, _ref2, _ref3, _ref4;
1785
+ var answer, exclusive, from, fromDecl, fromRef, name, to, valDef, valRef, _ref2, _ref3, _ref4;
1691
1786
  _ref2 = this.variable.properties.pop().range, from = _ref2.from, to = _ref2.to, exclusive = _ref2.exclusive;
1692
1787
  name = this.variable.compile(o);
1693
- _ref3 = (from != null ? from.cache(o, LEVEL_OP) : void 0) || ['0', '0'], fromDecl = _ref3[0], fromRef = _ref3[1];
1788
+ if (from) {
1789
+ _ref3 = this.cacheToCodeFragments(from.cache(o, LEVEL_OP)), fromDecl = _ref3[0], fromRef = _ref3[1];
1790
+ } else {
1791
+ fromDecl = fromRef = '0';
1792
+ }
1694
1793
  if (to) {
1695
- if ((from != null ? from.isSimpleNumber() : void 0) && to.isSimpleNumber()) {
1696
- to = +to.compile(o) - +fromRef;
1794
+ if (from instanceof Value && from.isSimpleNumber() && to instanceof Value && to.isSimpleNumber()) {
1795
+ to = to.compile(o) - fromRef;
1697
1796
  if (!exclusive) {
1698
1797
  to += 1;
1699
1798
  }
@@ -1707,11 +1806,11 @@ define(function(require, exports, module) {
1707
1806
  to = "9e9";
1708
1807
  }
1709
1808
  _ref4 = this.value.cache(o, LEVEL_LIST), valDef = _ref4[0], valRef = _ref4[1];
1710
- code = "[].splice.apply(" + name + ", [" + fromDecl + ", " + to + "].concat(" + valDef + ")), " + valRef;
1809
+ answer = [].concat(this.makeCode("[].splice.apply(" + name + ", [" + fromDecl + ", " + to + "].concat("), valDef, this.makeCode(")), "), valRef);
1711
1810
  if (o.level > LEVEL_TOP) {
1712
- return "(" + code + ")";
1811
+ return this.wrapInBraces(answer);
1713
1812
  } else {
1714
- return code;
1813
+ return answer;
1715
1814
  }
1716
1815
  };
1717
1816
 
@@ -1720,16 +1819,12 @@ define(function(require, exports, module) {
1720
1819
  })(Base);
1721
1820
 
1722
1821
  exports.Code = Code = (function(_super) {
1723
-
1724
1822
  __extends(Code, _super);
1725
1823
 
1726
1824
  function Code(params, body, tag) {
1727
1825
  this.params = params || [];
1728
1826
  this.body = body || new Block;
1729
1827
  this.bound = tag === 'boundfunc';
1730
- if (this.bound) {
1731
- this.context = '_this';
1732
- }
1733
1828
  }
1734
1829
 
1735
1830
  Code.prototype.children = ['params', 'body'];
@@ -1740,31 +1835,43 @@ define(function(require, exports, module) {
1740
1835
 
1741
1836
  Code.prototype.jumps = NO;
1742
1837
 
1838
+ Code.prototype.makeScope = function(parentScope) {
1839
+ return new Scope(parentScope, this.body, this);
1840
+ };
1841
+
1743
1842
  Code.prototype.compileNode = function(o) {
1744
- 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;
1745
- o.scope = new Scope(o.scope, this.body, this);
1843
+ var answer, boundfunc, code, exprs, i, lit, p, param, params, ref, splats, uniqs, val, wasEmpty, wrapper, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _m, _n, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
1844
+ if (this.bound && ((_ref2 = o.scope.method) != null ? _ref2.bound : void 0)) {
1845
+ this.context = o.scope.method.context;
1846
+ }
1847
+ if (this.bound && !this.context) {
1848
+ this.context = '_this';
1849
+ wrapper = new Code([new Param(new Literal(this.context))], new Block([this]));
1850
+ boundfunc = new Call(wrapper, [new Literal('this')]);
1851
+ boundfunc.updateLocationDataIfMissing(this.locationData);
1852
+ return boundfunc.compileNode(o);
1853
+ }
1854
+ o.scope = del(o, 'classScope') || this.makeScope(o.scope);
1746
1855
  o.scope.shared = del(o, 'sharedScope');
1747
1856
  o.indent += TAB;
1748
1857
  delete o.bare;
1749
1858
  delete o.isExistentialEquals;
1750
1859
  params = [];
1751
1860
  exprs = [];
1752
- _ref2 = this.paramNames();
1753
- for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
1754
- name = _ref2[_i];
1755
- if (!o.scope.check(name)) {
1756
- o.scope.parameter(name);
1757
- }
1758
- }
1759
1861
  _ref3 = this.params;
1760
- for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {
1761
- param = _ref3[_j];
1862
+ for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
1863
+ param = _ref3[_i];
1864
+ o.scope.parameter(param.asReference(o));
1865
+ }
1866
+ _ref4 = this.params;
1867
+ for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) {
1868
+ param = _ref4[_j];
1762
1869
  if (!param.splat) {
1763
1870
  continue;
1764
1871
  }
1765
- _ref4 = this.params;
1766
- for (_k = 0, _len2 = _ref4.length; _k < _len2; _k++) {
1767
- p = _ref4[_k].name;
1872
+ _ref5 = this.params;
1873
+ for (_k = 0, _len2 = _ref5.length; _k < _len2; _k++) {
1874
+ p = _ref5[_k].name;
1768
1875
  if (p["this"]) {
1769
1876
  p = p.properties[0].name;
1770
1877
  }
@@ -1773,20 +1880,20 @@ define(function(require, exports, module) {
1773
1880
  }
1774
1881
  }
1775
1882
  splats = new Assign(new Value(new Arr((function() {
1776
- var _l, _len3, _ref5, _results;
1777
- _ref5 = this.params;
1883
+ var _l, _len3, _ref6, _results;
1884
+ _ref6 = this.params;
1778
1885
  _results = [];
1779
- for (_l = 0, _len3 = _ref5.length; _l < _len3; _l++) {
1780
- p = _ref5[_l];
1886
+ for (_l = 0, _len3 = _ref6.length; _l < _len3; _l++) {
1887
+ p = _ref6[_l];
1781
1888
  _results.push(p.asReference(o));
1782
1889
  }
1783
1890
  return _results;
1784
1891
  }).call(this))), new Value(new Literal('arguments')));
1785
1892
  break;
1786
1893
  }
1787
- _ref5 = this.params;
1788
- for (_l = 0, _len3 = _ref5.length; _l < _len3; _l++) {
1789
- param = _ref5[_l];
1894
+ _ref6 = this.params;
1895
+ for (_l = 0, _len3 = _ref6.length; _l < _len3; _l++) {
1896
+ param = _ref6[_l];
1790
1897
  if (param.isComplex()) {
1791
1898
  val = ref = param.asReference(o);
1792
1899
  if (param.value) {
@@ -1812,60 +1919,60 @@ define(function(require, exports, module) {
1812
1919
  exprs.unshift(splats);
1813
1920
  }
1814
1921
  if (exprs.length) {
1815
- (_ref6 = this.body.expressions).unshift.apply(_ref6, exprs);
1922
+ (_ref7 = this.body.expressions).unshift.apply(_ref7, exprs);
1816
1923
  }
1817
1924
  for (i = _m = 0, _len4 = params.length; _m < _len4; i = ++_m) {
1818
1925
  p = params[i];
1819
- o.scope.parameter(params[i] = p.compile(o));
1926
+ params[i] = p.compileToFragments(o);
1927
+ o.scope.parameter(fragmentsToText(params[i]));
1820
1928
  }
1821
1929
  uniqs = [];
1822
- _ref7 = this.paramNames();
1823
- for (_n = 0, _len5 = _ref7.length; _n < _len5; _n++) {
1824
- name = _ref7[_n];
1930
+ this.eachParamName(function(name, node) {
1825
1931
  if (__indexOf.call(uniqs, name) >= 0) {
1826
- throw SyntaxError("multiple parameters named '" + name + "'");
1932
+ node.error("multiple parameters named '" + name + "'");
1827
1933
  }
1828
- uniqs.push(name);
1829
- }
1934
+ return uniqs.push(name);
1935
+ });
1830
1936
  if (!(wasEmpty || this.noReturn)) {
1831
1937
  this.body.makeReturn();
1832
1938
  }
1833
- if (this.bound) {
1834
- if ((_ref8 = o.scope.parent.method) != null ? _ref8.bound : void 0) {
1835
- this.bound = this.context = o.scope.parent.method.context;
1836
- } else if (!this["static"]) {
1837
- o.scope.parent.assign('_this', 'this');
1838
- }
1839
- }
1840
- idt = o.indent;
1841
1939
  code = 'function';
1842
1940
  if (this.ctor) {
1843
1941
  code += ' ' + this.name;
1844
1942
  }
1845
- code += '(' + params.join(', ') + ') {';
1943
+ code += '(';
1944
+ answer = [this.makeCode(code)];
1945
+ for (i = _n = 0, _len5 = params.length; _n < _len5; i = ++_n) {
1946
+ p = params[i];
1947
+ if (i) {
1948
+ answer.push(this.makeCode(", "));
1949
+ }
1950
+ answer.push.apply(answer, p);
1951
+ }
1952
+ answer.push(this.makeCode(') {'));
1846
1953
  if (!this.body.isEmpty()) {
1847
- code += "\n" + (this.body.compileWithDeclarations(o)) + "\n" + this.tab;
1954
+ answer = answer.concat(this.makeCode("\n"), this.body.compileWithDeclarations(o), this.makeCode("\n" + this.tab));
1848
1955
  }
1849
- code += '}';
1956
+ answer.push(this.makeCode('}'));
1850
1957
  if (this.ctor) {
1851
- return this.tab + code;
1958
+ return [this.makeCode(this.tab)].concat(__slice.call(answer));
1852
1959
  }
1853
1960
  if (this.front || (o.level >= LEVEL_ACCESS)) {
1854
- return "(" + code + ")";
1961
+ return this.wrapInBraces(answer);
1855
1962
  } else {
1856
- return code;
1963
+ return answer;
1857
1964
  }
1858
1965
  };
1859
1966
 
1860
- Code.prototype.paramNames = function() {
1861
- var names, param, _i, _len, _ref2;
1862
- names = [];
1967
+ Code.prototype.eachParamName = function(iterator) {
1968
+ var param, _i, _len, _ref2, _results;
1863
1969
  _ref2 = this.params;
1970
+ _results = [];
1864
1971
  for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
1865
1972
  param = _ref2[_i];
1866
- names.push.apply(names, param.names());
1973
+ _results.push(param.eachName(iterator));
1867
1974
  }
1868
- return names;
1975
+ return _results;
1869
1976
  };
1870
1977
 
1871
1978
  Code.prototype.traverseChildren = function(crossScope, func) {
@@ -1879,7 +1986,6 @@ define(function(require, exports, module) {
1879
1986
  })(Base);
1880
1987
 
1881
1988
  exports.Param = Param = (function(_super) {
1882
-
1883
1989
  __extends(Param, _super);
1884
1990
 
1885
1991
  function Param(name, value, splat) {
@@ -1888,14 +1994,14 @@ define(function(require, exports, module) {
1888
1994
  this.value = value;
1889
1995
  this.splat = splat;
1890
1996
  if (_ref2 = (name = this.name.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0) {
1891
- throw SyntaxError("parameter name \"" + name + "\" is not allowed");
1997
+ this.name.error("parameter name \"" + name + "\" is not allowed");
1892
1998
  }
1893
1999
  }
1894
2000
 
1895
2001
  Param.prototype.children = ['name', 'value'];
1896
2002
 
1897
- Param.prototype.compile = function(o) {
1898
- return this.name.compile(o, LEVEL_LIST);
2003
+ Param.prototype.compileToFragments = function(o) {
2004
+ return this.name.compileToFragments(o, LEVEL_LIST);
1899
2005
  };
1900
2006
 
1901
2007
  Param.prototype.asReference = function(o) {
@@ -1916,6 +2022,7 @@ define(function(require, exports, module) {
1916
2022
  if (this.splat) {
1917
2023
  node = new Splat(node);
1918
2024
  }
2025
+ node.updateLocationDataIfMissing(this.locationData);
1919
2026
  return this.reference = node;
1920
2027
  };
1921
2028
 
@@ -1923,47 +2030,44 @@ define(function(require, exports, module) {
1923
2030
  return this.name.isComplex();
1924
2031
  };
1925
2032
 
1926
- Param.prototype.names = function(name) {
1927
- var atParam, names, obj, _i, _len, _ref2;
2033
+ Param.prototype.eachName = function(iterator, name) {
2034
+ var atParam, node, obj, _i, _len, _ref2;
1928
2035
  if (name == null) {
1929
2036
  name = this.name;
1930
2037
  }
1931
2038
  atParam = function(obj) {
1932
- var value;
1933
- value = obj.properties[0].name.value;
1934
- if (value.reserved) {
1935
- return [];
1936
- } else {
1937
- return [value];
2039
+ var node;
2040
+ node = obj.properties[0].name;
2041
+ if (!node.value.reserved) {
2042
+ return iterator(node.value, node);
1938
2043
  }
1939
2044
  };
1940
2045
  if (name instanceof Literal) {
1941
- return [name.value];
2046
+ return iterator(name.value, name);
1942
2047
  }
1943
2048
  if (name instanceof Value) {
1944
2049
  return atParam(name);
1945
2050
  }
1946
- names = [];
1947
2051
  _ref2 = name.objects;
1948
2052
  for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
1949
2053
  obj = _ref2[_i];
1950
2054
  if (obj instanceof Assign) {
1951
- names.push(obj.value.unwrap().value);
2055
+ this.eachName(iterator, obj.value.unwrap());
1952
2056
  } else if (obj instanceof Splat) {
1953
- names.push(obj.name.unwrap().value);
2057
+ node = obj.name.unwrap();
2058
+ iterator(node.value, node);
1954
2059
  } else if (obj instanceof Value) {
1955
2060
  if (obj.isArray() || obj.isObject()) {
1956
- names.push.apply(names, this.names(obj.base));
2061
+ this.eachName(iterator, obj.base);
1957
2062
  } else if (obj["this"]) {
1958
- names.push.apply(names, atParam(obj));
2063
+ atParam(obj);
1959
2064
  } else {
1960
- names.push(obj.base.value);
2065
+ iterator(obj.base.value, obj.base);
1961
2066
  }
1962
2067
  } else {
1963
- throw SyntaxError("illegal parameter " + (obj.compile()));
2068
+ obj.error("illegal parameter " + (obj.compile()));
1964
2069
  }
1965
2070
  }
1966
- return names;
1967
2071
  };
1968
2072
 
1969
2073
  return Param;
@@ -1971,7 +2075,6 @@ define(function(require, exports, module) {
1971
2075
  })(Base);
1972
2076
 
1973
2077
  exports.Splat = Splat = (function(_super) {
1974
-
1975
2078
  __extends(Splat, _super);
1976
2079
 
1977
2080
  Splat.prototype.children = ['name'];
@@ -1986,12 +2089,8 @@ define(function(require, exports, module) {
1986
2089
  return this.name.assigns(name);
1987
2090
  };
1988
2091
 
1989
- Splat.prototype.compile = function(o) {
1990
- if (this.index != null) {
1991
- return this.compileParam(o);
1992
- } else {
1993
- return this.name.compile(o);
1994
- }
2092
+ Splat.prototype.compileToFragments = function(o) {
2093
+ return this.name.compileToFragments(o);
1995
2094
  };
1996
2095
 
1997
2096
  Splat.prototype.unwrap = function() {
@@ -1999,29 +2098,32 @@ define(function(require, exports, module) {
1999
2098
  };
2000
2099
 
2001
2100
  Splat.compileSplattedArray = function(o, list, apply) {
2002
- var args, base, code, i, index, node, _i, _len;
2101
+ var args, base, compiledNode, concatPart, fragments, i, index, node, _i, _len;
2003
2102
  index = -1;
2004
2103
  while ((node = list[++index]) && !(node instanceof Splat)) {
2005
2104
  continue;
2006
2105
  }
2007
2106
  if (index >= list.length) {
2008
- return '';
2107
+ return [];
2009
2108
  }
2010
2109
  if (list.length === 1) {
2011
- code = list[0].compile(o, LEVEL_LIST);
2110
+ node = list[0];
2111
+ fragments = node.compileToFragments(o, LEVEL_LIST);
2012
2112
  if (apply) {
2013
- return code;
2113
+ return fragments;
2014
2114
  }
2015
- return "" + (utility('slice')) + ".call(" + code + ")";
2115
+ return [].concat(node.makeCode("" + (utility('slice')) + ".call("), fragments, node.makeCode(")"));
2016
2116
  }
2017
2117
  args = list.slice(index);
2018
2118
  for (i = _i = 0, _len = args.length; _i < _len; i = ++_i) {
2019
2119
  node = args[i];
2020
- code = node.compile(o, LEVEL_LIST);
2021
- args[i] = node instanceof Splat ? "" + (utility('slice')) + ".call(" + code + ")" : "[" + code + "]";
2120
+ compiledNode = node.compileToFragments(o, LEVEL_LIST);
2121
+ args[i] = node instanceof Splat ? [].concat(node.makeCode("" + (utility('slice')) + ".call("), compiledNode, node.makeCode(")")) : [].concat(node.makeCode("["), compiledNode, node.makeCode("]"));
2022
2122
  }
2023
2123
  if (index === 0) {
2024
- return args[0] + (".concat(" + (args.slice(1).join(', ')) + ")");
2124
+ node = list[0];
2125
+ concatPart = node.joinFragmentArrays(args.slice(1), ', ');
2126
+ return args[0].concat(node.makeCode(".concat("), concatPart, node.makeCode(")"));
2025
2127
  }
2026
2128
  base = (function() {
2027
2129
  var _j, _len1, _ref2, _results;
@@ -2029,11 +2131,13 @@ define(function(require, exports, module) {
2029
2131
  _results = [];
2030
2132
  for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
2031
2133
  node = _ref2[_j];
2032
- _results.push(node.compile(o, LEVEL_LIST));
2134
+ _results.push(node.compileToFragments(o, LEVEL_LIST));
2033
2135
  }
2034
2136
  return _results;
2035
2137
  })();
2036
- return "[" + (base.join(', ')) + "].concat(" + (args.join(', ')) + ")";
2138
+ base = list[0].joinFragmentArrays(base, ', ');
2139
+ concatPart = list[index].joinFragmentArrays(args, ', ');
2140
+ return [].concat(list[0].makeCode("["), base, list[index].makeCode("].concat("), concatPart, (last(list)).makeCode(")"));
2037
2141
  };
2038
2142
 
2039
2143
  return Splat;
@@ -2041,7 +2145,6 @@ define(function(require, exports, module) {
2041
2145
  })(Base);
2042
2146
 
2043
2147
  exports.While = While = (function(_super) {
2044
-
2045
2148
  __extends(While, _super);
2046
2149
 
2047
2150
  function While(condition, options) {
@@ -2070,29 +2173,29 @@ define(function(require, exports, module) {
2070
2173
  };
2071
2174
 
2072
2175
  While.prototype.jumps = function() {
2073
- var expressions, node, _i, _len;
2176
+ var expressions, jumpNode, node, _i, _len;
2074
2177
  expressions = this.body.expressions;
2075
2178
  if (!expressions.length) {
2076
2179
  return false;
2077
2180
  }
2078
2181
  for (_i = 0, _len = expressions.length; _i < _len; _i++) {
2079
2182
  node = expressions[_i];
2080
- if (node.jumps({
2183
+ if (jumpNode = node.jumps({
2081
2184
  loop: true
2082
2185
  })) {
2083
- return node;
2186
+ return jumpNode;
2084
2187
  }
2085
2188
  }
2086
2189
  return false;
2087
2190
  };
2088
2191
 
2089
2192
  While.prototype.compileNode = function(o) {
2090
- var body, code, rvar, set;
2193
+ var answer, body, rvar, set;
2091
2194
  o.indent += TAB;
2092
2195
  set = '';
2093
2196
  body = this.body;
2094
2197
  if (body.isEmpty()) {
2095
- body = '';
2198
+ body = this.makeCode('');
2096
2199
  } else {
2097
2200
  if (this.returns) {
2098
2201
  body.makeReturn(rvar = o.scope.freeVariable('results'));
@@ -2107,13 +2210,13 @@ define(function(require, exports, module) {
2107
2210
  }
2108
2211
  }
2109
2212
  }
2110
- body = "\n" + (body.compile(o, LEVEL_TOP)) + "\n" + this.tab;
2213
+ body = [].concat(this.makeCode("\n"), body.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab));
2111
2214
  }
2112
- code = set + this.tab + ("while (" + (this.condition.compile(o, LEVEL_PAREN)) + ") {" + body + "}");
2215
+ answer = [].concat(this.makeCode(set + this.tab + "while ("), this.condition.compileToFragments(o, LEVEL_PAREN), this.makeCode(") {"), body, this.makeCode("}"));
2113
2216
  if (this.returns) {
2114
- code += "\n" + this.tab + "return " + rvar + ";";
2217
+ answer.push(this.makeCode("\n" + this.tab + "return " + rvar + ";"));
2115
2218
  }
2116
- return code;
2219
+ return answer;
2117
2220
  };
2118
2221
 
2119
2222
  return While;
@@ -2235,16 +2338,16 @@ define(function(require, exports, module) {
2235
2338
  };
2236
2339
 
2237
2340
  Op.prototype.compileNode = function(o) {
2238
- var code, isChain, _ref2, _ref3;
2341
+ var answer, isChain, _ref2, _ref3;
2239
2342
  isChain = this.isChainable() && this.first.isChainable();
2240
2343
  if (!isChain) {
2241
2344
  this.first.front = this.front;
2242
2345
  }
2243
2346
  if (this.operator === 'delete' && o.scope.check(this.first.unwrapAll().value)) {
2244
- throw SyntaxError('delete operand may not be argument or var');
2347
+ this.error('delete operand may not be argument or var');
2245
2348
  }
2246
2349
  if (((_ref2 = this.operator) === '--' || _ref2 === '++') && (_ref3 = this.first.unwrapAll().value, __indexOf.call(STRICT_PROSCRIBED, _ref3) >= 0)) {
2247
- throw SyntaxError('prefix increment/decrement may not have eval or arguments operand');
2350
+ this.error("cannot increment/decrement \"" + (this.first.unwrapAll().value) + "\"");
2248
2351
  }
2249
2352
  if (this.isUnary()) {
2250
2353
  return this.compileUnary(o);
@@ -2255,20 +2358,20 @@ define(function(require, exports, module) {
2255
2358
  if (this.operator === '?') {
2256
2359
  return this.compileExistence(o);
2257
2360
  }
2258
- code = this.first.compile(o, LEVEL_OP) + ' ' + this.operator + ' ' + this.second.compile(o, LEVEL_OP);
2361
+ answer = [].concat(this.first.compileToFragments(o, LEVEL_OP), this.makeCode(' ' + this.operator + ' '), this.second.compileToFragments(o, LEVEL_OP));
2259
2362
  if (o.level <= LEVEL_OP) {
2260
- return code;
2363
+ return answer;
2261
2364
  } else {
2262
- return "(" + code + ")";
2365
+ return this.wrapInBraces(answer);
2263
2366
  }
2264
2367
  };
2265
2368
 
2266
2369
  Op.prototype.compileChain = function(o) {
2267
- var code, fst, shared, _ref2;
2370
+ var fragments, fst, shared, _ref2;
2268
2371
  _ref2 = this.first.second.cache(o), this.first.second = _ref2[0], shared = _ref2[1];
2269
- fst = this.first.compile(o, LEVEL_OP);
2270
- code = "" + fst + " " + (this.invert ? '&&' : '||') + " " + (shared.compile(o)) + " " + this.operator + " " + (this.second.compile(o, LEVEL_OP));
2271
- return "(" + code + ")";
2372
+ fst = this.first.compileToFragments(o, LEVEL_OP);
2373
+ fragments = fst.concat(this.makeCode(" " + (this.invert ? '&&' : '||') + " "), shared.compileToFragments(o), this.makeCode(" " + this.operator + " "), this.second.compileToFragments(o, LEVEL_OP));
2374
+ return this.wrapInBraces(fragments);
2272
2375
  };
2273
2376
 
2274
2377
  Op.prototype.compileExistence = function(o) {
@@ -2282,27 +2385,33 @@ define(function(require, exports, module) {
2282
2385
  }
2283
2386
  return new If(new Existence(fst), ref, {
2284
2387
  type: 'if'
2285
- }).addElse(this.second).compile(o);
2388
+ }).addElse(this.second).compileToFragments(o);
2286
2389
  };
2287
2390
 
2288
2391
  Op.prototype.compileUnary = function(o) {
2289
2392
  var op, parts, plusMinus;
2393
+ parts = [];
2394
+ op = this.operator;
2395
+ parts.push([this.makeCode(op)]);
2396
+ if (op === '!' && this.first instanceof Existence) {
2397
+ this.first.negated = !this.first.negated;
2398
+ return this.first.compileToFragments(o);
2399
+ }
2290
2400
  if (o.level >= LEVEL_ACCESS) {
2291
- return (new Parens(this)).compile(o);
2401
+ return (new Parens(this)).compileToFragments(o);
2292
2402
  }
2293
- parts = [op = this.operator];
2294
2403
  plusMinus = op === '+' || op === '-';
2295
2404
  if ((op === 'new' || op === 'typeof' || op === 'delete') || plusMinus && this.first instanceof Op && this.first.operator === op) {
2296
- parts.push(' ');
2405
+ parts.push([this.makeCode(' ')]);
2297
2406
  }
2298
2407
  if ((plusMinus && this.first instanceof Op) || (op === 'new' && this.first.isStatement(o))) {
2299
2408
  this.first = new Parens(this.first);
2300
2409
  }
2301
- parts.push(this.first.compile(o, LEVEL_OP));
2410
+ parts.push(this.first.compileToFragments(o, LEVEL_OP));
2302
2411
  if (this.flip) {
2303
2412
  parts.reverse();
2304
2413
  }
2305
- return parts.join('');
2414
+ return this.joinFragmentArrays(parts, '');
2306
2415
  };
2307
2416
 
2308
2417
  Op.prototype.toString = function(idt) {
@@ -2314,7 +2423,6 @@ define(function(require, exports, module) {
2314
2423
  })(Base);
2315
2424
 
2316
2425
  exports.In = In = (function(_super) {
2317
-
2318
2426
  __extends(In, _super);
2319
2427
 
2320
2428
  function In(object, array) {
@@ -2346,42 +2454,40 @@ define(function(require, exports, module) {
2346
2454
  };
2347
2455
 
2348
2456
  In.prototype.compileOrTest = function(o) {
2349
- var cmp, cnj, i, item, ref, sub, tests, _ref2, _ref3;
2457
+ var cmp, cnj, i, item, ref, sub, tests, _i, _len, _ref2, _ref3, _ref4;
2350
2458
  if (this.array.base.objects.length === 0) {
2351
- return "" + (!!this.negated);
2459
+ return [this.makeCode("" + (!!this.negated))];
2352
2460
  }
2353
2461
  _ref2 = this.object.cache(o, LEVEL_OP), sub = _ref2[0], ref = _ref2[1];
2354
2462
  _ref3 = this.negated ? [' !== ', ' && '] : [' === ', ' || '], cmp = _ref3[0], cnj = _ref3[1];
2355
- tests = (function() {
2356
- var _i, _len, _ref4, _results;
2357
- _ref4 = this.array.base.objects;
2358
- _results = [];
2359
- for (i = _i = 0, _len = _ref4.length; _i < _len; i = ++_i) {
2360
- item = _ref4[i];
2361
- _results.push((i ? ref : sub) + cmp + item.compile(o, LEVEL_ACCESS));
2463
+ tests = [];
2464
+ _ref4 = this.array.base.objects;
2465
+ for (i = _i = 0, _len = _ref4.length; _i < _len; i = ++_i) {
2466
+ item = _ref4[i];
2467
+ if (i) {
2468
+ tests.push(this.makeCode(cnj));
2362
2469
  }
2363
- return _results;
2364
- }).call(this);
2365
- tests = tests.join(cnj);
2470
+ tests = tests.concat((i ? ref : sub), this.makeCode(cmp), item.compileToFragments(o, LEVEL_ACCESS));
2471
+ }
2366
2472
  if (o.level < LEVEL_OP) {
2367
2473
  return tests;
2368
2474
  } else {
2369
- return "(" + tests + ")";
2475
+ return this.wrapInBraces(tests);
2370
2476
  }
2371
2477
  };
2372
2478
 
2373
2479
  In.prototype.compileLoopTest = function(o) {
2374
- var code, ref, sub, _ref2;
2480
+ var fragments, ref, sub, _ref2;
2375
2481
  _ref2 = this.object.cache(o, LEVEL_LIST), sub = _ref2[0], ref = _ref2[1];
2376
- code = utility('indexOf') + (".call(" + (this.array.compile(o, LEVEL_LIST)) + ", " + ref + ") ") + (this.negated ? '< 0' : '>= 0');
2377
- if (sub === ref) {
2378
- return code;
2482
+ fragments = [].concat(this.makeCode(utility('indexOf') + ".call("), this.array.compileToFragments(o, LEVEL_LIST), this.makeCode(", "), ref, this.makeCode(") " + (this.negated ? '< 0' : '>= 0')));
2483
+ if (fragmentsToText(sub) === fragmentsToText(ref)) {
2484
+ return fragments;
2379
2485
  }
2380
- code = sub + ', ' + code;
2486
+ fragments = sub.concat(this.makeCode(', '), fragments);
2381
2487
  if (o.level < LEVEL_LIST) {
2382
- return code;
2488
+ return fragments;
2383
2489
  } else {
2384
- return "(" + code + ")";
2490
+ return this.wrapInBraces(fragments);
2385
2491
  }
2386
2492
  };
2387
2493
 
@@ -2394,12 +2500,11 @@ define(function(require, exports, module) {
2394
2500
  })(Base);
2395
2501
 
2396
2502
  exports.Try = Try = (function(_super) {
2397
-
2398
2503
  __extends(Try, _super);
2399
2504
 
2400
- function Try(attempt, error, recovery, ensure) {
2505
+ function Try(attempt, errorVariable, recovery, ensure) {
2401
2506
  this.attempt = attempt;
2402
- this.error = error;
2507
+ this.errorVariable = errorVariable;
2403
2508
  this.recovery = recovery;
2404
2509
  this.ensure = ensure;
2405
2510
  }
@@ -2424,26 +2529,12 @@ define(function(require, exports, module) {
2424
2529
  };
2425
2530
 
2426
2531
  Try.prototype.compileNode = function(o) {
2427
- var catchPart, ensurePart, errorPart, tryPart;
2532
+ var catchPart, ensurePart, placeholder, tryPart;
2428
2533
  o.indent += TAB;
2429
- errorPart = this.error ? " (" + (this.error.compile(o)) + ") " : ' ';
2430
- tryPart = this.attempt.compile(o, LEVEL_TOP);
2431
- catchPart = (function() {
2432
- var _ref2;
2433
- if (this.recovery) {
2434
- if (_ref2 = this.error.value, __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0) {
2435
- throw SyntaxError("catch variable may not be \"" + this.error.value + "\"");
2436
- }
2437
- if (!o.scope.check(this.error.value)) {
2438
- o.scope.add(this.error.value, 'param');
2439
- }
2440
- return " catch" + errorPart + "{\n" + (this.recovery.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}";
2441
- } else if (!(this.ensure || this.recovery)) {
2442
- return ' catch (_error) {}';
2443
- }
2444
- }).call(this);
2445
- ensurePart = this.ensure ? " finally {\n" + (this.ensure.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}" : '';
2446
- return "" + this.tab + "try {\n" + tryPart + "\n" + this.tab + "}" + (catchPart || '') + ensurePart;
2534
+ tryPart = this.attempt.compileToFragments(o, LEVEL_TOP);
2535
+ catchPart = this.recovery ? (placeholder = new Literal('_error'), this.errorVariable ? this.recovery.unshift(new Assign(this.errorVariable, placeholder)) : void 0, [].concat(this.makeCode(" catch ("), placeholder.compileToFragments(o), this.makeCode(") {\n"), this.recovery.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab + "}"))) : !(this.ensure || this.recovery) ? [this.makeCode(' catch (_error) {}')] : [];
2536
+ ensurePart = this.ensure ? [].concat(this.makeCode(" finally {\n"), this.ensure.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab + "}")) : [];
2537
+ return [].concat(this.makeCode("" + this.tab + "try {\n"), tryPart, this.makeCode("\n" + this.tab + "}"), catchPart, ensurePart);
2447
2538
  };
2448
2539
 
2449
2540
  return Try;
@@ -2451,7 +2542,6 @@ define(function(require, exports, module) {
2451
2542
  })(Base);
2452
2543
 
2453
2544
  exports.Throw = Throw = (function(_super) {
2454
-
2455
2545
  __extends(Throw, _super);
2456
2546
 
2457
2547
  function Throw(expression) {
@@ -2467,7 +2557,7 @@ define(function(require, exports, module) {
2467
2557
  Throw.prototype.makeReturn = THIS;
2468
2558
 
2469
2559
  Throw.prototype.compileNode = function(o) {
2470
- return this.tab + ("throw " + (this.expression.compile(o)) + ";");
2560
+ return [].concat(this.makeCode(this.tab + "throw "), this.expression.compileToFragments(o), this.makeCode(";"));
2471
2561
  };
2472
2562
 
2473
2563
  return Throw;
@@ -2475,7 +2565,6 @@ define(function(require, exports, module) {
2475
2565
  })(Base);
2476
2566
 
2477
2567
  exports.Existence = Existence = (function(_super) {
2478
-
2479
2568
  __extends(Existence, _super);
2480
2569
 
2481
2570
  function Existence(expression) {
@@ -2496,11 +2585,7 @@ define(function(require, exports, module) {
2496
2585
  } else {
2497
2586
  code = "" + code + " " + (this.negated ? '==' : '!=') + " null";
2498
2587
  }
2499
- if (o.level <= LEVEL_COND) {
2500
- return code;
2501
- } else {
2502
- return "(" + code + ")";
2503
- }
2588
+ return [this.makeCode(o.level <= LEVEL_COND ? code : "(" + code + ")")];
2504
2589
  };
2505
2590
 
2506
2591
  return Existence;
@@ -2508,7 +2593,6 @@ define(function(require, exports, module) {
2508
2593
  })(Base);
2509
2594
 
2510
2595
  exports.Parens = Parens = (function(_super) {
2511
-
2512
2596
  __extends(Parens, _super);
2513
2597
 
2514
2598
  function Parens(body) {
@@ -2526,18 +2610,18 @@ define(function(require, exports, module) {
2526
2610
  };
2527
2611
 
2528
2612
  Parens.prototype.compileNode = function(o) {
2529
- var bare, code, expr;
2613
+ var bare, expr, fragments;
2530
2614
  expr = this.body.unwrap();
2531
2615
  if (expr instanceof Value && expr.isAtomic()) {
2532
2616
  expr.front = this.front;
2533
- return expr.compile(o);
2617
+ return expr.compileToFragments(o);
2534
2618
  }
2535
- code = expr.compile(o, LEVEL_PAREN);
2619
+ fragments = expr.compileToFragments(o, LEVEL_PAREN);
2536
2620
  bare = o.level < LEVEL_OP && (expr instanceof Op || expr instanceof Call || (expr instanceof For && expr.returns));
2537
2621
  if (bare) {
2538
- return code;
2622
+ return fragments;
2539
2623
  } else {
2540
- return "(" + code + ")";
2624
+ return this.wrapInBraces(fragments);
2541
2625
  }
2542
2626
  };
2543
2627
 
@@ -2546,7 +2630,6 @@ define(function(require, exports, module) {
2546
2630
  })(Base);
2547
2631
 
2548
2632
  exports.For = For = (function(_super) {
2549
-
2550
2633
  __extends(For, _super);
2551
2634
 
2552
2635
  function For(body, source) {
@@ -2559,15 +2642,18 @@ define(function(require, exports, module) {
2559
2642
  _ref2 = [this.index, this.name], this.name = _ref2[0], this.index = _ref2[1];
2560
2643
  }
2561
2644
  if (this.index instanceof Value) {
2562
- throw SyntaxError('index cannot be a pattern matching expression');
2645
+ this.index.error('index cannot be a pattern matching expression');
2563
2646
  }
2564
2647
  this.range = this.source instanceof Value && this.source.base instanceof Range && !this.source.properties.length;
2565
2648
  this.pattern = this.name instanceof Value;
2566
2649
  if (this.range && this.index) {
2567
- throw SyntaxError('indexes do not apply to range loops');
2650
+ this.index.error('indexes do not apply to range loops');
2568
2651
  }
2569
2652
  if (this.range && this.pattern) {
2570
- throw SyntaxError('cannot pattern match over range loops');
2653
+ this.name.error('cannot pattern match over range loops');
2654
+ }
2655
+ if (this.own && !this.object) {
2656
+ this.name.error('cannot use own with for-in');
2571
2657
  }
2572
2658
  this.returns = false;
2573
2659
  }
@@ -2575,7 +2661,7 @@ define(function(require, exports, module) {
2575
2661
  For.prototype.children = ['body', 'source', 'guard', 'step'];
2576
2662
 
2577
2663
  For.prototype.compileNode = function(o) {
2578
- 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;
2664
+ var body, bodyFragments, compare, compareDown, declare, declareDown, defPart, defPartFragments, down, forPartFragments, guardPart, idt1, increment, index, ivar, kvar, kvarAssign, lastJumps, lvar, name, namePart, ref, resultPart, returnResult, rvar, scope, source, step, stepNum, stepVar, svar, varPart, _ref2, _ref3;
2579
2665
  body = Block.wrap([this.body]);
2580
2666
  lastJumps = (_ref2 = last(body.expressions)) != null ? _ref2.jumps() : void 0;
2581
2667
  if (lastJumps && lastJumps instanceof Return) {
@@ -2583,8 +2669,8 @@ define(function(require, exports, module) {
2583
2669
  }
2584
2670
  source = this.range ? this.source.base : this.source;
2585
2671
  scope = o.scope;
2586
- name = this.name && this.name.compile(o, LEVEL_LIST);
2587
- index = this.index && this.index.compile(o, LEVEL_LIST);
2672
+ name = this.name && (this.name.compile(o, LEVEL_LIST));
2673
+ index = this.index && (this.index.compile(o, LEVEL_LIST));
2588
2674
  if (name && !this.pattern) {
2589
2675
  scope.find(name);
2590
2676
  }
@@ -2598,7 +2684,8 @@ define(function(require, exports, module) {
2598
2684
  kvar = (this.range && name) || index || ivar;
2599
2685
  kvarAssign = kvar !== ivar ? "" + kvar + " = " : "";
2600
2686
  if (this.step && !this.range) {
2601
- stepvar = scope.freeVariable("step");
2687
+ _ref3 = this.cacheToCodeFragments(this.step.cache(o, LEVEL_LIST)), step = _ref3[0], stepVar = _ref3[1];
2688
+ stepNum = stepVar.match(NUMBER);
2602
2689
  }
2603
2690
  if (this.pattern) {
2604
2691
  name = ivar;
@@ -2608,7 +2695,7 @@ define(function(require, exports, module) {
2608
2695
  defPart = '';
2609
2696
  idt1 = this.tab + TAB;
2610
2697
  if (this.range) {
2611
- forPart = source.compile(merge(o, {
2698
+ forPartFragments = source.compileToFragments(merge(o, {
2612
2699
  index: ivar,
2613
2700
  name: name,
2614
2701
  step: this.step
@@ -2616,20 +2703,38 @@ define(function(require, exports, module) {
2616
2703
  } else {
2617
2704
  svar = this.source.compile(o, LEVEL_LIST);
2618
2705
  if ((name || this.own) && !IDENTIFIER.test(svar)) {
2619
- defPart = "" + this.tab + (ref = scope.freeVariable('ref')) + " = " + svar + ";\n";
2706
+ defPart += "" + this.tab + (ref = scope.freeVariable('ref')) + " = " + svar + ";\n";
2620
2707
  svar = ref;
2621
2708
  }
2622
2709
  if (name && !this.pattern) {
2623
2710
  namePart = "" + name + " = " + svar + "[" + kvar + "]";
2624
2711
  }
2625
2712
  if (!this.object) {
2626
- lvar = scope.freeVariable('len');
2627
- forVarPart = "" + kvarAssign + ivar + " = 0, " + lvar + " = " + svar + ".length";
2713
+ if (step !== stepVar) {
2714
+ defPart += "" + this.tab + step + ";\n";
2715
+ }
2716
+ if (!(this.step && stepNum && (down = parseNum(stepNum[0]) < 0))) {
2717
+ lvar = scope.freeVariable('len');
2718
+ }
2719
+ declare = "" + kvarAssign + ivar + " = 0, " + lvar + " = " + svar + ".length";
2720
+ declareDown = "" + kvarAssign + ivar + " = " + svar + ".length - 1";
2721
+ compare = "" + ivar + " < " + lvar;
2722
+ compareDown = "" + ivar + " >= 0";
2628
2723
  if (this.step) {
2629
- forVarPart += ", " + stepvar + " = " + (this.step.compile(o, LEVEL_OP));
2724
+ if (stepNum) {
2725
+ if (down) {
2726
+ compare = compareDown;
2727
+ declare = declareDown;
2728
+ }
2729
+ } else {
2730
+ compare = "" + stepVar + " > 0 ? " + compare + " : " + compareDown;
2731
+ declare = "(" + stepVar + " > 0 ? (" + declare + ") : " + declareDown + ")";
2732
+ }
2733
+ increment = "" + ivar + " += " + stepVar;
2734
+ } else {
2735
+ increment = "" + (kvar !== ivar ? "++" + ivar : "" + ivar + "++");
2630
2736
  }
2631
- stepPart = "" + kvarAssign + (this.step ? "" + ivar + " += " + stepvar : (kvar !== ivar ? "++" + ivar : "" + ivar + "++"));
2632
- forPart = "" + forVarPart + "; " + ivar + " < " + lvar + "; " + stepPart;
2737
+ forPartFragments = [this.makeCode("" + declare + "; " + compare + "; " + kvarAssign + increment)];
2633
2738
  }
2634
2739
  }
2635
2740
  if (this.returns) {
@@ -2649,28 +2754,28 @@ define(function(require, exports, module) {
2649
2754
  if (this.pattern) {
2650
2755
  body.expressions.unshift(new Assign(this.name, new Literal("" + svar + "[" + kvar + "]")));
2651
2756
  }
2652
- defPart += this.pluckDirectCall(o, body);
2757
+ defPartFragments = [].concat(this.makeCode(defPart), this.pluckDirectCall(o, body));
2653
2758
  if (namePart) {
2654
2759
  varPart = "\n" + idt1 + namePart + ";";
2655
2760
  }
2656
2761
  if (this.object) {
2657
- forPart = "" + kvar + " in " + svar;
2762
+ forPartFragments = [this.makeCode("" + kvar + " in " + svar)];
2658
2763
  if (this.own) {
2659
2764
  guardPart = "\n" + idt1 + "if (!" + (utility('hasProp')) + ".call(" + svar + ", " + kvar + ")) continue;";
2660
2765
  }
2661
2766
  }
2662
- body = body.compile(merge(o, {
2767
+ bodyFragments = body.compileToFragments(merge(o, {
2663
2768
  indent: idt1
2664
2769
  }), LEVEL_TOP);
2665
- if (body) {
2666
- body = '\n' + body + '\n';
2770
+ if (bodyFragments && (bodyFragments.length > 0)) {
2771
+ bodyFragments = [].concat(this.makeCode("\n"), bodyFragments, this.makeCode("\n"));
2667
2772
  }
2668
- return "" + defPart + (resultPart || '') + this.tab + "for (" + forPart + ") {" + guardPart + varPart + body + this.tab + "}" + (returnResult || '');
2773
+ return [].concat(defPartFragments, this.makeCode("" + (resultPart || '') + this.tab + "for ("), forPartFragments, this.makeCode(") {" + guardPart + varPart), bodyFragments, this.makeCode("" + this.tab + "}" + (returnResult || '')));
2669
2774
  };
2670
2775
 
2671
2776
  For.prototype.pluckDirectCall = function(o, body) {
2672
- var base, defs, expr, fn, idx, ref, val, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
2673
- defs = '';
2777
+ var base, defs, expr, fn, idx, ref, val, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8;
2778
+ defs = [];
2674
2779
  _ref2 = body.expressions;
2675
2780
  for (idx = _i = 0, _len = _ref2.length; _i < _len; idx = ++_i) {
2676
2781
  expr = _ref2[idx];
@@ -2678,18 +2783,18 @@ define(function(require, exports, module) {
2678
2783
  if (!(expr instanceof Call)) {
2679
2784
  continue;
2680
2785
  }
2681
- val = expr.variable.unwrapAll();
2682
- 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')))) {
2786
+ val = (_ref3 = expr.variable) != null ? _ref3.unwrapAll() : void 0;
2787
+ if (!((val instanceof Code) || (val instanceof Value && ((_ref4 = val.base) != null ? _ref4.unwrapAll() : void 0) instanceof Code && val.properties.length === 1 && ((_ref5 = (_ref6 = val.properties[0].name) != null ? _ref6.value : void 0) === 'call' || _ref5 === 'apply')))) {
2683
2788
  continue;
2684
2789
  }
2685
- fn = ((_ref6 = val.base) != null ? _ref6.unwrapAll() : void 0) || val;
2790
+ fn = ((_ref7 = val.base) != null ? _ref7.unwrapAll() : void 0) || val;
2686
2791
  ref = new Literal(o.scope.freeVariable('fn'));
2687
2792
  base = new Value(ref);
2688
2793
  if (val.base) {
2689
- _ref7 = [base, val], val.base = _ref7[0], base = _ref7[1];
2794
+ _ref8 = [base, val], val.base = _ref8[0], base = _ref8[1];
2690
2795
  }
2691
2796
  body.expressions[idx] = new Call(base, expr.args);
2692
- defs += this.tab + new Assign(ref, fn).compile(o, LEVEL_TOP) + ';\n';
2797
+ defs = defs.concat(this.makeCode(this.tab), new Assign(ref, fn).compileToFragments(o, LEVEL_TOP), this.makeCode(';\n'));
2693
2798
  }
2694
2799
  return defs;
2695
2800
  };
@@ -2699,7 +2804,6 @@ define(function(require, exports, module) {
2699
2804
  })(While);
2700
2805
 
2701
2806
  exports.Switch = Switch = (function(_super) {
2702
-
2703
2807
  __extends(Switch, _super);
2704
2808
 
2705
2809
  function Switch(subject, cases, otherwise) {
@@ -2713,7 +2817,7 @@ define(function(require, exports, module) {
2713
2817
  Switch.prototype.isStatement = YES;
2714
2818
 
2715
2819
  Switch.prototype.jumps = function(o) {
2716
- var block, conds, _i, _len, _ref2, _ref3, _ref4;
2820
+ var block, conds, jumpNode, _i, _len, _ref2, _ref3, _ref4;
2717
2821
  if (o == null) {
2718
2822
  o = {
2719
2823
  block: true
@@ -2722,8 +2826,8 @@ define(function(require, exports, module) {
2722
2826
  _ref2 = this.cases;
2723
2827
  for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
2724
2828
  _ref3 = _ref2[_i], conds = _ref3[0], block = _ref3[1];
2725
- if (block.jumps(o)) {
2726
- return block;
2829
+ if (jumpNode = block.jumps(o)) {
2830
+ return jumpNode;
2727
2831
  }
2728
2832
  }
2729
2833
  return (_ref4 = this.otherwise) != null ? _ref4.jumps(o) : void 0;
@@ -2746,23 +2850,23 @@ define(function(require, exports, module) {
2746
2850
  };
2747
2851
 
2748
2852
  Switch.prototype.compileNode = function(o) {
2749
- var block, body, code, cond, conditions, expr, i, idt1, idt2, _i, _j, _len, _len1, _ref2, _ref3, _ref4, _ref5;
2853
+ var block, body, cond, conditions, expr, fragments, i, idt1, idt2, _i, _j, _len, _len1, _ref2, _ref3, _ref4;
2750
2854
  idt1 = o.indent + TAB;
2751
2855
  idt2 = o.indent = idt1 + TAB;
2752
- code = this.tab + ("switch (" + (((_ref2 = this.subject) != null ? _ref2.compile(o, LEVEL_PAREN) : void 0) || false) + ") {\n");
2753
- _ref3 = this.cases;
2754
- for (i = _i = 0, _len = _ref3.length; _i < _len; i = ++_i) {
2755
- _ref4 = _ref3[i], conditions = _ref4[0], block = _ref4[1];
2756
- _ref5 = flatten([conditions]);
2757
- for (_j = 0, _len1 = _ref5.length; _j < _len1; _j++) {
2758
- cond = _ref5[_j];
2856
+ fragments = [].concat(this.makeCode(this.tab + "switch ("), (this.subject ? this.subject.compileToFragments(o, LEVEL_PAREN) : this.makeCode("false")), this.makeCode(") {\n"));
2857
+ _ref2 = this.cases;
2858
+ for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
2859
+ _ref3 = _ref2[i], conditions = _ref3[0], block = _ref3[1];
2860
+ _ref4 = flatten([conditions]);
2861
+ for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) {
2862
+ cond = _ref4[_j];
2759
2863
  if (!this.subject) {
2760
2864
  cond = cond.invert();
2761
2865
  }
2762
- code += idt1 + ("case " + (cond.compile(o, LEVEL_PAREN)) + ":\n");
2866
+ fragments = fragments.concat(this.makeCode(idt1 + "case "), cond.compileToFragments(o, LEVEL_PAREN), this.makeCode(":\n"));
2763
2867
  }
2764
- if (body = block.compile(o, LEVEL_TOP)) {
2765
- code += body + '\n';
2868
+ if ((body = block.compileToFragments(o, LEVEL_TOP)).length > 0) {
2869
+ fragments = fragments.concat(body, this.makeCode('\n'));
2766
2870
  }
2767
2871
  if (i === this.cases.length - 1 && !this.otherwise) {
2768
2872
  break;
@@ -2771,12 +2875,13 @@ define(function(require, exports, module) {
2771
2875
  if (expr instanceof Return || (expr instanceof Literal && expr.jumps() && expr.value !== 'debugger')) {
2772
2876
  continue;
2773
2877
  }
2774
- code += idt2 + 'break;\n';
2878
+ fragments.push(cond.makeCode(idt2 + 'break;\n'));
2775
2879
  }
2776
2880
  if (this.otherwise && this.otherwise.expressions.length) {
2777
- code += idt1 + ("default:\n" + (this.otherwise.compile(o, LEVEL_TOP)) + "\n");
2881
+ fragments.push.apply(fragments, [this.makeCode(idt1 + "default:\n")].concat(__slice.call(this.otherwise.compileToFragments(o, LEVEL_TOP)), [this.makeCode("\n")]));
2778
2882
  }
2779
- return code + this.tab + '}';
2883
+ fragments.push(this.makeCode(this.tab + '}'));
2884
+ return fragments;
2780
2885
  };
2781
2886
 
2782
2887
  return Switch;
@@ -2784,7 +2889,6 @@ define(function(require, exports, module) {
2784
2889
  })(Base);
2785
2890
 
2786
2891
  exports.If = If = (function(_super) {
2787
-
2788
2892
  __extends(If, _super);
2789
2893
 
2790
2894
  function If(condition, body, options) {
@@ -2816,6 +2920,7 @@ define(function(require, exports, module) {
2816
2920
  } else {
2817
2921
  this.isChain = elseBody instanceof If;
2818
2922
  this.elseBody = this.ensureBlock(elseBody);
2923
+ this.elseBody.updateLocationDataIfMissing(elseBody.locationData);
2819
2924
  }
2820
2925
  return this;
2821
2926
  };
@@ -2856,37 +2961,48 @@ define(function(require, exports, module) {
2856
2961
  };
2857
2962
 
2858
2963
  If.prototype.compileStatement = function(o) {
2859
- var body, child, cond, exeq, ifPart;
2964
+ var answer, body, child, cond, exeq, ifPart, indent;
2860
2965
  child = del(o, 'chainChild');
2861
2966
  exeq = del(o, 'isExistentialEquals');
2862
2967
  if (exeq) {
2863
2968
  return new If(this.condition.invert(), this.elseBodyNode(), {
2864
2969
  type: 'if'
2865
- }).compile(o);
2866
- }
2867
- cond = this.condition.compile(o, LEVEL_PAREN);
2868
- o.indent += TAB;
2869
- body = this.ensureBlock(this.body);
2870
- ifPart = "if (" + cond + ") {\n" + (body.compile(o)) + "\n" + this.tab + "}";
2970
+ }).compileToFragments(o);
2971
+ }
2972
+ indent = o.indent + TAB;
2973
+ cond = this.condition.compileToFragments(o, LEVEL_PAREN);
2974
+ body = this.ensureBlock(this.body).compileToFragments(merge(o, {
2975
+ indent: indent
2976
+ }));
2977
+ ifPart = [].concat(this.makeCode("if ("), cond, this.makeCode(") {\n"), body, this.makeCode("\n" + this.tab + "}"));
2871
2978
  if (!child) {
2872
- ifPart = this.tab + ifPart;
2979
+ ifPart.unshift(this.makeCode(this.tab));
2873
2980
  }
2874
2981
  if (!this.elseBody) {
2875
2982
  return ifPart;
2876
2983
  }
2877
- 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 + "}");
2984
+ answer = ifPart.concat(this.makeCode(' else '));
2985
+ if (this.isChain) {
2986
+ o.chainChild = true;
2987
+ answer = answer.concat(this.elseBody.unwrap().compileToFragments(o, LEVEL_TOP));
2988
+ } else {
2989
+ answer = answer.concat(this.makeCode("{\n"), this.elseBody.compileToFragments(merge(o, {
2990
+ indent: indent
2991
+ }), LEVEL_TOP), this.makeCode("\n" + this.tab + "}"));
2992
+ }
2993
+ return answer;
2878
2994
  };
2879
2995
 
2880
2996
  If.prototype.compileExpression = function(o) {
2881
- var alt, body, code, cond;
2882
- cond = this.condition.compile(o, LEVEL_COND);
2883
- body = this.bodyNode().compile(o, LEVEL_LIST);
2884
- alt = this.elseBodyNode() ? this.elseBodyNode().compile(o, LEVEL_LIST) : 'void 0';
2885
- code = "" + cond + " ? " + body + " : " + alt;
2997
+ var alt, body, cond, fragments;
2998
+ cond = this.condition.compileToFragments(o, LEVEL_COND);
2999
+ body = this.bodyNode().compileToFragments(o, LEVEL_LIST);
3000
+ alt = this.elseBodyNode() ? this.elseBodyNode().compileToFragments(o, LEVEL_LIST) : [this.makeCode('void 0')];
3001
+ fragments = cond.concat(this.makeCode(" ? "), body, this.makeCode(" : "), alt);
2886
3002
  if (o.level >= LEVEL_COND) {
2887
- return "(" + code + ")";
3003
+ return this.wrapInBraces(fragments);
2888
3004
  } else {
2889
- return code;
3005
+ return fragments;
2890
3006
  }
2891
3007
  };
2892
3008
 
@@ -2898,48 +3014,6 @@ define(function(require, exports, module) {
2898
3014
 
2899
3015
  })(Base);
2900
3016
 
2901
- Closure = {
2902
- wrap: function(expressions, statement, noReturn) {
2903
- var args, call, func, mentionsArgs, meth;
2904
- if (expressions.jumps()) {
2905
- return expressions;
2906
- }
2907
- func = new Code([], Block.wrap([expressions]));
2908
- args = [];
2909
- if ((mentionsArgs = expressions.contains(this.literalArgs)) || expressions.contains(this.literalThis)) {
2910
- meth = new Literal(mentionsArgs ? 'apply' : 'call');
2911
- args = [new Literal('this')];
2912
- if (mentionsArgs) {
2913
- args.push(new Literal('arguments'));
2914
- }
2915
- func = new Value(func, [new Access(meth)]);
2916
- }
2917
- func.noReturn = noReturn;
2918
- call = new Call(func, args);
2919
- if (statement) {
2920
- return Block.wrap([call]);
2921
- } else {
2922
- return call;
2923
- }
2924
- },
2925
- literalArgs: function(node) {
2926
- return node instanceof Literal && node.value === 'arguments' && !node.asKey;
2927
- },
2928
- literalThis: function(node) {
2929
- return (node instanceof Literal && node.value === 'this' && !node.asKey) || (node instanceof Code && node.bound) || (node instanceof Call && node.isSuper);
2930
- }
2931
- };
2932
-
2933
- unfoldSoak = function(o, parent, name) {
2934
- var ifn;
2935
- if (!(ifn = parent[name].unfoldSoak(o))) {
2936
- return;
2937
- }
2938
- parent[name] = ifn.body;
2939
- ifn.body = new Value(parent);
2940
- return ifn;
2941
- };
2942
-
2943
3017
  UTILITIES = {
2944
3018
  "extends": function() {
2945
3019
  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; }";
@@ -2978,10 +3052,16 @@ define(function(require, exports, module) {
2978
3052
 
2979
3053
  SIMPLENUM = /^[+-]?\d+$/;
2980
3054
 
2981
- METHOD_DEF = RegExp("^(?:(" + IDENTIFIER_STR + ")\\.prototype(?:\\.(" + IDENTIFIER_STR + ")|\\[(\"(?:[^\\\\\"\\r\\n]|\\\\.)*\"|'(?:[^\\\\'\\r\\n]|\\\\.)*')\\]|\\[(0x[\\da-fA-F]+|\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\]))|(" + IDENTIFIER_STR + ")$");
3055
+ HEXNUM = /^[+-]?0x[\da-f]+/i;
3056
+
3057
+ NUMBER = /^[+-]?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)$/i;
3058
+
3059
+ METHOD_DEF = RegExp("^(" + IDENTIFIER_STR + ")(\\.prototype)?(?:\\.(" + IDENTIFIER_STR + ")|\\[(\"(?:[^\\\\\"\\r\\n]|\\\\.)*\"|'(?:[^\\\\'\\r\\n]|\\\\.)*')\\]|\\[(0x[\\da-fA-F]+|\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\])$");
2982
3060
 
2983
3061
  IS_STRING = /^['"]/;
2984
3062
 
3063
+ IS_REGEX = /^\//;
3064
+
2985
3065
  utility = function(name) {
2986
3066
  var ref;
2987
3067
  ref = "__" + name;
@@ -2994,5 +3074,33 @@ define(function(require, exports, module) {
2994
3074
  return code.replace(/\s+$/, '');
2995
3075
  };
2996
3076
 
3077
+ parseNum = function(x) {
3078
+ if (x == null) {
3079
+ return 0;
3080
+ } else if (x.match(HEXNUM)) {
3081
+ return parseInt(x, 16);
3082
+ } else {
3083
+ return parseFloat(x);
3084
+ }
3085
+ };
3086
+
3087
+ isLiteralArguments = function(node) {
3088
+ return node instanceof Literal && node.value === 'arguments' && !node.asKey;
3089
+ };
3090
+
3091
+ isLiteralThis = function(node) {
3092
+ return (node instanceof Literal && node.value === 'this' && !node.asKey) || (node instanceof Code && node.bound) || (node instanceof Call && node.isSuper);
3093
+ };
3094
+
3095
+ unfoldSoak = function(o, parent, name) {
3096
+ var ifn;
3097
+ if (!(ifn = parent[name].unfoldSoak(o))) {
3098
+ return;
3099
+ }
3100
+ parent[name] = ifn.body;
3101
+ ifn.body = new Value(parent);
3102
+ return ifn;
3103
+ };
3104
+
2997
3105
 
2998
3106
  });