poly-cms 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/Gemfile +27 -0
- data/Gemfile.lock +95 -0
- data/README.md +3 -0
- data/Rakefile +45 -0
- data/bin/poly +88 -0
- data/config.ru +3 -0
- data/core/admin/assets/images/icons/cache-clear.svg +11 -0
- data/core/admin/assets/images/icons/delete-dark.svg +10 -0
- data/core/admin/assets/images/icons/delete.svg +10 -0
- data/core/admin/assets/images/icons/handle.svg +12 -0
- data/core/admin/assets/images/icons/logout.svg +13 -0
- data/core/admin/assets/images/icons/move.svg +10 -0
- data/core/admin/assets/images/icons/new.svg +9 -0
- data/core/admin/assets/images/icons/prompt.svg +11 -0
- data/core/admin/assets/images/icons/refresh.svg +40 -0
- data/core/admin/assets/images/icons/save.svg +7 -0
- data/core/admin/assets/images/poly-small-boxed.svg +51 -0
- data/core/admin/assets/images/poly-small.svg +52 -0
- data/core/admin/assets/images/poly.svg +36 -0
- data/core/admin/assets/js/app/file-ext.js +15 -0
- data/core/admin/assets/js/app/views/editor.js +300 -0
- data/core/admin/assets/js/app/views/git.js +65 -0
- data/core/admin/assets/js/app/views/main.js +59 -0
- data/core/admin/assets/js/main.js +44 -0
- data/core/admin/assets/js/routes.js +25 -0
- data/core/admin/assets/js/vendor/backbone.js +4 -0
- data/core/admin/assets/js/vendor/codemirror/.gitattributes +8 -0
- data/core/admin/assets/js/vendor/codemirror/.gitignore +6 -0
- data/core/admin/assets/js/vendor/codemirror/.travis.yml +3 -0
- data/core/admin/assets/js/vendor/codemirror/addon/comment/comment.js +145 -0
- data/core/admin/assets/js/vendor/codemirror/addon/comment/continuecomment.js +54 -0
- data/core/admin/assets/js/vendor/codemirror/addon/dialog/dialog.css +32 -0
- data/core/admin/assets/js/vendor/codemirror/addon/dialog/dialog.js +80 -0
- data/core/admin/assets/js/vendor/codemirror/addon/display/fullscreen.css +6 -0
- data/core/admin/assets/js/vendor/codemirror/addon/display/fullscreen.js +30 -0
- data/core/admin/assets/js/vendor/codemirror/addon/display/placeholder.js +54 -0
- data/core/admin/assets/js/vendor/codemirror/addon/edit/closebrackets.js +82 -0
- data/core/admin/assets/js/vendor/codemirror/addon/edit/closetag.js +87 -0
- data/core/admin/assets/js/vendor/codemirror/addon/edit/continuelist.js +25 -0
- data/core/admin/assets/js/vendor/codemirror/addon/edit/matchbrackets.js +86 -0
- data/core/admin/assets/js/vendor/codemirror/addon/edit/matchtags.js +56 -0
- data/core/admin/assets/js/vendor/codemirror/addon/edit/trailingspace.js +15 -0
- data/core/admin/assets/js/vendor/codemirror/addon/fold/brace-fold.js +93 -0
- data/core/admin/assets/js/vendor/codemirror/addon/fold/comment-fold.js +40 -0
- data/core/admin/assets/js/vendor/codemirror/addon/fold/foldcode.js +75 -0
- data/core/admin/assets/js/vendor/codemirror/addon/fold/foldgutter.css +21 -0
- data/core/admin/assets/js/vendor/codemirror/addon/fold/foldgutter.js +124 -0
- data/core/admin/assets/js/vendor/codemirror/addon/fold/indent-fold.js +26 -0
- data/core/admin/assets/js/vendor/codemirror/addon/fold/xml-fold.js +167 -0
- data/core/admin/assets/js/vendor/codemirror/addon/hint/anyword-hint.js +34 -0
- data/core/admin/assets/js/vendor/codemirror/addon/hint/css-hint.js +50 -0
- data/core/admin/assets/js/vendor/codemirror/addon/hint/html-hint.js +337 -0
- data/core/admin/assets/js/vendor/codemirror/addon/hint/javascript-hint.js +130 -0
- data/core/admin/assets/js/vendor/codemirror/addon/hint/pig-hint.js +121 -0
- data/core/admin/assets/js/vendor/codemirror/addon/hint/python-hint.js +95 -0
- data/core/admin/assets/js/vendor/codemirror/addon/hint/show-hint.css +38 -0
- data/core/admin/assets/js/vendor/codemirror/addon/hint/show-hint.js +274 -0
- data/core/admin/assets/js/vendor/codemirror/addon/hint/sql-hint.js +105 -0
- data/core/admin/assets/js/vendor/codemirror/addon/hint/xml-hint.js +69 -0
- data/core/admin/assets/js/vendor/codemirror/addon/lint/coffeescript-lint.js +27 -0
- data/core/admin/assets/js/vendor/codemirror/addon/lint/css-lint.js +19 -0
- data/core/admin/assets/js/vendor/codemirror/addon/lint/javascript-lint.js +126 -0
- data/core/admin/assets/js/vendor/codemirror/addon/lint/json-lint.js +17 -0
- data/core/admin/assets/js/vendor/codemirror/addon/lint/lint.css +73 -0
- data/core/admin/assets/js/vendor/codemirror/addon/lint/lint.js +203 -0
- data/core/admin/assets/js/vendor/codemirror/addon/merge/dep/diff_match_patch.js +50 -0
- data/core/admin/assets/js/vendor/codemirror/addon/merge/merge.css +92 -0
- data/core/admin/assets/js/vendor/codemirror/addon/merge/merge.js +474 -0
- data/core/admin/assets/js/vendor/codemirror/addon/mode/loadmode.js +51 -0
- data/core/admin/assets/js/vendor/codemirror/addon/mode/multiplex.js +101 -0
- data/core/admin/assets/js/vendor/codemirror/addon/mode/multiplex_test.js +30 -0
- data/core/admin/assets/js/vendor/codemirror/addon/mode/overlay.js +59 -0
- data/core/admin/assets/js/vendor/codemirror/addon/runmode/colorize.js +29 -0
- data/core/admin/assets/js/vendor/codemirror/addon/runmode/runmode-standalone.js +136 -0
- data/core/admin/assets/js/vendor/codemirror/addon/runmode/runmode.js +56 -0
- data/core/admin/assets/js/vendor/codemirror/addon/runmode/runmode.node.js +103 -0
- data/core/admin/assets/js/vendor/codemirror/addon/scroll/scrollpastend.js +34 -0
- data/core/admin/assets/js/vendor/codemirror/addon/search/match-highlighter.js +91 -0
- data/core/admin/assets/js/vendor/codemirror/addon/search/search.js +133 -0
- data/core/admin/assets/js/vendor/codemirror/addon/search/searchcursor.js +143 -0
- data/core/admin/assets/js/vendor/codemirror/addon/selection/active-line.js +39 -0
- data/core/admin/assets/js/vendor/codemirror/addon/selection/mark-selection.js +108 -0
- data/core/admin/assets/js/vendor/codemirror/addon/tern/tern.css +85 -0
- data/core/admin/assets/js/vendor/codemirror/addon/tern/tern.js +632 -0
- data/core/admin/assets/js/vendor/codemirror/addon/tern/worker.js +41 -0
- data/core/admin/assets/js/vendor/codemirror/addon/wrap/hardwrap.js +99 -0
- data/core/admin/assets/js/vendor/codemirror/bin/authors.sh +6 -0
- data/core/admin/assets/js/vendor/codemirror/bin/compress +92 -0
- data/core/admin/assets/js/vendor/codemirror/bin/lint +16 -0
- data/core/admin/assets/js/vendor/codemirror/bin/source-highlight +61 -0
- data/core/admin/assets/js/vendor/codemirror/bower.json +15 -0
- data/core/admin/assets/js/vendor/codemirror/demo/activeline.html +78 -0
- data/core/admin/assets/js/vendor/codemirror/demo/anywordhint.html +79 -0
- data/core/admin/assets/js/vendor/codemirror/demo/bidi.html +74 -0
- data/core/admin/assets/js/vendor/codemirror/demo/btree.html +86 -0
- data/core/admin/assets/js/vendor/codemirror/demo/buffers.html +109 -0
- data/core/admin/assets/js/vendor/codemirror/demo/changemode.html +59 -0
- data/core/admin/assets/js/vendor/codemirror/demo/closebrackets.html +63 -0
- data/core/admin/assets/js/vendor/codemirror/demo/closetag.html +40 -0
- data/core/admin/assets/js/vendor/codemirror/demo/complete.html +80 -0
- data/core/admin/assets/js/vendor/codemirror/demo/emacs.html +75 -0
- data/core/admin/assets/js/vendor/codemirror/demo/folding.html +75 -0
- data/core/admin/assets/js/vendor/codemirror/demo/fullscreen.html +130 -0
- data/core/admin/assets/js/vendor/codemirror/demo/hardwrap.html +69 -0
- data/core/admin/assets/js/vendor/codemirror/demo/html5complete.html +54 -0
- data/core/admin/assets/js/vendor/codemirror/demo/indentwrap.html +58 -0
- data/core/admin/assets/js/vendor/codemirror/demo/lint.html +171 -0
- data/core/admin/assets/js/vendor/codemirror/demo/loadmode.html +49 -0
- data/core/admin/assets/js/vendor/codemirror/demo/marker.html +52 -0
- data/core/admin/assets/js/vendor/codemirror/demo/markselection.html +45 -0
- data/core/admin/assets/js/vendor/codemirror/demo/matchhighlighter.html +47 -0
- data/core/admin/assets/js/vendor/codemirror/demo/matchtags.html +49 -0
- data/core/admin/assets/js/vendor/codemirror/demo/merge.html +82 -0
- data/core/admin/assets/js/vendor/codemirror/demo/multiplex.html +75 -0
- data/core/admin/assets/js/vendor/codemirror/demo/mustache.html +68 -0
- data/core/admin/assets/js/vendor/codemirror/demo/placeholder.html +45 -0
- data/core/admin/assets/js/vendor/codemirror/demo/preview.html +88 -0
- data/core/admin/assets/js/vendor/codemirror/demo/resize.html +58 -0
- data/core/admin/assets/js/vendor/codemirror/demo/runmode.html +62 -0
- data/core/admin/assets/js/vendor/codemirror/demo/search.html +94 -0
- data/core/admin/assets/js/vendor/codemirror/demo/spanaffectswrapping_shim.html +85 -0
- data/core/admin/assets/js/vendor/codemirror/demo/tern.html +128 -0
- data/core/admin/assets/js/vendor/codemirror/demo/theme.html +121 -0
- data/core/admin/assets/js/vendor/codemirror/demo/trailingspace.html +48 -0
- data/core/admin/assets/js/vendor/codemirror/demo/variableheight.html +61 -0
- data/core/admin/assets/js/vendor/codemirror/demo/vim.html +74 -0
- data/core/admin/assets/js/vendor/codemirror/demo/visibletabs.html +62 -0
- data/core/admin/assets/js/vendor/codemirror/demo/widget.html +85 -0
- data/core/admin/assets/js/vendor/codemirror/demo/xmlcomplete.html +116 -0
- data/core/admin/assets/js/vendor/codemirror/doc/activebookmark.js +42 -0
- data/core/admin/assets/js/vendor/codemirror/doc/compress.html +231 -0
- data/core/admin/assets/js/vendor/codemirror/doc/docs.css +226 -0
- data/core/admin/assets/js/vendor/codemirror/doc/internals.html +503 -0
- data/core/admin/assets/js/vendor/codemirror/doc/logo.png +0 -0
- data/core/admin/assets/js/vendor/codemirror/doc/logo.svg +147 -0
- data/core/admin/assets/js/vendor/codemirror/doc/manual.html +2512 -0
- data/core/admin/assets/js/vendor/codemirror/doc/realworld.html +134 -0
- data/core/admin/assets/js/vendor/codemirror/doc/releases.html +779 -0
- data/core/admin/assets/js/vendor/codemirror/doc/reporting.html +61 -0
- data/core/admin/assets/js/vendor/codemirror/doc/upgrade_v2.2.html +96 -0
- data/core/admin/assets/js/vendor/codemirror/doc/upgrade_v3.html +230 -0
- data/core/admin/assets/js/vendor/codemirror/index.html +192 -0
- data/core/admin/assets/js/vendor/codemirror/keymap/emacs.js +387 -0
- data/core/admin/assets/js/vendor/codemirror/keymap/extra.js +43 -0
- data/core/admin/assets/js/vendor/codemirror/keymap/vim.js +3704 -0
- data/core/admin/assets/js/vendor/codemirror/lib/codemirror.css +263 -0
- data/core/admin/assets/js/vendor/codemirror/lib/codemirror.js +5910 -0
- data/core/admin/assets/js/vendor/codemirror/mode/apl/apl.js +160 -0
- data/core/admin/assets/js/vendor/codemirror/mode/apl/index.html +72 -0
- data/core/admin/assets/js/vendor/codemirror/mode/asterisk/asterisk.js +183 -0
- data/core/admin/assets/js/vendor/codemirror/mode/asterisk/index.html +154 -0
- data/core/admin/assets/js/vendor/codemirror/mode/clike/clike.js +362 -0
- data/core/admin/assets/js/vendor/codemirror/mode/clike/index.html +195 -0
- data/core/admin/assets/js/vendor/codemirror/mode/clike/scala.html +767 -0
- data/core/admin/assets/js/vendor/codemirror/mode/clojure/clojure.js +224 -0
- data/core/admin/assets/js/vendor/codemirror/mode/clojure/index.html +88 -0
- data/core/admin/assets/js/vendor/codemirror/mode/cobol/cobol.js +240 -0
- data/core/admin/assets/js/vendor/codemirror/mode/cobol/index.html +210 -0
- data/core/admin/assets/js/vendor/codemirror/mode/coffeescript/coffeescript.js +349 -0
- data/core/admin/assets/js/vendor/codemirror/mode/coffeescript/index.html +740 -0
- data/core/admin/assets/js/vendor/codemirror/mode/commonlisp/commonlisp.js +105 -0
- data/core/admin/assets/js/vendor/codemirror/mode/commonlisp/index.html +177 -0
- data/core/admin/assets/js/vendor/codemirror/mode/css/css.js +639 -0
- data/core/admin/assets/js/vendor/codemirror/mode/css/index.html +70 -0
- data/core/admin/assets/js/vendor/codemirror/mode/css/scss.html +157 -0
- data/core/admin/assets/js/vendor/codemirror/mode/css/scss_test.js +84 -0
- data/core/admin/assets/js/vendor/codemirror/mode/css/test.js +130 -0
- data/core/admin/assets/js/vendor/codemirror/mode/d/d.js +205 -0
- data/core/admin/assets/js/vendor/codemirror/mode/d/index.html +273 -0
- data/core/admin/assets/js/vendor/codemirror/mode/diff/diff.js +32 -0
- data/core/admin/assets/js/vendor/codemirror/mode/diff/index.html +117 -0
- data/core/admin/assets/js/vendor/codemirror/mode/dtd/dtd.js +127 -0
- data/core/admin/assets/js/vendor/codemirror/mode/dtd/index.html +89 -0
- data/core/admin/assets/js/vendor/codemirror/mode/ecl/ecl.js +192 -0
- data/core/admin/assets/js/vendor/codemirror/mode/ecl/index.html +52 -0
- data/core/admin/assets/js/vendor/codemirror/mode/eiffel/eiffel.js +147 -0
- data/core/admin/assets/js/vendor/codemirror/mode/eiffel/index.html +430 -0
- data/core/admin/assets/js/vendor/codemirror/mode/erlang/erlang.js +484 -0
- data/core/admin/assets/js/vendor/codemirror/mode/erlang/index.html +75 -0
- data/core/admin/assets/js/vendor/codemirror/mode/fortran/fortran.js +173 -0
- data/core/admin/assets/js/vendor/codemirror/mode/fortran/index.html +81 -0
- data/core/admin/assets/js/vendor/codemirror/mode/gas/gas.js +330 -0
- data/core/admin/assets/js/vendor/codemirror/mode/gas/index.html +68 -0
- data/core/admin/assets/js/vendor/codemirror/mode/gfm/gfm.js +97 -0
- data/core/admin/assets/js/vendor/codemirror/mode/gfm/index.html +82 -0
- data/core/admin/assets/js/vendor/codemirror/mode/gfm/test.js +112 -0
- data/core/admin/assets/js/vendor/codemirror/mode/gherkin/gherkin.js +168 -0
- data/core/admin/assets/js/vendor/codemirror/mode/gherkin/index.html +48 -0
- data/core/admin/assets/js/vendor/codemirror/mode/go/go.js +168 -0
- data/core/admin/assets/js/vendor/codemirror/mode/go/index.html +85 -0
- data/core/admin/assets/js/vendor/codemirror/mode/groovy/groovy.js +211 -0
- data/core/admin/assets/js/vendor/codemirror/mode/groovy/index.html +84 -0
- data/core/admin/assets/js/vendor/codemirror/mode/haml/haml.js +153 -0
- data/core/admin/assets/js/vendor/codemirror/mode/haml/index.html +79 -0
- data/core/admin/assets/js/vendor/codemirror/mode/haml/test.js +94 -0
- data/core/admin/assets/js/vendor/codemirror/mode/haskell/haskell.js +250 -0
- data/core/admin/assets/js/vendor/codemirror/mode/haskell/index.html +73 -0
- data/core/admin/assets/js/vendor/codemirror/mode/haxe/haxe.js +429 -0
- data/core/admin/assets/js/vendor/codemirror/mode/haxe/index.html +103 -0
- data/core/admin/assets/js/vendor/codemirror/mode/htmlembedded/htmlembedded.js +73 -0
- data/core/admin/assets/js/vendor/codemirror/mode/htmlembedded/index.html +60 -0
- data/core/admin/assets/js/vendor/codemirror/mode/htmlmixed/htmlmixed.js +104 -0
- data/core/admin/assets/js/vendor/codemirror/mode/htmlmixed/index.html +85 -0
- data/core/admin/assets/js/vendor/codemirror/mode/http/http.js +98 -0
- data/core/admin/assets/js/vendor/codemirror/mode/http/index.html +45 -0
- data/core/admin/assets/js/vendor/codemirror/mode/index.html +112 -0
- data/core/admin/assets/js/vendor/codemirror/mode/jade/index.html +66 -0
- data/core/admin/assets/js/vendor/codemirror/mode/jade/jade.js +90 -0
- data/core/admin/assets/js/vendor/codemirror/mode/javascript/index.html +107 -0
- data/core/admin/assets/js/vendor/codemirror/mode/javascript/javascript.js +480 -0
- data/core/admin/assets/js/vendor/codemirror/mode/javascript/test.js +10 -0
- data/core/admin/assets/js/vendor/codemirror/mode/javascript/typescript.html +61 -0
- data/core/admin/assets/js/vendor/codemirror/mode/jinja2/index.html +50 -0
- data/core/admin/assets/js/vendor/codemirror/mode/jinja2/jinja2.js +42 -0
- data/core/admin/assets/js/vendor/codemirror/mode/less/index.html +753 -0
- data/core/admin/assets/js/vendor/codemirror/mode/less/less.js +344 -0
- data/core/admin/assets/js/vendor/codemirror/mode/livescript/index.html +459 -0
- data/core/admin/assets/js/vendor/codemirror/mode/livescript/livescript.js +267 -0
- data/core/admin/assets/js/vendor/codemirror/mode/livescript/livescript.ls +266 -0
- data/core/admin/assets/js/vendor/codemirror/mode/lua/index.html +86 -0
- data/core/admin/assets/js/vendor/codemirror/mode/lua/lua.js +144 -0
- data/core/admin/assets/js/vendor/codemirror/mode/markdown/index.html +359 -0
- data/core/admin/assets/js/vendor/codemirror/mode/markdown/markdown.js +551 -0
- data/core/admin/assets/js/vendor/codemirror/mode/markdown/test.js +656 -0
- data/core/admin/assets/js/vendor/codemirror/mode/meta.js +89 -0
- data/core/admin/assets/js/vendor/codemirror/mode/mirc/index.html +161 -0
- data/core/admin/assets/js/vendor/codemirror/mode/mirc/mirc.js +177 -0
- data/core/admin/assets/js/vendor/codemirror/mode/nginx/index.html +181 -0
- data/core/admin/assets/js/vendor/codemirror/mode/nginx/nginx.js +163 -0
- data/core/admin/assets/js/vendor/codemirror/mode/ntriples/index.html +45 -0
- data/core/admin/assets/js/vendor/codemirror/mode/ntriples/ntriples.js +170 -0
- data/core/admin/assets/js/vendor/codemirror/mode/ocaml/index.html +146 -0
- data/core/admin/assets/js/vendor/codemirror/mode/ocaml/ocaml.js +116 -0
- data/core/admin/assets/js/vendor/codemirror/mode/octave/index.html +95 -0
- data/core/admin/assets/js/vendor/codemirror/mode/octave/octave.js +118 -0
- data/core/admin/assets/js/vendor/codemirror/mode/pascal/index.html +61 -0
- data/core/admin/assets/js/vendor/codemirror/mode/pascal/pascal.js +94 -0
- data/core/admin/assets/js/vendor/codemirror/mode/perl/index.html +75 -0
- data/core/admin/assets/js/vendor/codemirror/mode/perl/perl.js +816 -0
- data/core/admin/assets/js/vendor/codemirror/mode/php/index.html +62 -0
- data/core/admin/assets/js/vendor/codemirror/mode/php/php.js +132 -0
- data/core/admin/assets/js/vendor/codemirror/mode/pig/index.html +55 -0
- data/core/admin/assets/js/vendor/codemirror/mode/pig/pig.js +171 -0
- data/core/admin/assets/js/vendor/codemirror/mode/properties/index.html +53 -0
- data/core/admin/assets/js/vendor/codemirror/mode/properties/properties.js +63 -0
- data/core/admin/assets/js/vendor/codemirror/mode/python/index.html +187 -0
- data/core/admin/assets/js/vendor/codemirror/mode/python/python.js +368 -0
- data/core/admin/assets/js/vendor/codemirror/mode/q/index.html +144 -0
- data/core/admin/assets/js/vendor/codemirror/mode/q/q.js +124 -0
- data/core/admin/assets/js/vendor/codemirror/mode/r/index.html +86 -0
- data/core/admin/assets/js/vendor/codemirror/mode/r/r.js +141 -0
- data/core/admin/assets/js/vendor/codemirror/mode/rpm/changes/changes.js +19 -0
- data/core/admin/assets/js/vendor/codemirror/mode/rpm/changes/index.html +67 -0
- data/core/admin/assets/js/vendor/codemirror/mode/rpm/spec/index.html +114 -0
- data/core/admin/assets/js/vendor/codemirror/mode/rpm/spec/spec.css +5 -0
- data/core/admin/assets/js/vendor/codemirror/mode/rpm/spec/spec.js +66 -0
- data/core/admin/assets/js/vendor/codemirror/mode/rst/index.html +534 -0
- data/core/admin/assets/js/vendor/codemirror/mode/rst/rst.js +560 -0
- data/core/admin/assets/js/vendor/codemirror/mode/ruby/index.html +185 -0
- data/core/admin/assets/js/vendor/codemirror/mode/ruby/ruby.js +247 -0
- data/core/admin/assets/js/vendor/codemirror/mode/rust/index.html +61 -0
- data/core/admin/assets/js/vendor/codemirror/mode/rust/rust.js +436 -0
- data/core/admin/assets/js/vendor/codemirror/mode/sass/index.html +66 -0
- data/core/admin/assets/js/vendor/codemirror/mode/sass/sass.js +330 -0
- data/core/admin/assets/js/vendor/codemirror/mode/scheme/index.html +77 -0
- data/core/admin/assets/js/vendor/codemirror/mode/scheme/scheme.js +232 -0
- data/core/admin/assets/js/vendor/codemirror/mode/shell/index.html +66 -0
- data/core/admin/assets/js/vendor/codemirror/mode/shell/shell.js +118 -0
- data/core/admin/assets/js/vendor/codemirror/mode/sieve/index.html +93 -0
- data/core/admin/assets/js/vendor/codemirror/mode/sieve/sieve.js +183 -0
- data/core/admin/assets/js/vendor/codemirror/mode/smalltalk/index.html +68 -0
- data/core/admin/assets/js/vendor/codemirror/mode/smalltalk/smalltalk.js +151 -0
- data/core/admin/assets/js/vendor/codemirror/mode/smarty/index.html +136 -0
- data/core/admin/assets/js/vendor/codemirror/mode/smarty/smarty.js +205 -0
- data/core/admin/assets/js/vendor/codemirror/mode/smartymixed/index.html +114 -0
- data/core/admin/assets/js/vendor/codemirror/mode/smartymixed/smartymixed.js +175 -0
- data/core/admin/assets/js/vendor/codemirror/mode/sparql/index.html +54 -0
- data/core/admin/assets/js/vendor/codemirror/mode/sparql/sparql.js +145 -0
- data/core/admin/assets/js/vendor/codemirror/mode/sql/index.html +75 -0
- data/core/admin/assets/js/vendor/codemirror/mode/sql/sql.js +365 -0
- data/core/admin/assets/js/vendor/codemirror/mode/stex/index.html +110 -0
- data/core/admin/assets/js/vendor/codemirror/mode/stex/stex.js +246 -0
- data/core/admin/assets/js/vendor/codemirror/mode/stex/test.js +120 -0
- data/core/admin/assets/js/vendor/codemirror/mode/tcl/index.html +143 -0
- data/core/admin/assets/js/vendor/codemirror/mode/tcl/tcl.js +131 -0
- data/core/admin/assets/js/vendor/codemirror/mode/tiddlywiki/index.html +155 -0
- data/core/admin/assets/js/vendor/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/core/admin/assets/js/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
- data/core/admin/assets/js/vendor/codemirror/mode/tiki/index.html +95 -0
- data/core/admin/assets/js/vendor/codemirror/mode/tiki/tiki.css +26 -0
- data/core/admin/assets/js/vendor/codemirror/mode/tiki/tiki.js +308 -0
- data/core/admin/assets/js/vendor/codemirror/mode/toml/index.html +73 -0
- data/core/admin/assets/js/vendor/codemirror/mode/toml/toml.js +71 -0
- data/core/admin/assets/js/vendor/codemirror/mode/turtle/index.html +51 -0
- data/core/admin/assets/js/vendor/codemirror/mode/turtle/turtle.js +145 -0
- data/core/admin/assets/js/vendor/codemirror/mode/vb/index.html +103 -0
- data/core/admin/assets/js/vendor/codemirror/mode/vb/vb.js +259 -0
- data/core/admin/assets/js/vendor/codemirror/mode/vbscript/index.html +55 -0
- data/core/admin/assets/js/vendor/codemirror/mode/vbscript/vbscript.js +334 -0
- data/core/admin/assets/js/vendor/codemirror/mode/velocity/index.html +119 -0
- data/core/admin/assets/js/vendor/codemirror/mode/velocity/velocity.js +186 -0
- data/core/admin/assets/js/vendor/codemirror/mode/verilog/index.html +132 -0
- data/core/admin/assets/js/vendor/codemirror/mode/verilog/verilog.js +182 -0
- data/core/admin/assets/js/vendor/codemirror/mode/xml/index.html +57 -0
- data/core/admin/assets/js/vendor/codemirror/mode/xml/xml.js +345 -0
- data/core/admin/assets/js/vendor/codemirror/mode/xquery/index.html +210 -0
- data/core/admin/assets/js/vendor/codemirror/mode/xquery/test.js +64 -0
- data/core/admin/assets/js/vendor/codemirror/mode/xquery/xquery.js +432 -0
- data/core/admin/assets/js/vendor/codemirror/mode/yaml/index.html +80 -0
- data/core/admin/assets/js/vendor/codemirror/mode/yaml/yaml.js +97 -0
- data/core/admin/assets/js/vendor/codemirror/mode/z80/index.html +52 -0
- data/core/admin/assets/js/vendor/codemirror/mode/z80/z80.js +85 -0
- data/core/admin/assets/js/vendor/codemirror/package.json +19 -0
- data/core/admin/assets/js/vendor/codemirror/test/comment_test.js +51 -0
- data/core/admin/assets/js/vendor/codemirror/test/doc_test.js +329 -0
- data/core/admin/assets/js/vendor/codemirror/test/driver.js +139 -0
- data/core/admin/assets/js/vendor/codemirror/test/emacs_test.js +135 -0
- data/core/admin/assets/js/vendor/codemirror/test/index.html +209 -0
- data/core/admin/assets/js/vendor/codemirror/test/lint/acorn.js +1593 -0
- data/core/admin/assets/js/vendor/codemirror/test/lint/lint.js +139 -0
- data/core/admin/assets/js/vendor/codemirror/test/lint/walk.js +216 -0
- data/core/admin/assets/js/vendor/codemirror/test/mode_test.css +10 -0
- data/core/admin/assets/js/vendor/codemirror/test/mode_test.js +200 -0
- data/core/admin/assets/js/vendor/codemirror/test/phantom_driver.js +31 -0
- data/core/admin/assets/js/vendor/codemirror/test/run.js +34 -0
- data/core/admin/assets/js/vendor/codemirror/test/test.js +1562 -0
- data/core/admin/assets/js/vendor/codemirror/test/vim_test.js +2391 -0
- data/core/admin/assets/js/vendor/codemirror/theme/3024-day.css +34 -0
- data/core/admin/assets/js/vendor/codemirror/theme/3024-night.css +34 -0
- data/core/admin/assets/js/vendor/codemirror/theme/ambiance-mobile.css +5 -0
- data/core/admin/assets/js/vendor/codemirror/theme/ambiance.css +75 -0
- data/core/admin/assets/js/vendor/codemirror/theme/base16-dark.css +34 -0
- data/core/admin/assets/js/vendor/codemirror/theme/base16-light.css +34 -0
- data/core/admin/assets/js/vendor/codemirror/theme/blackboard.css +28 -0
- data/core/admin/assets/js/vendor/codemirror/theme/cobalt.css +21 -0
- data/core/admin/assets/js/vendor/codemirror/theme/eclipse.css +23 -0
- data/core/admin/assets/js/vendor/codemirror/theme/elegant.css +13 -0
- data/core/admin/assets/js/vendor/codemirror/theme/erlang-dark.css +30 -0
- data/core/admin/assets/js/vendor/codemirror/theme/lesser-dark.css +47 -0
- data/core/admin/assets/js/vendor/codemirror/theme/mbo.css +35 -0
- data/core/admin/assets/js/vendor/codemirror/theme/midnight.css +43 -0
- data/core/admin/assets/js/vendor/codemirror/theme/monokai.css +29 -0
- data/core/admin/assets/js/vendor/codemirror/theme/neat.css +12 -0
- data/core/admin/assets/js/vendor/codemirror/theme/night.css +24 -0
- data/core/admin/assets/js/vendor/codemirror/theme/paraiso-dark.css +34 -0
- data/core/admin/assets/js/vendor/codemirror/theme/paraiso-light.css +34 -0
- data/core/admin/assets/js/vendor/codemirror/theme/rubyblue.css +23 -0
- data/core/admin/assets/js/vendor/codemirror/theme/solarized-mod.css +181 -0
- data/core/admin/assets/js/vendor/codemirror/theme/solarized.css +180 -0
- data/core/admin/assets/js/vendor/codemirror/theme/the-matrix.css +26 -0
- data/core/admin/assets/js/vendor/codemirror/theme/tomorrow-night-eighties.css +34 -0
- data/core/admin/assets/js/vendor/codemirror/theme/twilight.css +28 -0
- data/core/admin/assets/js/vendor/codemirror/theme/vibrant-ink.css +30 -0
- data/core/admin/assets/js/vendor/codemirror/theme/xq-dark.css +49 -0
- data/core/admin/assets/js/vendor/codemirror/theme/xq-light.css +43 -0
- data/core/admin/assets/js/vendor/fastclick.js +777 -0
- data/core/admin/assets/js/vendor/jquery.js +6 -0
- data/core/admin/assets/js/vendor/lodash.underscore.js +38 -0
- data/core/admin/assets/js/vendor/require.js +36 -0
- data/core/admin/assets/scss/bootstrap.scss +18 -0
- data/core/admin/assets/scss/modules/_all.scss +7 -0
- data/core/admin/assets/scss/modules/_colors.scss +7 -0
- data/core/admin/assets/scss/modules/_extensions.scss +24 -0
- data/core/admin/assets/scss/modules/_mixins.scss +18 -0
- data/core/admin/assets/scss/modules/_susy.scss +7 -0
- data/core/admin/assets/scss/partials/_base.scss +33 -0
- data/core/admin/assets/scss/partials/_buttons.scss +9 -0
- data/core/admin/assets/scss/partials/_links.scss +15 -0
- data/core/admin/assets/scss/partials/_main.scss +14 -0
- data/core/admin/assets/scss/partials/_typography.scss +15 -0
- data/core/admin/assets/scss/sections/_editor.scss +274 -0
- data/core/admin/assets/scss/sections/_login.scss +34 -0
- data/core/admin/assets/scss/vendor/_normalize.scss +406 -0
- data/core/admin/layouts/admin.haml +67 -0
- data/core/admin/partials/_head.haml +23 -0
- data/core/admin/partials/_tree.haml +3 -0
- data/core/admin/partials/_treeitem.haml +4 -0
- data/core/admin/settings.yml +4 -0
- data/core/app.rb +21 -0
- data/core/classes/cached.rb +35 -0
- data/core/classes/checker.rb +37 -0
- data/core/classes/commit.rb +62 -0
- data/core/classes/error.rb +9 -0
- data/core/classes/page.rb +165 -0
- data/core/classes/partial.rb +13 -0
- data/core/classes/path.rb +30 -0
- data/core/classes/persona.rb +55 -0
- data/core/classes/sassfile.rb +95 -0
- data/core/classes/settings.rb +19 -0
- data/core/classes/theme.rb +55 -0
- data/core/helpers/base.rb +46 -0
- data/core/helpers/render.rb +26 -0
- data/core/helpers/truncate.rb +17 -0
- data/core/routes/admin.rb +139 -0
- data/core/routes/assetcompiler.rb +23 -0
- data/core/routes/base.rb +22 -0
- data/core/routes/bootstrap.rb +35 -0
- data/core/routes/cache.rb +52 -0
- data/core/routes/deploy.rb +16 -0
- data/core/routes/git.rb +23 -0
- data/poly.gemspec +29 -0
- data/sample/.cabi-data +0 -0
- data/sample/data/home/index.haml +22 -0
- data/sample/data/other/nav/links.yml +4 -0
- data/sample/data/page/about/index.haml +12 -0
- data/sample/data/page/contact-us/index.haml +11 -0
- data/sample/data/page/dynamic-page/index.haml +14 -0
- data/sample/data/page/error/index.haml +8 -0
- data/sample/data/page/html/index.html +4 -0
- data/sample/data/page/no-front-matter/index.haml +7 -0
- data/sample/data/page/not-found/index.haml +8 -0
- data/sample/data/page/static-page/index.haml +14 -0
- data/sample/data/post/about-life/index.md +12 -0
- data/sample/data/post/sample-post/index.haml +12 -0
- data/sample/data/post/technology/index.haml +12 -0
- data/sample/data/post/the-40-hour-workweek/index.haml +9 -0
- data/sample/data/post/things-are-changing/index.haml +9 -0
- data/sample/data/post/yet-another-post/index.haml +11 -0
- data/sample/plugins/my-plugin/plugin.rb +15 -0
- data/sample/settings.yml +21 -0
- data/sample/themes/base/assets/css/readme.txt +6 -0
- data/sample/themes/base/assets/images/poly.svg +36 -0
- data/sample/themes/base/assets/js/app/views/main.js +13 -0
- data/sample/themes/base/assets/js/main.js +31 -0
- data/sample/themes/base/assets/js/vendor/backbone.js +4 -0
- data/sample/themes/base/assets/js/vendor/jquery.js +6 -0
- data/sample/themes/base/assets/js/vendor/lodash.underscore.js +38 -0
- data/sample/themes/base/assets/js/vendor/require.js +36 -0
- data/sample/themes/base/assets/scss/bootstrap.scss +20 -0
- data/sample/themes/base/assets/scss/modules/_all.scss +7 -0
- data/sample/themes/base/assets/scss/modules/_colors.scss +7 -0
- data/sample/themes/base/assets/scss/modules/_extensions.scss +13 -0
- data/sample/themes/base/assets/scss/modules/_mixins.scss +11 -0
- data/sample/themes/base/assets/scss/modules/_susy.scss +7 -0
- data/sample/themes/base/assets/scss/partials/_base.scss +33 -0
- data/sample/themes/base/assets/scss/partials/_buttons.scss +0 -0
- data/sample/themes/base/assets/scss/partials/_links.scss +15 -0
- data/sample/themes/base/assets/scss/partials/_main.scss +39 -0
- data/sample/themes/base/assets/scss/partials/_typography.scss +15 -0
- data/sample/themes/base/assets/scss/sections/_footer.scss +22 -0
- data/sample/themes/base/assets/scss/sections/_header.scss +23 -0
- data/sample/themes/base/assets/scss/sections/_home.scss +13 -0
- data/sample/themes/base/assets/scss/sections/_pages.scss +11 -0
- data/sample/themes/base/assets/scss/vendor/_normalize.scss +406 -0
- data/sample/themes/base/layouts/default.haml +14 -0
- data/sample/themes/base/layouts/post.haml +15 -0
- data/sample/themes/base/partials/_footer.haml +9 -0
- data/sample/themes/base/partials/_ga.haml +10 -0
- data/sample/themes/base/partials/_head.haml +20 -0
- data/sample/themes/base/partials/_header.haml +5 -0
- data/sample/themes/base/settings.yml +4 -0
- data/test/data/post-receive-hook.json +146 -0
- data/test/test_basics.rb +50 -0
- data/test/test_data.rb +14 -0
- data/test/test_deploy.rb +23 -0
- data/test/test_includes.rb +43 -0
- data/test/test_page.rb +47 -0
- metadata +1049 -0
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
|
|
3
|
+
<title>CodeMirror: Eiffel mode</title>
|
|
4
|
+
<meta charset="utf-8"/>
|
|
5
|
+
<link rel=stylesheet href="../../doc/docs.css">
|
|
6
|
+
|
|
7
|
+
<link rel="stylesheet" href="../../lib/codemirror.css">
|
|
8
|
+
<link rel="stylesheet" href="../../theme/neat.css">
|
|
9
|
+
<script src="../../lib/codemirror.js"></script>
|
|
10
|
+
<script src="eiffel.js"></script>
|
|
11
|
+
<style>
|
|
12
|
+
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
|
|
13
|
+
.cm-s-default span.cm-arrow { color: red; }
|
|
14
|
+
</style>
|
|
15
|
+
<div id=nav>
|
|
16
|
+
<a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>
|
|
17
|
+
|
|
18
|
+
<ul>
|
|
19
|
+
<li><a href="../../index.html">Home</a>
|
|
20
|
+
<li><a href="../../doc/manual.html">Manual</a>
|
|
21
|
+
<li><a href="https://github.com/marijnh/codemirror">Code</a>
|
|
22
|
+
</ul>
|
|
23
|
+
<ul>
|
|
24
|
+
<li><a href="../index.html">Language modes</a>
|
|
25
|
+
<li><a class=active href="#">Eiffel</a>
|
|
26
|
+
</ul>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<article>
|
|
30
|
+
<h2>Eiffel mode</h2>
|
|
31
|
+
<form><textarea id="code" name="code">
|
|
32
|
+
note
|
|
33
|
+
description: "[
|
|
34
|
+
Project-wide universal properties.
|
|
35
|
+
This class is an ancestor to all developer-written classes.
|
|
36
|
+
ANY may be customized for individual projects or teams.
|
|
37
|
+
]"
|
|
38
|
+
|
|
39
|
+
library: "Free implementation of ELKS library"
|
|
40
|
+
status: "See notice at end of class."
|
|
41
|
+
legal: "See notice at end of class."
|
|
42
|
+
date: "$Date: 2013-01-25 11:49:00 -0800 (Fri, 25 Jan 2013) $"
|
|
43
|
+
revision: "$Revision: 712 $"
|
|
44
|
+
|
|
45
|
+
class
|
|
46
|
+
ANY
|
|
47
|
+
|
|
48
|
+
feature -- Customization
|
|
49
|
+
|
|
50
|
+
feature -- Access
|
|
51
|
+
|
|
52
|
+
generator: STRING
|
|
53
|
+
-- Name of current object's generating class
|
|
54
|
+
-- (base class of the type of which it is a direct instance)
|
|
55
|
+
external
|
|
56
|
+
"built_in"
|
|
57
|
+
ensure
|
|
58
|
+
generator_not_void: Result /= Void
|
|
59
|
+
generator_not_empty: not Result.is_empty
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
generating_type: TYPE [detachable like Current]
|
|
63
|
+
-- Type of current object
|
|
64
|
+
-- (type of which it is a direct instance)
|
|
65
|
+
do
|
|
66
|
+
Result := {detachable like Current}
|
|
67
|
+
ensure
|
|
68
|
+
generating_type_not_void: Result /= Void
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
feature -- Status report
|
|
72
|
+
|
|
73
|
+
conforms_to (other: ANY): BOOLEAN
|
|
74
|
+
-- Does type of current object conform to type
|
|
75
|
+
-- of `other' (as per Eiffel: The Language, chapter 13)?
|
|
76
|
+
require
|
|
77
|
+
other_not_void: other /= Void
|
|
78
|
+
external
|
|
79
|
+
"built_in"
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
same_type (other: ANY): BOOLEAN
|
|
83
|
+
-- Is type of current object identical to type of `other'?
|
|
84
|
+
require
|
|
85
|
+
other_not_void: other /= Void
|
|
86
|
+
external
|
|
87
|
+
"built_in"
|
|
88
|
+
ensure
|
|
89
|
+
definition: Result = (conforms_to (other) and
|
|
90
|
+
other.conforms_to (Current))
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
feature -- Comparison
|
|
94
|
+
|
|
95
|
+
is_equal (other: like Current): BOOLEAN
|
|
96
|
+
-- Is `other' attached to an object considered
|
|
97
|
+
-- equal to current object?
|
|
98
|
+
require
|
|
99
|
+
other_not_void: other /= Void
|
|
100
|
+
external
|
|
101
|
+
"built_in"
|
|
102
|
+
ensure
|
|
103
|
+
symmetric: Result implies other ~ Current
|
|
104
|
+
consistent: standard_is_equal (other) implies Result
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
frozen standard_is_equal (other: like Current): BOOLEAN
|
|
108
|
+
-- Is `other' attached to an object of the same type
|
|
109
|
+
-- as current object, and field-by-field identical to it?
|
|
110
|
+
require
|
|
111
|
+
other_not_void: other /= Void
|
|
112
|
+
external
|
|
113
|
+
"built_in"
|
|
114
|
+
ensure
|
|
115
|
+
same_type: Result implies same_type (other)
|
|
116
|
+
symmetric: Result implies other.standard_is_equal (Current)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
frozen equal (a: detachable ANY; b: like a): BOOLEAN
|
|
120
|
+
-- Are `a' and `b' either both void or attached
|
|
121
|
+
-- to objects considered equal?
|
|
122
|
+
do
|
|
123
|
+
if a = Void then
|
|
124
|
+
Result := b = Void
|
|
125
|
+
else
|
|
126
|
+
Result := b /= Void and then
|
|
127
|
+
a.is_equal (b)
|
|
128
|
+
end
|
|
129
|
+
ensure
|
|
130
|
+
definition: Result = (a = Void and b = Void) or else
|
|
131
|
+
((a /= Void and b /= Void) and then
|
|
132
|
+
a.is_equal (b))
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
frozen standard_equal (a: detachable ANY; b: like a): BOOLEAN
|
|
136
|
+
-- Are `a' and `b' either both void or attached to
|
|
137
|
+
-- field-by-field identical objects of the same type?
|
|
138
|
+
-- Always uses default object comparison criterion.
|
|
139
|
+
do
|
|
140
|
+
if a = Void then
|
|
141
|
+
Result := b = Void
|
|
142
|
+
else
|
|
143
|
+
Result := b /= Void and then
|
|
144
|
+
a.standard_is_equal (b)
|
|
145
|
+
end
|
|
146
|
+
ensure
|
|
147
|
+
definition: Result = (a = Void and b = Void) or else
|
|
148
|
+
((a /= Void and b /= Void) and then
|
|
149
|
+
a.standard_is_equal (b))
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
frozen is_deep_equal (other: like Current): BOOLEAN
|
|
153
|
+
-- Are `Current' and `other' attached to isomorphic object structures?
|
|
154
|
+
require
|
|
155
|
+
other_not_void: other /= Void
|
|
156
|
+
external
|
|
157
|
+
"built_in"
|
|
158
|
+
ensure
|
|
159
|
+
shallow_implies_deep: standard_is_equal (other) implies Result
|
|
160
|
+
same_type: Result implies same_type (other)
|
|
161
|
+
symmetric: Result implies other.is_deep_equal (Current)
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
frozen deep_equal (a: detachable ANY; b: like a): BOOLEAN
|
|
165
|
+
-- Are `a' and `b' either both void
|
|
166
|
+
-- or attached to isomorphic object structures?
|
|
167
|
+
do
|
|
168
|
+
if a = Void then
|
|
169
|
+
Result := b = Void
|
|
170
|
+
else
|
|
171
|
+
Result := b /= Void and then a.is_deep_equal (b)
|
|
172
|
+
end
|
|
173
|
+
ensure
|
|
174
|
+
shallow_implies_deep: standard_equal (a, b) implies Result
|
|
175
|
+
both_or_none_void: (a = Void) implies (Result = (b = Void))
|
|
176
|
+
same_type: (Result and (a /= Void)) implies (b /= Void and then a.same_type (b))
|
|
177
|
+
symmetric: Result implies deep_equal (b, a)
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
feature -- Duplication
|
|
181
|
+
|
|
182
|
+
frozen twin: like Current
|
|
183
|
+
-- New object equal to `Current'
|
|
184
|
+
-- `twin' calls `copy'; to change copying/twinning semantics, redefine `copy'.
|
|
185
|
+
external
|
|
186
|
+
"built_in"
|
|
187
|
+
ensure
|
|
188
|
+
twin_not_void: Result /= Void
|
|
189
|
+
is_equal: Result ~ Current
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
copy (other: like Current)
|
|
193
|
+
-- Update current object using fields of object attached
|
|
194
|
+
-- to `other', so as to yield equal objects.
|
|
195
|
+
require
|
|
196
|
+
other_not_void: other /= Void
|
|
197
|
+
type_identity: same_type (other)
|
|
198
|
+
external
|
|
199
|
+
"built_in"
|
|
200
|
+
ensure
|
|
201
|
+
is_equal: Current ~ other
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
frozen standard_copy (other: like Current)
|
|
205
|
+
-- Copy every field of `other' onto corresponding field
|
|
206
|
+
-- of current object.
|
|
207
|
+
require
|
|
208
|
+
other_not_void: other /= Void
|
|
209
|
+
type_identity: same_type (other)
|
|
210
|
+
external
|
|
211
|
+
"built_in"
|
|
212
|
+
ensure
|
|
213
|
+
is_standard_equal: standard_is_equal (other)
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
frozen clone (other: detachable ANY): like other
|
|
217
|
+
-- Void if `other' is void; otherwise new object
|
|
218
|
+
-- equal to `other'
|
|
219
|
+
--
|
|
220
|
+
-- For non-void `other', `clone' calls `copy';
|
|
221
|
+
-- to change copying/cloning semantics, redefine `copy'.
|
|
222
|
+
obsolete
|
|
223
|
+
"Use `twin' instead."
|
|
224
|
+
do
|
|
225
|
+
if other /= Void then
|
|
226
|
+
Result := other.twin
|
|
227
|
+
end
|
|
228
|
+
ensure
|
|
229
|
+
equal: Result ~ other
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
frozen standard_clone (other: detachable ANY): like other
|
|
233
|
+
-- Void if `other' is void; otherwise new object
|
|
234
|
+
-- field-by-field identical to `other'.
|
|
235
|
+
-- Always uses default copying semantics.
|
|
236
|
+
obsolete
|
|
237
|
+
"Use `standard_twin' instead."
|
|
238
|
+
do
|
|
239
|
+
if other /= Void then
|
|
240
|
+
Result := other.standard_twin
|
|
241
|
+
end
|
|
242
|
+
ensure
|
|
243
|
+
equal: standard_equal (Result, other)
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
frozen standard_twin: like Current
|
|
247
|
+
-- New object field-by-field identical to `other'.
|
|
248
|
+
-- Always uses default copying semantics.
|
|
249
|
+
external
|
|
250
|
+
"built_in"
|
|
251
|
+
ensure
|
|
252
|
+
standard_twin_not_void: Result /= Void
|
|
253
|
+
equal: standard_equal (Result, Current)
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
frozen deep_twin: like Current
|
|
257
|
+
-- New object structure recursively duplicated from Current.
|
|
258
|
+
external
|
|
259
|
+
"built_in"
|
|
260
|
+
ensure
|
|
261
|
+
deep_twin_not_void: Result /= Void
|
|
262
|
+
deep_equal: deep_equal (Current, Result)
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
frozen deep_clone (other: detachable ANY): like other
|
|
266
|
+
-- Void if `other' is void: otherwise, new object structure
|
|
267
|
+
-- recursively duplicated from the one attached to `other'
|
|
268
|
+
obsolete
|
|
269
|
+
"Use `deep_twin' instead."
|
|
270
|
+
do
|
|
271
|
+
if other /= Void then
|
|
272
|
+
Result := other.deep_twin
|
|
273
|
+
end
|
|
274
|
+
ensure
|
|
275
|
+
deep_equal: deep_equal (other, Result)
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
frozen deep_copy (other: like Current)
|
|
279
|
+
-- Effect equivalent to that of:
|
|
280
|
+
-- `copy' (`other' . `deep_twin')
|
|
281
|
+
require
|
|
282
|
+
other_not_void: other /= Void
|
|
283
|
+
do
|
|
284
|
+
copy (other.deep_twin)
|
|
285
|
+
ensure
|
|
286
|
+
deep_equal: deep_equal (Current, other)
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
feature {NONE} -- Retrieval
|
|
290
|
+
|
|
291
|
+
frozen internal_correct_mismatch
|
|
292
|
+
-- Called from runtime to perform a proper dynamic dispatch on `correct_mismatch'
|
|
293
|
+
-- from MISMATCH_CORRECTOR.
|
|
294
|
+
local
|
|
295
|
+
l_msg: STRING
|
|
296
|
+
l_exc: EXCEPTIONS
|
|
297
|
+
do
|
|
298
|
+
if attached {MISMATCH_CORRECTOR} Current as l_corrector then
|
|
299
|
+
l_corrector.correct_mismatch
|
|
300
|
+
else
|
|
301
|
+
create l_msg.make_from_string ("Mismatch: ")
|
|
302
|
+
create l_exc
|
|
303
|
+
l_msg.append (generating_type.name)
|
|
304
|
+
l_exc.raise_retrieval_exception (l_msg)
|
|
305
|
+
end
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
feature -- Output
|
|
309
|
+
|
|
310
|
+
io: STD_FILES
|
|
311
|
+
-- Handle to standard file setup
|
|
312
|
+
once
|
|
313
|
+
create Result
|
|
314
|
+
Result.set_output_default
|
|
315
|
+
ensure
|
|
316
|
+
io_not_void: Result /= Void
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
out: STRING
|
|
320
|
+
-- New string containing terse printable representation
|
|
321
|
+
-- of current object
|
|
322
|
+
do
|
|
323
|
+
Result := tagged_out
|
|
324
|
+
ensure
|
|
325
|
+
out_not_void: Result /= Void
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
frozen tagged_out: STRING
|
|
329
|
+
-- New string containing terse printable representation
|
|
330
|
+
-- of current object
|
|
331
|
+
external
|
|
332
|
+
"built_in"
|
|
333
|
+
ensure
|
|
334
|
+
tagged_out_not_void: Result /= Void
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
print (o: detachable ANY)
|
|
338
|
+
-- Write terse external representation of `o'
|
|
339
|
+
-- on standard output.
|
|
340
|
+
do
|
|
341
|
+
if o /= Void then
|
|
342
|
+
io.put_string (o.out)
|
|
343
|
+
end
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
feature -- Platform
|
|
347
|
+
|
|
348
|
+
Operating_environment: OPERATING_ENVIRONMENT
|
|
349
|
+
-- Objects available from the operating system
|
|
350
|
+
once
|
|
351
|
+
create Result
|
|
352
|
+
ensure
|
|
353
|
+
operating_environment_not_void: Result /= Void
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
feature {NONE} -- Initialization
|
|
357
|
+
|
|
358
|
+
default_create
|
|
359
|
+
-- Process instances of classes with no creation clause.
|
|
360
|
+
-- (Default: do nothing.)
|
|
361
|
+
do
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
feature -- Basic operations
|
|
365
|
+
|
|
366
|
+
default_rescue
|
|
367
|
+
-- Process exception for routines with no Rescue clause.
|
|
368
|
+
-- (Default: do nothing.)
|
|
369
|
+
do
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
frozen do_nothing
|
|
373
|
+
-- Execute a null action.
|
|
374
|
+
do
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
frozen default: detachable like Current
|
|
378
|
+
-- Default value of object's type
|
|
379
|
+
do
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
frozen default_pointer: POINTER
|
|
383
|
+
-- Default value of type `POINTER'
|
|
384
|
+
-- (Avoid the need to write `p'.`default' for
|
|
385
|
+
-- some `p' of type `POINTER'.)
|
|
386
|
+
do
|
|
387
|
+
ensure
|
|
388
|
+
-- Result = Result.default
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
frozen as_attached: attached like Current
|
|
392
|
+
-- Attached version of Current
|
|
393
|
+
-- (Can be used during transitional period to convert
|
|
394
|
+
-- non-void-safe classes to void-safe ones.)
|
|
395
|
+
do
|
|
396
|
+
Result := Current
|
|
397
|
+
end
|
|
398
|
+
|
|
399
|
+
invariant
|
|
400
|
+
reflexive_equality: standard_is_equal (Current)
|
|
401
|
+
reflexive_conformance: conforms_to (Current)
|
|
402
|
+
|
|
403
|
+
note
|
|
404
|
+
copyright: "Copyright (c) 1984-2012, Eiffel Software and others"
|
|
405
|
+
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
|
406
|
+
source: "[
|
|
407
|
+
Eiffel Software
|
|
408
|
+
5949 Hollister Ave., Goleta, CA 93117 USA
|
|
409
|
+
Telephone 805-685-1006, Fax 805-685-6869
|
|
410
|
+
Website http://www.eiffel.com
|
|
411
|
+
Customer support http://support.eiffel.com
|
|
412
|
+
]"
|
|
413
|
+
|
|
414
|
+
end
|
|
415
|
+
|
|
416
|
+
</textarea></form>
|
|
417
|
+
<script>
|
|
418
|
+
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
|
419
|
+
mode: "text/x-eiffel",
|
|
420
|
+
tabMode: "indent",
|
|
421
|
+
indentUnit: 4,
|
|
422
|
+
lineNumbers: true,
|
|
423
|
+
theme: "neat"
|
|
424
|
+
});
|
|
425
|
+
</script>
|
|
426
|
+
|
|
427
|
+
<p><strong>MIME types defined:</strong> <code>text/x-eiffel</code>.</p>
|
|
428
|
+
|
|
429
|
+
<p> Created by <a href="https://github.com/ynh">YNH</a>.</p>
|
|
430
|
+
</article>
|
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
// block; "begin", "case", "fun", "if", "receive", "try": closed by "end"
|
|
2
|
+
// block internal; "after", "catch", "of"
|
|
3
|
+
// guard; "when", closed by "->"
|
|
4
|
+
// "->" opens a clause, closed by ";" or "."
|
|
5
|
+
// "<<" opens a binary, closed by ">>"
|
|
6
|
+
// "," appears in arglists, lists, tuples and terminates lines of code
|
|
7
|
+
// "." resets indentation to 0
|
|
8
|
+
// obsolete; "cond", "let", "query"
|
|
9
|
+
|
|
10
|
+
CodeMirror.defineMIME("text/x-erlang", "erlang");
|
|
11
|
+
|
|
12
|
+
CodeMirror.defineMode("erlang", function(cmCfg) {
|
|
13
|
+
|
|
14
|
+
function rval(state,_stream,type) {
|
|
15
|
+
// distinguish between "." as terminator and record field operator
|
|
16
|
+
state.in_record = (type == "record");
|
|
17
|
+
|
|
18
|
+
// erlang -> CodeMirror tag
|
|
19
|
+
switch (type) {
|
|
20
|
+
case "atom": return "atom";
|
|
21
|
+
case "attribute": return "attribute";
|
|
22
|
+
case "boolean": return "special";
|
|
23
|
+
case "builtin": return "builtin";
|
|
24
|
+
case "comment": return "comment";
|
|
25
|
+
case "fun": return "meta";
|
|
26
|
+
case "function": return "tag";
|
|
27
|
+
case "guard": return "property";
|
|
28
|
+
case "keyword": return "keyword";
|
|
29
|
+
case "macro": return "variable-2";
|
|
30
|
+
case "number": return "number";
|
|
31
|
+
case "operator": return "operator";
|
|
32
|
+
case "record": return "bracket";
|
|
33
|
+
case "string": return "string";
|
|
34
|
+
case "type": return "def";
|
|
35
|
+
case "variable": return "variable";
|
|
36
|
+
case "error": return "error";
|
|
37
|
+
case "separator": return null;
|
|
38
|
+
case "open_paren": return null;
|
|
39
|
+
case "close_paren": return null;
|
|
40
|
+
default: return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
var typeWords = [
|
|
45
|
+
"-type", "-spec", "-export_type", "-opaque"];
|
|
46
|
+
|
|
47
|
+
var keywordWords = [
|
|
48
|
+
"after","begin","catch","case","cond","end","fun","if",
|
|
49
|
+
"let","of","query","receive","try","when"];
|
|
50
|
+
|
|
51
|
+
var separatorRE = /[\->\.,:;]/;
|
|
52
|
+
var separatorWords = [
|
|
53
|
+
"->",";",":",".",","];
|
|
54
|
+
|
|
55
|
+
var operatorWords = [
|
|
56
|
+
"and","andalso","band","bnot","bor","bsl","bsr","bxor",
|
|
57
|
+
"div","not","or","orelse","rem","xor"];
|
|
58
|
+
|
|
59
|
+
var symbolRE = /[\+\-\*\/<>=\|:!]/;
|
|
60
|
+
var symbolWords = [
|
|
61
|
+
"+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"];
|
|
62
|
+
|
|
63
|
+
var openParenRE = /[<\(\[\{]/;
|
|
64
|
+
var openParenWords = [
|
|
65
|
+
"<<","(","[","{"];
|
|
66
|
+
|
|
67
|
+
var closeParenRE = /[>\)\]\}]/;
|
|
68
|
+
var closeParenWords = [
|
|
69
|
+
"}","]",")",">>"];
|
|
70
|
+
|
|
71
|
+
var guardWords = [
|
|
72
|
+
"is_atom","is_binary","is_bitstring","is_boolean","is_float",
|
|
73
|
+
"is_function","is_integer","is_list","is_number","is_pid",
|
|
74
|
+
"is_port","is_record","is_reference","is_tuple",
|
|
75
|
+
"atom","binary","bitstring","boolean","function","integer","list",
|
|
76
|
+
"number","pid","port","record","reference","tuple"];
|
|
77
|
+
|
|
78
|
+
var bifWords = [
|
|
79
|
+
"abs","adler32","adler32_combine","alive","apply","atom_to_binary",
|
|
80
|
+
"atom_to_list","binary_to_atom","binary_to_existing_atom",
|
|
81
|
+
"binary_to_list","binary_to_term","bit_size","bitstring_to_list",
|
|
82
|
+
"byte_size","check_process_code","contact_binary","crc32",
|
|
83
|
+
"crc32_combine","date","decode_packet","delete_module",
|
|
84
|
+
"disconnect_node","element","erase","exit","float","float_to_list",
|
|
85
|
+
"garbage_collect","get","get_keys","group_leader","halt","hd",
|
|
86
|
+
"integer_to_list","internal_bif","iolist_size","iolist_to_binary",
|
|
87
|
+
"is_alive","is_atom","is_binary","is_bitstring","is_boolean",
|
|
88
|
+
"is_float","is_function","is_integer","is_list","is_number","is_pid",
|
|
89
|
+
"is_port","is_process_alive","is_record","is_reference","is_tuple",
|
|
90
|
+
"length","link","list_to_atom","list_to_binary","list_to_bitstring",
|
|
91
|
+
"list_to_existing_atom","list_to_float","list_to_integer",
|
|
92
|
+
"list_to_pid","list_to_tuple","load_module","make_ref","module_loaded",
|
|
93
|
+
"monitor_node","node","node_link","node_unlink","nodes","notalive",
|
|
94
|
+
"now","open_port","pid_to_list","port_close","port_command",
|
|
95
|
+
"port_connect","port_control","pre_loaded","process_flag",
|
|
96
|
+
"process_info","processes","purge_module","put","register",
|
|
97
|
+
"registered","round","self","setelement","size","spawn","spawn_link",
|
|
98
|
+
"spawn_monitor","spawn_opt","split_binary","statistics",
|
|
99
|
+
"term_to_binary","time","throw","tl","trunc","tuple_size",
|
|
100
|
+
"tuple_to_list","unlink","unregister","whereis"];
|
|
101
|
+
|
|
102
|
+
// [Ø-Þ] [À-Ö]
|
|
103
|
+
// [ß-ö] [ø-ÿ]
|
|
104
|
+
var anumRE = /[\w@Ø-ÞÀ-Öß-öø-ÿ]/;
|
|
105
|
+
var escapesRE =
|
|
106
|
+
/[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/;
|
|
107
|
+
|
|
108
|
+
function tokenize(stream, state) {
|
|
109
|
+
|
|
110
|
+
// in multi-line string
|
|
111
|
+
if (state.in_string) {
|
|
112
|
+
state.in_string = (!doubleQuote(stream));
|
|
113
|
+
return rval(state,stream,"string");
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// in multi-line atom
|
|
117
|
+
if (state.in_atom) {
|
|
118
|
+
state.in_atom = (!singleQuote(stream));
|
|
119
|
+
return rval(state,stream,"atom");
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// whitespace
|
|
123
|
+
if (stream.eatSpace()) {
|
|
124
|
+
return rval(state,stream,"whitespace");
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// attributes and type specs
|
|
128
|
+
if ((peekToken(state).token == "") &&
|
|
129
|
+
stream.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/)) {
|
|
130
|
+
if (isMember(stream.current(),typeWords)) {
|
|
131
|
+
return rval(state,stream,"type");
|
|
132
|
+
}else{
|
|
133
|
+
return rval(state,stream,"attribute");
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
var ch = stream.next();
|
|
138
|
+
|
|
139
|
+
// comment
|
|
140
|
+
if (ch == '%') {
|
|
141
|
+
stream.skipToEnd();
|
|
142
|
+
return rval(state,stream,"comment");
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// macro
|
|
146
|
+
if (ch == '?') {
|
|
147
|
+
stream.eatWhile(anumRE);
|
|
148
|
+
return rval(state,stream,"macro");
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// record
|
|
152
|
+
if (ch == "#") {
|
|
153
|
+
stream.eatWhile(anumRE);
|
|
154
|
+
return rval(state,stream,"record");
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// dollar escape
|
|
158
|
+
if ( ch == "$" ) {
|
|
159
|
+
if (stream.next() == "\\" && !stream.match(escapesRE)) {
|
|
160
|
+
return rval(state,stream,"error");
|
|
161
|
+
}
|
|
162
|
+
return rval(state,stream,"number");
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// quoted atom
|
|
166
|
+
if (ch == '\'') {
|
|
167
|
+
if (!(state.in_atom = (!singleQuote(stream)))) {
|
|
168
|
+
if (stream.match(/\s*\/\s*[0-9]/,false)) {
|
|
169
|
+
stream.match(/\s*\/\s*[0-9]/,true);
|
|
170
|
+
popToken(state);
|
|
171
|
+
return rval(state,stream,"fun"); // 'f'/0 style fun
|
|
172
|
+
}
|
|
173
|
+
if (stream.match(/\s*\(/,false) || stream.match(/\s*:/,false)) {
|
|
174
|
+
return rval(state,stream,"function");
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return rval(state,stream,"atom");
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// string
|
|
181
|
+
if (ch == '"') {
|
|
182
|
+
state.in_string = (!doubleQuote(stream));
|
|
183
|
+
return rval(state,stream,"string");
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// variable
|
|
187
|
+
if (/[A-Z_Ø-ÞÀ-Ö]/.test(ch)) {
|
|
188
|
+
stream.eatWhile(anumRE);
|
|
189
|
+
return rval(state,stream,"variable");
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// atom/keyword/BIF/function
|
|
193
|
+
if (/[a-z_ß-öø-ÿ]/.test(ch)) {
|
|
194
|
+
stream.eatWhile(anumRE);
|
|
195
|
+
|
|
196
|
+
if (stream.match(/\s*\/\s*[0-9]/,false)) {
|
|
197
|
+
stream.match(/\s*\/\s*[0-9]/,true);
|
|
198
|
+
popToken(state);
|
|
199
|
+
return rval(state,stream,"fun"); // f/0 style fun
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
var w = stream.current();
|
|
203
|
+
|
|
204
|
+
if (isMember(w,keywordWords)) {
|
|
205
|
+
pushToken(state,stream);
|
|
206
|
+
return rval(state,stream,"keyword");
|
|
207
|
+
}else if (stream.match(/\s*\(/,false)) {
|
|
208
|
+
// 'put' and 'erlang:put' are bifs, 'foo:put' is not
|
|
209
|
+
if (isMember(w,bifWords) &&
|
|
210
|
+
(!isPrev(stream,":") || isPrev(stream,"erlang:"))) {
|
|
211
|
+
return rval(state,stream,"builtin");
|
|
212
|
+
}else if (isMember(w,guardWords)) {
|
|
213
|
+
return rval(state,stream,"guard");
|
|
214
|
+
}else{
|
|
215
|
+
return rval(state,stream,"function");
|
|
216
|
+
}
|
|
217
|
+
}else if (isMember(w,operatorWords)) {
|
|
218
|
+
return rval(state,stream,"operator");
|
|
219
|
+
}else if (stream.match(/\s*:/,false)) {
|
|
220
|
+
if (w == "erlang") {
|
|
221
|
+
return rval(state,stream,"builtin");
|
|
222
|
+
} else {
|
|
223
|
+
return rval(state,stream,"function");
|
|
224
|
+
}
|
|
225
|
+
}else if (isMember(w,["true","false"])) {
|
|
226
|
+
return rval(state,stream,"boolean");
|
|
227
|
+
}else{
|
|
228
|
+
return rval(state,stream,"atom");
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// number
|
|
233
|
+
var digitRE = /[0-9]/;
|
|
234
|
+
var radixRE = /[0-9a-zA-Z]/; // 36#zZ style int
|
|
235
|
+
if (digitRE.test(ch)) {
|
|
236
|
+
stream.eatWhile(digitRE);
|
|
237
|
+
if (stream.eat('#')) {
|
|
238
|
+
stream.eatWhile(radixRE); // 36#aZ style integer
|
|
239
|
+
} else {
|
|
240
|
+
if (stream.eat('.')) { // float
|
|
241
|
+
stream.eatWhile(digitRE);
|
|
242
|
+
}
|
|
243
|
+
if (stream.eat(/[eE]/)) {
|
|
244
|
+
stream.eat(/[-+]/); // float with exponent
|
|
245
|
+
stream.eatWhile(digitRE);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return rval(state,stream,"number"); // normal integer
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// open parens
|
|
252
|
+
if (nongreedy(stream,openParenRE,openParenWords)) {
|
|
253
|
+
pushToken(state,stream);
|
|
254
|
+
return rval(state,stream,"open_paren");
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// close parens
|
|
258
|
+
if (nongreedy(stream,closeParenRE,closeParenWords)) {
|
|
259
|
+
pushToken(state,stream);
|
|
260
|
+
return rval(state,stream,"close_paren");
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
// separators
|
|
264
|
+
if (greedy(stream,separatorRE,separatorWords)) {
|
|
265
|
+
// distinguish between "." as terminator and record field operator
|
|
266
|
+
if (!state.in_record) {
|
|
267
|
+
pushToken(state,stream);
|
|
268
|
+
}
|
|
269
|
+
return rval(state,stream,"separator");
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// operators
|
|
273
|
+
if (greedy(stream,symbolRE,symbolWords)) {
|
|
274
|
+
return rval(state,stream,"operator");
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
return rval(state,stream,null);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function isPrev(stream,string) {
|
|
281
|
+
var start = stream.start;
|
|
282
|
+
var len = string.length;
|
|
283
|
+
if (len <= start) {
|
|
284
|
+
var word = stream.string.slice(start-len,start);
|
|
285
|
+
return word == string;
|
|
286
|
+
}else{
|
|
287
|
+
return false;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
function nongreedy(stream,re,words) {
|
|
292
|
+
if (stream.current().length == 1 && re.test(stream.current())) {
|
|
293
|
+
stream.backUp(1);
|
|
294
|
+
while (re.test(stream.peek())) {
|
|
295
|
+
stream.next();
|
|
296
|
+
if (isMember(stream.current(),words)) {
|
|
297
|
+
return true;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
stream.backUp(stream.current().length-1);
|
|
301
|
+
}
|
|
302
|
+
return false;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
function greedy(stream,re,words) {
|
|
306
|
+
if (stream.current().length == 1 && re.test(stream.current())) {
|
|
307
|
+
while (re.test(stream.peek())) {
|
|
308
|
+
stream.next();
|
|
309
|
+
}
|
|
310
|
+
while (0 < stream.current().length) {
|
|
311
|
+
if (isMember(stream.current(),words)) {
|
|
312
|
+
return true;
|
|
313
|
+
}else{
|
|
314
|
+
stream.backUp(1);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
stream.next();
|
|
318
|
+
}
|
|
319
|
+
return false;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function doubleQuote(stream) {
|
|
323
|
+
return quote(stream, '"', '\\');
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
function singleQuote(stream) {
|
|
327
|
+
return quote(stream,'\'','\\');
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function quote(stream,quoteChar,escapeChar) {
|
|
331
|
+
while (!stream.eol()) {
|
|
332
|
+
var ch = stream.next();
|
|
333
|
+
if (ch == quoteChar) {
|
|
334
|
+
return true;
|
|
335
|
+
}else if (ch == escapeChar) {
|
|
336
|
+
stream.next();
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
return false;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
function isMember(element,list) {
|
|
343
|
+
return (-1 < list.indexOf(element));
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/////////////////////////////////////////////////////////////////////////////
|
|
347
|
+
function myIndent(state,textAfter) {
|
|
348
|
+
var indent = cmCfg.indentUnit;
|
|
349
|
+
var token = (peekToken(state)).token;
|
|
350
|
+
var wordAfter = takewhile(textAfter,/[^a-z]/);
|
|
351
|
+
|
|
352
|
+
if (state.in_string || state.in_atom) {
|
|
353
|
+
return CodeMirror.Pass;
|
|
354
|
+
}else if (token == "") {
|
|
355
|
+
return 0;
|
|
356
|
+
}else if (isMember(token,openParenWords)) {
|
|
357
|
+
return (peekToken(state)).column+token.length;
|
|
358
|
+
}else if (token == "when") {
|
|
359
|
+
return (peekToken(state)).column+token.length+1;
|
|
360
|
+
}else if (token == "fun" && wordAfter == "") {
|
|
361
|
+
return (peekToken(state)).column+token.length;
|
|
362
|
+
}else if (token == "->") {
|
|
363
|
+
if (isMember(wordAfter,["end","after","catch"])) {
|
|
364
|
+
return peekToken(state,2).column;
|
|
365
|
+
}else if (peekToken(state,2).token == "fun") {
|
|
366
|
+
return peekToken(state,2).column+indent;
|
|
367
|
+
}else if (peekToken(state,2).token == "") {
|
|
368
|
+
return indent;
|
|
369
|
+
}else{
|
|
370
|
+
return (peekToken(state)).indent+indent;
|
|
371
|
+
}
|
|
372
|
+
}else if (isMember(wordAfter,["after","catch","of"])) {
|
|
373
|
+
return (peekToken(state)).indent;
|
|
374
|
+
}else{
|
|
375
|
+
return (peekToken(state)).column+indent;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
function takewhile(str,re) {
|
|
380
|
+
var m = str.match(re);
|
|
381
|
+
return m ? str.slice(0,m.index) : str;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
function Token(stream) {
|
|
385
|
+
this.token = stream ? stream.current() : "";
|
|
386
|
+
this.column = stream ? stream.column() : 0;
|
|
387
|
+
this.indent = stream ? stream.indentation() : 0;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
function popToken(state) {
|
|
391
|
+
return state.tokenStack.pop();
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
function peekToken(state,depth) {
|
|
395
|
+
var len = state.tokenStack.length;
|
|
396
|
+
var dep = (depth ? depth : 1);
|
|
397
|
+
if (len < dep) {
|
|
398
|
+
return new Token;
|
|
399
|
+
}else{
|
|
400
|
+
return state.tokenStack[len-dep];
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
function pushToken(state,stream) {
|
|
405
|
+
var token = stream.current();
|
|
406
|
+
var prev_token = peekToken(state).token;
|
|
407
|
+
|
|
408
|
+
if (token == ".") {
|
|
409
|
+
state.tokenStack = [];
|
|
410
|
+
return false;
|
|
411
|
+
}else if(isMember(token,[",", ":", "of", "cond", "let", "query"])) {
|
|
412
|
+
return false;
|
|
413
|
+
}else if (drop_last(prev_token,token)) {
|
|
414
|
+
return false;
|
|
415
|
+
}else if (drop_both(prev_token,token)) {
|
|
416
|
+
popToken(state);
|
|
417
|
+
return false;
|
|
418
|
+
}else if (drop_first(prev_token,token)) {
|
|
419
|
+
popToken(state);
|
|
420
|
+
return pushToken(state,stream);
|
|
421
|
+
}else if (isMember(token,["after","catch"])) {
|
|
422
|
+
return false;
|
|
423
|
+
}else{
|
|
424
|
+
state.tokenStack.push(new Token(stream));
|
|
425
|
+
return true;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
function drop_last(open, close) {
|
|
430
|
+
switch(open+" "+close) {
|
|
431
|
+
case "when ;": return true;
|
|
432
|
+
default: return false;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
function drop_first(open, close) {
|
|
437
|
+
switch (open+" "+close) {
|
|
438
|
+
case "when ->": return true;
|
|
439
|
+
case "-> end": return true;
|
|
440
|
+
default: return false;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
function drop_both(open, close) {
|
|
445
|
+
switch (open+" "+close) {
|
|
446
|
+
case "( )": return true;
|
|
447
|
+
case "[ ]": return true;
|
|
448
|
+
case "{ }": return true;
|
|
449
|
+
case "<< >>": return true;
|
|
450
|
+
case "begin end": return true;
|
|
451
|
+
case "case end": return true;
|
|
452
|
+
case "fun end": return true;
|
|
453
|
+
case "if end": return true;
|
|
454
|
+
case "receive end": return true;
|
|
455
|
+
case "try end": return true;
|
|
456
|
+
case "-> catch": return true;
|
|
457
|
+
case "-> after": return true;
|
|
458
|
+
case "-> ;": return true;
|
|
459
|
+
default: return false;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
return {
|
|
464
|
+
startState:
|
|
465
|
+
function() {
|
|
466
|
+
return {tokenStack: [],
|
|
467
|
+
in_record: false,
|
|
468
|
+
in_string: false,
|
|
469
|
+
in_atom: false};
|
|
470
|
+
},
|
|
471
|
+
|
|
472
|
+
token:
|
|
473
|
+
function(stream, state) {
|
|
474
|
+
return tokenize(stream, state);
|
|
475
|
+
},
|
|
476
|
+
|
|
477
|
+
indent:
|
|
478
|
+
function(state, textAfter) {
|
|
479
|
+
return myIndent(state,textAfter);
|
|
480
|
+
},
|
|
481
|
+
|
|
482
|
+
lineComment: "%"
|
|
483
|
+
};
|
|
484
|
+
});
|