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,189 @@
|
|
1
|
+
CodeMirror.defineMode("delorean", 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
|
+
"if", "then", "else",
|
9
|
+
]);
|
10
|
+
var indentWords = wordObj([]);
|
11
|
+
var dedentWords = wordObj([]);
|
12
|
+
var matching = {"[": "]", "{": "}", "(": ")"};
|
13
|
+
var curPunc;
|
14
|
+
|
15
|
+
function chain(newtok, stream, state) {
|
16
|
+
state.tokenize.push(newtok);
|
17
|
+
return newtok(stream, state);
|
18
|
+
}
|
19
|
+
|
20
|
+
function tokenBase(stream, state) {
|
21
|
+
curPunc = null;
|
22
|
+
if (stream.sol() && stream.match("=begin") && stream.eol()) {
|
23
|
+
state.tokenize.push(readBlockComment);
|
24
|
+
return "comment";
|
25
|
+
}
|
26
|
+
if (stream.eatSpace()) return null;
|
27
|
+
var ch = stream.next(), m;
|
28
|
+
if (ch == "`" || ch == "'" || ch == '"' ||
|
29
|
+
(ch == "/" && !stream.eol() && stream.peek() != " ")) {
|
30
|
+
return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state);
|
31
|
+
} else if (ch == "%") {
|
32
|
+
var style, embed = false;
|
33
|
+
if (stream.eat("s")) style = "atom";
|
34
|
+
else if (stream.eat(/[WQ]/)) { style = "string"; embed = true; }
|
35
|
+
else if (stream.eat(/[wxqr]/)) style = "string";
|
36
|
+
var delim = stream.eat(/[^\w\s]/);
|
37
|
+
if (!delim) return "operator";
|
38
|
+
if (matching.propertyIsEnumerable(delim)) delim = matching[delim];
|
39
|
+
return chain(readQuoted(delim, style, embed, true), stream, state);
|
40
|
+
} else if (ch == "#") {
|
41
|
+
stream.skipToEnd();
|
42
|
+
return "comment";
|
43
|
+
} else if (ch == "<" && (m = stream.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/))) {
|
44
|
+
return chain(readHereDoc(m[1]), stream, state);
|
45
|
+
} else if (ch == "0") {
|
46
|
+
if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/);
|
47
|
+
else if (stream.eat("b")) stream.eatWhile(/[01]/);
|
48
|
+
else stream.eatWhile(/[0-7]/);
|
49
|
+
return "number";
|
50
|
+
} else if (/\d/.test(ch)) {
|
51
|
+
stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/);
|
52
|
+
return "number";
|
53
|
+
} else if (ch == "?") {
|
54
|
+
while (stream.match(/^\\[CM]-/)) {}
|
55
|
+
if (stream.eat("\\")) stream.eatWhile(/\w/);
|
56
|
+
else stream.next();
|
57
|
+
return "string";
|
58
|
+
} else if (ch == ":") {
|
59
|
+
if (stream.eat("'")) return chain(readQuoted("'", "atom", false), stream, state);
|
60
|
+
if (stream.eat('"')) return chain(readQuoted('"', "atom", true), stream, state);
|
61
|
+
stream.eatWhile(/[\w\?]/);
|
62
|
+
return "atom";
|
63
|
+
} else if (ch == "@") {
|
64
|
+
stream.eat("@");
|
65
|
+
stream.eatWhile(/[\w\?]/);
|
66
|
+
return "variable-2";
|
67
|
+
} else if (ch == "$") {
|
68
|
+
stream.next();
|
69
|
+
stream.eatWhile(/[\w\?]/);
|
70
|
+
return "variable-3";
|
71
|
+
} else if (/\w/.test(ch)) {
|
72
|
+
stream.eatWhile(/[\w\?]/);
|
73
|
+
if (stream.eat(":")) return "atom";
|
74
|
+
return "ident";
|
75
|
+
} else if (ch == "|" && (state.varList || state.lastTok == "{" || state.lastTok == "do")) {
|
76
|
+
curPunc = "|";
|
77
|
+
return null;
|
78
|
+
} else if (/[\(\)\[\]{}\\;]/.test(ch)) {
|
79
|
+
curPunc = ch;
|
80
|
+
return null;
|
81
|
+
} else if (ch == "-" && stream.eat(">")) {
|
82
|
+
return "arrow";
|
83
|
+
} else if (/[=+\-\/*:\.^%<>~|]/.test(ch)) {
|
84
|
+
stream.eatWhile(/[=+\-\/*:\.^%<>~|]/);
|
85
|
+
return "operator";
|
86
|
+
} else {
|
87
|
+
return null;
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
function tokenBaseUntilBrace() {
|
92
|
+
var depth = 1;
|
93
|
+
return function(stream, state) {
|
94
|
+
if (stream.peek() == "}") {
|
95
|
+
depth--;
|
96
|
+
if (depth == 0) {
|
97
|
+
state.tokenize.pop();
|
98
|
+
return state.tokenize[state.tokenize.length-1](stream, state);
|
99
|
+
}
|
100
|
+
} else if (stream.peek() == "{") {
|
101
|
+
depth++;
|
102
|
+
}
|
103
|
+
return tokenBase(stream, state);
|
104
|
+
};
|
105
|
+
}
|
106
|
+
function readQuoted(quote, style, embed, unescaped) {
|
107
|
+
return function(stream, state) {
|
108
|
+
var escaped = false, ch;
|
109
|
+
while ((ch = stream.next()) != null) {
|
110
|
+
if (ch == quote && (unescaped || !escaped)) {
|
111
|
+
state.tokenize.pop();
|
112
|
+
break;
|
113
|
+
}
|
114
|
+
if (embed && ch == "#" && !escaped && stream.eat("{")) {
|
115
|
+
state.tokenize.push(tokenBaseUntilBrace(arguments.callee));
|
116
|
+
break;
|
117
|
+
}
|
118
|
+
escaped = !escaped && ch == "\\";
|
119
|
+
}
|
120
|
+
return style;
|
121
|
+
};
|
122
|
+
}
|
123
|
+
function readHereDoc(phrase) {
|
124
|
+
return function(stream, state) {
|
125
|
+
if (stream.match(phrase)) state.tokenize.pop();
|
126
|
+
else stream.skipToEnd();
|
127
|
+
return "string";
|
128
|
+
};
|
129
|
+
}
|
130
|
+
function readBlockComment(stream, state) {
|
131
|
+
if (stream.sol() && stream.match("=end") && stream.eol())
|
132
|
+
state.tokenize.pop();
|
133
|
+
stream.skipToEnd();
|
134
|
+
return "comment";
|
135
|
+
}
|
136
|
+
|
137
|
+
return {
|
138
|
+
startState: function() {
|
139
|
+
return {tokenize: [tokenBase],
|
140
|
+
indented: 0,
|
141
|
+
context: {type: "top", indented: -config.indentUnit},
|
142
|
+
continuedLine: false,
|
143
|
+
lastTok: null,
|
144
|
+
varList: false};
|
145
|
+
},
|
146
|
+
|
147
|
+
token: function(stream, state) {
|
148
|
+
if (stream.sol()) state.indented = stream.indentation();
|
149
|
+
var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype;
|
150
|
+
if (style == "ident") {
|
151
|
+
var word = stream.current();
|
152
|
+
style = keywords.propertyIsEnumerable(stream.current()) ? "keyword"
|
153
|
+
: /^[A-Z]/.test(word) ? "tag"
|
154
|
+
: (state.lastTok == "def" || state.lastTok == "class" || state.varList) ? "def"
|
155
|
+
: "variable";
|
156
|
+
if (indentWords.propertyIsEnumerable(word)) kwtype = "indent";
|
157
|
+
else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent";
|
158
|
+
else if ((word == "if" || word == "unless") && stream.column() == stream.indentation())
|
159
|
+
kwtype = "indent";
|
160
|
+
}
|
161
|
+
if (curPunc || (style && style != "comment")) state.lastTok = word || curPunc || style;
|
162
|
+
if (curPunc == "|") state.varList = !state.varList;
|
163
|
+
|
164
|
+
if (kwtype == "indent" || /[\(\[\{]/.test(curPunc))
|
165
|
+
state.context = {prev: state.context, type: curPunc || style, indented: state.indented};
|
166
|
+
else if ((kwtype == "dedent" || /[\)\]\}]/.test(curPunc)) && state.context.prev)
|
167
|
+
state.context = state.context.prev;
|
168
|
+
|
169
|
+
if (stream.eol())
|
170
|
+
state.continuedLine = (curPunc == "\\" || style == "operator");
|
171
|
+
return style;
|
172
|
+
},
|
173
|
+
|
174
|
+
indent: function(state, textAfter) {
|
175
|
+
if (state.tokenize[state.tokenize.length-1] != tokenBase) return 0;
|
176
|
+
var firstChar = textAfter && textAfter.charAt(0);
|
177
|
+
var ct = state.context;
|
178
|
+
var closing = ct.type == matching[firstChar] ||
|
179
|
+
ct.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(textAfter);
|
180
|
+
return ct.indented + (closing ? 0 : config.indentUnit) +
|
181
|
+
(state.continuedLine ? config.indentUnit : 0);
|
182
|
+
},
|
183
|
+
electricChars: ""
|
184
|
+
|
185
|
+
};
|
186
|
+
});
|
187
|
+
|
188
|
+
CodeMirror.defineMIME("text/x-delorean", "delorean");
|
189
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
CodeMirror.defineMode("diff", function() {
|
2
|
+
|
3
|
+
var TOKEN_NAMES = {
|
4
|
+
'+': 'tag',
|
5
|
+
'-': 'string',
|
6
|
+
'@': 'meta'
|
7
|
+
};
|
8
|
+
|
9
|
+
return {
|
10
|
+
token: function(stream) {
|
11
|
+
var tw_pos = stream.string.search(/[\t ]+?$/);
|
12
|
+
|
13
|
+
if (!stream.sol() || tw_pos === 0) {
|
14
|
+
stream.skipToEnd();
|
15
|
+
return ("error " + (
|
16
|
+
TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, '');
|
17
|
+
}
|
18
|
+
|
19
|
+
var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd();
|
20
|
+
|
21
|
+
if (tw_pos === -1) {
|
22
|
+
stream.skipToEnd();
|
23
|
+
} else {
|
24
|
+
stream.pos = tw_pos;
|
25
|
+
}
|
26
|
+
|
27
|
+
return token_name;
|
28
|
+
}
|
29
|
+
};
|
30
|
+
});
|
31
|
+
|
32
|
+
CodeMirror.defineMIME("text/x-diff", "diff");
|
@@ -0,0 +1,105 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>CodeMirror: Diff mode</title>
|
6
|
+
<link rel="stylesheet" href="../../lib/codemirror.css">
|
7
|
+
<script src="../../lib/codemirror.js"></script>
|
8
|
+
<script src="diff.js"></script>
|
9
|
+
<style>
|
10
|
+
.CodeMirror {border-top: 1px solid #ddd; border-bottom: 1px solid #ddd;}
|
11
|
+
span.cm-meta {color: #a0b !important;}
|
12
|
+
span.cm-error { background-color: black; opacity: 0.4;}
|
13
|
+
span.cm-error.cm-string { background-color: red; }
|
14
|
+
span.cm-error.cm-tag { background-color: #2b2; }
|
15
|
+
</style>
|
16
|
+
<link rel="stylesheet" href="../../doc/docs.css">
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
<h1>CodeMirror: Diff mode</h1>
|
20
|
+
<form><textarea id="code" name="code">
|
21
|
+
diff --git a/index.html b/index.html
|
22
|
+
index c1d9156..7764744 100644
|
23
|
+
--- a/index.html
|
24
|
+
+++ b/index.html
|
25
|
+
@@ -95,7 +95,8 @@ StringStream.prototype = {
|
26
|
+
<script>
|
27
|
+
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
28
|
+
lineNumbers: true,
|
29
|
+
- autoMatchBrackets: true
|
30
|
+
+ autoMatchBrackets: true,
|
31
|
+
+ onGutterClick: function(x){console.log(x);}
|
32
|
+
});
|
33
|
+
</script>
|
34
|
+
</body>
|
35
|
+
diff --git a/lib/codemirror.js b/lib/codemirror.js
|
36
|
+
index 04646a9..9a39cc7 100644
|
37
|
+
--- a/lib/codemirror.js
|
38
|
+
+++ b/lib/codemirror.js
|
39
|
+
@@ -399,10 +399,16 @@ var CodeMirror = (function() {
|
40
|
+
}
|
41
|
+
|
42
|
+
function onMouseDown(e) {
|
43
|
+
- var start = posFromMouse(e), last = start;
|
44
|
+
+ var start = posFromMouse(e), last = start, target = e.target();
|
45
|
+
if (!start) return;
|
46
|
+
setCursor(start.line, start.ch, false);
|
47
|
+
if (e.button() != 1) return;
|
48
|
+
+ if (target.parentNode == gutter) {
|
49
|
+
+ if (options.onGutterClick)
|
50
|
+
+ options.onGutterClick(indexOf(gutter.childNodes, target) + showingFrom);
|
51
|
+
+ return;
|
52
|
+
+ }
|
53
|
+
+
|
54
|
+
if (!focused) onFocus();
|
55
|
+
|
56
|
+
e.stop();
|
57
|
+
@@ -808,7 +814,7 @@ var CodeMirror = (function() {
|
58
|
+
for (var i = showingFrom; i < showingTo; ++i) {
|
59
|
+
var marker = lines[i].gutterMarker;
|
60
|
+
if (marker) html.push('<div class="' + marker.style + '">' + htmlEscape(marker.text) + '</div>');
|
61
|
+
- else html.push("<div>" + (options.lineNumbers ? i + 1 : "\u00a0") + "</div>");
|
62
|
+
+ else html.push("<div>" + (options.lineNumbers ? i + options.firstLineNumber : "\u00a0") + "</div>");
|
63
|
+
}
|
64
|
+
gutter.style.display = "none"; // TODO test whether this actually helps
|
65
|
+
gutter.innerHTML = html.join("");
|
66
|
+
@@ -1371,10 +1377,8 @@ var CodeMirror = (function() {
|
67
|
+
if (option == "parser") setParser(value);
|
68
|
+
else if (option === "lineNumbers") setLineNumbers(value);
|
69
|
+
else if (option === "gutter") setGutter(value);
|
70
|
+
- else if (option === "readOnly") options.readOnly = value;
|
71
|
+
- else if (option === "indentUnit") {options.indentUnit = indentUnit = value; setParser(options.parser);}
|
72
|
+
- else if (/^(?:enterMode|tabMode|indentWithTabs|readOnly|autoMatchBrackets|undoDepth)$/.test(option)) options[option] = value;
|
73
|
+
- else throw new Error("Can't set option " + option);
|
74
|
+
+ else if (option === "indentUnit") {options.indentUnit = value; setParser(options.parser);}
|
75
|
+
+ else options[option] = value;
|
76
|
+
},
|
77
|
+
cursorCoords: cursorCoords,
|
78
|
+
undo: operation(undo),
|
79
|
+
@@ -1402,7 +1406,8 @@ var CodeMirror = (function() {
|
80
|
+
replaceRange: operation(replaceRange),
|
81
|
+
|
82
|
+
operation: function(f){return operation(f)();},
|
83
|
+
- refresh: function(){updateDisplay([{from: 0, to: lines.length}]);}
|
84
|
+
+ refresh: function(){updateDisplay([{from: 0, to: lines.length}]);},
|
85
|
+
+ getInputField: function(){return input;}
|
86
|
+
};
|
87
|
+
return instance;
|
88
|
+
}
|
89
|
+
@@ -1420,6 +1425,7 @@ var CodeMirror = (function() {
|
90
|
+
readOnly: false,
|
91
|
+
onChange: null,
|
92
|
+
onCursorActivity: null,
|
93
|
+
+ onGutterClick: null,
|
94
|
+
autoMatchBrackets: false,
|
95
|
+
workTime: 200,
|
96
|
+
workDelay: 300,
|
97
|
+
</textarea></form>
|
98
|
+
<script>
|
99
|
+
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
|
100
|
+
</script>
|
101
|
+
|
102
|
+
<p><strong>MIME types defined:</strong> <code>text/x-diff</code>.</p>
|
103
|
+
|
104
|
+
</body>
|
105
|
+
</html>
|
@@ -0,0 +1,203 @@
|
|
1
|
+
CodeMirror.defineMode("ecl", function(config) {
|
2
|
+
|
3
|
+
function words(str) {
|
4
|
+
var obj = {}, words = str.split(" ");
|
5
|
+
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
6
|
+
return obj;
|
7
|
+
}
|
8
|
+
|
9
|
+
function metaHook(stream, state) {
|
10
|
+
if (!state.startOfLine) return false;
|
11
|
+
stream.skipToEnd();
|
12
|
+
return "meta";
|
13
|
+
}
|
14
|
+
|
15
|
+
function tokenAtString(stream, state) {
|
16
|
+
var next;
|
17
|
+
while ((next = stream.next()) != null) {
|
18
|
+
if (next == '"' && !stream.eat('"')) {
|
19
|
+
state.tokenize = null;
|
20
|
+
break;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
return "string";
|
24
|
+
}
|
25
|
+
|
26
|
+
var indentUnit = config.indentUnit;
|
27
|
+
var keyword = words("abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode");
|
28
|
+
var variable = words("apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait");
|
29
|
+
var variable_2 = words("__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath");
|
30
|
+
var variable_3 = words("ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode");
|
31
|
+
var builtin = words("checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when");
|
32
|
+
var blockKeywords = words("catch class do else finally for if switch try while");
|
33
|
+
var atoms = words("true false null");
|
34
|
+
var hooks = {"#": metaHook};
|
35
|
+
var multiLineStrings;
|
36
|
+
var isOperatorChar = /[+\-*&%=<>!?|\/]/;
|
37
|
+
|
38
|
+
var curPunc;
|
39
|
+
|
40
|
+
function tokenBase(stream, state) {
|
41
|
+
var ch = stream.next();
|
42
|
+
if (hooks[ch]) {
|
43
|
+
var result = hooks[ch](stream, state);
|
44
|
+
if (result !== false) return result;
|
45
|
+
}
|
46
|
+
if (ch == '"' || ch == "'") {
|
47
|
+
state.tokenize = tokenString(ch);
|
48
|
+
return state.tokenize(stream, state);
|
49
|
+
}
|
50
|
+
if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
|
51
|
+
curPunc = ch;
|
52
|
+
return null;
|
53
|
+
}
|
54
|
+
if (/\d/.test(ch)) {
|
55
|
+
stream.eatWhile(/[\w\.]/);
|
56
|
+
return "number";
|
57
|
+
}
|
58
|
+
if (ch == "/") {
|
59
|
+
if (stream.eat("*")) {
|
60
|
+
state.tokenize = tokenComment;
|
61
|
+
return tokenComment(stream, state);
|
62
|
+
}
|
63
|
+
if (stream.eat("/")) {
|
64
|
+
stream.skipToEnd();
|
65
|
+
return "comment";
|
66
|
+
}
|
67
|
+
}
|
68
|
+
if (isOperatorChar.test(ch)) {
|
69
|
+
stream.eatWhile(isOperatorChar);
|
70
|
+
return "operator";
|
71
|
+
}
|
72
|
+
stream.eatWhile(/[\w\$_]/);
|
73
|
+
var cur = stream.current().toLowerCase();
|
74
|
+
if (keyword.propertyIsEnumerable(cur)) {
|
75
|
+
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
|
76
|
+
return "keyword";
|
77
|
+
} else if (variable.propertyIsEnumerable(cur)) {
|
78
|
+
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
|
79
|
+
return "variable";
|
80
|
+
} else if (variable_2.propertyIsEnumerable(cur)) {
|
81
|
+
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
|
82
|
+
return "variable-2";
|
83
|
+
} else if (variable_3.propertyIsEnumerable(cur)) {
|
84
|
+
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
|
85
|
+
return "variable-3";
|
86
|
+
} else if (builtin.propertyIsEnumerable(cur)) {
|
87
|
+
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
|
88
|
+
return "builtin";
|
89
|
+
} else { //Data types are of from KEYWORD##
|
90
|
+
var i = cur.length - 1;
|
91
|
+
while(i >= 0 && (!isNaN(cur[i]) || cur[i] == '_'))
|
92
|
+
--i;
|
93
|
+
|
94
|
+
if (i > 0) {
|
95
|
+
var cur2 = cur.substr(0, i + 1);
|
96
|
+
if (variable_3.propertyIsEnumerable(cur2)) {
|
97
|
+
if (blockKeywords.propertyIsEnumerable(cur2)) curPunc = "newstatement";
|
98
|
+
return "variable-3";
|
99
|
+
}
|
100
|
+
}
|
101
|
+
}
|
102
|
+
if (atoms.propertyIsEnumerable(cur)) return "atom";
|
103
|
+
return null;
|
104
|
+
}
|
105
|
+
|
106
|
+
function tokenString(quote) {
|
107
|
+
return function(stream, state) {
|
108
|
+
var escaped = false, next, end = false;
|
109
|
+
while ((next = stream.next()) != null) {
|
110
|
+
if (next == quote && !escaped) {end = true; break;}
|
111
|
+
escaped = !escaped && next == "\\";
|
112
|
+
}
|
113
|
+
if (end || !(escaped || multiLineStrings))
|
114
|
+
state.tokenize = tokenBase;
|
115
|
+
return "string";
|
116
|
+
};
|
117
|
+
}
|
118
|
+
|
119
|
+
function tokenComment(stream, state) {
|
120
|
+
var maybeEnd = false, ch;
|
121
|
+
while (ch = stream.next()) {
|
122
|
+
if (ch == "/" && maybeEnd) {
|
123
|
+
state.tokenize = tokenBase;
|
124
|
+
break;
|
125
|
+
}
|
126
|
+
maybeEnd = (ch == "*");
|
127
|
+
}
|
128
|
+
return "comment";
|
129
|
+
}
|
130
|
+
|
131
|
+
function Context(indented, column, type, align, prev) {
|
132
|
+
this.indented = indented;
|
133
|
+
this.column = column;
|
134
|
+
this.type = type;
|
135
|
+
this.align = align;
|
136
|
+
this.prev = prev;
|
137
|
+
}
|
138
|
+
function pushContext(state, col, type) {
|
139
|
+
return state.context = new Context(state.indented, col, type, null, state.context);
|
140
|
+
}
|
141
|
+
function popContext(state) {
|
142
|
+
var t = state.context.type;
|
143
|
+
if (t == ")" || t == "]" || t == "}")
|
144
|
+
state.indented = state.context.indented;
|
145
|
+
return state.context = state.context.prev;
|
146
|
+
}
|
147
|
+
|
148
|
+
// Interface
|
149
|
+
|
150
|
+
return {
|
151
|
+
startState: function(basecolumn) {
|
152
|
+
return {
|
153
|
+
tokenize: null,
|
154
|
+
context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
|
155
|
+
indented: 0,
|
156
|
+
startOfLine: true
|
157
|
+
};
|
158
|
+
},
|
159
|
+
|
160
|
+
token: function(stream, state) {
|
161
|
+
var ctx = state.context;
|
162
|
+
if (stream.sol()) {
|
163
|
+
if (ctx.align == null) ctx.align = false;
|
164
|
+
state.indented = stream.indentation();
|
165
|
+
state.startOfLine = true;
|
166
|
+
}
|
167
|
+
if (stream.eatSpace()) return null;
|
168
|
+
curPunc = null;
|
169
|
+
var style = (state.tokenize || tokenBase)(stream, state);
|
170
|
+
if (style == "comment" || style == "meta") return style;
|
171
|
+
if (ctx.align == null) ctx.align = true;
|
172
|
+
|
173
|
+
if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state);
|
174
|
+
else if (curPunc == "{") pushContext(state, stream.column(), "}");
|
175
|
+
else if (curPunc == "[") pushContext(state, stream.column(), "]");
|
176
|
+
else if (curPunc == "(") pushContext(state, stream.column(), ")");
|
177
|
+
else if (curPunc == "}") {
|
178
|
+
while (ctx.type == "statement") ctx = popContext(state);
|
179
|
+
if (ctx.type == "}") ctx = popContext(state);
|
180
|
+
while (ctx.type == "statement") ctx = popContext(state);
|
181
|
+
}
|
182
|
+
else if (curPunc == ctx.type) popContext(state);
|
183
|
+
else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement"))
|
184
|
+
pushContext(state, stream.column(), "statement");
|
185
|
+
state.startOfLine = false;
|
186
|
+
return style;
|
187
|
+
},
|
188
|
+
|
189
|
+
indent: function(state, textAfter) {
|
190
|
+
if (state.tokenize != tokenBase && state.tokenize != null) return 0;
|
191
|
+
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
|
192
|
+
if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
|
193
|
+
var closing = firstChar == ctx.type;
|
194
|
+
if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit);
|
195
|
+
else if (ctx.align) return ctx.column + (closing ? 0 : 1);
|
196
|
+
else return ctx.indented + (closing ? 0 : indentUnit);
|
197
|
+
},
|
198
|
+
|
199
|
+
electricChars: "{}"
|
200
|
+
};
|
201
|
+
});
|
202
|
+
|
203
|
+
CodeMirror.defineMIME("text/x-ecl", "ecl");
|