marty 0.5.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +84 -0
- data/Rakefile +29 -0
- data/app/assets/javascripts/marty/application.js +15 -0
- data/app/assets/stylesheets/marty/application.css +13 -0
- data/app/components/marty/api_auth_view.rb +32 -0
- data/app/components/marty/auth_app.rb +55 -0
- data/app/components/marty/auth_app.rb~ +51 -0
- data/app/components/marty/auth_app/javascripts/auth_app.js +91 -0
- data/app/components/marty/auth_app/javascripts/auth_app.js~ +91 -0
- data/app/components/marty/cm_form_panel.rb~ +5 -0
- data/app/components/marty/cm_grid_panel.rb~ +35 -0
- data/app/components/marty/data_import_view.rb~ +142 -0
- data/app/components/marty/extras/layout.rb +46 -0
- data/app/components/marty/extras/layout.rb~ +46 -0
- data/app/components/marty/extras/misc.rb +18 -0
- data/app/components/marty/form.rb +6 -0
- data/app/components/marty/grid.rb +45 -0
- data/app/components/marty/grid_append_only.rb +12 -0
- data/app/components/marty/import_type_view.rb +53 -0
- data/app/components/marty/live_search_grid_panel.rb +46 -0
- data/app/components/marty/live_search_grid_panel.rb~ +49 -0
- data/app/components/marty/main_auth_app.rb +269 -0
- data/app/components/marty/main_auth_app.rb~ +238 -0
- data/app/components/marty/mcfly_grid_panel.rb +62 -0
- data/app/components/marty/mcfly_grid_panel.rb~ +80 -0
- data/app/components/marty/new_posting_form.rb +46 -0
- data/app/components/marty/new_posting_form.rb~ +46 -0
- data/app/components/marty/new_posting_window.rb +21 -0
- data/app/components/marty/new_posting_window.rb~ +21 -0
- data/app/components/marty/panel.rb +12 -0
- data/app/components/marty/pivot_grid.rb +52 -0
- data/app/components/marty/pivot_grid/endpoints.rb +45 -0
- data/app/components/marty/pivot_grid/javascripts/extensions.js +150 -0
- data/app/components/marty/pivot_grid/javascripts/pivot_grid.js +86 -0
- data/app/components/marty/pivot_grid/services.rb +44 -0
- data/app/components/marty/posting_grid.rb +139 -0
- data/app/components/marty/posting_grid.rb~ +140 -0
- data/app/components/marty/posting_window.rb +27 -0
- data/app/components/marty/promise_view.rb +177 -0
- data/app/components/marty/promise_view.rb~ +157 -0
- data/app/components/marty/promise_view/stylesheets/promise_view.css +26 -0
- data/app/components/marty/promise_view/stylesheets/promise_view.css~ +15 -0
- data/app/components/marty/report_form.rb +225 -0
- data/app/components/marty/report_form.rb~ +217 -0
- data/app/components/marty/report_select.rb +145 -0
- data/app/components/marty/report_select.rb~ +133 -0
- data/app/components/marty/reporting.rb +39 -0
- data/app/components/marty/reporting.rb~ +39 -0
- data/app/components/marty/script_detail.rb~ +430 -0
- data/app/components/marty/script_form.rb +233 -0
- data/app/components/marty/script_form.rb~ +233 -0
- data/app/components/marty/script_form/javascripts/Ext.ux.form.field.CodeMirror.js +698 -0
- data/app/components/marty/script_form/javascripts/Ext.ux.form.field.CodeMirror.js~ +909 -0
- data/app/components/marty/script_form/javascripts/codemirror.js +3130 -0
- data/app/components/marty/script_form/javascripts/mode/clike/clike.js +284 -0
- data/app/components/marty/script_form/javascripts/mode/clike/index.html +102 -0
- data/app/components/marty/script_form/javascripts/mode/clike/scala.html +766 -0
- data/app/components/marty/script_form/javascripts/mode/clojure/clojure.js +206 -0
- data/app/components/marty/script_form/javascripts/mode/clojure/index.html +67 -0
- data/app/components/marty/script_form/javascripts/mode/coffeescript/LICENSE +22 -0
- data/app/components/marty/script_form/javascripts/mode/coffeescript/coffeescript.js +346 -0
- data/app/components/marty/script_form/javascripts/mode/coffeescript/index.html +728 -0
- data/app/components/marty/script_form/javascripts/mode/commonlisp/commonlisp.js +101 -0
- data/app/components/marty/script_form/javascripts/mode/commonlisp/index.html +165 -0
- data/app/components/marty/script_form/javascripts/mode/css/css.js +448 -0
- data/app/components/marty/script_form/javascripts/mode/css/index.html +58 -0
- data/app/components/marty/script_form/javascripts/mode/css/test.js +501 -0
- data/app/components/marty/script_form/javascripts/mode/delorean/delorean.js +189 -0
- data/app/components/marty/script_form/javascripts/mode/diff/diff.js +32 -0
- data/app/components/marty/script_form/javascripts/mode/diff/index.html +105 -0
- data/app/components/marty/script_form/javascripts/mode/ecl/ecl.js +203 -0
- data/app/components/marty/script_form/javascripts/mode/ecl/index.html +42 -0
- data/app/components/marty/script_form/javascripts/mode/erlang/erlang.js +463 -0
- data/app/components/marty/script_form/javascripts/mode/erlang/index.html +63 -0
- data/app/components/marty/script_form/javascripts/mode/gfm/gfm.js +150 -0
- data/app/components/marty/script_form/javascripts/mode/gfm/index.html +48 -0
- data/app/components/marty/script_form/javascripts/mode/go/go.js +170 -0
- data/app/components/marty/script_form/javascripts/mode/go/index.html +73 -0
- data/app/components/marty/script_form/javascripts/mode/groovy/groovy.js +210 -0
- data/app/components/marty/script_form/javascripts/mode/groovy/index.html +72 -0
- data/app/components/marty/script_form/javascripts/mode/haskell/haskell.js +242 -0
- data/app/components/marty/script_form/javascripts/mode/haskell/index.html +61 -0
- data/app/components/marty/script_form/javascripts/mode/haxe/haxe.js +429 -0
- data/app/components/marty/script_form/javascripts/mode/haxe/index.html +91 -0
- data/app/components/marty/script_form/javascripts/mode/htmlembedded/htmlembedded.js +72 -0
- data/app/components/marty/script_form/javascripts/mode/htmlembedded/index.html +50 -0
- data/app/components/marty/script_form/javascripts/mode/htmlmixed/htmlmixed.js +84 -0
- data/app/components/marty/script_form/javascripts/mode/htmlmixed/index.html +52 -0
- data/app/components/marty/script_form/javascripts/mode/javascript/index.html +78 -0
- data/app/components/marty/script_form/javascripts/mode/javascript/javascript.js +361 -0
- data/app/components/marty/script_form/javascripts/mode/jinja2/index.html +38 -0
- data/app/components/marty/script_form/javascripts/mode/jinja2/jinja2.js +42 -0
- data/app/components/marty/script_form/javascripts/mode/less/index.html +740 -0
- data/app/components/marty/script_form/javascripts/mode/less/less.js +266 -0
- data/app/components/marty/script_form/javascripts/mode/lua/index.html +73 -0
- data/app/components/marty/script_form/javascripts/mode/lua/lua.js +140 -0
- data/app/components/marty/script_form/javascripts/mode/markdown/index.html +343 -0
- data/app/components/marty/script_form/javascripts/mode/markdown/markdown.js +382 -0
- data/app/components/marty/script_form/javascripts/mode/markdown/test.js +1084 -0
- data/app/components/marty/script_form/javascripts/mode/mysql/index.html +42 -0
- data/app/components/marty/script_form/javascripts/mode/mysql/mysql.js +186 -0
- data/app/components/marty/script_form/javascripts/mode/ntriples/index.html +33 -0
- data/app/components/marty/script_form/javascripts/mode/ntriples/ntriples.js +172 -0
- data/app/components/marty/script_form/javascripts/mode/ocaml/index.html +130 -0
- data/app/components/marty/script_form/javascripts/mode/ocaml/ocaml.js +114 -0
- data/app/components/marty/script_form/javascripts/mode/pascal/LICENSE +7 -0
- data/app/components/marty/script_form/javascripts/mode/pascal/index.html +49 -0
- data/app/components/marty/script_form/javascripts/mode/pascal/pascal.js +94 -0
- data/app/components/marty/script_form/javascripts/mode/perl/LICENSE +19 -0
- data/app/components/marty/script_form/javascripts/mode/perl/index.html +63 -0
- data/app/components/marty/script_form/javascripts/mode/perl/perl.js +816 -0
- data/app/components/marty/script_form/javascripts/mode/php/index.html +49 -0
- data/app/components/marty/script_form/javascripts/mode/php/php.js +148 -0
- data/app/components/marty/script_form/javascripts/mode/pig/index.html +43 -0
- data/app/components/marty/script_form/javascripts/mode/pig/pig.js +172 -0
- data/app/components/marty/script_form/javascripts/mode/plsql/index.html +63 -0
- data/app/components/marty/script_form/javascripts/mode/plsql/plsql.js +217 -0
- data/app/components/marty/script_form/javascripts/mode/properties/index.html +41 -0
- data/app/components/marty/script_form/javascripts/mode/properties/properties.js +63 -0
- data/app/components/marty/script_form/javascripts/mode/python/LICENSE.txt +21 -0
- data/app/components/marty/script_form/javascripts/mode/python/index.html +123 -0
- data/app/components/marty/script_form/javascripts/mode/python/python.js +338 -0
- data/app/components/marty/script_form/javascripts/mode/r/LICENSE +24 -0
- data/app/components/marty/script_form/javascripts/mode/r/index.html +74 -0
- data/app/components/marty/script_form/javascripts/mode/r/r.js +141 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/changes/changes.js +19 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/changes/index.html +54 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/spec/index.html +100 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/spec/spec.css +5 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/spec/spec.js +66 -0
- data/app/components/marty/script_form/javascripts/mode/rst/index.html +526 -0
- data/app/components/marty/script_form/javascripts/mode/rst/rst.js +326 -0
- data/app/components/marty/script_form/javascripts/mode/ruby/LICENSE +24 -0
- data/app/components/marty/script_form/javascripts/mode/ruby/index.html +172 -0
- data/app/components/marty/script_form/javascripts/mode/ruby/ruby.js +195 -0
- data/app/components/marty/script_form/javascripts/mode/rust/index.html +49 -0
- data/app/components/marty/script_form/javascripts/mode/rust/rust.js +432 -0
- data/app/components/marty/script_form/javascripts/mode/scheme/index.html +65 -0
- data/app/components/marty/script_form/javascripts/mode/scheme/scheme.js +230 -0
- data/app/components/marty/script_form/javascripts/mode/shell/index.html +50 -0
- data/app/components/marty/script_form/javascripts/mode/shell/shell.js +118 -0
- data/app/components/marty/script_form/javascripts/mode/sieve/LICENSE +23 -0
- data/app/components/marty/script_form/javascripts/mode/sieve/index.html +81 -0
- data/app/components/marty/script_form/javascripts/mode/sieve/sieve.js +156 -0
- data/app/components/marty/script_form/javascripts/mode/smalltalk/index.html +56 -0
- data/app/components/marty/script_form/javascripts/mode/smalltalk/smalltalk.js +139 -0
- data/app/components/marty/script_form/javascripts/mode/smarty/index.html +83 -0
- data/app/components/marty/script_form/javascripts/mode/smarty/smarty.js +148 -0
- data/app/components/marty/script_form/javascripts/mode/sparql/index.html +41 -0
- data/app/components/marty/script_form/javascripts/mode/sparql/sparql.js +143 -0
- data/app/components/marty/script_form/javascripts/mode/stex/index.html +98 -0
- data/app/components/marty/script_form/javascripts/mode/stex/stex.js +182 -0
- data/app/components/marty/script_form/javascripts/mode/stex/test.js +343 -0
- data/app/components/marty/script_form/javascripts/mode/tiddlywiki/index.html +141 -0
- data/app/components/marty/script_form/javascripts/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/app/components/marty/script_form/javascripts/mode/tiddlywiki/tiddlywiki.js +384 -0
- data/app/components/marty/script_form/javascripts/mode/tiki/index.html +83 -0
- data/app/components/marty/script_form/javascripts/mode/tiki/tiki.css +26 -0
- data/app/components/marty/script_form/javascripts/mode/tiki/tiki.js +309 -0
- data/app/components/marty/script_form/javascripts/mode/vb/LICENSE.txt +21 -0
- data/app/components/marty/script_form/javascripts/mode/vb/index.html +89 -0
- data/app/components/marty/script_form/javascripts/mode/vb/vb.js +260 -0
- data/app/components/marty/script_form/javascripts/mode/vbscript/index.html +43 -0
- data/app/components/marty/script_form/javascripts/mode/vbscript/vbscript.js +26 -0
- data/app/components/marty/script_form/javascripts/mode/velocity/index.html +104 -0
- data/app/components/marty/script_form/javascripts/mode/velocity/velocity.js +146 -0
- data/app/components/marty/script_form/javascripts/mode/verilog/index.html +211 -0
- data/app/components/marty/script_form/javascripts/mode/verilog/verilog.js +194 -0
- data/app/components/marty/script_form/javascripts/mode/xml/index.html +45 -0
- data/app/components/marty/script_form/javascripts/mode/xml/xml.js +318 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/LICENSE +20 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/index.html +223 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/index.html +27 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testBase.js +42 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testEmptySequenceKeyword.js +16 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testMultiAttr.js +16 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testNamespaces.js +91 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testProcessingInstructions.js +16 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testQuotes.js +19 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/xquery.js +451 -0
- data/app/components/marty/script_form/javascripts/mode/yaml/index.html +68 -0
- data/app/components/marty/script_form/javascripts/mode/yaml/yaml.js +95 -0
- data/app/components/marty/script_form/javascripts/util/closetag.js +164 -0
- data/app/components/marty/script_form/javascripts/util/dialog.css +27 -0
- data/app/components/marty/script_form/javascripts/util/dialog.js +70 -0
- data/app/components/marty/script_form/javascripts/util/foldcode.js +196 -0
- data/app/components/marty/script_form/javascripts/util/formatting.js +193 -0
- data/app/components/marty/script_form/javascripts/util/javascript-hint.js +134 -0
- data/app/components/marty/script_form/javascripts/util/loadmode.js +51 -0
- data/app/components/marty/script_form/javascripts/util/match-highlighter.js +44 -0
- data/app/components/marty/script_form/javascripts/util/multiplex.js +77 -0
- data/app/components/marty/script_form/javascripts/util/overlay.js +54 -0
- data/app/components/marty/script_form/javascripts/util/pig-hint.js +123 -0
- data/app/components/marty/script_form/javascripts/util/runmode-standalone.js +90 -0
- data/app/components/marty/script_form/javascripts/util/runmode.js +53 -0
- data/app/components/marty/script_form/javascripts/util/search.js +118 -0
- data/app/components/marty/script_form/javascripts/util/searchcursor.js +119 -0
- data/app/components/marty/script_form/javascripts/util/simple-hint.css +16 -0
- data/app/components/marty/script_form/javascripts/util/simple-hint.js +97 -0
- data/app/components/marty/script_form/javascripts/util/xml-hint.js +137 -0
- data/app/components/marty/script_form/stylesheets/codemirror.css +172 -0
- data/app/components/marty/script_form/stylesheets/delorean.css +10 -0
- data/app/components/marty/script_form/stylesheets/theme/ambiance.css +81 -0
- data/app/components/marty/script_form/stylesheets/theme/blackboard.css +25 -0
- data/app/components/marty/script_form/stylesheets/theme/cobalt.css +18 -0
- data/app/components/marty/script_form/stylesheets/theme/eclipse.css +25 -0
- data/app/components/marty/script_form/stylesheets/theme/elegant.css +10 -0
- data/app/components/marty/script_form/stylesheets/theme/erlang-dark.css +21 -0
- data/app/components/marty/script_form/stylesheets/theme/lesser-dark.css +44 -0
- data/app/components/marty/script_form/stylesheets/theme/monokai.css +28 -0
- data/app/components/marty/script_form/stylesheets/theme/neat.css +9 -0
- data/app/components/marty/script_form/stylesheets/theme/night.css +21 -0
- data/app/components/marty/script_form/stylesheets/theme/rubyblue.css +21 -0
- data/app/components/marty/script_form/stylesheets/theme/vibrant-ink.css +27 -0
- data/app/components/marty/script_form/stylesheets/theme/xq-dark.css +46 -0
- data/app/components/marty/script_grid.rb +104 -0
- data/app/components/marty/script_grid.rb~ +99 -0
- data/app/components/marty/script_tester.rb +114 -0
- data/app/components/marty/script_tester.rb~ +213 -0
- data/app/components/marty/scripting.rb +132 -0
- data/app/components/marty/scripting.rb~ +124 -0
- data/app/components/marty/select_report.rb~ +143 -0
- data/app/components/marty/simple_app.rb +97 -0
- data/app/components/marty/simple_app.rb~ +101 -0
- data/app/components/marty/simple_app/javascripts/simple_app.js +50 -0
- data/app/components/marty/simple_app/javascripts/statusbar_ext.js +8 -0
- data/app/components/marty/tag_grid.rb +83 -0
- data/app/components/marty/tag_grid.rb~ +89 -0
- data/app/components/marty/tree_panel.rb~ +256 -0
- data/app/components/marty/tree_panel/javascripts/tree_panel.js~ +317 -0
- data/app/components/marty/user_pivot.rb +128 -0
- data/app/components/marty/user_view.rb +181 -0
- data/app/components/marty/user_view.rb~ +188 -0
- data/app/controllers/marty/application_controller.rb +124 -0
- data/app/controllers/marty/application_controller.rb~ +133 -0
- data/app/controllers/marty/components_controller.rb +41 -0
- data/app/controllers/marty/components_controller.rb~ +37 -0
- data/app/controllers/marty/job_controller.rb +28 -0
- data/app/controllers/marty/job_controller.rb~ +28 -0
- data/app/controllers/marty/rpc_controller.rb +64 -0
- data/app/controllers/marty/rpc_controller.rb~ +61 -0
- data/app/helpers/marty/application_helper.rb +4 -0
- data/app/helpers/marty/script_set.rb +57 -0
- data/app/helpers/marty/script_set.rb~ +59 -0
- data/app/models/marty/api_auth.rb +44 -0
- data/app/models/marty/api_auth.rb~ +48 -0
- data/app/models/marty/base.rb +4 -0
- data/app/models/marty/data_change.rb +179 -0
- data/app/models/marty/data_change.rb~ +141 -0
- data/app/models/marty/enum.rb +22 -0
- data/app/models/marty/enum.rb~ +16 -0
- data/app/models/marty/import_type.rb +44 -0
- data/app/models/marty/import_type.rb~ +48 -0
- data/app/models/marty/poop.rb~ +169 -0
- data/app/models/marty/posting.rb +101 -0
- data/app/models/marty/posting.rb~ +86 -0
- data/app/models/marty/posting_type.rb +12 -0
- data/app/models/marty/posting_type.rb~ +21 -0
- data/app/models/marty/promise.rb +252 -0
- data/app/models/marty/promise.rb~ +196 -0
- data/app/models/marty/role.rb +6 -0
- data/app/models/marty/role.rb~ +10 -0
- data/app/models/marty/script.rb +144 -0
- data/app/models/marty/script.rb~ +62 -0
- data/app/models/marty/tag.rb +96 -0
- data/app/models/marty/tag.rb~ +91 -0
- data/app/models/marty/token.rb +30 -0
- data/app/models/marty/user.rb +146 -0
- data/app/models/marty/user.rb~ +148 -0
- data/app/models/marty/user_role.rb +7 -0
- data/app/models/marty/user_role.rb~ +13 -0
- data/app/views/layouts/marty/application.html.erb +12 -0
- data/app/views/layouts/marty/application.html.erb~ +11 -0
- data/config/locales/en.yml +134 -0
- data/config/routes.rb +6 -0
- data/config/routes.rb~ +10 -0
- data/db/migrate/001_create_marty_scripts.rb +14 -0
- data/db/migrate/003_create_marty_users.rb +12 -0
- data/db/migrate/004_create_marty_roles.rb +7 -0
- data/db/migrate/005_create_marty_user_roles.rb +14 -0
- data/db/migrate/006_create_marty_tokens.rb +14 -0
- data/db/migrate/008_create_marty_posting_types.rb +7 -0
- data/db/migrate/019_create_marty_postings.rb +18 -0
- data/db/migrate/019_create_marty_postings.rb~ +19 -0
- data/db/migrate/068_create_marty_import_types.rb +12 -0
- data/db/migrate/069_create_marty_import_synonyms.rb +15 -0
- data/db/migrate/070_create_versions.rb +18 -0
- data/db/migrate/071_add_object_changes_column_to_versions.rb +9 -0
- data/db/migrate/072_add_validation_function_to_import_types.rb +6 -0
- data/db/migrate/073_add_preprocess_function_to_import_types.rb +5 -0
- data/db/migrate/090_create_delayed_jobs.rb +22 -0
- data/db/migrate/091_create_marty_promises.rb +36 -0
- data/db/migrate/095_create_marty_tags.rb +14 -0
- data/db/migrate/095_create_marty_tags.rb~ +19 -0
- data/db/migrate/096_add_user_roles_to_import_types.rb +11 -0
- data/db/migrate/097_drop_versions.rb +9 -0
- data/db/migrate/098_create_marty_api_auths.rb +20 -0
- data/db/seeds.rb +48 -0
- data/lib/marty.rb +18 -0
- data/lib/marty.rb~ +13 -0
- data/lib/marty/content_handler.rb +97 -0
- data/lib/marty/content_handler.rb~ +93 -0
- data/lib/marty/data_conversion.rb +298 -0
- data/lib/marty/data_exporter.rb +150 -0
- data/lib/marty/data_exporter.rb~ +137 -0
- data/lib/marty/data_importer.rb +122 -0
- data/lib/marty/data_importer.rb~ +114 -0
- data/lib/marty/data_row_processor.rb~ +206 -0
- data/lib/marty/drop_folder_hook.rb~ +17 -0
- data/lib/marty/engine.rb +10 -0
- data/lib/marty/folder_hook.rb~ +9 -0
- data/lib/marty/lazy_column_loader.rb +57 -0
- data/lib/marty/lazy_column_loader.rb~ +47 -0
- data/lib/marty/mcfly_query.rb +189 -0
- data/lib/marty/mcfly_query.rb~ +188 -0
- data/lib/marty/migrations.rb +108 -0
- data/lib/marty/migrations.rb~ +65 -0
- data/lib/marty/monkey.rb +163 -0
- data/lib/marty/monkey.rb~ +160 -0
- data/lib/marty/permissions.rb +64 -0
- data/lib/marty/permissions.rb~ +69 -0
- data/lib/marty/promise.rb~ +41 -0
- data/lib/marty/promise_job.rb +123 -0
- data/lib/marty/promise_job.rb~ +121 -0
- data/lib/marty/promise_proxy.rb +94 -0
- data/lib/marty/promise_proxy.rb~ +69 -0
- data/lib/marty/railtie.rb +5 -0
- data/lib/marty/relation.rb +39 -0
- data/lib/marty/util.rb +110 -0
- data/lib/marty/util.rb~ +80 -0
- data/lib/marty/version.rb +3 -0
- data/lib/marty/version.rb~ +3 -0
- data/lib/marty/xl.rb +527 -0
- data/lib/marty/xl.rb~ +526 -0
- data/lib/pyxll/README.txt +19 -0
- data/lib/pyxll/README.txt~ +16 -0
- data/lib/pyxll/gemini.py +155 -0
- data/lib/pyxll/gemini.py~ +110 -0
- data/lib/pyxll/pyxll.cfg +12 -0
- data/lib/pyxll/pyxll.cfg~ +12 -0
- data/lib/pyxll/sample.xlsx +0 -0
- data/lib/tasks/marty_tasks.rake +37 -0
- metadata +517 -0
@@ -0,0 +1,195 @@
|
|
1
|
+
CodeMirror.defineMode("ruby", function(config, parserConfig) {
|
2
|
+
function wordObj(words) {
|
3
|
+
var o = {};
|
4
|
+
for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true;
|
5
|
+
return o;
|
6
|
+
}
|
7
|
+
var keywords = wordObj([
|
8
|
+
"alias", "and", "BEGIN", "begin", "break", "case", "class", "def", "defined?", "do", "else",
|
9
|
+
"elsif", "END", "end", "ensure", "false", "for", "if", "in", "module", "next", "not", "or",
|
10
|
+
"redo", "rescue", "retry", "return", "self", "super", "then", "true", "undef", "unless",
|
11
|
+
"until", "when", "while", "yield", "nil", "raise", "throw", "catch", "fail", "loop", "callcc",
|
12
|
+
"caller", "lambda", "proc", "public", "protected", "private", "require", "load",
|
13
|
+
"require_relative", "extend", "autoload"
|
14
|
+
]);
|
15
|
+
var indentWords = wordObj(["def", "class", "case", "for", "while", "do", "module", "then",
|
16
|
+
"catch", "loop", "proc", "begin"]);
|
17
|
+
var dedentWords = wordObj(["end", "until"]);
|
18
|
+
var matching = {"[": "]", "{": "}", "(": ")"};
|
19
|
+
var curPunc;
|
20
|
+
|
21
|
+
function chain(newtok, stream, state) {
|
22
|
+
state.tokenize.push(newtok);
|
23
|
+
return newtok(stream, state);
|
24
|
+
}
|
25
|
+
|
26
|
+
function tokenBase(stream, state) {
|
27
|
+
curPunc = null;
|
28
|
+
if (stream.sol() && stream.match("=begin") && stream.eol()) {
|
29
|
+
state.tokenize.push(readBlockComment);
|
30
|
+
return "comment";
|
31
|
+
}
|
32
|
+
if (stream.eatSpace()) return null;
|
33
|
+
var ch = stream.next(), m;
|
34
|
+
if (ch == "`" || ch == "'" || ch == '"' ||
|
35
|
+
(ch == "/" && !stream.eol() && stream.peek() != " ")) {
|
36
|
+
return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state);
|
37
|
+
} else if (ch == "%") {
|
38
|
+
var style, embed = false;
|
39
|
+
if (stream.eat("s")) style = "atom";
|
40
|
+
else if (stream.eat(/[WQ]/)) { style = "string"; embed = true; }
|
41
|
+
else if (stream.eat(/[wxqr]/)) style = "string";
|
42
|
+
var delim = stream.eat(/[^\w\s]/);
|
43
|
+
if (!delim) return "operator";
|
44
|
+
if (matching.propertyIsEnumerable(delim)) delim = matching[delim];
|
45
|
+
return chain(readQuoted(delim, style, embed, true), stream, state);
|
46
|
+
} else if (ch == "#") {
|
47
|
+
stream.skipToEnd();
|
48
|
+
return "comment";
|
49
|
+
} else if (ch == "<" && (m = stream.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/))) {
|
50
|
+
return chain(readHereDoc(m[1]), stream, state);
|
51
|
+
} else if (ch == "0") {
|
52
|
+
if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/);
|
53
|
+
else if (stream.eat("b")) stream.eatWhile(/[01]/);
|
54
|
+
else stream.eatWhile(/[0-7]/);
|
55
|
+
return "number";
|
56
|
+
} else if (/\d/.test(ch)) {
|
57
|
+
stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/);
|
58
|
+
return "number";
|
59
|
+
} else if (ch == "?") {
|
60
|
+
while (stream.match(/^\\[CM]-/)) {}
|
61
|
+
if (stream.eat("\\")) stream.eatWhile(/\w/);
|
62
|
+
else stream.next();
|
63
|
+
return "string";
|
64
|
+
} else if (ch == ":") {
|
65
|
+
if (stream.eat("'")) return chain(readQuoted("'", "atom", false), stream, state);
|
66
|
+
if (stream.eat('"')) return chain(readQuoted('"', "atom", true), stream, state);
|
67
|
+
stream.eatWhile(/[\w\?]/);
|
68
|
+
return "atom";
|
69
|
+
} else if (ch == "@") {
|
70
|
+
stream.eat("@");
|
71
|
+
stream.eatWhile(/[\w\?]/);
|
72
|
+
return "variable-2";
|
73
|
+
} else if (ch == "$") {
|
74
|
+
stream.next();
|
75
|
+
stream.eatWhile(/[\w\?]/);
|
76
|
+
return "variable-3";
|
77
|
+
} else if (/\w/.test(ch)) {
|
78
|
+
stream.eatWhile(/[\w\?]/);
|
79
|
+
if (stream.eat(":")) return "atom";
|
80
|
+
return "ident";
|
81
|
+
} else if (ch == "|" && (state.varList || state.lastTok == "{" || state.lastTok == "do")) {
|
82
|
+
curPunc = "|";
|
83
|
+
return null;
|
84
|
+
} else if (/[\(\)\[\]{}\\;]/.test(ch)) {
|
85
|
+
curPunc = ch;
|
86
|
+
return null;
|
87
|
+
} else if (ch == "-" && stream.eat(">")) {
|
88
|
+
return "arrow";
|
89
|
+
} else if (/[=+\-\/*:\.^%<>~|]/.test(ch)) {
|
90
|
+
stream.eatWhile(/[=+\-\/*:\.^%<>~|]/);
|
91
|
+
return "operator";
|
92
|
+
} else {
|
93
|
+
return null;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
function tokenBaseUntilBrace() {
|
98
|
+
var depth = 1;
|
99
|
+
return function(stream, state) {
|
100
|
+
if (stream.peek() == "}") {
|
101
|
+
depth--;
|
102
|
+
if (depth == 0) {
|
103
|
+
state.tokenize.pop();
|
104
|
+
return state.tokenize[state.tokenize.length-1](stream, state);
|
105
|
+
}
|
106
|
+
} else if (stream.peek() == "{") {
|
107
|
+
depth++;
|
108
|
+
}
|
109
|
+
return tokenBase(stream, state);
|
110
|
+
};
|
111
|
+
}
|
112
|
+
function readQuoted(quote, style, embed, unescaped) {
|
113
|
+
return function(stream, state) {
|
114
|
+
var escaped = false, ch;
|
115
|
+
while ((ch = stream.next()) != null) {
|
116
|
+
if (ch == quote && (unescaped || !escaped)) {
|
117
|
+
state.tokenize.pop();
|
118
|
+
break;
|
119
|
+
}
|
120
|
+
if (embed && ch == "#" && !escaped && stream.eat("{")) {
|
121
|
+
state.tokenize.push(tokenBaseUntilBrace(arguments.callee));
|
122
|
+
break;
|
123
|
+
}
|
124
|
+
escaped = !escaped && ch == "\\";
|
125
|
+
}
|
126
|
+
return style;
|
127
|
+
};
|
128
|
+
}
|
129
|
+
function readHereDoc(phrase) {
|
130
|
+
return function(stream, state) {
|
131
|
+
if (stream.match(phrase)) state.tokenize.pop();
|
132
|
+
else stream.skipToEnd();
|
133
|
+
return "string";
|
134
|
+
};
|
135
|
+
}
|
136
|
+
function readBlockComment(stream, state) {
|
137
|
+
if (stream.sol() && stream.match("=end") && stream.eol())
|
138
|
+
state.tokenize.pop();
|
139
|
+
stream.skipToEnd();
|
140
|
+
return "comment";
|
141
|
+
}
|
142
|
+
|
143
|
+
return {
|
144
|
+
startState: function() {
|
145
|
+
return {tokenize: [tokenBase],
|
146
|
+
indented: 0,
|
147
|
+
context: {type: "top", indented: -config.indentUnit},
|
148
|
+
continuedLine: false,
|
149
|
+
lastTok: null,
|
150
|
+
varList: false};
|
151
|
+
},
|
152
|
+
|
153
|
+
token: function(stream, state) {
|
154
|
+
if (stream.sol()) state.indented = stream.indentation();
|
155
|
+
var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype;
|
156
|
+
if (style == "ident") {
|
157
|
+
var word = stream.current();
|
158
|
+
style = keywords.propertyIsEnumerable(stream.current()) ? "keyword"
|
159
|
+
: /^[A-Z]/.test(word) ? "tag"
|
160
|
+
: (state.lastTok == "def" || state.lastTok == "class" || state.varList) ? "def"
|
161
|
+
: "variable";
|
162
|
+
if (indentWords.propertyIsEnumerable(word)) kwtype = "indent";
|
163
|
+
else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent";
|
164
|
+
else if ((word == "if" || word == "unless") && stream.column() == stream.indentation())
|
165
|
+
kwtype = "indent";
|
166
|
+
}
|
167
|
+
if (curPunc || (style && style != "comment")) state.lastTok = word || curPunc || style;
|
168
|
+
if (curPunc == "|") state.varList = !state.varList;
|
169
|
+
|
170
|
+
if (kwtype == "indent" || /[\(\[\{]/.test(curPunc))
|
171
|
+
state.context = {prev: state.context, type: curPunc || style, indented: state.indented};
|
172
|
+
else if ((kwtype == "dedent" || /[\)\]\}]/.test(curPunc)) && state.context.prev)
|
173
|
+
state.context = state.context.prev;
|
174
|
+
|
175
|
+
if (stream.eol())
|
176
|
+
state.continuedLine = (curPunc == "\\" || style == "operator");
|
177
|
+
return style;
|
178
|
+
},
|
179
|
+
|
180
|
+
indent: function(state, textAfter) {
|
181
|
+
if (state.tokenize[state.tokenize.length-1] != tokenBase) return 0;
|
182
|
+
var firstChar = textAfter && textAfter.charAt(0);
|
183
|
+
var ct = state.context;
|
184
|
+
var closing = ct.type == matching[firstChar] ||
|
185
|
+
ct.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(textAfter);
|
186
|
+
return ct.indented + (closing ? 0 : config.indentUnit) +
|
187
|
+
(state.continuedLine ? config.indentUnit : 0);
|
188
|
+
},
|
189
|
+
electricChars: "}de" // enD and rescuE
|
190
|
+
|
191
|
+
};
|
192
|
+
});
|
193
|
+
|
194
|
+
CodeMirror.defineMIME("text/x-ruby", "ruby");
|
195
|
+
|
@@ -0,0 +1,49 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>CodeMirror: Rust mode</title>
|
6
|
+
<link rel="stylesheet" href="../../lib/codemirror.css">
|
7
|
+
<script src="../../lib/codemirror.js"></script>
|
8
|
+
<script src="rust.js"></script>
|
9
|
+
<link rel="stylesheet" href="../../doc/docs.css">
|
10
|
+
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
<h1>CodeMirror: Rust mode</h1>
|
14
|
+
|
15
|
+
<div><textarea id="code" name="code">
|
16
|
+
// Demo code.
|
17
|
+
|
18
|
+
type foo<T> = int;
|
19
|
+
enum bar {
|
20
|
+
some(int, foo<float>),
|
21
|
+
none
|
22
|
+
}
|
23
|
+
|
24
|
+
fn check_crate(x: int) {
|
25
|
+
let v = 10;
|
26
|
+
alt foo {
|
27
|
+
1 to 3 {
|
28
|
+
print_foo();
|
29
|
+
if x {
|
30
|
+
blah() + 10;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
(x, y) { "bye" }
|
34
|
+
_ { "hi" }
|
35
|
+
}
|
36
|
+
}
|
37
|
+
</textarea></div>
|
38
|
+
|
39
|
+
<script>
|
40
|
+
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
41
|
+
lineNumbers: true,
|
42
|
+
matchBrackets: true,
|
43
|
+
tabMode: "indent"
|
44
|
+
});
|
45
|
+
</script>
|
46
|
+
|
47
|
+
<p><strong>MIME types defined:</strong> <code>text/x-rustsrc</code>.</p>
|
48
|
+
</body>
|
49
|
+
</html>
|
@@ -0,0 +1,432 @@
|
|
1
|
+
CodeMirror.defineMode("rust", function() {
|
2
|
+
var indentUnit = 4, altIndentUnit = 2;
|
3
|
+
var valKeywords = {
|
4
|
+
"if": "if-style", "while": "if-style", "else": "else-style",
|
5
|
+
"do": "else-style", "ret": "else-style", "fail": "else-style",
|
6
|
+
"break": "atom", "cont": "atom", "const": "let", "resource": "fn",
|
7
|
+
"let": "let", "fn": "fn", "for": "for", "alt": "alt", "iface": "iface",
|
8
|
+
"impl": "impl", "type": "type", "enum": "enum", "mod": "mod",
|
9
|
+
"as": "op", "true": "atom", "false": "atom", "assert": "op", "check": "op",
|
10
|
+
"claim": "op", "native": "ignore", "unsafe": "ignore", "import": "else-style",
|
11
|
+
"export": "else-style", "copy": "op", "log": "op", "log_err": "op",
|
12
|
+
"use": "op", "bind": "op", "self": "atom"
|
13
|
+
};
|
14
|
+
var typeKeywords = function() {
|
15
|
+
var keywords = {"fn": "fn", "block": "fn", "obj": "obj"};
|
16
|
+
var atoms = "bool uint int i8 i16 i32 i64 u8 u16 u32 u64 float f32 f64 str char".split(" ");
|
17
|
+
for (var i = 0, e = atoms.length; i < e; ++i) keywords[atoms[i]] = "atom";
|
18
|
+
return keywords;
|
19
|
+
}();
|
20
|
+
var operatorChar = /[+\-*&%=<>!?|\.@]/;
|
21
|
+
|
22
|
+
// Tokenizer
|
23
|
+
|
24
|
+
// Used as scratch variable to communicate multiple values without
|
25
|
+
// consing up tons of objects.
|
26
|
+
var tcat, content;
|
27
|
+
function r(tc, style) {
|
28
|
+
tcat = tc;
|
29
|
+
return style;
|
30
|
+
}
|
31
|
+
|
32
|
+
function tokenBase(stream, state) {
|
33
|
+
var ch = stream.next();
|
34
|
+
if (ch == '"') {
|
35
|
+
state.tokenize = tokenString;
|
36
|
+
return state.tokenize(stream, state);
|
37
|
+
}
|
38
|
+
if (ch == "'") {
|
39
|
+
tcat = "atom";
|
40
|
+
if (stream.eat("\\")) {
|
41
|
+
if (stream.skipTo("'")) { stream.next(); return "string"; }
|
42
|
+
else { return "error"; }
|
43
|
+
} else {
|
44
|
+
stream.next();
|
45
|
+
return stream.eat("'") ? "string" : "error";
|
46
|
+
}
|
47
|
+
}
|
48
|
+
if (ch == "/") {
|
49
|
+
if (stream.eat("/")) { stream.skipToEnd(); return "comment"; }
|
50
|
+
if (stream.eat("*")) {
|
51
|
+
state.tokenize = tokenComment(1);
|
52
|
+
return state.tokenize(stream, state);
|
53
|
+
}
|
54
|
+
}
|
55
|
+
if (ch == "#") {
|
56
|
+
if (stream.eat("[")) { tcat = "open-attr"; return null; }
|
57
|
+
stream.eatWhile(/\w/);
|
58
|
+
return r("macro", "meta");
|
59
|
+
}
|
60
|
+
if (ch == ":" && stream.match(":<")) {
|
61
|
+
return r("op", null);
|
62
|
+
}
|
63
|
+
if (ch.match(/\d/) || (ch == "." && stream.eat(/\d/))) {
|
64
|
+
var flp = false;
|
65
|
+
if (!stream.match(/^x[\da-f]+/i) && !stream.match(/^b[01]+/)) {
|
66
|
+
stream.eatWhile(/\d/);
|
67
|
+
if (stream.eat(".")) { flp = true; stream.eatWhile(/\d/); }
|
68
|
+
if (stream.match(/^e[+\-]?\d+/i)) { flp = true; }
|
69
|
+
}
|
70
|
+
if (flp) stream.match(/^f(?:32|64)/);
|
71
|
+
else stream.match(/^[ui](?:8|16|32|64)/);
|
72
|
+
return r("atom", "number");
|
73
|
+
}
|
74
|
+
if (ch.match(/[()\[\]{}:;,]/)) return r(ch, null);
|
75
|
+
if (ch == "-" && stream.eat(">")) return r("->", null);
|
76
|
+
if (ch.match(operatorChar)) {
|
77
|
+
stream.eatWhile(operatorChar);
|
78
|
+
return r("op", null);
|
79
|
+
}
|
80
|
+
stream.eatWhile(/\w/);
|
81
|
+
content = stream.current();
|
82
|
+
if (stream.match(/^::\w/)) {
|
83
|
+
stream.backUp(1);
|
84
|
+
return r("prefix", "variable-2");
|
85
|
+
}
|
86
|
+
if (state.keywords.propertyIsEnumerable(content))
|
87
|
+
return r(state.keywords[content], content.match(/true|false/) ? "atom" : "keyword");
|
88
|
+
return r("name", "variable");
|
89
|
+
}
|
90
|
+
|
91
|
+
function tokenString(stream, state) {
|
92
|
+
var ch, escaped = false;
|
93
|
+
while (ch = stream.next()) {
|
94
|
+
if (ch == '"' && !escaped) {
|
95
|
+
state.tokenize = tokenBase;
|
96
|
+
return r("atom", "string");
|
97
|
+
}
|
98
|
+
escaped = !escaped && ch == "\\";
|
99
|
+
}
|
100
|
+
// Hack to not confuse the parser when a string is split in
|
101
|
+
// pieces.
|
102
|
+
return r("op", "string");
|
103
|
+
}
|
104
|
+
|
105
|
+
function tokenComment(depth) {
|
106
|
+
return function(stream, state) {
|
107
|
+
var lastCh = null, ch;
|
108
|
+
while (ch = stream.next()) {
|
109
|
+
if (ch == "/" && lastCh == "*") {
|
110
|
+
if (depth == 1) {
|
111
|
+
state.tokenize = tokenBase;
|
112
|
+
break;
|
113
|
+
} else {
|
114
|
+
state.tokenize = tokenComment(depth - 1);
|
115
|
+
return state.tokenize(stream, state);
|
116
|
+
}
|
117
|
+
}
|
118
|
+
if (ch == "*" && lastCh == "/") {
|
119
|
+
state.tokenize = tokenComment(depth + 1);
|
120
|
+
return state.tokenize(stream, state);
|
121
|
+
}
|
122
|
+
lastCh = ch;
|
123
|
+
}
|
124
|
+
return "comment";
|
125
|
+
};
|
126
|
+
}
|
127
|
+
|
128
|
+
// Parser
|
129
|
+
|
130
|
+
var cx = {state: null, stream: null, marked: null, cc: null};
|
131
|
+
function pass() {
|
132
|
+
for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
|
133
|
+
}
|
134
|
+
function cont() {
|
135
|
+
pass.apply(null, arguments);
|
136
|
+
return true;
|
137
|
+
}
|
138
|
+
|
139
|
+
function pushlex(type, info) {
|
140
|
+
var result = function() {
|
141
|
+
var state = cx.state;
|
142
|
+
state.lexical = {indented: state.indented, column: cx.stream.column(),
|
143
|
+
type: type, prev: state.lexical, info: info};
|
144
|
+
};
|
145
|
+
result.lex = true;
|
146
|
+
return result;
|
147
|
+
}
|
148
|
+
function poplex() {
|
149
|
+
var state = cx.state;
|
150
|
+
if (state.lexical.prev) {
|
151
|
+
if (state.lexical.type == ")")
|
152
|
+
state.indented = state.lexical.indented;
|
153
|
+
state.lexical = state.lexical.prev;
|
154
|
+
}
|
155
|
+
}
|
156
|
+
function typecx() { cx.state.keywords = typeKeywords; }
|
157
|
+
function valcx() { cx.state.keywords = valKeywords; }
|
158
|
+
poplex.lex = typecx.lex = valcx.lex = true;
|
159
|
+
|
160
|
+
function commasep(comb, end) {
|
161
|
+
function more(type) {
|
162
|
+
if (type == ",") return cont(comb, more);
|
163
|
+
if (type == end) return cont();
|
164
|
+
return cont(more);
|
165
|
+
}
|
166
|
+
return function(type) {
|
167
|
+
if (type == end) return cont();
|
168
|
+
return pass(comb, more);
|
169
|
+
};
|
170
|
+
}
|
171
|
+
|
172
|
+
function stat_of(comb, tag) {
|
173
|
+
return cont(pushlex("stat", tag), comb, poplex, block);
|
174
|
+
}
|
175
|
+
function block(type) {
|
176
|
+
if (type == "}") return cont();
|
177
|
+
if (type == "let") return stat_of(letdef1, "let");
|
178
|
+
if (type == "fn") return stat_of(fndef);
|
179
|
+
if (type == "type") return cont(pushlex("stat"), tydef, endstatement, poplex, block);
|
180
|
+
if (type == "enum") return stat_of(enumdef);
|
181
|
+
if (type == "mod") return stat_of(mod);
|
182
|
+
if (type == "iface") return stat_of(iface);
|
183
|
+
if (type == "impl") return stat_of(impl);
|
184
|
+
if (type == "open-attr") return cont(pushlex("]"), commasep(expression, "]"), poplex);
|
185
|
+
if (type == "ignore" || type.match(/[\]\);,]/)) return cont(block);
|
186
|
+
return pass(pushlex("stat"), expression, poplex, endstatement, block);
|
187
|
+
}
|
188
|
+
function endstatement(type) {
|
189
|
+
if (type == ";") return cont();
|
190
|
+
return pass();
|
191
|
+
}
|
192
|
+
function expression(type) {
|
193
|
+
if (type == "atom" || type == "name") return cont(maybeop);
|
194
|
+
if (type == "{") return cont(pushlex("}"), exprbrace, poplex);
|
195
|
+
if (type.match(/[\[\(]/)) return matchBrackets(type, expression);
|
196
|
+
if (type.match(/[\]\)\};,]/)) return pass();
|
197
|
+
if (type == "if-style") return cont(expression, expression);
|
198
|
+
if (type == "else-style" || type == "op") return cont(expression);
|
199
|
+
if (type == "for") return cont(pattern, maybetype, inop, expression, expression);
|
200
|
+
if (type == "alt") return cont(expression, altbody);
|
201
|
+
if (type == "fn") return cont(fndef);
|
202
|
+
if (type == "macro") return cont(macro);
|
203
|
+
return cont();
|
204
|
+
}
|
205
|
+
function maybeop(type) {
|
206
|
+
if (content == ".") return cont(maybeprop);
|
207
|
+
if (content == "::<"){return cont(typarams, maybeop);}
|
208
|
+
if (type == "op" || content == ":") return cont(expression);
|
209
|
+
if (type == "(" || type == "[") return matchBrackets(type, expression);
|
210
|
+
return pass();
|
211
|
+
}
|
212
|
+
function maybeprop(type) {
|
213
|
+
if (content.match(/^\w+$/)) {cx.marked = "variable"; return cont(maybeop);}
|
214
|
+
return pass(expression);
|
215
|
+
}
|
216
|
+
function exprbrace(type) {
|
217
|
+
if (type == "op") {
|
218
|
+
if (content == "|") return cont(blockvars, poplex, pushlex("}", "block"), block);
|
219
|
+
if (content == "||") return cont(poplex, pushlex("}", "block"), block);
|
220
|
+
}
|
221
|
+
if (content == "mutable" || (content.match(/^\w+$/) && cx.stream.peek() == ":"
|
222
|
+
&& !cx.stream.match("::", false)))
|
223
|
+
return pass(record_of(expression));
|
224
|
+
return pass(block);
|
225
|
+
}
|
226
|
+
function record_of(comb) {
|
227
|
+
function ro(type) {
|
228
|
+
if (content == "mutable" || content == "with") {cx.marked = "keyword"; return cont(ro);}
|
229
|
+
if (content.match(/^\w*$/)) {cx.marked = "variable"; return cont(ro);}
|
230
|
+
if (type == ":") return cont(comb, ro);
|
231
|
+
if (type == "}") return cont();
|
232
|
+
return cont(ro);
|
233
|
+
}
|
234
|
+
return ro;
|
235
|
+
}
|
236
|
+
function blockvars(type) {
|
237
|
+
if (type == "name") {cx.marked = "def"; return cont(blockvars);}
|
238
|
+
if (type == "op" && content == "|") return cont();
|
239
|
+
return cont(blockvars);
|
240
|
+
}
|
241
|
+
|
242
|
+
function letdef1(type) {
|
243
|
+
if (type.match(/[\]\)\};]/)) return cont();
|
244
|
+
if (content == "=") return cont(expression, letdef2);
|
245
|
+
if (type == ",") return cont(letdef1);
|
246
|
+
return pass(pattern, maybetype, letdef1);
|
247
|
+
}
|
248
|
+
function letdef2(type) {
|
249
|
+
if (type.match(/[\]\)\};,]/)) return pass(letdef1);
|
250
|
+
else return pass(expression, letdef2);
|
251
|
+
}
|
252
|
+
function maybetype(type) {
|
253
|
+
if (type == ":") return cont(typecx, rtype, valcx);
|
254
|
+
return pass();
|
255
|
+
}
|
256
|
+
function inop(type) {
|
257
|
+
if (type == "name" && content == "in") {cx.marked = "keyword"; return cont();}
|
258
|
+
return pass();
|
259
|
+
}
|
260
|
+
function fndef(type) {
|
261
|
+
if (content == "@" || content == "~") {cx.marked = "keyword"; return cont(fndef);}
|
262
|
+
if (type == "name") {cx.marked = "def"; return cont(fndef);}
|
263
|
+
if (content == "<") return cont(typarams, fndef);
|
264
|
+
if (type == "{") return pass(expression);
|
265
|
+
if (type == "(") return cont(pushlex(")"), commasep(argdef, ")"), poplex, fndef);
|
266
|
+
if (type == "->") return cont(typecx, rtype, valcx, fndef);
|
267
|
+
if (type == ";") return cont();
|
268
|
+
return cont(fndef);
|
269
|
+
}
|
270
|
+
function tydef(type) {
|
271
|
+
if (type == "name") {cx.marked = "def"; return cont(tydef);}
|
272
|
+
if (content == "<") return cont(typarams, tydef);
|
273
|
+
if (content == "=") return cont(typecx, rtype, valcx);
|
274
|
+
return cont(tydef);
|
275
|
+
}
|
276
|
+
function enumdef(type) {
|
277
|
+
if (type == "name") {cx.marked = "def"; return cont(enumdef);}
|
278
|
+
if (content == "<") return cont(typarams, enumdef);
|
279
|
+
if (content == "=") return cont(typecx, rtype, valcx, endstatement);
|
280
|
+
if (type == "{") return cont(pushlex("}"), typecx, enumblock, valcx, poplex);
|
281
|
+
return cont(enumdef);
|
282
|
+
}
|
283
|
+
function enumblock(type) {
|
284
|
+
if (type == "}") return cont();
|
285
|
+
if (type == "(") return cont(pushlex(")"), commasep(rtype, ")"), poplex, enumblock);
|
286
|
+
if (content.match(/^\w+$/)) cx.marked = "def";
|
287
|
+
return cont(enumblock);
|
288
|
+
}
|
289
|
+
function mod(type) {
|
290
|
+
if (type == "name") {cx.marked = "def"; return cont(mod);}
|
291
|
+
if (type == "{") return cont(pushlex("}"), block, poplex);
|
292
|
+
return pass();
|
293
|
+
}
|
294
|
+
function iface(type) {
|
295
|
+
if (type == "name") {cx.marked = "def"; return cont(iface);}
|
296
|
+
if (content == "<") return cont(typarams, iface);
|
297
|
+
if (type == "{") return cont(pushlex("}"), block, poplex);
|
298
|
+
return pass();
|
299
|
+
}
|
300
|
+
function impl(type) {
|
301
|
+
if (content == "<") return cont(typarams, impl);
|
302
|
+
if (content == "of" || content == "for") {cx.marked = "keyword"; return cont(rtype, impl);}
|
303
|
+
if (type == "name") {cx.marked = "def"; return cont(impl);}
|
304
|
+
if (type == "{") return cont(pushlex("}"), block, poplex);
|
305
|
+
return pass();
|
306
|
+
}
|
307
|
+
function typarams(type) {
|
308
|
+
if (content == ">") return cont();
|
309
|
+
if (content == ",") return cont(typarams);
|
310
|
+
if (content == ":") return cont(rtype, typarams);
|
311
|
+
return pass(rtype, typarams);
|
312
|
+
}
|
313
|
+
function argdef(type) {
|
314
|
+
if (type == "name") {cx.marked = "def"; return cont(argdef);}
|
315
|
+
if (type == ":") return cont(typecx, rtype, valcx);
|
316
|
+
return pass();
|
317
|
+
}
|
318
|
+
function rtype(type) {
|
319
|
+
if (type == "name") {cx.marked = "variable-3"; return cont(rtypemaybeparam); }
|
320
|
+
if (content == "mutable") {cx.marked = "keyword"; return cont(rtype);}
|
321
|
+
if (type == "atom") return cont(rtypemaybeparam);
|
322
|
+
if (type == "op" || type == "obj") return cont(rtype);
|
323
|
+
if (type == "fn") return cont(fntype);
|
324
|
+
if (type == "{") return cont(pushlex("{"), record_of(rtype), poplex);
|
325
|
+
return matchBrackets(type, rtype);
|
326
|
+
}
|
327
|
+
function rtypemaybeparam(type) {
|
328
|
+
if (content == "<") return cont(typarams);
|
329
|
+
return pass();
|
330
|
+
}
|
331
|
+
function fntype(type) {
|
332
|
+
if (type == "(") return cont(pushlex("("), commasep(rtype, ")"), poplex, fntype);
|
333
|
+
if (type == "->") return cont(rtype);
|
334
|
+
return pass();
|
335
|
+
}
|
336
|
+
function pattern(type) {
|
337
|
+
if (type == "name") {cx.marked = "def"; return cont(patternmaybeop);}
|
338
|
+
if (type == "atom") return cont(patternmaybeop);
|
339
|
+
if (type == "op") return cont(pattern);
|
340
|
+
if (type.match(/[\]\)\};,]/)) return pass();
|
341
|
+
return matchBrackets(type, pattern);
|
342
|
+
}
|
343
|
+
function patternmaybeop(type) {
|
344
|
+
if (type == "op" && content == ".") return cont();
|
345
|
+
if (content == "to") {cx.marked = "keyword"; return cont(pattern);}
|
346
|
+
else return pass();
|
347
|
+
}
|
348
|
+
function altbody(type) {
|
349
|
+
if (type == "{") return cont(pushlex("}", "alt"), altblock1, poplex);
|
350
|
+
return pass();
|
351
|
+
}
|
352
|
+
function altblock1(type) {
|
353
|
+
if (type == "}") return cont();
|
354
|
+
if (type == "|") return cont(altblock1);
|
355
|
+
if (content == "when") {cx.marked = "keyword"; return cont(expression, altblock2);}
|
356
|
+
if (type.match(/[\]\);,]/)) return cont(altblock1);
|
357
|
+
return pass(pattern, altblock2);
|
358
|
+
}
|
359
|
+
function altblock2(type) {
|
360
|
+
if (type == "{") return cont(pushlex("}", "alt"), block, poplex, altblock1);
|
361
|
+
else return pass(altblock1);
|
362
|
+
}
|
363
|
+
|
364
|
+
function macro(type) {
|
365
|
+
if (type.match(/[\[\(\{]/)) return matchBrackets(type, expression);
|
366
|
+
return pass();
|
367
|
+
}
|
368
|
+
function matchBrackets(type, comb) {
|
369
|
+
if (type == "[") return cont(pushlex("]"), commasep(comb, "]"), poplex);
|
370
|
+
if (type == "(") return cont(pushlex(")"), commasep(comb, ")"), poplex);
|
371
|
+
if (type == "{") return cont(pushlex("}"), commasep(comb, "}"), poplex);
|
372
|
+
return cont();
|
373
|
+
}
|
374
|
+
|
375
|
+
function parse(state, stream, style) {
|
376
|
+
var cc = state.cc;
|
377
|
+
// Communicate our context to the combinators.
|
378
|
+
// (Less wasteful than consing up a hundred closures on every call.)
|
379
|
+
cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc;
|
380
|
+
|
381
|
+
while (true) {
|
382
|
+
var combinator = cc.length ? cc.pop() : block;
|
383
|
+
if (combinator(tcat)) {
|
384
|
+
while(cc.length && cc[cc.length - 1].lex)
|
385
|
+
cc.pop()();
|
386
|
+
return cx.marked || style;
|
387
|
+
}
|
388
|
+
}
|
389
|
+
}
|
390
|
+
|
391
|
+
return {
|
392
|
+
startState: function() {
|
393
|
+
return {
|
394
|
+
tokenize: tokenBase,
|
395
|
+
cc: [],
|
396
|
+
lexical: {indented: -indentUnit, column: 0, type: "top", align: false},
|
397
|
+
keywords: valKeywords,
|
398
|
+
indented: 0
|
399
|
+
};
|
400
|
+
},
|
401
|
+
|
402
|
+
token: function(stream, state) {
|
403
|
+
if (stream.sol()) {
|
404
|
+
if (!state.lexical.hasOwnProperty("align"))
|
405
|
+
state.lexical.align = false;
|
406
|
+
state.indented = stream.indentation();
|
407
|
+
}
|
408
|
+
if (stream.eatSpace()) return null;
|
409
|
+
tcat = content = null;
|
410
|
+
var style = state.tokenize(stream, state);
|
411
|
+
if (style == "comment") return style;
|
412
|
+
if (!state.lexical.hasOwnProperty("align"))
|
413
|
+
state.lexical.align = true;
|
414
|
+
if (tcat == "prefix") return style;
|
415
|
+
if (!content) content = stream.current();
|
416
|
+
return parse(state, stream, style);
|
417
|
+
},
|
418
|
+
|
419
|
+
indent: function(state, textAfter) {
|
420
|
+
if (state.tokenize != tokenBase) return 0;
|
421
|
+
var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical,
|
422
|
+
type = lexical.type, closing = firstChar == type;
|
423
|
+
if (type == "stat") return lexical.indented + indentUnit;
|
424
|
+
if (lexical.align) return lexical.column + (closing ? 0 : 1);
|
425
|
+
return lexical.indented + (closing ? 0 : (lexical.info == "alt" ? altIndentUnit : indentUnit));
|
426
|
+
},
|
427
|
+
|
428
|
+
electricChars: "{}"
|
429
|
+
};
|
430
|
+
});
|
431
|
+
|
432
|
+
CodeMirror.defineMIME("text/x-rustsrc", "rust");
|