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.
- checksums.yaml +13 -5
- data/README.md +4 -5
- data/gollum.gemspec +560 -28
- data/lib/gollum.rb +1 -1
- data/lib/gollum/app.rb +16 -10
- data/lib/gollum/public/gollum/javascript/editor/gollum.editor.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ace.js +33 -11
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/anchor.js +77 -80
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/anchor_test.js +46 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete.js +497 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete/popup.js +341 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete/text_completer.js +78 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/autocomplete/util.js +74 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer.js +28 -32
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer_test.js +5 -5
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager.js +17 -20
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager_test.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/default_commands.js +312 -58
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/incremental_search_commands.js +232 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/multi_select_commands.js +17 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/occur_commands.js +110 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/config.js +70 -7
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/config_test.js +67 -3
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/css/editor.css +123 -69
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/document.js +118 -71
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session.js +507 -392
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/bracket_match.js +4 -2
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold.js +37 -5
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold_line.js +30 -29
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/folding.js +210 -102
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session_test.js +82 -8
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor.js +1006 -465
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_highlight_selected_word_test.js +2 -2
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_text_edit_test.js +36 -34
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/beautify.js +57 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/beautify/php_rules.js +366 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/chromevox.js +980 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/elastic_tabstops_lite.js +319 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/emmet.js +434 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/error_marker.js +214 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/keybinding_menu.js +86 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/language_tools.js +226 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/linking.js +78 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/add_editor_menu_options.js +109 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/element_generator.js +148 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/generate_settings_menu.js +264 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/get_editor_keyboard_shortcuts.js +91 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/get_set_functions.js +141 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/overlay_page.js +116 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/menu_tools/settings_menu.css +48 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/modelist.js +195 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/old_ie.js +114 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/old_ie_test.js +77 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/searchbox.css +153 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/searchbox.js +308 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/settings_menu.js +76 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/spellcheck.js +69 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/{keyboard/vim/registers.js → ext/split.js} +8 -10
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static.css +18 -9
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight.js +128 -26
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight_test.js +56 -36
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/statusbar.js +48 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/textarea.js +112 -117
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/themelist.js +100 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/whitespace.js +213 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/whitespace_test.js +116 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/incremental_search.js +317 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/incremental_search_test.js +213 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs.js +369 -92
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs_test.js +151 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/hash_handler.js +109 -41
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding.js +35 -24
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding_test.js +69 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/state_handler.js +1 -2
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/textarea.js +82 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/textinput.js +337 -208
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim.js +5987 -120
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim_test.js +3866 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/cursor.js +48 -25
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/font_metrics.js +176 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/gutter.js +110 -44
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/marker.js +29 -14
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/text.js +69 -150
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/text_test.js +11 -10
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/app_config.js +157 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/dom.js +33 -31
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/es5-shim.js +284 -304
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/event.js +147 -95
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter.js +64 -23
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/keys.js +35 -9
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/lang.js +30 -13
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/net.js +21 -39
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/oop.js +12 -9
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/useragent.js +8 -4
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/line_widgets.js +297 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/Readme.md +9 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/highlight_rules_test.js +210 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_asciidoc.txt +111 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_coffee.txt +57 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_curly.txt +9 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_html.txt +10 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_javascript.txt +34 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_livescript.txt +1 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_lucene.txt +16 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_markdown.txt +22 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_php.txt +24 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_ruby.txt +34 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_xml.txt +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_abap.json +189 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_abc.json +2207 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_actionscript.json +263 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ada.json +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_asciidoc.json +422 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_assembly_x86.json +114 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_autohotkey.json +261 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_batchfile.json +70 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c9search.json +131 -175
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c_cpp.json +190 -124
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_cirru.json +267 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_clojure.json +162 -248
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_cobol.json +4 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coffee.json +545 -188
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coldfusion.json +26 -41
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_csharp.json +31 -42
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_css.json +148 -231
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_curly.json +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_d.json +111 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_dart.json +368 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_diff.json +262 -732
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_dot.json +2254 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_eiffel.json +141 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ejs.json +296 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_elixir.json +196 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_elm.json +198 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_erlang.json +166 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_forth.json +219 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ftl.json +341 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_gcode.json +296 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_gherkin.json +142 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_gitignore.json +33 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_glsl.json +127 -185
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_golang.json +256 -362
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_groovy.json +410 -529
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haml.json +174 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_handlebars.json +81 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haskell.json +156 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haxe.json +143 -195
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_html.json +63 -150
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_html_ruby.json +257 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ini.json +23 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_io.json +49 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jack.json +1786 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jade.json +188 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_java.json +95 -139
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_javascript.json +593 -555
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_json.json +412 -611
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsoniq.json +4 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsp.json +435 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsx.json +51 -79
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_julia.json +111 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_latex.json +127 -196
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_less.json +204 -292
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_liquid.json +551 -698
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lisp.json +248 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_livescript.json +6 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_logiql.json +190 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lsl.json +503 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lua.json +348 -451
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_luapage.json +633 -824
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lucene.json +92 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_markdown.json +114 -1202
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mask.json +302 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_matlab.json +90 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mel.json +257 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mushcode.json +790 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_mysql.json +4 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_nix.json +360 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_objectivec.json +793 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ocaml.json +200 -260
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_pascal.json +297 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_perl.json +227 -311
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_pgsql.json +889 -1020
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_php.json +171 -238
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_powershell.json +184 -255
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_prolog.json +245 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_properties.json +68 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_protobuf.json +136 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_python.json +152 -205
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_r.json +235 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_rdoc.json +441 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_rhtml.json +106 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ruby.json +242 -104
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_rust.json +136 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sass.json +229 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scad.json +194 -267
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scala.json +542 -748
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scheme.json +216 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scss.json +123 -181
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sh.json +334 -434
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sjs.json +276 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_smarty.json +98 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_snippets.json +159 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_soy_template.json +286 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_space.json +322 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sql.json +54 -73
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_stylus.json +271 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_svg.json +684 -931
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_tcl.json +385 -536
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_tex.json +130 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_text.json +29 -58
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_textile.json +113 -195
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_toml.json +131 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_twig.json +288 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_typescript.json +559 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_vala.json +158 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_vbscript.json +205 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_velocity.json +285 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_verilog.json +113 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_vhdl.json +271 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xml.json +43 -705
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xquery.json +44 -64
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_yaml.json +150 -260
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abap.js +2 -2
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abap_highlight_rules.js +7 -6
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abc.js +58 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abc_highlight_rules.js +114 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/actionscript.js +58 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/actionscript_highlight_rules.js +141 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ada.js +54 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ada_highlight_rules.js +93 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/apache_conf.js +62 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/apache_conf_highlight_rules.js +231 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/applescript.js +55 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/applescript_highlight_rules.js +139 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc.js +3 -3
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc_highlight_rules.js +11 -11
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/assembly_x86.js +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/assembly_x86_highlight_rules.js +114 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/autohotkey.js +57 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/autohotkey_highlight_rules.js +107 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/batchfile.js +61 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/batchfile_highlight_rules.js +97 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/behaviour_test.js +139 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/css.js +108 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/cstyle.js +164 -137
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/html.js +4 -48
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xml.js +141 -44
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xquery.js +76 -52
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c9search.js +2 -2
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c9search_highlight_rules.js +127 -4
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp.js +7 -30
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp_highlight_rules.js +60 -51
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cirru.js +51 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cirru_highlight_rules.js +125 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/clojure.js +62 -46
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/clojure_highlight_rules.js +4 -21
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cobol.js +53 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/cobol_highlight_rules.js +100 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee.js +28 -7
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/coffee-script.js +13 -7
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/helpers.js +160 -4
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/lexer.js +228 -108
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/nodes.js +778 -670
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser.js +377 -347
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser_test.js +33 -6
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/rewriter.js +275 -135
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/scope.js +5 -4
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules.js +72 -167
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_worker.js +12 -24
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion.js +11 -14
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_highlight_rules.js +5 -84
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_test.js +3 -3
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/csharp.js +7 -4
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js +13 -10
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css.js +7 -6
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css/csslint.js +2325 -1216
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules.js +72 -102
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css_test.js +2 -2
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker.js +11 -5
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/curly.js +63 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/curly_highlight_rules.js +66 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/d.js +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/d_highlight_rules.js +334 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dart.js +8 -8
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dart_highlight_rules.js +70 -76
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/diff.js +2 -2
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/diff_highlight_rules.js +24 -18
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/django.js +119 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/doc_comment_highlight_rules.js +12 -19
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dockerfile.js +52 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dockerfile_highlight_rules.js +57 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dot.js +55 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dot_highlight_rules.js +126 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/eiffel.js +52 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/eiffel_highlight_rules.js +136 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ejs.js +109 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/elixir.js +58 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/elixir_highlight_rules.js +433 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/elm.js +58 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/elm_highlight_rules.js +162 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/erlang.js +57 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/erlang_highlight_rules.js +876 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/c9search.js +12 -6
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/csharp.js +137 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle.js +118 -6
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle_test.js +24 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/fold_mode.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html.js +2 -33
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html_test.js +30 -6
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/ini.js +80 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/latex.js +9 -9
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/lua.js +4 -4
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/mixed.js +2 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/velocity.js +120 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml.js +110 -87
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/forth.js +58 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/forth_highlight_rules.js +164 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ftl.js +49 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ftl_highlight_rules.js +195 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/gcode.js +51 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/gcode_highlight_rules.js +94 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/gherkin.js +80 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/gherkin_highlight_rules.js +113 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/gitignore.js +20 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/gitignore_highlight_rules.js +31 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/glsl.js +6 -2
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/golang.js +42 -67
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/golang_highlight_rules.js +25 -39
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/groovy.js +2 -2
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/groovy_highlight_rules.js +0 -2
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haml.js +5 -6
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haml_highlight_rules.js +43 -43
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/handlebars.js +29 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/handlebars_highlight_rules.js +72 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haskell.js +62 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haskell_highlight_rules.js +246 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haxe.js +7 -4
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haxe_highlight_rules.js +0 -2
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html.js +42 -12
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html/saxparser.js +10430 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_completions.js +305 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules.js +43 -85
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_ruby.js +59 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_ruby_highlight_rules.js +84 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_test.js +3 -3
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/{lib/browser_focus.js → mode/html_worker.js} +48 -51
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ini.js +53 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ini_highlight_rules.js +112 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/io.js +58 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/io_highlight_rules.js +120 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jack.js +79 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jack_highlight_rules.js +142 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jade.js +4 -5
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jade_highlight_rules.js +94 -100
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/java.js +2 -3
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/java_highlight_rules.js +0 -5
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript.js +15 -40
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript/jshint.js +10824 -4816
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules.js +113 -97
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_test.js +61 -6
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker.js +5 -7
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker_test.js +11 -2
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/js_regex_highlight_rules.js +94 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json.js +5 -5
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json_highlight_rules.js +3 -6
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker.js +6 -35
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker_test.js +12 -11
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsoniq.js +203 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsp.js +2 -3
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsp_highlight_rules.js +36 -30
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsx.js +26 -23
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsx_highlight_rules.js +113 -115
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/julia.js +62 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/julia_highlight_rules.js +170 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/latex.js +5 -37
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/latex_highlight_rules.js +44 -9
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/less.js +8 -3
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/less_highlight_rules.js +2 -2
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/liquid.js +4 -31
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules.js +15 -89
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lisp.js +5 -9
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lisp_highlight_rules.js +25 -28
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/livescript.js +246 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/logiql.js +139 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/logiql_highlight_rules.js +119 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/logiql_test.js +98 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lsl.js +92 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lsl_highlight_rules.js +123 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lua.js +27 -6
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lua/luaparse.js +1989 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lua_highlight_rules.js +55 -272
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lua_worker.js +70 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/luapage.js +6 -4
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/luapage_highlight_rules.js +21 -14
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lucene.js +5 -2
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/makefile.js +6 -10
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/makefile_highlight_rules.js +22 -22
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/markdown.js +12 -11
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules.js +130 -89
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mask.js +84 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mask_highlight_rules.js +309 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/matching_brace_outdent.js +1 -6
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/matlab.js +55 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/matlab_highlight_rules.js +262 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mel.js +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mel_highlight_rules.js +133 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mushcode.js +116 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mushcode_highlight_rules.js +569 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mysql.js +51 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/mysql_highlight_rules.js +122 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/nix.js +62 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/nix_highlight_rules.js +119 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/objectivec.js +4 -5
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/objectivec_highlight_rules.js +137 -149
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml.js +4 -3
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml_highlight_rules.js +0 -4
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/pascal.js +67 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/pascal_highlight_rules.js +127 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/perl.js +10 -30
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/perl_highlight_rules.js +17 -7
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql.js +23 -51
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql_highlight_rules.js +334 -302
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/php.js +59 -38
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/php/php.js +5031 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/php_highlight_rules.js +72 -52
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/php_test.js +65 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/php_worker.js +77 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/plain_text.js +55 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/{keyboard/vim/maps/aliases.js → mode/plain_text_test.js} +21 -59
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/powershell.js +7 -4
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/powershell_highlight_rules.js +0 -3
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/{xquery/JSONParseTreeHandler.js → praat.js} +45 -53
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/praat_highlight_rules.js +262 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/prolog.js +62 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/prolog_highlight_rules.js +238 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/properties.js +48 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/properties_highlight_rules.js +86 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/protobuf.js +63 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/protobuf_highlight_rules.js +66 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/python.js +5 -31
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/python_highlight_rules.js +50 -24
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/r.js +37 -18
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/r_highlight_rules.js +29 -11
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rdoc.js +36 -11
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rdoc_highlight_rules.js +27 -7
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rhtml.js +31 -11
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rhtml_highlight_rules.js +31 -14
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ruby.js +26 -36
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules.js +153 -33
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/{css_highlight_rules_test.js → ruby_test.js} +24 -39
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rust.js +58 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rust_highlight_rules.js +158 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sass.js +52 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sass_highlight_rules.js +79 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scad.js +5 -30
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scad_highlight_rules.js +0 -4
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scala.js +2 -2
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scala_highlight_rules.js +1 -6
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scheme.js +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scheme_highlight_rules.js +123 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scss.js +9 -4
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scss_highlight_rules.js +7 -8
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sh.js +10 -31
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sh_highlight_rules.js +85 -11
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sjs.js +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sjs_highlight_rules.js +233 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/smarty.js +51 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/smarty_highlight_rules.js +139 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/snippets.js +113 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/soy_template.js +60 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/soy_template_highlight_rules.js +356 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/space.js +21 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/space_highlight_rules.js +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sql.js +3 -30
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sql_highlight_rules.js +6 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/stylus.js +5 -5
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/stylus_highlight_rules.js +32 -42
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/svg.js +3 -5
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/svg_highlight_rules.js +3 -18
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/tcl.js +4 -30
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/tcl_highlight_rules.js +5 -13
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/tex.js +30 -10
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/tex_highlight_rules.js +27 -7
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/text.js +266 -29
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/text_highlight_rules.js +129 -15
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/text_test.js +2 -2
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/textile.js +3 -2
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/toml.js +56 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/toml_highlight_rules.js +103 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/twig.js +81 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/twig_highlight_rules.js +166 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/typescript.js +2 -8
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/typescript_highlight_rules.js +16 -16
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/vala.js +105 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/vala_highlight_rules.js +457 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/vbscript.js +60 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/vbscript_highlight_rules.js +246 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/velocity.js +58 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/velocity_highlight_rules.js +177 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/verilog.js +54 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/verilog_highlight_rules.js +101 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/vhdl.js +52 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/vhdl_highlight_rules.js +115 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml.js +25 -8
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml/dom-parser.js +260 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml/dom.js +1138 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml/sax.js +592 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules.js +185 -45
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_test.js +3 -3
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_worker.js +92 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery.js +107 -88
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/Readme.md +1 -6
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/jsoniq_lexer.js +4453 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/xqlint.js +78911 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/xquery_lexer.js +4422 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_worker.js +66 -29
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/yaml.js +5 -3
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/yaml_highlight_rules.js +2 -13
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/default_gutter_handler.js +50 -28
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/default_handlers.js +70 -137
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/dragdrop_handler.js +428 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/fold_handler.js +6 -23
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_event.js +6 -9
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_handler.js +83 -39
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/{mode/liquid_highlight_rules_test.js → mouse/mouse_handler_test.js} +27 -34
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/multi_select_handler.js +94 -38
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/multi_select.js +192 -115
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/multi_select_test.js +124 -18
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/occur.js +193 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/occur_test.js +154 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/placeholder.js +9 -4
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/placeholder_test.js +2 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/range.js +81 -102
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/range_list.js +38 -21
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/range_list_test.js +20 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/range_test.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/renderloop.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/requirejs/text.js +9 -8
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/requirejs/text_build.js +60 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/scrollbar.js +163 -32
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/search.js +38 -19
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/search_highlight.js +1 -3
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/search_test.js +33 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/selection.js +167 -83
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/selection_test.js +22 -7
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets.js +949 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/_.snippets +240 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/_all_modes.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/_all_modes.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/abap.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/abap.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/abc.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/abc.snippets +31 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/actionscript.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/actionscript.snippets +157 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ada.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ada.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/all_modes.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/all_modes.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/apache.snippets +35 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/apache_conf.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/apache_conf.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/applescript.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/applescript.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/asciidoc.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/asciidoc.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/assembly_x86.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/assembly_x86.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/autohotkey.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/autohotkey.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/autoit.snippets +66 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/batchfile.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/batchfile.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/c.snippets +235 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/c9search.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/c9search.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/c_cpp.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/c_cpp.snippets +131 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/chef.snippets +204 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/cirru.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/cirru.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/clojure.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/clojure.snippets +90 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/cmake.snippets +58 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/cobol.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/cobol.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/coffee.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/coffee.snippets +95 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/coldfusion.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/coldfusion.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/cs.snippets +374 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/csharp.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/csharp.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/css.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/css.snippets +967 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/curly.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/curly.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/d.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/d.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dart.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dart.snippets +83 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/diff.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/diff.snippets +11 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/django.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/django.snippets +108 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dockerfile.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dockerfile.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dot.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dot.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dummy.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/dummy_syntax.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/eiffel.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/eiffel.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ejs.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ejs.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/elixir.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/elixir.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/elm.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/elm.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/erlang.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/erlang.snippets +160 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/eruby.snippets +113 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/falcon.snippets +71 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/forth.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/forth.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ftl.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ftl.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/gcode.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/gcode.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/gherkin.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/gherkin.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/gitignore.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/gitignore.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/glsl.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/glsl.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/go.snippets +201 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/golang.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/golang.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/groovy.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/groovy.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/haml.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/haml.snippets +20 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/handlebars.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/handlebars.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/haskell.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/haskell.snippets +82 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/haxe.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/haxe.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/html.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/html.snippets +828 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/html_ruby.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/html_ruby.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/htmldjango.snippets +136 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/htmltornado.snippets +55 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ini.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ini.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/io.js +69 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/io.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jack.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jack.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jade.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jade.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/java.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/java.snippets +240 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/javascript-jquery.snippets +589 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/javascript.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/javascript.snippets +195 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/json.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/json.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsoniq.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsoniq.snippets +61 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsp.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsp.snippets +99 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsx.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/jsx.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/julia.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/julia.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/latex.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/latex.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ledger.snippets +5 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/less.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/less.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/liquid.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/liquid.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lisp.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lisp.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/livescript.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/livescript.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/logiql.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/logiql.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lsl.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lsl.snippets +1066 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lua.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lua.snippets +21 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/luapage.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/luapage.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lucene.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/lucene.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/makefile.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/makefile.snippets +4 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mako.snippets +54 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/markdown.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/markdown.snippets +88 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/matlab.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/matlab.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mel.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mel.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode_high_rules.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mushcode_high_rules.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mysql.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/mysql.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/nix.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/nix.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/objc.snippets +247 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/objectivec.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/objectivec.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ocaml.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ocaml.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pascal.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pascal.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/perl.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/perl.snippets +347 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pgsql.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/pgsql.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/php.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/php.snippets +377 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/plain_text.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/plain_text.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/powershell.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/powershell.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/praat.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/praat.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/prolog.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/prolog.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/properties.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/properties.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/protobuf.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/protobuf.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/python.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/python.snippets +158 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/r.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/r.snippets +121 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rdoc.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rdoc.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rhtml.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rhtml.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rst.snippets +22 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ruby.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/ruby.snippets +928 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rust.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/rust.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sass.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sass.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scad.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scad.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scala.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scala.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scheme.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scheme.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scss.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/scss.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sh.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sh.snippets +83 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sjs.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sjs.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/smarty.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/smarty.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/snippets.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/snippets.snippets +9 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/soy_template.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/soy_template.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/space.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/space.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sql.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/sql.snippets +26 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/stylus.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/stylus.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/svg.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/svg.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tcl.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tcl.snippets +92 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tex.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tex.snippets +191 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/text.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/text.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/textile.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/textile.snippets +30 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/tmsnippet.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/toml.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/toml.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/twig.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/twig.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/typescript.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/typescript.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vala.js +195 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vala.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vbscript.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vbscript.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/velocity.js +8 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/velocity.snippets +28 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/verilog.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/verilog.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vhdl.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/vhdl.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xml.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xml.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xquery.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xquery.snippets +61 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/xslt.snippets +97 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/yaml.js +7 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets/yaml.snippets +0 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/snippets_test.js +131 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/split.js +3 -3
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/all_browser.js +20 -7
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/assert.js +2 -2
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/mockrenderer.js +8 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.css +6 -2
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chaos.css +154 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chaos.js +33 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.css +5 -9
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.css +3 -15
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.css +4 -16
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.css +16 -26
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.css +2 -10
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.css +10 -20
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.css +9 -12
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.css +16 -9
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/github.css +3 -10
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.css +5 -17
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/katzenmilch.css +140 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/katzenmilch.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.css +9 -20
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kuroir.css +67 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kuroir.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.css +4 -16
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.css +4 -16
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.css +5 -17
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.css +14 -20
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.css +4 -16
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.css +8 -20
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.css +6 -18
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/terminal.css +132 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/terminal.js +39 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.css +5 -9
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.css +4 -15
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.css +5 -16
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.css +6 -17
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.css +21 -16
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.css +10 -17
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.css +6 -16
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.css +4 -12
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.css +4 -12
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.js +1 -1
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/token_iterator.js +4 -3
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tokenizer.js +246 -78
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tokenizer_dev.js +71 -93
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tokenizer_test.js +97 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tooltip.js +138 -0
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/undomanager.js +63 -30
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer.js +788 -403
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/mirror.js +9 -3
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker.js +92 -55
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker_client.js +90 -52
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker_test.js +125 -0
- data/lib/gollum/public/gollum/livepreview/js/livepreview.js +18 -12
- data/lib/gollum/public/gollum/livepreview/readme.md +1 -1
- data/lib/gollum/templates/layout.mustache +1 -1
- data/lib/gollum/{public/gollum/livepreview/index.html → templates/livepreview.mustache} +23 -1
- data/lib/gollum/views/livepreview.rb +13 -0
- metadata +569 -37
- data/lib/gollum/editing_auth.rb +0 -34
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/commands.js +0 -561
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/motions.js +0 -593
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/operators.js +0 -196
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/util.js +0 -134
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/test_highlight_rules.js +0 -144
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules_test.js +0 -266
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules_test.js +0 -186
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules_test.js +0 -218
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lucene_highlight_rules_test.js +0 -99
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules_test.js +0 -100
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules_test.js +0 -108
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules_test.js +0 -208
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_util.js +0 -112
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryParser.js +0 -32982
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/visitors/SyntaxHighlighter.js +0 -316
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_highlight_rules.js +0 -145
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/dragdrop.js +0 -98
- data/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker_sourcemint.js +0 -73
@@ -0,0 +1,1989 @@
|
|
1
|
+
define(function(require, exports, module) {
|
2
|
+
/*global exports:true module:true require:true define:true global:true */
|
3
|
+
|
4
|
+
(function (root, name, factory) {
|
5
|
+
factory(exports)
|
6
|
+
}(this, 'luaparse', function (exports) {
|
7
|
+
'use strict';
|
8
|
+
|
9
|
+
exports.version = '0.1.4';
|
10
|
+
|
11
|
+
var input, options, length;
|
12
|
+
|
13
|
+
// Options can be set either globally on the parser object through
|
14
|
+
// defaultOptions, or during the parse call.
|
15
|
+
var defaultOptions = exports.defaultOptions = {
|
16
|
+
// Explicitly tell the parser when the input ends.
|
17
|
+
wait: false
|
18
|
+
// Store comments as an array in the chunk object.
|
19
|
+
, comments: true
|
20
|
+
// Track identifier scopes by adding an isLocal attribute to each
|
21
|
+
// identifier-node.
|
22
|
+
, scope: false
|
23
|
+
// Store location information on each syntax node as
|
24
|
+
// `loc: { start: { line, column }, end: { line, column } }`.
|
25
|
+
, locations: false
|
26
|
+
// Store the start and end character locations on each syntax node as
|
27
|
+
// `range: [start, end]`.
|
28
|
+
, ranges: false
|
29
|
+
};
|
30
|
+
|
31
|
+
// The available tokens expressed as enum flags so they can be checked with
|
32
|
+
// bitwise operations.
|
33
|
+
|
34
|
+
var EOF = 1, StringLiteral = 2, Keyword = 4, Identifier = 8
|
35
|
+
, NumericLiteral = 16, Punctuator = 32, BooleanLiteral = 64
|
36
|
+
, NilLiteral = 128, VarargLiteral = 256;
|
37
|
+
|
38
|
+
exports.tokenTypes = { EOF: EOF, StringLiteral: StringLiteral
|
39
|
+
, Keyword: Keyword, Identifier: Identifier, NumericLiteral: NumericLiteral
|
40
|
+
, Punctuator: Punctuator, BooleanLiteral: BooleanLiteral
|
41
|
+
, NilLiteral: NilLiteral, VarargLiteral: VarargLiteral
|
42
|
+
};
|
43
|
+
|
44
|
+
// As this parser is a bit different from luas own, the error messages
|
45
|
+
// will be different in some situations.
|
46
|
+
|
47
|
+
var errors = exports.errors = {
|
48
|
+
unexpected: 'Unexpected %1 \'%2\' near \'%3\''
|
49
|
+
, expected: '\'%1\' expected near \'%2\''
|
50
|
+
, expectedToken: '%1 expected near \'%2\''
|
51
|
+
, unfinishedString: 'unfinished string near \'%1\''
|
52
|
+
, malformedNumber: 'malformed number near \'%1\''
|
53
|
+
};
|
54
|
+
|
55
|
+
// ### Abstract Syntax Tree
|
56
|
+
//
|
57
|
+
// The default AST structure is inspired by the Mozilla Parser API but can
|
58
|
+
// easily be customized by overriding these functions.
|
59
|
+
|
60
|
+
var ast = exports.ast = {
|
61
|
+
labelStatement: function(label) {
|
62
|
+
return {
|
63
|
+
type: 'LabelStatement'
|
64
|
+
, label: label
|
65
|
+
};
|
66
|
+
}
|
67
|
+
|
68
|
+
, breakStatement: function() {
|
69
|
+
return {
|
70
|
+
type: 'BreakStatement'
|
71
|
+
};
|
72
|
+
}
|
73
|
+
|
74
|
+
, gotoStatement: function(label) {
|
75
|
+
return {
|
76
|
+
type: 'GotoStatement'
|
77
|
+
, label: label
|
78
|
+
};
|
79
|
+
}
|
80
|
+
|
81
|
+
, returnStatement: function(args) {
|
82
|
+
return {
|
83
|
+
type: 'ReturnStatement'
|
84
|
+
, 'arguments': args
|
85
|
+
};
|
86
|
+
}
|
87
|
+
|
88
|
+
, ifStatement: function(clauses) {
|
89
|
+
return {
|
90
|
+
type: 'IfStatement'
|
91
|
+
, clauses: clauses
|
92
|
+
};
|
93
|
+
}
|
94
|
+
, ifClause: function(condition, body) {
|
95
|
+
return {
|
96
|
+
type: 'IfClause'
|
97
|
+
, condition: condition
|
98
|
+
, body: body
|
99
|
+
};
|
100
|
+
}
|
101
|
+
, elseifClause: function(condition, body) {
|
102
|
+
return {
|
103
|
+
type: 'ElseifClause'
|
104
|
+
, condition: condition
|
105
|
+
, body: body
|
106
|
+
};
|
107
|
+
}
|
108
|
+
, elseClause: function(body) {
|
109
|
+
return {
|
110
|
+
type: 'ElseClause'
|
111
|
+
, body: body
|
112
|
+
};
|
113
|
+
}
|
114
|
+
|
115
|
+
, whileStatement: function(condition, body) {
|
116
|
+
return {
|
117
|
+
type: 'WhileStatement'
|
118
|
+
, condition: condition
|
119
|
+
, body: body
|
120
|
+
};
|
121
|
+
}
|
122
|
+
|
123
|
+
, doStatement: function(body) {
|
124
|
+
return {
|
125
|
+
type: 'DoStatement'
|
126
|
+
, body: body
|
127
|
+
};
|
128
|
+
}
|
129
|
+
|
130
|
+
, repeatStatement: function(condition, body) {
|
131
|
+
return {
|
132
|
+
type: 'RepeatStatement'
|
133
|
+
, condition: condition
|
134
|
+
, body: body
|
135
|
+
};
|
136
|
+
}
|
137
|
+
|
138
|
+
, localStatement: function(variables, init) {
|
139
|
+
return {
|
140
|
+
type: 'LocalStatement'
|
141
|
+
, variables: variables
|
142
|
+
, init: init
|
143
|
+
};
|
144
|
+
}
|
145
|
+
|
146
|
+
, assignmentStatement: function(variables, init) {
|
147
|
+
return {
|
148
|
+
type: 'AssignmentStatement'
|
149
|
+
, variables: variables
|
150
|
+
, init: init
|
151
|
+
};
|
152
|
+
}
|
153
|
+
|
154
|
+
, callStatement: function(expression) {
|
155
|
+
return {
|
156
|
+
type: 'CallStatement'
|
157
|
+
, expression: expression
|
158
|
+
};
|
159
|
+
}
|
160
|
+
|
161
|
+
, functionStatement: function(identifier, parameters, isLocal, body) {
|
162
|
+
return {
|
163
|
+
type: 'FunctionDeclaration'
|
164
|
+
, identifier: identifier
|
165
|
+
, isLocal: isLocal
|
166
|
+
, parameters: parameters
|
167
|
+
, body: body
|
168
|
+
};
|
169
|
+
}
|
170
|
+
|
171
|
+
, forNumericStatement: function(variable, start, end, step, body) {
|
172
|
+
return {
|
173
|
+
type: 'ForNumericStatement'
|
174
|
+
, variable: variable
|
175
|
+
, start: start
|
176
|
+
, end: end
|
177
|
+
, step: step
|
178
|
+
, body: body
|
179
|
+
};
|
180
|
+
}
|
181
|
+
|
182
|
+
, forGenericStatement: function(variables, iterators, body) {
|
183
|
+
return {
|
184
|
+
type: 'ForGenericStatement'
|
185
|
+
, variables: variables
|
186
|
+
, iterators: iterators
|
187
|
+
, body: body
|
188
|
+
};
|
189
|
+
}
|
190
|
+
|
191
|
+
, chunk: function(body) {
|
192
|
+
return {
|
193
|
+
type: 'Chunk'
|
194
|
+
, body: body
|
195
|
+
};
|
196
|
+
}
|
197
|
+
|
198
|
+
, identifier: function(name) {
|
199
|
+
return {
|
200
|
+
type: 'Identifier'
|
201
|
+
, name: name
|
202
|
+
};
|
203
|
+
}
|
204
|
+
|
205
|
+
, literal: function(type, value, raw) {
|
206
|
+
type = (type === StringLiteral) ? 'StringLiteral'
|
207
|
+
: (type === NumericLiteral) ? 'NumericLiteral'
|
208
|
+
: (type === BooleanLiteral) ? 'BooleanLiteral'
|
209
|
+
: (type === NilLiteral) ? 'NilLiteral'
|
210
|
+
: 'VarargLiteral';
|
211
|
+
|
212
|
+
return {
|
213
|
+
type: type
|
214
|
+
, value: value
|
215
|
+
, raw: raw
|
216
|
+
};
|
217
|
+
}
|
218
|
+
|
219
|
+
, tableKey: function(key, value) {
|
220
|
+
return {
|
221
|
+
type: 'TableKey'
|
222
|
+
, key: key
|
223
|
+
, value: value
|
224
|
+
};
|
225
|
+
}
|
226
|
+
, tableKeyString: function(key, value) {
|
227
|
+
return {
|
228
|
+
type: 'TableKeyString'
|
229
|
+
, key: key
|
230
|
+
, value: value
|
231
|
+
};
|
232
|
+
}
|
233
|
+
, tableValue: function(value) {
|
234
|
+
return {
|
235
|
+
type: 'TableValue'
|
236
|
+
, value: value
|
237
|
+
};
|
238
|
+
}
|
239
|
+
|
240
|
+
|
241
|
+
, tableConstructorExpression: function(fields) {
|
242
|
+
return {
|
243
|
+
type: 'TableConstructorExpression'
|
244
|
+
, fields: fields
|
245
|
+
};
|
246
|
+
}
|
247
|
+
, binaryExpression: function(operator, left, right) {
|
248
|
+
var type = ('and' === operator || 'or' === operator) ?
|
249
|
+
'LogicalExpression' :
|
250
|
+
'BinaryExpression';
|
251
|
+
|
252
|
+
return {
|
253
|
+
type: type
|
254
|
+
, operator: operator
|
255
|
+
, left: left
|
256
|
+
, right: right
|
257
|
+
};
|
258
|
+
}
|
259
|
+
, unaryExpression: function(operator, argument) {
|
260
|
+
return {
|
261
|
+
type: 'UnaryExpression'
|
262
|
+
, operator: operator
|
263
|
+
, argument: argument
|
264
|
+
};
|
265
|
+
}
|
266
|
+
, memberExpression: function(base, indexer, identifier) {
|
267
|
+
return {
|
268
|
+
type: 'MemberExpression'
|
269
|
+
, indexer: indexer
|
270
|
+
, identifier: identifier
|
271
|
+
, base: base
|
272
|
+
};
|
273
|
+
}
|
274
|
+
|
275
|
+
, indexExpression: function(base, index) {
|
276
|
+
return {
|
277
|
+
type: 'IndexExpression'
|
278
|
+
, base: base
|
279
|
+
, index: index
|
280
|
+
};
|
281
|
+
}
|
282
|
+
|
283
|
+
, callExpression: function(base, args) {
|
284
|
+
return {
|
285
|
+
type: 'CallExpression'
|
286
|
+
, base: base
|
287
|
+
, 'arguments': args
|
288
|
+
};
|
289
|
+
}
|
290
|
+
|
291
|
+
, tableCallExpression: function(base, args) {
|
292
|
+
return {
|
293
|
+
type: 'TableCallExpression'
|
294
|
+
, base: base
|
295
|
+
, 'arguments': args
|
296
|
+
};
|
297
|
+
}
|
298
|
+
|
299
|
+
, stringCallExpression: function(base, argument) {
|
300
|
+
return {
|
301
|
+
type: 'StringCallExpression'
|
302
|
+
, base: base
|
303
|
+
, argument: argument
|
304
|
+
};
|
305
|
+
}
|
306
|
+
|
307
|
+
, comment: function(value, raw) {
|
308
|
+
return {
|
309
|
+
type: 'Comment'
|
310
|
+
, value: value
|
311
|
+
, raw: raw
|
312
|
+
};
|
313
|
+
}
|
314
|
+
};
|
315
|
+
|
316
|
+
// Wrap up the node object.
|
317
|
+
|
318
|
+
function finishNode(node) {
|
319
|
+
// Pop a `Marker` off the location-array and attach its location data.
|
320
|
+
if (trackLocations) {
|
321
|
+
var location = locations.pop();
|
322
|
+
location.complete();
|
323
|
+
if (options.locations) node.loc = location.loc;
|
324
|
+
if (options.ranges) node.range = location.range;
|
325
|
+
}
|
326
|
+
return node;
|
327
|
+
}
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
// Helpers
|
332
|
+
// -------
|
333
|
+
|
334
|
+
var slice = Array.prototype.slice
|
335
|
+
, toString = Object.prototype.toString
|
336
|
+
, indexOf = function indexOf(array, element) {
|
337
|
+
for (var i = 0, length = array.length; i < length; i++) {
|
338
|
+
if (array[i] === element) return i;
|
339
|
+
}
|
340
|
+
return -1;
|
341
|
+
};
|
342
|
+
|
343
|
+
// Iterate through an array of objects and return the index of an object
|
344
|
+
// with a matching property.
|
345
|
+
|
346
|
+
function indexOfObject(array, property, element) {
|
347
|
+
for (var i = 0, length = array.length; i < length; i++) {
|
348
|
+
if (array[i][property] === element) return i;
|
349
|
+
}
|
350
|
+
return -1;
|
351
|
+
}
|
352
|
+
|
353
|
+
// A sprintf implementation using %index (beginning at 1) to input
|
354
|
+
// arguments in the format string.
|
355
|
+
//
|
356
|
+
// Example:
|
357
|
+
//
|
358
|
+
// // Unexpected function in token
|
359
|
+
// sprintf('Unexpected %2 in %1.', 'token', 'function');
|
360
|
+
|
361
|
+
function sprintf(format) {
|
362
|
+
var args = slice.call(arguments, 1);
|
363
|
+
format = format.replace(/%(\d)/g, function (match, index) {
|
364
|
+
return '' + args[index - 1] || '';
|
365
|
+
});
|
366
|
+
return format;
|
367
|
+
}
|
368
|
+
|
369
|
+
// Returns a new object with the properties from all objectes passed as
|
370
|
+
// arguments. Last argument takes precedence.
|
371
|
+
//
|
372
|
+
// Example:
|
373
|
+
//
|
374
|
+
// this.options = extend(options, { output: false });
|
375
|
+
|
376
|
+
function extend() {
|
377
|
+
var args = slice.call(arguments)
|
378
|
+
, dest = {}
|
379
|
+
, src, prop;
|
380
|
+
|
381
|
+
for (var i = 0, length = args.length; i < length; i++) {
|
382
|
+
src = args[i];
|
383
|
+
for (prop in src) if (src.hasOwnProperty(prop)) {
|
384
|
+
dest[prop] = src[prop];
|
385
|
+
}
|
386
|
+
}
|
387
|
+
return dest;
|
388
|
+
}
|
389
|
+
|
390
|
+
// ### Error functions
|
391
|
+
|
392
|
+
// #### Raise an exception.
|
393
|
+
//
|
394
|
+
// Raise an exception by passing a token, a string format and its paramters.
|
395
|
+
//
|
396
|
+
// The passed tokens location will automatically be added to the error
|
397
|
+
// message if it exists, if not it will default to the lexers current
|
398
|
+
// position.
|
399
|
+
//
|
400
|
+
// Example:
|
401
|
+
//
|
402
|
+
// // [1:0] expected [ near (
|
403
|
+
// raise(token, "expected %1 near %2", '[', token.value);
|
404
|
+
|
405
|
+
function raise(token) {
|
406
|
+
var message = sprintf.apply(null, slice.call(arguments, 1))
|
407
|
+
, error, col;
|
408
|
+
|
409
|
+
if ('undefined' !== typeof token.line) {
|
410
|
+
col = token.range[0] - token.lineStart;
|
411
|
+
error = new SyntaxError(sprintf('[%1:%2] %3', token.line, col, message));
|
412
|
+
error.line = token.line;
|
413
|
+
error.index = token.range[0];
|
414
|
+
error.column = col;
|
415
|
+
} else {
|
416
|
+
col = index - lineStart + 1;
|
417
|
+
error = new SyntaxError(sprintf('[%1:%2] %3', line, col, message));
|
418
|
+
error.index = index;
|
419
|
+
error.line = line;
|
420
|
+
error.column = col;
|
421
|
+
}
|
422
|
+
throw error;
|
423
|
+
}
|
424
|
+
|
425
|
+
// #### Raise an unexpected token error.
|
426
|
+
//
|
427
|
+
// Example:
|
428
|
+
//
|
429
|
+
// // expected <name> near '0'
|
430
|
+
// raiseUnexpectedToken('<name>', token);
|
431
|
+
|
432
|
+
function raiseUnexpectedToken(type, token) {
|
433
|
+
raise(token, errors.expectedToken, type, token.value);
|
434
|
+
}
|
435
|
+
|
436
|
+
// #### Raise a general unexpected error
|
437
|
+
//
|
438
|
+
// Usage should pass either a token object or a symbol string which was
|
439
|
+
// expected. We can also specify a nearby token such as <eof>, this will
|
440
|
+
// default to the currently active token.
|
441
|
+
//
|
442
|
+
// Example:
|
443
|
+
//
|
444
|
+
// // Unexpected symbol 'end' near '<eof>'
|
445
|
+
// unexpected(token);
|
446
|
+
//
|
447
|
+
// If there's no token in the buffer it means we have reached <eof>.
|
448
|
+
|
449
|
+
function unexpected(found, near) {
|
450
|
+
if ('undefined' === typeof near) near = lookahead.value;
|
451
|
+
if ('undefined' !== typeof found.type) {
|
452
|
+
var type;
|
453
|
+
switch (found.type) {
|
454
|
+
case StringLiteral: type = 'string'; break;
|
455
|
+
case Keyword: type = 'keyword'; break;
|
456
|
+
case Identifier: type = 'identifier'; break;
|
457
|
+
case NumericLiteral: type = 'number'; break;
|
458
|
+
case Punctuator: type = 'symbol'; break;
|
459
|
+
case BooleanLiteral: type = 'boolean'; break;
|
460
|
+
case NilLiteral:
|
461
|
+
return raise(found, errors.unexpected, 'symbol', 'nil', near);
|
462
|
+
}
|
463
|
+
return raise(found, errors.unexpected, type, found.value, near);
|
464
|
+
}
|
465
|
+
return raise(found, errors.unexpected, 'symbol', found, near);
|
466
|
+
}
|
467
|
+
|
468
|
+
// Lexer
|
469
|
+
// -----
|
470
|
+
//
|
471
|
+
// The lexer, or the tokenizer reads the input string character by character
|
472
|
+
// and derives a token left-right. To be as efficient as possible the lexer
|
473
|
+
// prioritizes the common cases such as identifiers. It also works with
|
474
|
+
// character codes instead of characters as string comparisons was the
|
475
|
+
// biggest bottleneck of the parser.
|
476
|
+
//
|
477
|
+
// If `options.comments` is enabled, all comments encountered will be stored
|
478
|
+
// in an array which later will be appended to the chunk object. If disabled,
|
479
|
+
// they will simply be disregarded.
|
480
|
+
//
|
481
|
+
// When the lexer has derived a valid token, it will be returned as an object
|
482
|
+
// containing its value and as well as its position in the input string (this
|
483
|
+
// is always enabled to provide proper debug messages).
|
484
|
+
//
|
485
|
+
// `lex()` starts lexing and returns the following token in the stream.
|
486
|
+
|
487
|
+
var index
|
488
|
+
, token
|
489
|
+
, previousToken
|
490
|
+
, lookahead
|
491
|
+
, comments
|
492
|
+
, tokenStart
|
493
|
+
, line
|
494
|
+
, lineStart;
|
495
|
+
|
496
|
+
exports.lex = lex;
|
497
|
+
|
498
|
+
function lex() {
|
499
|
+
skipWhiteSpace();
|
500
|
+
|
501
|
+
// Skip comments beginning with --
|
502
|
+
while (45 === input.charCodeAt(index) &&
|
503
|
+
45 === input.charCodeAt(index + 1)) {
|
504
|
+
scanComment();
|
505
|
+
skipWhiteSpace();
|
506
|
+
}
|
507
|
+
if (index >= length) return {
|
508
|
+
type : EOF
|
509
|
+
, value: '<eof>'
|
510
|
+
, line: line
|
511
|
+
, lineStart: lineStart
|
512
|
+
, range: [index, index]
|
513
|
+
};
|
514
|
+
|
515
|
+
var charCode = input.charCodeAt(index)
|
516
|
+
, next = input.charCodeAt(index + 1);
|
517
|
+
|
518
|
+
// Memorize the range index where the token begins.
|
519
|
+
tokenStart = index;
|
520
|
+
if (isIdentifierStart(charCode)) return scanIdentifierOrKeyword();
|
521
|
+
|
522
|
+
switch (charCode) {
|
523
|
+
case 39: case 34: // '"
|
524
|
+
return scanStringLiteral();
|
525
|
+
|
526
|
+
// 0-9
|
527
|
+
case 48: case 49: case 50: case 51: case 52: case 53:
|
528
|
+
case 54: case 55: case 56: case 57:
|
529
|
+
return scanNumericLiteral();
|
530
|
+
|
531
|
+
case 46: // .
|
532
|
+
// If the dot is followed by a digit it's a float.
|
533
|
+
if (isDecDigit(next)) return scanNumericLiteral();
|
534
|
+
if (46 === next) {
|
535
|
+
if (46 === input.charCodeAt(index + 2)) return scanVarargLiteral();
|
536
|
+
return scanPunctuator('..');
|
537
|
+
}
|
538
|
+
return scanPunctuator('.');
|
539
|
+
|
540
|
+
case 61: // =
|
541
|
+
if (61 === next) return scanPunctuator('==');
|
542
|
+
return scanPunctuator('=');
|
543
|
+
|
544
|
+
case 62: // >
|
545
|
+
if (61 === next) return scanPunctuator('>=');
|
546
|
+
return scanPunctuator('>');
|
547
|
+
|
548
|
+
case 60: // <
|
549
|
+
if (61 === next) return scanPunctuator('<=');
|
550
|
+
return scanPunctuator('<');
|
551
|
+
|
552
|
+
case 126: // ~
|
553
|
+
if (61 === next) return scanPunctuator('~=');
|
554
|
+
return raise({}, errors.expected, '=', '~');
|
555
|
+
|
556
|
+
case 58: // :
|
557
|
+
if (58 === next) return scanPunctuator('::');
|
558
|
+
return scanPunctuator(':');
|
559
|
+
|
560
|
+
case 91: // [
|
561
|
+
// Check for a multiline string, they begin with [= or [[
|
562
|
+
if (91 === next || 61 === next) return scanLongStringLiteral();
|
563
|
+
return scanPunctuator('[');
|
564
|
+
|
565
|
+
// \* / ^ % , { } ] ( ) ; # - +
|
566
|
+
case 42: case 47: case 94: case 37: case 44: case 123: case 125:
|
567
|
+
case 93: case 40: case 41: case 59: case 35: case 45: case 43:
|
568
|
+
return scanPunctuator(input.charAt(index));
|
569
|
+
}
|
570
|
+
|
571
|
+
return unexpected(input.charAt(index));
|
572
|
+
}
|
573
|
+
|
574
|
+
// Whitespace has no semantic meaning in lua so simply skip ahead while
|
575
|
+
// tracking the encounted newlines. Newlines are also tracked in all
|
576
|
+
// token functions where multiline values are allowed.
|
577
|
+
|
578
|
+
function skipWhiteSpace() {
|
579
|
+
while (index < length) {
|
580
|
+
var charCode = input.charCodeAt(index);
|
581
|
+
if (isWhiteSpace(charCode)) {
|
582
|
+
index++;
|
583
|
+
} else if (isLineTerminator(charCode)) {
|
584
|
+
line++;
|
585
|
+
lineStart = ++index;
|
586
|
+
} else {
|
587
|
+
break;
|
588
|
+
}
|
589
|
+
}
|
590
|
+
}
|
591
|
+
|
592
|
+
// Identifiers, keywords, booleans and nil all look the same syntax wise. We
|
593
|
+
// simply go through them one by one and defaulting to an identifier if no
|
594
|
+
// previous case matched.
|
595
|
+
|
596
|
+
function scanIdentifierOrKeyword() {
|
597
|
+
var value, type;
|
598
|
+
|
599
|
+
// Slicing the input string is prefered before string concatenation in a
|
600
|
+
// loop for performance reasons.
|
601
|
+
while (isIdentifierPart(input.charCodeAt(++index)));
|
602
|
+
value = input.slice(tokenStart, index);
|
603
|
+
|
604
|
+
// Decide on the token type and possibly cast the value.
|
605
|
+
if (isKeyword(value)) {
|
606
|
+
type = Keyword;
|
607
|
+
} else if ('true' === value || 'false' === value) {
|
608
|
+
type = BooleanLiteral;
|
609
|
+
value = ('true' === value);
|
610
|
+
} else if ('nil' === value) {
|
611
|
+
type = NilLiteral;
|
612
|
+
value = null;
|
613
|
+
} else {
|
614
|
+
type = Identifier;
|
615
|
+
}
|
616
|
+
|
617
|
+
return {
|
618
|
+
type: type
|
619
|
+
, value: value
|
620
|
+
, line: line
|
621
|
+
, lineStart: lineStart
|
622
|
+
, range: [tokenStart, index]
|
623
|
+
};
|
624
|
+
}
|
625
|
+
|
626
|
+
// Once a punctuator reaches this function it should already have been
|
627
|
+
// validated so we simply return it as a token.
|
628
|
+
|
629
|
+
function scanPunctuator(value) {
|
630
|
+
index += value.length;
|
631
|
+
return {
|
632
|
+
type: Punctuator
|
633
|
+
, value: value
|
634
|
+
, line: line
|
635
|
+
, lineStart: lineStart
|
636
|
+
, range: [tokenStart, index]
|
637
|
+
};
|
638
|
+
}
|
639
|
+
|
640
|
+
// A vararg literal consists of three dots.
|
641
|
+
|
642
|
+
function scanVarargLiteral() {
|
643
|
+
index += 3;
|
644
|
+
return {
|
645
|
+
type: VarargLiteral
|
646
|
+
, value: '...'
|
647
|
+
, line: line
|
648
|
+
, lineStart: lineStart
|
649
|
+
, range: [tokenStart, index]
|
650
|
+
};
|
651
|
+
}
|
652
|
+
|
653
|
+
// Find the string literal by matching the delimiter marks used.
|
654
|
+
|
655
|
+
function scanStringLiteral() {
|
656
|
+
var delimiter = input.charCodeAt(index++)
|
657
|
+
, stringStart = index
|
658
|
+
, string = ''
|
659
|
+
, charCode;
|
660
|
+
|
661
|
+
while (index < length) {
|
662
|
+
charCode = input.charCodeAt(index++);
|
663
|
+
if (delimiter === charCode) break;
|
664
|
+
if (92 === charCode) { // \
|
665
|
+
string += input.slice(stringStart, index - 1) + readEscapeSequence();
|
666
|
+
stringStart = index;
|
667
|
+
}
|
668
|
+
// EOF or `\n` terminates a string literal. If we haven't found the
|
669
|
+
// ending delimiter by now, raise an exception.
|
670
|
+
else if (index >= length || isLineTerminator(charCode)) {
|
671
|
+
string += input.slice(stringStart, index - 1);
|
672
|
+
raise({}, errors.unfinishedString, string + String.fromCharCode(charCode));
|
673
|
+
}
|
674
|
+
}
|
675
|
+
string += input.slice(stringStart, index - 1);
|
676
|
+
|
677
|
+
return {
|
678
|
+
type: StringLiteral
|
679
|
+
, value: string
|
680
|
+
, line: line
|
681
|
+
, lineStart: lineStart
|
682
|
+
, range: [tokenStart, index]
|
683
|
+
};
|
684
|
+
}
|
685
|
+
|
686
|
+
// Expect a multiline string literal and return it as a regular string
|
687
|
+
// literal, if it doesn't validate into a valid multiline string, throw an
|
688
|
+
// exception.
|
689
|
+
|
690
|
+
function scanLongStringLiteral() {
|
691
|
+
var string = readLongString();
|
692
|
+
// Fail if it's not a multiline literal.
|
693
|
+
if (false === string) raise(token, errors.expected, '[', token.value);
|
694
|
+
|
695
|
+
return {
|
696
|
+
type: StringLiteral
|
697
|
+
, value: string
|
698
|
+
, line: line
|
699
|
+
, lineStart: lineStart
|
700
|
+
, range: [tokenStart, index]
|
701
|
+
};
|
702
|
+
}
|
703
|
+
|
704
|
+
// Numeric literals will be returned as floating-point numbers instead of
|
705
|
+
// strings. The raw value should be retrieved from slicing the input string
|
706
|
+
// later on in the process.
|
707
|
+
//
|
708
|
+
// If a hexadecimal number is encountered, it will be converted.
|
709
|
+
|
710
|
+
function scanNumericLiteral() {
|
711
|
+
var character = input.charAt(index)
|
712
|
+
, next = input.charAt(index + 1);
|
713
|
+
|
714
|
+
var value = ('0' === character && 'xX'.indexOf(next || null) >= 0) ?
|
715
|
+
readHexLiteral() : readDecLiteral();
|
716
|
+
|
717
|
+
return {
|
718
|
+
type: NumericLiteral
|
719
|
+
, value: value
|
720
|
+
, line: line
|
721
|
+
, lineStart: lineStart
|
722
|
+
, range: [tokenStart, index]
|
723
|
+
};
|
724
|
+
}
|
725
|
+
|
726
|
+
// Lua hexadecimals have an optional fraction part and an optional binary
|
727
|
+
// exoponent part. These are not included in JavaScript so we will compute
|
728
|
+
// all three parts separately and then sum them up at the end of the function
|
729
|
+
// with the following algorithm.
|
730
|
+
//
|
731
|
+
// Digit := toDec(digit)
|
732
|
+
// Fraction := toDec(fraction) / 16 ^ fractionCount
|
733
|
+
// BinaryExp := 2 ^ binaryExp
|
734
|
+
// Number := ( Digit + Fraction ) * BinaryExp
|
735
|
+
|
736
|
+
function readHexLiteral() {
|
737
|
+
var fraction = 0 // defaults to 0 as it gets summed
|
738
|
+
, binaryExponent = 1 // defaults to 1 as it gets multiplied
|
739
|
+
, binarySign = 1 // positive
|
740
|
+
, digit, fractionStart, exponentStart, digitStart;
|
741
|
+
|
742
|
+
digitStart = index += 2; // Skip 0x part
|
743
|
+
|
744
|
+
// A minimum of one hex digit is required.
|
745
|
+
if (!isHexDigit(input.charCodeAt(index)))
|
746
|
+
raise({}, errors.malformedNumber, input.slice(tokenStart, index));
|
747
|
+
|
748
|
+
while (isHexDigit(input.charCodeAt(index))) index++;
|
749
|
+
// Convert the hexadecimal digit to base 10.
|
750
|
+
digit = parseInt(input.slice(digitStart, index), 16);
|
751
|
+
|
752
|
+
// Fraction part i optional.
|
753
|
+
if ('.' === input.charAt(index)) {
|
754
|
+
fractionStart = ++index;
|
755
|
+
|
756
|
+
while (isHexDigit(input.charCodeAt(index))) index++;
|
757
|
+
fraction = input.slice(fractionStart, index);
|
758
|
+
|
759
|
+
// Empty fraction parts should default to 0, others should be converted
|
760
|
+
// 0.x form so we can use summation at the end.
|
761
|
+
fraction = (fractionStart === index) ? 0
|
762
|
+
: parseInt(fraction, 16) / Math.pow(16, index - fractionStart);
|
763
|
+
}
|
764
|
+
|
765
|
+
// Binary exponents are optional
|
766
|
+
if ('pP'.indexOf(input.charAt(index) || null) >= 0) {
|
767
|
+
index++;
|
768
|
+
|
769
|
+
// Sign part is optional and defaults to 1 (positive).
|
770
|
+
if ('+-'.indexOf(input.charAt(index) || null) >= 0)
|
771
|
+
binarySign = ('+' === input.charAt(index++)) ? 1 : -1;
|
772
|
+
|
773
|
+
exponentStart = index;
|
774
|
+
|
775
|
+
// The binary exponent sign requires a decimal digit.
|
776
|
+
if (!isDecDigit(input.charCodeAt(index)))
|
777
|
+
raise({}, errors.malformedNumber, input.slice(tokenStart, index));
|
778
|
+
|
779
|
+
while (isDecDigit(input.charCodeAt(index))) index++;
|
780
|
+
binaryExponent = input.slice(exponentStart, index);
|
781
|
+
|
782
|
+
// Calculate the binary exponent of the number.
|
783
|
+
binaryExponent = Math.pow(2, binaryExponent * binarySign);
|
784
|
+
}
|
785
|
+
|
786
|
+
return (digit + fraction) * binaryExponent;
|
787
|
+
}
|
788
|
+
|
789
|
+
// Decimal numbers are exactly the same in Lua and in JavaScript, because of
|
790
|
+
// this we check where the token ends and then parse it with native
|
791
|
+
// functions.
|
792
|
+
|
793
|
+
function readDecLiteral() {
|
794
|
+
while (isDecDigit(input.charCodeAt(index))) index++;
|
795
|
+
// Fraction part is optional
|
796
|
+
if ('.' === input.charAt(index)) {
|
797
|
+
index++;
|
798
|
+
// Fraction part defaults to 0
|
799
|
+
while (isDecDigit(input.charCodeAt(index))) index++;
|
800
|
+
}
|
801
|
+
// Exponent part is optional.
|
802
|
+
if ('eE'.indexOf(input.charAt(index) || null) >= 0) {
|
803
|
+
index++;
|
804
|
+
// Sign part is optional.
|
805
|
+
if ('+-'.indexOf(input.charAt(index) || null) >= 0) index++;
|
806
|
+
// An exponent is required to contain at least one decimal digit.
|
807
|
+
if (!isDecDigit(input.charCodeAt(index)))
|
808
|
+
raise({}, errors.malformedNumber, input.slice(tokenStart, index));
|
809
|
+
|
810
|
+
while (isDecDigit(input.charCodeAt(index))) index++;
|
811
|
+
}
|
812
|
+
|
813
|
+
return parseFloat(input.slice(tokenStart, index));
|
814
|
+
}
|
815
|
+
|
816
|
+
|
817
|
+
// Translate escape sequences to the actual characters.
|
818
|
+
|
819
|
+
function readEscapeSequence() {
|
820
|
+
var sequenceStart = index;
|
821
|
+
switch (input.charAt(index)) {
|
822
|
+
// Lua allow the following escape sequences.
|
823
|
+
// We don't escape the bell sequence.
|
824
|
+
case 'n': index++; return '\n';
|
825
|
+
case 'r': index++; return '\r';
|
826
|
+
case 't': index++; return '\t';
|
827
|
+
case 'v': index++; return '\x0B';
|
828
|
+
case 'b': index++; return '\b';
|
829
|
+
case 'f': index++; return '\f';
|
830
|
+
// Skips the following span of white-space.
|
831
|
+
case 'z': index++; skipWhiteSpace(); return '';
|
832
|
+
// Byte representation should for now be returned as is.
|
833
|
+
case 'x':
|
834
|
+
// \xXX, where XX is a sequence of exactly two hexadecimal digits
|
835
|
+
if (isHexDigit(input.charCodeAt(index + 1)) &&
|
836
|
+
isHexDigit(input.charCodeAt(index + 2))) {
|
837
|
+
index += 3;
|
838
|
+
// Return it as is, without translating the byte.
|
839
|
+
return '\\' + input.slice(sequenceStart, index);
|
840
|
+
}
|
841
|
+
return '\\' + input.charAt(index++);
|
842
|
+
default:
|
843
|
+
// \ddd, where ddd is a sequence of up to three decimal digits.
|
844
|
+
if (isDecDigit(input.charCodeAt(index))) {
|
845
|
+
while (isDecDigit(input.charCodeAt(++index)));
|
846
|
+
return '\\' + input.slice(sequenceStart, index);
|
847
|
+
}
|
848
|
+
// Simply return the \ as is, it's not escaping any sequence.
|
849
|
+
return input.charAt(index++);
|
850
|
+
}
|
851
|
+
}
|
852
|
+
|
853
|
+
// Comments begin with -- after which it will be decided if they are
|
854
|
+
// multiline comments or not.
|
855
|
+
//
|
856
|
+
// The multiline functionality works the exact same way as with string
|
857
|
+
// literals so we reuse the functionality.
|
858
|
+
|
859
|
+
function scanComment() {
|
860
|
+
tokenStart = index;
|
861
|
+
index += 2; // --
|
862
|
+
|
863
|
+
var character = input.charAt(index)
|
864
|
+
, content = ''
|
865
|
+
, isLong = false
|
866
|
+
, commentStart = index
|
867
|
+
, lineStartComment = lineStart
|
868
|
+
, lineComment = line;
|
869
|
+
|
870
|
+
if ('[' === character) {
|
871
|
+
content = readLongString();
|
872
|
+
// This wasn't a multiline comment after all.
|
873
|
+
if (false === content) content = character;
|
874
|
+
else isLong = true;
|
875
|
+
}
|
876
|
+
// Scan until next line as long as it's not a multiline comment.
|
877
|
+
if (!isLong) {
|
878
|
+
while (index < length) {
|
879
|
+
if (isLineTerminator(input.charCodeAt(index))) break;
|
880
|
+
index++;
|
881
|
+
}
|
882
|
+
if (options.comments) content = input.slice(commentStart, index);
|
883
|
+
}
|
884
|
+
|
885
|
+
if (options.comments) {
|
886
|
+
var node = ast.comment(content, input.slice(tokenStart, index));
|
887
|
+
|
888
|
+
// `Marker`s depend on tokens available in the parser and as comments are
|
889
|
+
// intercepted in the lexer all location data is set manually.
|
890
|
+
if (options.locations) {
|
891
|
+
node.loc = {
|
892
|
+
start: { line: lineComment, column: tokenStart - lineStartComment }
|
893
|
+
, end: { line: line, column: index - lineStart }
|
894
|
+
};
|
895
|
+
}
|
896
|
+
if (options.ranges) {
|
897
|
+
node.range = [tokenStart, index];
|
898
|
+
}
|
899
|
+
comments.push(node);
|
900
|
+
}
|
901
|
+
}
|
902
|
+
|
903
|
+
// Read a multiline string by calculating the depth of `=` characters and
|
904
|
+
// then appending until an equal depth is found.
|
905
|
+
|
906
|
+
function readLongString() {
|
907
|
+
var level = 0
|
908
|
+
, content = ''
|
909
|
+
, terminator = false
|
910
|
+
, character, stringStart;
|
911
|
+
|
912
|
+
index++; // [
|
913
|
+
|
914
|
+
// Calculate the depth of the comment.
|
915
|
+
while ('=' === input.charAt(index + level)) level++;
|
916
|
+
// Exit, this is not a long string afterall.
|
917
|
+
if ('[' !== input.charAt(index + level)) return false;
|
918
|
+
|
919
|
+
index += level + 1;
|
920
|
+
|
921
|
+
// If the first character is a newline, ignore it and begin on next line.
|
922
|
+
if (isLineTerminator(input.charCodeAt(index))) {
|
923
|
+
line++;
|
924
|
+
lineStart = index++;
|
925
|
+
}
|
926
|
+
|
927
|
+
stringStart = index;
|
928
|
+
while (index < length) {
|
929
|
+
character = input.charAt(index++);
|
930
|
+
|
931
|
+
// We have to keep track of newlines as `skipWhiteSpace()` does not get
|
932
|
+
// to scan this part.
|
933
|
+
if (isLineTerminator(character.charCodeAt(0))) {
|
934
|
+
line++;
|
935
|
+
lineStart = index;
|
936
|
+
}
|
937
|
+
|
938
|
+
// Once the delimiter is found, iterate through the depth count and see
|
939
|
+
// if it matches.
|
940
|
+
if (']' === character) {
|
941
|
+
terminator = true;
|
942
|
+
for (var i = 0; i < level; i++) {
|
943
|
+
if ('=' !== input.charAt(index + i)) terminator = false;
|
944
|
+
}
|
945
|
+
if (']' !== input.charAt(index + level)) terminator = false;
|
946
|
+
}
|
947
|
+
|
948
|
+
// We reached the end of the multiline string. Get out now.
|
949
|
+
if (terminator) break;
|
950
|
+
}
|
951
|
+
content += input.slice(stringStart, index - 1);
|
952
|
+
index += level + 1;
|
953
|
+
|
954
|
+
return content;
|
955
|
+
}
|
956
|
+
|
957
|
+
// ## Lex functions and helpers.
|
958
|
+
|
959
|
+
// Read the next token.
|
960
|
+
//
|
961
|
+
// This is actually done by setting the current token to the lookahead and
|
962
|
+
// reading in the new lookahead token.
|
963
|
+
|
964
|
+
function next() {
|
965
|
+
previousToken = token;
|
966
|
+
token = lookahead;
|
967
|
+
lookahead = lex();
|
968
|
+
}
|
969
|
+
|
970
|
+
// Consume a token if its value matches. Once consumed or not, return the
|
971
|
+
// success of the operation.
|
972
|
+
|
973
|
+
function consume(value) {
|
974
|
+
if (value === token.value) {
|
975
|
+
next();
|
976
|
+
return true;
|
977
|
+
}
|
978
|
+
return false;
|
979
|
+
}
|
980
|
+
|
981
|
+
// Expect the next token value to match. If not, throw an exception.
|
982
|
+
|
983
|
+
function expect(value) {
|
984
|
+
if (value === token.value) next();
|
985
|
+
else raise(token, errors.expected, value, token.value);
|
986
|
+
}
|
987
|
+
|
988
|
+
// ### Validation functions
|
989
|
+
|
990
|
+
function isWhiteSpace(charCode) {
|
991
|
+
return 9 === charCode || 32 === charCode || 0xB === charCode || 0xC === charCode;
|
992
|
+
}
|
993
|
+
|
994
|
+
function isLineTerminator(charCode) {
|
995
|
+
return 10 === charCode || 13 === charCode;
|
996
|
+
}
|
997
|
+
|
998
|
+
function isDecDigit(charCode) {
|
999
|
+
return charCode >= 48 && charCode <= 57;
|
1000
|
+
}
|
1001
|
+
|
1002
|
+
function isHexDigit(charCode) {
|
1003
|
+
return (charCode >= 48 && charCode <= 57) || (charCode >= 97 && charCode <= 102) || (charCode >= 65 && charCode <= 70);
|
1004
|
+
}
|
1005
|
+
|
1006
|
+
// From [Lua 5.2](http://www.lua.org/manual/5.2/manual.html#8.1) onwards
|
1007
|
+
// identifiers cannot use locale-dependet letters.
|
1008
|
+
|
1009
|
+
function isIdentifierStart(charCode) {
|
1010
|
+
return (charCode >= 65 && charCode <= 90) || (charCode >= 97 && charCode <= 122) || 95 === charCode;
|
1011
|
+
}
|
1012
|
+
|
1013
|
+
function isIdentifierPart(charCode) {
|
1014
|
+
return (charCode >= 65 && charCode <= 90) || (charCode >= 97 && charCode <= 122) || 95 === charCode || (charCode >= 48 && charCode <= 57);
|
1015
|
+
}
|
1016
|
+
|
1017
|
+
// [3.1 Lexical Conventions](http://www.lua.org/manual/5.2/manual.html#3.1)
|
1018
|
+
//
|
1019
|
+
// `true`, `false` and `nil` will not be considered keywords, but literals.
|
1020
|
+
|
1021
|
+
function isKeyword(id) {
|
1022
|
+
switch (id.length) {
|
1023
|
+
case 2:
|
1024
|
+
return 'do' === id || 'if' === id || 'in' === id || 'or' === id;
|
1025
|
+
case 3:
|
1026
|
+
return 'and' === id || 'end' === id || 'for' === id || 'not' === id;
|
1027
|
+
case 4:
|
1028
|
+
return 'else' === id || 'goto' === id || 'then' === id;
|
1029
|
+
case 5:
|
1030
|
+
return 'break' === id || 'local' === id || 'until' === id || 'while' === id;
|
1031
|
+
case 6:
|
1032
|
+
return 'elseif' === id || 'repeat' === id || 'return' === id;
|
1033
|
+
case 8:
|
1034
|
+
return 'function' === id;
|
1035
|
+
}
|
1036
|
+
return false;
|
1037
|
+
}
|
1038
|
+
|
1039
|
+
function isUnary(token) {
|
1040
|
+
if (Punctuator === token.type) return '#-'.indexOf(token.value) >= 0;
|
1041
|
+
if (Keyword === token.type) return 'not' === token.value;
|
1042
|
+
return false;
|
1043
|
+
}
|
1044
|
+
|
1045
|
+
// @TODO this needs to be rethought.
|
1046
|
+
function isCallExpression(expression) {
|
1047
|
+
switch (expression.type) {
|
1048
|
+
case 'CallExpression':
|
1049
|
+
case 'TableCallExpression':
|
1050
|
+
case 'StringCallExpression':
|
1051
|
+
return true;
|
1052
|
+
}
|
1053
|
+
return false;
|
1054
|
+
}
|
1055
|
+
|
1056
|
+
// Check if the token syntactically closes a block.
|
1057
|
+
|
1058
|
+
function isBlockFollow(token) {
|
1059
|
+
if (EOF === token.type) return true;
|
1060
|
+
if (Keyword !== token.type) return false;
|
1061
|
+
switch (token.value) {
|
1062
|
+
case 'else': case 'elseif':
|
1063
|
+
case 'end': case 'until':
|
1064
|
+
return true;
|
1065
|
+
default:
|
1066
|
+
return false;
|
1067
|
+
}
|
1068
|
+
}
|
1069
|
+
|
1070
|
+
// Scope
|
1071
|
+
// -----
|
1072
|
+
|
1073
|
+
// Store each block scope as a an array of identifier names. Each scope is
|
1074
|
+
// stored in an FILO-array.
|
1075
|
+
var scopes
|
1076
|
+
// The current scope index
|
1077
|
+
, scopeDepth
|
1078
|
+
// A list of all global identifier nodes.
|
1079
|
+
, globals;
|
1080
|
+
|
1081
|
+
// Create a new scope inheriting all declarations from the previous scope.
|
1082
|
+
function createScope() {
|
1083
|
+
scopes.push(Array.apply(null, scopes[scopeDepth++]));
|
1084
|
+
}
|
1085
|
+
|
1086
|
+
// Exit and remove the current scope.
|
1087
|
+
function exitScope() {
|
1088
|
+
scopes.pop();
|
1089
|
+
scopeDepth--;
|
1090
|
+
}
|
1091
|
+
|
1092
|
+
// Add identifier name to the current scope if it doesnt already exist.
|
1093
|
+
function scopeIdentifierName(name) {
|
1094
|
+
if (-1 !== indexOf(scopes[scopeDepth], name)) return;
|
1095
|
+
scopes[scopeDepth].push(name);
|
1096
|
+
}
|
1097
|
+
|
1098
|
+
// Add identifier to the current scope
|
1099
|
+
function scopeIdentifier(node) {
|
1100
|
+
scopeIdentifierName(node.name);
|
1101
|
+
attachScope(node, true);
|
1102
|
+
}
|
1103
|
+
|
1104
|
+
// Attach scope information to node. If the node is global, store it in the
|
1105
|
+
// globals array so we can return the information to the user.
|
1106
|
+
function attachScope(node, isLocal) {
|
1107
|
+
if (!isLocal && -1 === indexOfObject(globals, 'name', node.name))
|
1108
|
+
globals.push(node);
|
1109
|
+
|
1110
|
+
node.isLocal = isLocal;
|
1111
|
+
}
|
1112
|
+
|
1113
|
+
// Is the identifier name available in this scope.
|
1114
|
+
function scopeHasName(name) {
|
1115
|
+
return (-1 !== indexOf(scopes[scopeDepth], name));
|
1116
|
+
}
|
1117
|
+
|
1118
|
+
// Location tracking
|
1119
|
+
// -----------------
|
1120
|
+
//
|
1121
|
+
// Locations are stored in FILO-array as a `Marker` object consisting of both
|
1122
|
+
// `loc` and `range` data. Once a `Marker` is popped off the list an end
|
1123
|
+
// location is added and the data is attached to a syntax node.
|
1124
|
+
|
1125
|
+
var locations = []
|
1126
|
+
, trackLocations;
|
1127
|
+
|
1128
|
+
function createLocationMarker() {
|
1129
|
+
return new Marker(token);
|
1130
|
+
}
|
1131
|
+
|
1132
|
+
function Marker(token) {
|
1133
|
+
if (options.locations) {
|
1134
|
+
this.loc = {
|
1135
|
+
start: {
|
1136
|
+
line: token.line
|
1137
|
+
, column: token.range[0] - token.lineStart
|
1138
|
+
}
|
1139
|
+
, end: {
|
1140
|
+
line: 0
|
1141
|
+
, column: 0
|
1142
|
+
}
|
1143
|
+
};
|
1144
|
+
}
|
1145
|
+
if (options.ranges) this.range = [token.range[0], 0];
|
1146
|
+
}
|
1147
|
+
|
1148
|
+
// Complete the location data stored in the `Marker` by adding the location
|
1149
|
+
// of the *previous token* as an end location.
|
1150
|
+
Marker.prototype.complete = function() {
|
1151
|
+
if (options.locations) {
|
1152
|
+
this.loc.end.line = previousToken.line;
|
1153
|
+
this.loc.end.column = previousToken.range[1] - previousToken.lineStart;
|
1154
|
+
}
|
1155
|
+
if (options.ranges) {
|
1156
|
+
this.range[1] = previousToken.range[1];
|
1157
|
+
}
|
1158
|
+
};
|
1159
|
+
|
1160
|
+
// Create a new `Marker` and add it to the FILO-array.
|
1161
|
+
function markLocation() {
|
1162
|
+
if (trackLocations) locations.push(createLocationMarker());
|
1163
|
+
}
|
1164
|
+
|
1165
|
+
// Push an arbitrary `Marker` object onto the FILO-array.
|
1166
|
+
function pushLocation(marker) {
|
1167
|
+
if (trackLocations) locations.push(marker);
|
1168
|
+
}
|
1169
|
+
|
1170
|
+
// Parse functions
|
1171
|
+
// ---------------
|
1172
|
+
|
1173
|
+
// Chunk is the main program object. Syntactically it's the same as a block.
|
1174
|
+
//
|
1175
|
+
// chunk ::= block
|
1176
|
+
|
1177
|
+
function parseChunk() {
|
1178
|
+
next();
|
1179
|
+
markLocation();
|
1180
|
+
var body = parseBlock();
|
1181
|
+
if (EOF !== token.type) unexpected(token);
|
1182
|
+
// If the body is empty no previousToken exists when finishNode runs.
|
1183
|
+
if (trackLocations && !body.length) previousToken = token;
|
1184
|
+
return finishNode(ast.chunk(body));
|
1185
|
+
}
|
1186
|
+
|
1187
|
+
// A block contains a list of statements with an optional return statement
|
1188
|
+
// as its last statement.
|
1189
|
+
//
|
1190
|
+
// block ::= {stat} [retstat]
|
1191
|
+
|
1192
|
+
function parseBlock(terminator) {
|
1193
|
+
var block = []
|
1194
|
+
, statement;
|
1195
|
+
|
1196
|
+
// Each block creates a new scope.
|
1197
|
+
if (options.scope) createScope();
|
1198
|
+
|
1199
|
+
while (!isBlockFollow(token)) {
|
1200
|
+
// Return has to be the last statement in a block.
|
1201
|
+
if ('return' === token.value) {
|
1202
|
+
block.push(parseStatement());
|
1203
|
+
break;
|
1204
|
+
}
|
1205
|
+
statement = parseStatement();
|
1206
|
+
// Statements are only added if they are returned, this allows us to
|
1207
|
+
// ignore some statements, such as EmptyStatement.
|
1208
|
+
if (statement) block.push(statement);
|
1209
|
+
}
|
1210
|
+
|
1211
|
+
if (options.scope) exitScope();
|
1212
|
+
// Doesn't really need an ast node
|
1213
|
+
return block;
|
1214
|
+
}
|
1215
|
+
|
1216
|
+
// There are two types of statements, simple and compound.
|
1217
|
+
//
|
1218
|
+
// statement ::= break | goto | do | while | repeat | return
|
1219
|
+
// | if | for | function | local | label | assignment
|
1220
|
+
// | functioncall | ';'
|
1221
|
+
|
1222
|
+
function parseStatement() {
|
1223
|
+
markLocation();
|
1224
|
+
if (Keyword === token.type) {
|
1225
|
+
switch (token.value) {
|
1226
|
+
case 'local': next(); return parseLocalStatement();
|
1227
|
+
case 'if': next(); return parseIfStatement();
|
1228
|
+
case 'return': next(); return parseReturnStatement();
|
1229
|
+
case 'function': next();
|
1230
|
+
var name = parseFunctionName();
|
1231
|
+
return parseFunctionDeclaration(name);
|
1232
|
+
case 'while': next(); return parseWhileStatement();
|
1233
|
+
case 'for': next(); return parseForStatement();
|
1234
|
+
case 'repeat': next(); return parseRepeatStatement();
|
1235
|
+
case 'break': next(); return parseBreakStatement();
|
1236
|
+
case 'do': next(); return parseDoStatement();
|
1237
|
+
case 'goto': next(); return parseGotoStatement();
|
1238
|
+
}
|
1239
|
+
}
|
1240
|
+
|
1241
|
+
if (Punctuator === token.type) {
|
1242
|
+
if (consume('::')) return parseLabelStatement();
|
1243
|
+
}
|
1244
|
+
// Assignments memorizes the location and pushes it manually for wrapper
|
1245
|
+
// nodes. Additionally empty `;` statements should not mark a location.
|
1246
|
+
if (trackLocations) locations.pop();
|
1247
|
+
|
1248
|
+
// When a `;` is encounted, simply eat it without storing it.
|
1249
|
+
if (consume(';')) return;
|
1250
|
+
|
1251
|
+
return parseAssignmentOrCallStatement();
|
1252
|
+
}
|
1253
|
+
|
1254
|
+
// ## Statements
|
1255
|
+
|
1256
|
+
// label ::= '::' Name '::'
|
1257
|
+
|
1258
|
+
function parseLabelStatement() {
|
1259
|
+
var name = token.value
|
1260
|
+
, label = parseIdentifier();
|
1261
|
+
|
1262
|
+
if (options.scope) {
|
1263
|
+
scopeIdentifierName('::' + name + '::');
|
1264
|
+
attachScope(label, true);
|
1265
|
+
}
|
1266
|
+
|
1267
|
+
expect('::');
|
1268
|
+
return finishNode(ast.labelStatement(label));
|
1269
|
+
}
|
1270
|
+
|
1271
|
+
// break ::= 'break'
|
1272
|
+
|
1273
|
+
function parseBreakStatement() {
|
1274
|
+
return finishNode(ast.breakStatement());
|
1275
|
+
}
|
1276
|
+
|
1277
|
+
// goto ::= 'goto' Name
|
1278
|
+
|
1279
|
+
function parseGotoStatement() {
|
1280
|
+
var name = token.value
|
1281
|
+
, label = parseIdentifier();
|
1282
|
+
|
1283
|
+
if (options.scope) label.isLabel = scopeHasName('::' + name + '::');
|
1284
|
+
return finishNode(ast.gotoStatement(label));
|
1285
|
+
}
|
1286
|
+
|
1287
|
+
// do ::= 'do' block 'end'
|
1288
|
+
|
1289
|
+
function parseDoStatement() {
|
1290
|
+
var body = parseBlock();
|
1291
|
+
expect('end');
|
1292
|
+
return finishNode(ast.doStatement(body));
|
1293
|
+
}
|
1294
|
+
|
1295
|
+
// while ::= 'while' exp 'do' block 'end'
|
1296
|
+
|
1297
|
+
function parseWhileStatement() {
|
1298
|
+
var condition = parseExpectedExpression();
|
1299
|
+
expect('do');
|
1300
|
+
var body = parseBlock();
|
1301
|
+
expect('end');
|
1302
|
+
return finishNode(ast.whileStatement(condition, body));
|
1303
|
+
}
|
1304
|
+
|
1305
|
+
// repeat ::= 'repeat' block 'until' exp
|
1306
|
+
|
1307
|
+
function parseRepeatStatement() {
|
1308
|
+
var body = parseBlock();
|
1309
|
+
expect('until');
|
1310
|
+
var condition = parseExpectedExpression();
|
1311
|
+
return finishNode(ast.repeatStatement(condition, body));
|
1312
|
+
}
|
1313
|
+
|
1314
|
+
// retstat ::= 'return' [exp {',' exp}] [';']
|
1315
|
+
|
1316
|
+
function parseReturnStatement() {
|
1317
|
+
var expressions = [];
|
1318
|
+
|
1319
|
+
if ('end' !== token.value) {
|
1320
|
+
var expression = parseExpression();
|
1321
|
+
if (null != expression) expressions.push(expression);
|
1322
|
+
while (consume(',')) {
|
1323
|
+
expression = parseExpectedExpression();
|
1324
|
+
expressions.push(expression);
|
1325
|
+
}
|
1326
|
+
consume(';'); // grammar tells us ; is optional here.
|
1327
|
+
}
|
1328
|
+
return finishNode(ast.returnStatement(expressions));
|
1329
|
+
}
|
1330
|
+
|
1331
|
+
// if ::= 'if' exp 'then' block {elif} ['else' block] 'end'
|
1332
|
+
// elif ::= 'elseif' exp 'then' block
|
1333
|
+
|
1334
|
+
function parseIfStatement() {
|
1335
|
+
var clauses = []
|
1336
|
+
, condition
|
1337
|
+
, body
|
1338
|
+
, marker;
|
1339
|
+
|
1340
|
+
// IfClauses begin at the same location as the parent IfStatement.
|
1341
|
+
// It ends at the start of `end`, `else`, or `elseif`.
|
1342
|
+
if (trackLocations) {
|
1343
|
+
marker = locations[locations.length - 1];
|
1344
|
+
locations.push(marker);
|
1345
|
+
}
|
1346
|
+
condition = parseExpectedExpression();
|
1347
|
+
expect('then');
|
1348
|
+
body = parseBlock();
|
1349
|
+
clauses.push(finishNode(ast.ifClause(condition, body)));
|
1350
|
+
|
1351
|
+
if (trackLocations) marker = createLocationMarker();
|
1352
|
+
while (consume('elseif')) {
|
1353
|
+
pushLocation(marker);
|
1354
|
+
condition = parseExpectedExpression();
|
1355
|
+
expect('then');
|
1356
|
+
body = parseBlock();
|
1357
|
+
clauses.push(finishNode(ast.elseifClause(condition, body)));
|
1358
|
+
if (trackLocations) marker = createLocationMarker();
|
1359
|
+
}
|
1360
|
+
|
1361
|
+
if (consume('else')) {
|
1362
|
+
// Include the `else` in the location of ElseClause.
|
1363
|
+
if (trackLocations) {
|
1364
|
+
marker = new Marker(previousToken);
|
1365
|
+
locations.push(marker);
|
1366
|
+
}
|
1367
|
+
body = parseBlock();
|
1368
|
+
clauses.push(finishNode(ast.elseClause(body)));
|
1369
|
+
}
|
1370
|
+
|
1371
|
+
expect('end');
|
1372
|
+
return finishNode(ast.ifStatement(clauses));
|
1373
|
+
}
|
1374
|
+
|
1375
|
+
// There are two types of for statements, generic and numeric.
|
1376
|
+
//
|
1377
|
+
// for ::= Name '=' exp ',' exp [',' exp] 'do' block 'end'
|
1378
|
+
// for ::= namelist 'in' explist 'do' block 'end'
|
1379
|
+
// namelist ::= Name {',' Name}
|
1380
|
+
// explist ::= exp {',' exp}
|
1381
|
+
|
1382
|
+
function parseForStatement() {
|
1383
|
+
var variable = parseIdentifier()
|
1384
|
+
, body;
|
1385
|
+
|
1386
|
+
// The start-identifier is local.
|
1387
|
+
if (options.scope) scopeIdentifier(variable);
|
1388
|
+
|
1389
|
+
// If the first expression is followed by a `=` punctuator, this is a
|
1390
|
+
// Numeric For Statement.
|
1391
|
+
if (consume('=')) {
|
1392
|
+
// Start expression
|
1393
|
+
var start = parseExpectedExpression();
|
1394
|
+
expect(',');
|
1395
|
+
// End expression
|
1396
|
+
var end = parseExpectedExpression();
|
1397
|
+
// Optional step expression
|
1398
|
+
var step = consume(',') ? parseExpectedExpression() : null;
|
1399
|
+
|
1400
|
+
expect('do');
|
1401
|
+
body = parseBlock();
|
1402
|
+
expect('end');
|
1403
|
+
|
1404
|
+
return finishNode(ast.forNumericStatement(variable, start, end, step, body));
|
1405
|
+
}
|
1406
|
+
// If not, it's a Generic For Statement
|
1407
|
+
else {
|
1408
|
+
// The namelist can contain one or more identifiers.
|
1409
|
+
var variables = [variable];
|
1410
|
+
while (consume(',')) {
|
1411
|
+
variable = parseIdentifier();
|
1412
|
+
// Each variable in the namelist is locally scoped.
|
1413
|
+
if (options.scope) scopeIdentifier(variable);
|
1414
|
+
variables.push(variable);
|
1415
|
+
}
|
1416
|
+
expect('in');
|
1417
|
+
var iterators = [];
|
1418
|
+
|
1419
|
+
// One or more expressions in the explist.
|
1420
|
+
do {
|
1421
|
+
var expression = parseExpectedExpression();
|
1422
|
+
iterators.push(expression);
|
1423
|
+
} while (consume(','));
|
1424
|
+
|
1425
|
+
expect('do');
|
1426
|
+
body = parseBlock();
|
1427
|
+
expect('end');
|
1428
|
+
|
1429
|
+
return finishNode(ast.forGenericStatement(variables, iterators, body));
|
1430
|
+
}
|
1431
|
+
}
|
1432
|
+
|
1433
|
+
// Local statements can either be variable assignments or function
|
1434
|
+
// definitions. If a function definition is found, it will be delegated to
|
1435
|
+
// `parseFunctionDeclaration()` with the isLocal flag.
|
1436
|
+
//
|
1437
|
+
// This AST structure might change into a local assignment with a function
|
1438
|
+
// child.
|
1439
|
+
//
|
1440
|
+
// local ::= 'local' 'function' Name funcdecl
|
1441
|
+
// | 'local' Name {',' Name} ['=' exp {',' exp}
|
1442
|
+
|
1443
|
+
function parseLocalStatement() {
|
1444
|
+
var name;
|
1445
|
+
|
1446
|
+
if (Identifier === token.type) {
|
1447
|
+
var variables = []
|
1448
|
+
, init = [];
|
1449
|
+
|
1450
|
+
do {
|
1451
|
+
name = parseIdentifier();
|
1452
|
+
|
1453
|
+
variables.push(name);
|
1454
|
+
} while (consume(','));
|
1455
|
+
|
1456
|
+
if (consume('=')) {
|
1457
|
+
do {
|
1458
|
+
var expression = parseExpectedExpression();
|
1459
|
+
init.push(expression);
|
1460
|
+
} while (consume(','));
|
1461
|
+
}
|
1462
|
+
|
1463
|
+
// Declarations doesn't exist before the statement has been evaluated.
|
1464
|
+
// Therefore assignments can't use their declarator. And the identifiers
|
1465
|
+
// shouldn't be added to the scope until the statement is complete.
|
1466
|
+
if (options.scope) {
|
1467
|
+
for (var i = 0, l = variables.length; i < l; i++) {
|
1468
|
+
scopeIdentifier(variables[i]);
|
1469
|
+
}
|
1470
|
+
}
|
1471
|
+
|
1472
|
+
return finishNode(ast.localStatement(variables, init));
|
1473
|
+
}
|
1474
|
+
if (consume('function')) {
|
1475
|
+
name = parseIdentifier();
|
1476
|
+
if (options.scope) scopeIdentifier(name);
|
1477
|
+
|
1478
|
+
// MemberExpressions are not allowed in local function statements.
|
1479
|
+
return parseFunctionDeclaration(name, true);
|
1480
|
+
} else {
|
1481
|
+
raiseUnexpectedToken('<name>', token);
|
1482
|
+
}
|
1483
|
+
}
|
1484
|
+
|
1485
|
+
// assignment ::= varlist '=' explist
|
1486
|
+
// varlist ::= prefixexp {',' prefixexp}
|
1487
|
+
// explist ::= exp {',' exp}
|
1488
|
+
//
|
1489
|
+
// call ::= callexp
|
1490
|
+
// callexp ::= prefixexp args | prefixexp ':' Name args
|
1491
|
+
|
1492
|
+
function parseAssignmentOrCallStatement() {
|
1493
|
+
// Keep a reference to the previous token for better error messages in case
|
1494
|
+
// of invalid statement
|
1495
|
+
var previous = token
|
1496
|
+
, expression, marker;
|
1497
|
+
|
1498
|
+
if (trackLocations) marker = createLocationMarker();
|
1499
|
+
expression = parsePrefixExpression();
|
1500
|
+
|
1501
|
+
if (null == expression) return unexpected(token);
|
1502
|
+
if (',='.indexOf(token.value) >= 0) {
|
1503
|
+
var variables = [expression]
|
1504
|
+
, init = []
|
1505
|
+
, exp;
|
1506
|
+
|
1507
|
+
while (consume(',')) {
|
1508
|
+
exp = parsePrefixExpression();
|
1509
|
+
if (null == exp) raiseUnexpectedToken('<expression>', token);
|
1510
|
+
variables.push(exp);
|
1511
|
+
}
|
1512
|
+
expect('=');
|
1513
|
+
do {
|
1514
|
+
exp = parseExpectedExpression();
|
1515
|
+
init.push(exp);
|
1516
|
+
} while (consume(','));
|
1517
|
+
|
1518
|
+
pushLocation(marker);
|
1519
|
+
return finishNode(ast.assignmentStatement(variables, init));
|
1520
|
+
}
|
1521
|
+
if (isCallExpression(expression)) {
|
1522
|
+
pushLocation(marker);
|
1523
|
+
return finishNode(ast.callStatement(expression));
|
1524
|
+
}
|
1525
|
+
// The prefix expression was neither part of an assignment or a
|
1526
|
+
// callstatement, however as it was valid it's been consumed, so raise
|
1527
|
+
// the exception on the previous token to provide a helpful message.
|
1528
|
+
return unexpected(previous);
|
1529
|
+
}
|
1530
|
+
|
1531
|
+
|
1532
|
+
|
1533
|
+
// ### Non-statements
|
1534
|
+
|
1535
|
+
// Identifier ::= Name
|
1536
|
+
|
1537
|
+
function parseIdentifier() {
|
1538
|
+
markLocation();
|
1539
|
+
var identifier = token.value;
|
1540
|
+
if (Identifier !== token.type) raiseUnexpectedToken('<name>', token);
|
1541
|
+
next();
|
1542
|
+
return finishNode(ast.identifier(identifier));
|
1543
|
+
}
|
1544
|
+
|
1545
|
+
// Parse the functions parameters and body block. The name should already
|
1546
|
+
// have been parsed and passed to this declaration function. By separating
|
1547
|
+
// this we allow for anonymous functions in expressions.
|
1548
|
+
//
|
1549
|
+
// For local functions there's a boolean parameter which needs to be set
|
1550
|
+
// when parsing the declaration.
|
1551
|
+
//
|
1552
|
+
// funcdecl ::= '(' [parlist] ')' block 'end'
|
1553
|
+
// parlist ::= Name {',' Name} | [',' '...'] | '...'
|
1554
|
+
|
1555
|
+
function parseFunctionDeclaration(name, isLocal) {
|
1556
|
+
var parameters = [];
|
1557
|
+
expect('(');
|
1558
|
+
|
1559
|
+
// The declaration has arguments
|
1560
|
+
if (!consume(')')) {
|
1561
|
+
// Arguments are a comma separated list of identifiers, optionally ending
|
1562
|
+
// with a vararg.
|
1563
|
+
while (true) {
|
1564
|
+
if (Identifier === token.type) {
|
1565
|
+
var parameter = parseIdentifier();
|
1566
|
+
// Function parameters are local.
|
1567
|
+
if (options.scope) scopeIdentifier(parameter);
|
1568
|
+
|
1569
|
+
parameters.push(parameter);
|
1570
|
+
|
1571
|
+
if (consume(',')) continue;
|
1572
|
+
else if (consume(')')) break;
|
1573
|
+
}
|
1574
|
+
// No arguments are allowed after a vararg.
|
1575
|
+
else if (VarargLiteral === token.type) {
|
1576
|
+
parameters.push(parsePrimaryExpression());
|
1577
|
+
expect(')');
|
1578
|
+
break;
|
1579
|
+
} else {
|
1580
|
+
raiseUnexpectedToken('<name> or \'...\'', token);
|
1581
|
+
}
|
1582
|
+
}
|
1583
|
+
}
|
1584
|
+
|
1585
|
+
var body = parseBlock();
|
1586
|
+
expect('end');
|
1587
|
+
|
1588
|
+
isLocal = isLocal || false;
|
1589
|
+
return finishNode(ast.functionStatement(name, parameters, isLocal, body));
|
1590
|
+
}
|
1591
|
+
|
1592
|
+
// Parse the function name as identifiers and member expressions.
|
1593
|
+
//
|
1594
|
+
// Name {'.' Name} [':' Name]
|
1595
|
+
|
1596
|
+
function parseFunctionName() {
|
1597
|
+
var base, name, marker;
|
1598
|
+
|
1599
|
+
if (trackLocations) marker = createLocationMarker();
|
1600
|
+
base = parseIdentifier();
|
1601
|
+
|
1602
|
+
if (options.scope) attachScope(base, false);
|
1603
|
+
|
1604
|
+
while (consume('.')) {
|
1605
|
+
pushLocation(marker);
|
1606
|
+
name = parseIdentifier();
|
1607
|
+
if (options.scope) attachScope(name, false);
|
1608
|
+
base = finishNode(ast.memberExpression(base, '.', name));
|
1609
|
+
}
|
1610
|
+
|
1611
|
+
if (consume(':')) {
|
1612
|
+
pushLocation(marker);
|
1613
|
+
name = parseIdentifier();
|
1614
|
+
if (options.scope) attachScope(name, false);
|
1615
|
+
base = finishNode(ast.memberExpression(base, ':', name));
|
1616
|
+
}
|
1617
|
+
|
1618
|
+
return base;
|
1619
|
+
}
|
1620
|
+
|
1621
|
+
// tableconstructor ::= '{' [fieldlist] '}'
|
1622
|
+
// fieldlist ::= field {fieldsep field} fieldsep
|
1623
|
+
// field ::= '[' exp ']' '=' exp | Name = 'exp' | exp
|
1624
|
+
//
|
1625
|
+
// fieldsep ::= ',' | ';'
|
1626
|
+
|
1627
|
+
function parseTableConstructor() {
|
1628
|
+
var fields = []
|
1629
|
+
, key, value;
|
1630
|
+
|
1631
|
+
while (true) {
|
1632
|
+
markLocation();
|
1633
|
+
if (Punctuator === token.type && consume('[')) {
|
1634
|
+
key = parseExpectedExpression();
|
1635
|
+
expect(']');
|
1636
|
+
expect('=');
|
1637
|
+
value = parseExpectedExpression();
|
1638
|
+
fields.push(finishNode(ast.tableKey(key, value)));
|
1639
|
+
} else if (Identifier === token.type) {
|
1640
|
+
key = parseExpectedExpression();
|
1641
|
+
if (consume('=')) {
|
1642
|
+
value = parseExpectedExpression();
|
1643
|
+
fields.push(finishNode(ast.tableKeyString(key, value)));
|
1644
|
+
} else {
|
1645
|
+
fields.push(finishNode(ast.tableValue(key)));
|
1646
|
+
}
|
1647
|
+
} else {
|
1648
|
+
if (null == (value = parseExpression())) {
|
1649
|
+
locations.pop();
|
1650
|
+
break;
|
1651
|
+
}
|
1652
|
+
fields.push(finishNode(ast.tableValue(value)));
|
1653
|
+
}
|
1654
|
+
if (',;'.indexOf(token.value) >= 0) {
|
1655
|
+
next();
|
1656
|
+
continue;
|
1657
|
+
}
|
1658
|
+
if ('}' === token.value) break;
|
1659
|
+
}
|
1660
|
+
expect('}');
|
1661
|
+
return finishNode(ast.tableConstructorExpression(fields));
|
1662
|
+
}
|
1663
|
+
|
1664
|
+
// Expression parser
|
1665
|
+
// -----------------
|
1666
|
+
//
|
1667
|
+
// Expressions are evaluated and always return a value. If nothing is
|
1668
|
+
// matched null will be returned.
|
1669
|
+
//
|
1670
|
+
// exp ::= (unop exp | primary | prefixexp ) { binop exp }
|
1671
|
+
//
|
1672
|
+
// primary ::= nil | false | true | Number | String | '...'
|
1673
|
+
// | functiondef | tableconstructor
|
1674
|
+
//
|
1675
|
+
// prefixexp ::= (Name | '(' exp ')' ) { '[' exp ']'
|
1676
|
+
// | '.' Name | ':' Name args | args }
|
1677
|
+
//
|
1678
|
+
|
1679
|
+
function parseExpression() {
|
1680
|
+
var expression = parseSubExpression(0);
|
1681
|
+
return expression;
|
1682
|
+
}
|
1683
|
+
|
1684
|
+
// Parse an expression expecting it to be valid.
|
1685
|
+
|
1686
|
+
function parseExpectedExpression() {
|
1687
|
+
var expression = parseExpression();
|
1688
|
+
if (null == expression) raiseUnexpectedToken('<expression>', token);
|
1689
|
+
else return expression;
|
1690
|
+
}
|
1691
|
+
|
1692
|
+
|
1693
|
+
// Return the precedence priority of the operator.
|
1694
|
+
//
|
1695
|
+
// As unary `-` can't be distinguished from binary `-`, unary precedence
|
1696
|
+
// isn't described in this table but in `parseSubExpression()` itself.
|
1697
|
+
//
|
1698
|
+
// As this function gets hit on every expression it's been optimized due to
|
1699
|
+
// the expensive CompareICStub which took ~8% of the parse time.
|
1700
|
+
|
1701
|
+
function binaryPrecedence(operator) {
|
1702
|
+
var charCode = operator.charCodeAt(0)
|
1703
|
+
, length = operator.length;
|
1704
|
+
|
1705
|
+
if (1 === length) {
|
1706
|
+
switch (charCode) {
|
1707
|
+
case 94: return 10; // ^
|
1708
|
+
case 42: case 47: case 37: return 7; // * / %
|
1709
|
+
case 43: case 45: return 6; // + -
|
1710
|
+
case 60: case 62: return 3; // < >
|
1711
|
+
}
|
1712
|
+
} else if (2 === length) {
|
1713
|
+
switch (charCode) {
|
1714
|
+
case 46: return 5; // ..
|
1715
|
+
case 60: case 62: case 61: case 126: return 3; // <= >= == ~=
|
1716
|
+
case 111: return 1; // or
|
1717
|
+
}
|
1718
|
+
} else if (97 === charCode && 'and' === operator) return 2;
|
1719
|
+
return 0;
|
1720
|
+
}
|
1721
|
+
|
1722
|
+
// Implement an operator-precedence parser to handle binary operator
|
1723
|
+
// precedence.
|
1724
|
+
//
|
1725
|
+
// We use this algorithm because it's compact, it's fast and Lua core uses
|
1726
|
+
// the same so we can be sure our expressions are parsed in the same manner
|
1727
|
+
// without excessive amounts of tests.
|
1728
|
+
//
|
1729
|
+
// exp ::= (unop exp | primary | prefixexp ) { binop exp }
|
1730
|
+
|
1731
|
+
function parseSubExpression(minPrecedence) {
|
1732
|
+
var operator = token.value
|
1733
|
+
// The left-hand side in binary operations.
|
1734
|
+
, expression, marker;
|
1735
|
+
|
1736
|
+
if (trackLocations) marker = createLocationMarker();
|
1737
|
+
|
1738
|
+
// UnaryExpression
|
1739
|
+
if (isUnary(token)) {
|
1740
|
+
markLocation();
|
1741
|
+
next();
|
1742
|
+
var argument = parseSubExpression(8);
|
1743
|
+
if (argument == null) raiseUnexpectedToken('<expression>', token);
|
1744
|
+
expression = finishNode(ast.unaryExpression(operator, argument));
|
1745
|
+
}
|
1746
|
+
if (null == expression) {
|
1747
|
+
// PrimaryExpression
|
1748
|
+
expression = parsePrimaryExpression();
|
1749
|
+
|
1750
|
+
// PrefixExpression
|
1751
|
+
if (null == expression) {
|
1752
|
+
expression = parsePrefixExpression();
|
1753
|
+
}
|
1754
|
+
}
|
1755
|
+
// This is not a valid left hand expression.
|
1756
|
+
if (null == expression) return null;
|
1757
|
+
|
1758
|
+
var precedence;
|
1759
|
+
while (true) {
|
1760
|
+
operator = token.value;
|
1761
|
+
|
1762
|
+
precedence = (Punctuator === token.type || Keyword === token.type) ?
|
1763
|
+
binaryPrecedence(operator) : 0;
|
1764
|
+
|
1765
|
+
if (precedence === 0 || precedence <= minPrecedence) break;
|
1766
|
+
// Right-hand precedence operators
|
1767
|
+
if ('^' === operator || '..' === operator) precedence--;
|
1768
|
+
next();
|
1769
|
+
var right = parseSubExpression(precedence);
|
1770
|
+
if (null == right) raiseUnexpectedToken('<expression>', token);
|
1771
|
+
// Push in the marker created before the loop to wrap its entirety.
|
1772
|
+
if (trackLocations) locations.push(marker);
|
1773
|
+
expression = finishNode(ast.binaryExpression(operator, expression, right));
|
1774
|
+
|
1775
|
+
}
|
1776
|
+
return expression;
|
1777
|
+
}
|
1778
|
+
|
1779
|
+
// prefixexp ::= prefix {suffix}
|
1780
|
+
// prefix ::= Name | '(' exp ')'
|
1781
|
+
// suffix ::= '[' exp ']' | '.' Name | ':' Name args | args
|
1782
|
+
//
|
1783
|
+
// args ::= '(' [explist] ')' | tableconstructor | String
|
1784
|
+
|
1785
|
+
function parsePrefixExpression() {
|
1786
|
+
var base, name, marker
|
1787
|
+
// Keep track of the scope, if a parent is local so are the children.
|
1788
|
+
, isLocal;
|
1789
|
+
|
1790
|
+
if (trackLocations) marker = createLocationMarker();
|
1791
|
+
|
1792
|
+
// The prefix
|
1793
|
+
if (Identifier === token.type) {
|
1794
|
+
name = token.value;
|
1795
|
+
base = parseIdentifier();
|
1796
|
+
// Set the parent scope.
|
1797
|
+
if (options.scope) attachScope(base, isLocal = scopeHasName(name));
|
1798
|
+
} else if (consume('(')) {
|
1799
|
+
base = parseExpectedExpression();
|
1800
|
+
expect(')');
|
1801
|
+
if (options.scope) isLocal = base.isLocal;
|
1802
|
+
} else {
|
1803
|
+
return null;
|
1804
|
+
}
|
1805
|
+
|
1806
|
+
// The suffix
|
1807
|
+
var expression, identifier;
|
1808
|
+
while (true) {
|
1809
|
+
if (Punctuator === token.type) {
|
1810
|
+
switch (token.value) {
|
1811
|
+
case '[':
|
1812
|
+
pushLocation(marker);
|
1813
|
+
next();
|
1814
|
+
expression = parseExpectedExpression();
|
1815
|
+
base = finishNode(ast.indexExpression(base, expression));
|
1816
|
+
expect(']');
|
1817
|
+
break;
|
1818
|
+
case '.':
|
1819
|
+
pushLocation(marker);
|
1820
|
+
next();
|
1821
|
+
identifier = parseIdentifier();
|
1822
|
+
// Inherit the scope
|
1823
|
+
if (options.scope) attachScope(identifier, isLocal);
|
1824
|
+
base = finishNode(ast.memberExpression(base, '.', identifier));
|
1825
|
+
break;
|
1826
|
+
case ':':
|
1827
|
+
pushLocation(marker);
|
1828
|
+
next();
|
1829
|
+
identifier = parseIdentifier();
|
1830
|
+
if (options.scope) attachScope(identifier, isLocal);
|
1831
|
+
base = finishNode(ast.memberExpression(base, ':', identifier));
|
1832
|
+
// Once a : is found, this has to be a CallExpression, otherwise
|
1833
|
+
// throw an error.
|
1834
|
+
pushLocation(marker);
|
1835
|
+
base = parseCallExpression(base);
|
1836
|
+
break;
|
1837
|
+
case '(': case '{': // args
|
1838
|
+
pushLocation(marker);
|
1839
|
+
base = parseCallExpression(base);
|
1840
|
+
break;
|
1841
|
+
default:
|
1842
|
+
return base;
|
1843
|
+
}
|
1844
|
+
} else if (StringLiteral === token.type) {
|
1845
|
+
pushLocation(marker);
|
1846
|
+
base = parseCallExpression(base);
|
1847
|
+
} else {
|
1848
|
+
break;
|
1849
|
+
}
|
1850
|
+
}
|
1851
|
+
|
1852
|
+
return base;
|
1853
|
+
}
|
1854
|
+
|
1855
|
+
// args ::= '(' [explist] ')' | tableconstructor | String
|
1856
|
+
|
1857
|
+
function parseCallExpression(base) {
|
1858
|
+
if (Punctuator === token.type) {
|
1859
|
+
switch (token.value) {
|
1860
|
+
case '(':
|
1861
|
+
next();
|
1862
|
+
|
1863
|
+
// List of expressions
|
1864
|
+
var expressions = [];
|
1865
|
+
var expression = parseExpression();
|
1866
|
+
if (null != expression) expressions.push(expression);
|
1867
|
+
while (consume(',')) {
|
1868
|
+
expression = parseExpectedExpression();
|
1869
|
+
expressions.push(expression);
|
1870
|
+
}
|
1871
|
+
|
1872
|
+
expect(')');
|
1873
|
+
return finishNode(ast.callExpression(base, expressions));
|
1874
|
+
|
1875
|
+
case '{':
|
1876
|
+
markLocation();
|
1877
|
+
next();
|
1878
|
+
var table = parseTableConstructor();
|
1879
|
+
return finishNode(ast.tableCallExpression(base, table));
|
1880
|
+
}
|
1881
|
+
} else if (StringLiteral === token.type) {
|
1882
|
+
return finishNode(ast.stringCallExpression(base, parsePrimaryExpression()));
|
1883
|
+
}
|
1884
|
+
|
1885
|
+
raiseUnexpectedToken('function arguments', token);
|
1886
|
+
}
|
1887
|
+
|
1888
|
+
// primary ::= String | Numeric | nil | true | false
|
1889
|
+
// | functiondef | tableconstructor | '...'
|
1890
|
+
|
1891
|
+
function parsePrimaryExpression() {
|
1892
|
+
var literals = StringLiteral | NumericLiteral | BooleanLiteral | NilLiteral | VarargLiteral
|
1893
|
+
, value = token.value
|
1894
|
+
, type = token.type
|
1895
|
+
, marker;
|
1896
|
+
|
1897
|
+
if (trackLocations) marker = createLocationMarker();
|
1898
|
+
|
1899
|
+
if (type & literals) {
|
1900
|
+
pushLocation(marker);
|
1901
|
+
var raw = input.slice(token.range[0], token.range[1]);
|
1902
|
+
next();
|
1903
|
+
return finishNode(ast.literal(type, value, raw));
|
1904
|
+
} else if (Keyword === type && 'function' === value) {
|
1905
|
+
pushLocation(marker);
|
1906
|
+
next();
|
1907
|
+
return parseFunctionDeclaration(null);
|
1908
|
+
} else if (consume('{')) {
|
1909
|
+
pushLocation(marker);
|
1910
|
+
return parseTableConstructor();
|
1911
|
+
}
|
1912
|
+
}
|
1913
|
+
|
1914
|
+
// Parser
|
1915
|
+
// ------
|
1916
|
+
|
1917
|
+
// Export the main parser.
|
1918
|
+
//
|
1919
|
+
// - `wait` Hold parsing until end() is called. Defaults to false
|
1920
|
+
// - `comments` Store comments. Defaults to true.
|
1921
|
+
// - `scope` Track identifier scope. Defaults to false.
|
1922
|
+
//
|
1923
|
+
// Example:
|
1924
|
+
//
|
1925
|
+
// var parser = require('luaparser');
|
1926
|
+
// parser.parse('i = 0');
|
1927
|
+
|
1928
|
+
exports.parse = parse;
|
1929
|
+
|
1930
|
+
function parse(_input, _options) {
|
1931
|
+
if ('undefined' === typeof _options && 'object' === typeof _input) {
|
1932
|
+
_options = _input;
|
1933
|
+
_input = undefined;
|
1934
|
+
}
|
1935
|
+
if (!_options) _options = {};
|
1936
|
+
|
1937
|
+
input = _input || '';
|
1938
|
+
options = extend(defaultOptions, _options);
|
1939
|
+
|
1940
|
+
// Rewind the lexer
|
1941
|
+
index = 0;
|
1942
|
+
line = 1;
|
1943
|
+
lineStart = 0;
|
1944
|
+
length = input.length;
|
1945
|
+
// When tracking identifier scope, initialize with an empty scope.
|
1946
|
+
scopes = [[]];
|
1947
|
+
scopeDepth = 0;
|
1948
|
+
globals = [];
|
1949
|
+
locations = [];
|
1950
|
+
|
1951
|
+
if (options.comments) comments = [];
|
1952
|
+
if (!options.wait) return end();
|
1953
|
+
return exports;
|
1954
|
+
}
|
1955
|
+
|
1956
|
+
// Write to the source code buffer without beginning the parse.
|
1957
|
+
exports.write = write;
|
1958
|
+
|
1959
|
+
function write(_input) {
|
1960
|
+
input += String(_input);
|
1961
|
+
length = input.length;
|
1962
|
+
return exports;
|
1963
|
+
}
|
1964
|
+
|
1965
|
+
// Send an EOF and begin parsing.
|
1966
|
+
exports.end = end;
|
1967
|
+
|
1968
|
+
function end(_input) {
|
1969
|
+
if ('undefined' !== typeof _input) write(_input);
|
1970
|
+
|
1971
|
+
length = input.length;
|
1972
|
+
trackLocations = options.locations || options.ranges;
|
1973
|
+
// Initialize with a lookahead token.
|
1974
|
+
lookahead = lex();
|
1975
|
+
|
1976
|
+
var chunk = parseChunk();
|
1977
|
+
if (options.comments) chunk.comments = comments;
|
1978
|
+
if (options.scope) chunk.globals = globals;
|
1979
|
+
|
1980
|
+
if (locations.length > 0)
|
1981
|
+
throw new Error('Location tracking failed. This is most likely a bug in luaparse');
|
1982
|
+
|
1983
|
+
return chunk;
|
1984
|
+
}
|
1985
|
+
|
1986
|
+
}));
|
1987
|
+
/* vim: set sw=2 ts=2 et tw=79 : */
|
1988
|
+
|
1989
|
+
});
|