fluentd-ui 0.3.12 → 0.3.13
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fluentd-ui might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/ChangeLog +4 -0
- data/Gemfile.lock +1 -1
- data/app/assets/javascripts/application.js +2 -0
- data/app/assets/javascripts/codemirror.js +29 -0
- data/app/assets/javascripts/codemirror_fluentd.js +59 -0
- data/app/assets/stylesheets/application.css +6 -0
- data/app/views/fluentd/settings/edit.html.haml +1 -1
- data/app/views/shared/vue/_setting.html.erb +1 -1
- data/bower.json +2 -1
- data/lib/fluentd-ui/version.rb +1 -1
- data/spec/features/source_and_output_spec.rb +16 -6
- data/vendor/assets/javascripts/bower/codemirror/.bower.json +29 -0
- data/vendor/assets/javascripts/bower/codemirror/AUTHORS +423 -0
- data/vendor/assets/javascripts/bower/codemirror/CONTRIBUTING.md +76 -0
- data/vendor/assets/javascripts/bower/codemirror/LICENSE +19 -0
- data/vendor/assets/javascripts/bower/codemirror/README.md +11 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/comment/comment.js +183 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/comment/continuecomment.js +85 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/dialog/dialog.css +32 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/dialog/dialog.js +155 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/display/fullscreen.css +6 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/display/fullscreen.js +41 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/display/panel.js +94 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/display/placeholder.js +58 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/display/rulers.js +64 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/edit/closebrackets.js +159 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/edit/closetag.js +159 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/edit/continuelist.js +51 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/edit/matchbrackets.js +120 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/edit/matchtags.js +66 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/edit/trailingspace.js +27 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/brace-fold.js +105 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/comment-fold.js +57 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldcode.js +145 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldgutter.css +20 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldgutter.js +134 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/indent-fold.js +44 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/markdown-fold.js +49 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/fold/xml-fold.js +182 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/anyword-hint.js +41 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/css-hint.js +56 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/html-hint.js +348 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/javascript-hint.js +146 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/show-hint.css +38 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/show-hint.js +389 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/sql-hint.js +197 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/hint/xml-hint.js +110 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/coffeescript-lint.js +41 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/css-lint.js +35 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/javascript-lint.js +136 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/json-lint.js +31 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/lint.css +73 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/lint.js +204 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/lint/yaml-lint.js +28 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/merge/merge.css +112 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/merge/merge.js +643 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/mode/loadmode.js +64 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/mode/multiplex.js +118 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/mode/multiplex_test.js +33 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/mode/overlay.js +85 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/mode/simple.js +213 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/runmode/colorize.js +40 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode-standalone.js +157 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode.js +72 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode.node.js +120 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/scroll/annotatescrollbar.js +76 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/scroll/scrollpastend.js +46 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/scroll/simplescrollbars.css +66 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/scroll/simplescrollbars.js +139 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/search/match-highlighter.js +128 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/search/matchesonscrollbar.css +8 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/search/matchesonscrollbar.js +90 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/search/search.js +164 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/search/searchcursor.js +189 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/selection/active-line.js +71 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/selection/mark-selection.js +118 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/tern/tern.css +86 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/tern/tern.js +670 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/tern/worker.js +44 -0
- data/vendor/assets/javascripts/bower/codemirror/addon/wrap/hardwrap.js +139 -0
- data/vendor/assets/javascripts/bower/codemirror/bower.json +16 -0
- data/vendor/assets/javascripts/bower/codemirror/keymap/emacs.js +411 -0
- data/vendor/assets/javascripts/bower/codemirror/keymap/sublime.js +540 -0
- data/vendor/assets/javascripts/bower/codemirror/keymap/vim.js +4901 -0
- data/vendor/assets/javascripts/bower/codemirror/lib/codemirror.css +309 -0
- data/vendor/assets/javascripts/bower/codemirror/lib/codemirror.js +8029 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/apl/apl.js +175 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/asterisk/asterisk.js +198 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/clike/clike.js +489 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/clike/scala.html +767 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/clojure/clojure.js +243 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/cobol/cobol.js +255 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/coffeescript/coffeescript.js +369 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/commonlisp/commonlisp.js +122 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/css/css.js +717 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/css/less.html +152 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/css/less_test.js +51 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/css/scss.html +157 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/css/scss_test.js +110 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/css/test.js +135 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/cypher/cypher.js +146 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/d/d.js +218 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/dart/dart.js +50 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/diff/diff.js +47 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/django/django.js +67 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/dockerfile/dockerfile.js +76 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/dtd/dtd.js +142 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/dylan/dylan.js +299 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/ebnf/ebnf.js +195 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/ecl/ecl.js +207 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/eiffel/eiffel.js +162 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/erlang/erlang.js +622 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/fortran/fortran.js +188 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/gas/gas.js +345 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/gfm/gfm.js +123 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/gfm/test.js +213 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/gherkin/gherkin.js +178 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/go/go.js +184 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/groovy/groovy.js +226 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/haml/haml.js +159 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/haml/test.js +97 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/haskell/haskell.js +267 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/haxe/haxe.js +518 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/htmlembedded/htmlembedded.js +86 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/htmlmixed/htmlmixed.js +121 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/http/http.js +113 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/idl/idl.js +290 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/jade/jade.js +590 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/javascript/javascript.js +686 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/javascript/json-ld.html +72 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/javascript/test.js +200 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/javascript/typescript.html +61 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/jinja2/jinja2.js +142 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/julia/julia.js +301 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/kotlin/kotlin.js +280 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/livescript/livescript.js +280 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/lua/lua.js +159 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/markdown/markdown.js +765 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/markdown/test.js +754 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/meta.js +165 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/mirc/mirc.js +193 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/mllike/mllike.js +205 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/modelica/modelica.js +245 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/nginx/nginx.js +178 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/ntriples/ntriples.js +186 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/octave/octave.js +135 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/pascal/pascal.js +109 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/pegjs/pegjs.js +114 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/perl/perl.js +832 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/php/php.js +226 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/php/test.js +154 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/pig/pig.js +188 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/properties/properties.js +78 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/puppet/puppet.js +220 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/python/python.js +359 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/q/q.js +139 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/r/r.js +162 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/rpm/rpm.js +101 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/rst/rst.js +557 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/ruby/ruby.js +285 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/ruby/test.js +14 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/rust/rust.js +451 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/sass/sass.js +327 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/scheme/scheme.js +248 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/shell/shell.js +139 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/shell/test.js +58 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/sieve/sieve.js +193 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/slim/slim.js +575 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/slim/test.js +96 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/smalltalk/smalltalk.js +168 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/smarty/smarty.js +221 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/smartymixed/smartymixed.js +197 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/solr/solr.js +104 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/soy/soy.js +198 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/sparql/sparql.js +174 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/spreadsheet/spreadsheet.js +109 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/sql/sql.js +391 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/stex/stex.js +251 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/stex/test.js +123 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/tcl/tcl.js +147 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/textile/test.js +417 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/textile/textile.js +469 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/tiddlywiki/tiddlywiki.js +369 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/tiki/tiki.css +26 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/tiki/tiki.js +323 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/toml/toml.js +88 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/tornado/tornado.js +68 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/turtle/turtle.js +162 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/vb/vb.js +274 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/vbscript/vbscript.js +350 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/velocity/velocity.js +201 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/verilog/test.js +273 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/verilog/verilog.js +364 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/xml/test.js +51 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/xml/xml.js +384 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/xquery/test.js +67 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/xquery/xquery.js +447 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/yaml/yaml.js +117 -0
- data/vendor/assets/javascripts/bower/codemirror/mode/z80/z80.js +100 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/3024-day.css +38 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/3024-night.css +37 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/ambiance-mobile.css +5 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/ambiance.css +77 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/base16-dark.css +36 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/base16-light.css +36 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/blackboard.css +30 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/cobalt.css +23 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/eclipse.css +23 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/elegant.css +13 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/erlang-dark.css +32 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/lesser-dark.css +45 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/mbo.css +35 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/mdn-like.css +44 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/midnight.css +45 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/monokai.css +31 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/neat.css +12 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/neo.css +43 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/night.css +26 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/paraiso-dark.css +36 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/paraiso-light.css +36 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/pastel-on-dark.css +50 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/rubyblue.css +23 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/solarized.css +165 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/the-matrix.css +28 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/tomorrow-night-bright.css +35 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/tomorrow-night-eighties.css +36 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/twilight.css +30 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/vibrant-ink.css +32 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/xq-dark.css +51 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/xq-light.css +43 -0
- data/vendor/assets/javascripts/bower/codemirror/theme/zenburn.css +37 -0
- metadata +225 -2
@@ -0,0 +1,165 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
(function(mod) {
|
5
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6
|
+
mod(require("../lib/codemirror"));
|
7
|
+
else if (typeof define == "function" && define.amd) // AMD
|
8
|
+
define(["../lib/codemirror"], mod);
|
9
|
+
else // Plain browser env
|
10
|
+
mod(CodeMirror);
|
11
|
+
})(function(CodeMirror) {
|
12
|
+
"use strict";
|
13
|
+
|
14
|
+
CodeMirror.modeInfo = [
|
15
|
+
{name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]},
|
16
|
+
{name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk"},
|
17
|
+
{name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h"]},
|
18
|
+
{name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "hpp", "h++"], alias: ["cpp"]},
|
19
|
+
{name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]},
|
20
|
+
{name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp"]},
|
21
|
+
{name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj"]},
|
22
|
+
{name: "CoffeeScript", mime: "text/x-coffeescript", mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]},
|
23
|
+
{name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]},
|
24
|
+
{name: "Cypher", mime: "application/x-cypher-query", mode: "cypher"},
|
25
|
+
{name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]},
|
26
|
+
{name: "CSS", mime: "text/css", mode: "css", ext: ["css"]},
|
27
|
+
{name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"]},
|
28
|
+
{name: "D", mime: "text/x-d", mode: "d", ext: ["d"]},
|
29
|
+
{name: "Dart", mimes: ["application/dart", "text/x-dart"], mode: "dart", ext: ["dart"]},
|
30
|
+
{name: "diff", mime: "text/x-diff", mode: "diff", ext: ["diff", "patch"]},
|
31
|
+
{name: "Django", mime: "text/x-django", mode: "django"},
|
32
|
+
{name: "Dockerfile", mime: "text/x-dockerfile", mode: "dockerfile"},
|
33
|
+
{name: "DTD", mime: "application/xml-dtd", mode: "dtd", ext: ["dtd"]},
|
34
|
+
{name: "Dylan", mime: "text/x-dylan", mode: "dylan", ext: ["dylan", "dyl", "intr"]},
|
35
|
+
{name: "EBNF", mime: "text/x-ebnf", mode: "ebnf"},
|
36
|
+
{name: "ECL", mime: "text/x-ecl", mode: "ecl", ext: ["ecl"]},
|
37
|
+
{name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]},
|
38
|
+
{name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]},
|
39
|
+
{name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]},
|
40
|
+
{name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]},
|
41
|
+
{name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90"]},
|
42
|
+
{name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]},
|
43
|
+
{name: "Gas", mime: "text/x-gas", mode: "gas", ext: ["s"]},
|
44
|
+
{name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]},
|
45
|
+
{name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm"},
|
46
|
+
{name: "Go", mime: "text/x-go", mode: "go", ext: ["go"]},
|
47
|
+
{name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy"]},
|
48
|
+
{name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]},
|
49
|
+
{name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]},
|
50
|
+
{name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]},
|
51
|
+
{name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]},
|
52
|
+
{name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"]},
|
53
|
+
{name: "HTML", mime: "text/html", mode: "htmlmixed", ext: ["html", "htm"], alias: ["xhtml"]},
|
54
|
+
{name: "HTTP", mime: "message/http", mode: "http"},
|
55
|
+
{name: "IDL", mime: "text/x-idl", mode: "idl", ext: ["pro"]},
|
56
|
+
{name: "Jade", mime: "text/x-jade", mode: "jade", ext: ["jade"]},
|
57
|
+
{name: "Java", mime: "text/x-java", mode: "clike", ext: ["java"]},
|
58
|
+
{name: "Java Server Pages", mime: "application/x-jsp", mode: "htmlembedded", ext: ["jsp"], alias: ["jsp"]},
|
59
|
+
{name: "JavaScript", mimes: ["text/javascript", "text/ecmascript", "application/javascript", "application/x-javascript", "application/ecmascript"],
|
60
|
+
mode: "javascript", ext: ["js"], alias: ["ecmascript", "js", "node"]},
|
61
|
+
{name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]},
|
62
|
+
{name: "JSON-LD", mime: "application/ld+json", mode: "javascript", alias: ["jsonld"]},
|
63
|
+
{name: "Jinja2", mime: "null", mode: "jinja2"},
|
64
|
+
{name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]},
|
65
|
+
{name: "Kotlin", mime: "text/x-kotlin", mode: "kotlin", ext: ["kt"]},
|
66
|
+
{name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]},
|
67
|
+
{name: "LiveScript", mime: "text/x-livescript", mode: "livescript", ext: ["ls"], alias: ["ls"]},
|
68
|
+
{name: "Lua", mime: "text/x-lua", mode: "lua", ext: ["lua"]},
|
69
|
+
{name: "Markdown", mime: "text/x-markdown", mode: "markdown", ext: ["markdown", "md", "mkd"]},
|
70
|
+
{name: "mIRC", mime: "text/mirc", mode: "mirc"},
|
71
|
+
{name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql"},
|
72
|
+
{name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]},
|
73
|
+
{name: "MS SQL", mime: "text/x-mssql", mode: "sql"},
|
74
|
+
{name: "MySQL", mime: "text/x-mysql", mode: "sql"},
|
75
|
+
{name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx"},
|
76
|
+
{name: "NTriples", mime: "text/n-triples", mode: "ntriples", ext: ["nt"]},
|
77
|
+
{name: "Objective C", mime: "text/x-objectivec", mode: "clike", ext: ["m", "mm"]},
|
78
|
+
{name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"]},
|
79
|
+
{name: "Octave", mime: "text/x-octave", mode: "octave", ext: ["m"]},
|
80
|
+
{name: "Pascal", mime: "text/x-pascal", mode: "pascal", ext: ["p", "pas"]},
|
81
|
+
{name: "PEG.js", mime: "null", mode: "pegjs"},
|
82
|
+
{name: "Perl", mime: "text/x-perl", mode: "perl", ext: ["pl", "pm"]},
|
83
|
+
{name: "PHP", mime: "application/x-httpd-php", mode: "php", ext: ["php", "php3", "php4", "php5", "phtml"]},
|
84
|
+
{name: "Pig", mime: "text/x-pig", mode: "pig"},
|
85
|
+
{name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"]},
|
86
|
+
{name: "PLSQL", mime: "text/x-plsql", mode: "sql"},
|
87
|
+
{name: "Properties files", mime: "text/x-properties", mode: "properties", ext: ["properties", "ini", "in"], alias: ["ini", "properties"]},
|
88
|
+
{name: "Python", mime: "text/x-python", mode: "python", ext: ["py", "pyw"]},
|
89
|
+
{name: "Puppet", mime: "text/x-puppet", mode: "puppet", ext: ["pp"]},
|
90
|
+
{name: "Q", mime: "text/x-q", mode: "q", ext: ["q"]},
|
91
|
+
{name: "R", mime: "text/x-rsrc", mode: "r", ext: ["r"], alias: ["rscript"]},
|
92
|
+
{name: "reStructuredText", mime: "text/x-rst", mode: "rst", ext: ["rst"], alias: ["rst"]},
|
93
|
+
{name: "RPM Changes", mime: "text/x-rpm-changes", mode: "rpm"},
|
94
|
+
{name: "RPM Spec", mime: "text/x-rpm-spec", mode: "rpm", ext: ["spec"]},
|
95
|
+
{name: "Ruby", mime: "text/x-ruby", mode: "ruby", ext: ["rb"], alias: ["jruby", "macruby", "rake", "rb", "rbx"]},
|
96
|
+
{name: "Rust", mime: "text/x-rustsrc", mode: "rust", ext: ["rs"]},
|
97
|
+
{name: "Sass", mime: "text/x-sass", mode: "sass", ext: ["sass"]},
|
98
|
+
{name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"]},
|
99
|
+
{name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"]},
|
100
|
+
{name: "SCSS", mime: "text/x-scss", mode: "css", ext: ["scss"]},
|
101
|
+
{name: "Shell", mime: "text/x-sh", mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"]},
|
102
|
+
{name: "Sieve", mime: "application/sieve", mode: "sieve"},
|
103
|
+
{name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim"},
|
104
|
+
{name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]},
|
105
|
+
{name: "Smarty", mime: "text/x-smarty", mode: "smarty", ext: ["tpl"]},
|
106
|
+
{name: "SmartyMixed", mime: "text/x-smarty", mode: "smartymixed"},
|
107
|
+
{name: "Solr", mime: "text/x-solr", mode: "solr"},
|
108
|
+
{name: "Soy", mime: "text/x-soy", mode: "soy", ext: ["soy"], alias: ["closure template"]},
|
109
|
+
{name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]},
|
110
|
+
{name: "Spreadsheet", mime: "text/x-spreadsheet", mode: "spreadsheet", alias: ["excel", "formula"]},
|
111
|
+
{name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]},
|
112
|
+
{name: "MariaDB", mime: "text/x-mariadb", mode: "sql"},
|
113
|
+
{name: "sTeX", mime: "text/x-stex", mode: "stex"},
|
114
|
+
{name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx"], alias: ["tex"]},
|
115
|
+
{name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v"]},
|
116
|
+
{name: "Tcl", mime: "text/x-tcl", mode: "tcl", ext: ["tcl"]},
|
117
|
+
{name: "Textile", mime: "text/x-textile", mode: "textile"},
|
118
|
+
{name: "TiddlyWiki ", mime: "text/x-tiddlywiki", mode: "tiddlywiki"},
|
119
|
+
{name: "Tiki wiki", mime: "text/tiki", mode: "tiki"},
|
120
|
+
{name: "TOML", mime: "text/x-toml", mode: "toml"},
|
121
|
+
{name: "Tornado", mime: "text/x-tornado", mode: "tornado"},
|
122
|
+
{name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]},
|
123
|
+
{name: "TypeScript", mime: "application/typescript", mode: "javascript", ext: ["ts"], alias: ["ts"]},
|
124
|
+
{name: "VB.NET", mime: "text/x-vb", mode: "vb", ext: ["vb"]},
|
125
|
+
{name: "VBScript", mime: "text/vbscript", mode: "vbscript"},
|
126
|
+
{name: "Velocity", mime: "text/velocity", mode: "velocity", ext: ["vtl"]},
|
127
|
+
{name: "Verilog", mime: "text/x-verilog", mode: "verilog", ext: ["v"]},
|
128
|
+
{name: "XML", mimes: ["application/xml", "text/xml"], mode: "xml", ext: ["xml", "xsl", "xsd"], alias: ["rss", "wsdl", "xsd"]},
|
129
|
+
{name: "XQuery", mime: "application/xquery", mode: "xquery", ext: ["xy", "xquery"]},
|
130
|
+
{name: "YAML", mime: "text/x-yaml", mode: "yaml", ext: ["yaml"], alias: ["yml"]},
|
131
|
+
{name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]}
|
132
|
+
];
|
133
|
+
// Ensure all modes have a mime property for backwards compatibility
|
134
|
+
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
|
135
|
+
var info = CodeMirror.modeInfo[i];
|
136
|
+
if (info.mimes) info.mime = info.mimes[0];
|
137
|
+
}
|
138
|
+
|
139
|
+
CodeMirror.findModeByMIME = function(mime) {
|
140
|
+
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
|
141
|
+
var info = CodeMirror.modeInfo[i];
|
142
|
+
if (info.mime == mime) return info;
|
143
|
+
if (info.mimes) for (var j = 0; j < info.mimes.length; j++)
|
144
|
+
if (info.mimes[j] == mime) return info;
|
145
|
+
}
|
146
|
+
};
|
147
|
+
|
148
|
+
CodeMirror.findModeByExtension = function(ext) {
|
149
|
+
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
|
150
|
+
var info = CodeMirror.modeInfo[i];
|
151
|
+
if (info.ext) for (var j = 0; j < info.ext.length; j++)
|
152
|
+
if (info.ext[j] == ext) return info;
|
153
|
+
}
|
154
|
+
};
|
155
|
+
|
156
|
+
CodeMirror.findModeByName = function(name) {
|
157
|
+
name = name.toLowerCase();
|
158
|
+
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
|
159
|
+
var info = CodeMirror.modeInfo[i];
|
160
|
+
if (info.name.toLowerCase() == name) return info;
|
161
|
+
if (info.alias) for (var j = 0; j < info.alias.length; j++)
|
162
|
+
if (info.alias[j].toLowerCase() == name) return info;
|
163
|
+
}
|
164
|
+
};
|
165
|
+
});
|
@@ -0,0 +1,193 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
//mIRC mode by Ford_Lawnmower :: Based on Velocity mode by Steve O'Hara
|
5
|
+
|
6
|
+
(function(mod) {
|
7
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
8
|
+
mod(require("../../lib/codemirror"));
|
9
|
+
else if (typeof define == "function" && define.amd) // AMD
|
10
|
+
define(["../../lib/codemirror"], mod);
|
11
|
+
else // Plain browser env
|
12
|
+
mod(CodeMirror);
|
13
|
+
})(function(CodeMirror) {
|
14
|
+
"use strict";
|
15
|
+
|
16
|
+
CodeMirror.defineMIME("text/mirc", "mirc");
|
17
|
+
CodeMirror.defineMode("mirc", function() {
|
18
|
+
function parseWords(str) {
|
19
|
+
var obj = {}, words = str.split(" ");
|
20
|
+
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
21
|
+
return obj;
|
22
|
+
}
|
23
|
+
var specials = parseWords("$! $$ $& $? $+ $abook $abs $active $activecid " +
|
24
|
+
"$activewid $address $addtok $agent $agentname $agentstat $agentver " +
|
25
|
+
"$alias $and $anick $ansi2mirc $aop $appactive $appstate $asc $asctime " +
|
26
|
+
"$asin $atan $avoice $away $awaymsg $awaytime $banmask $base $bfind " +
|
27
|
+
"$binoff $biton $bnick $bvar $bytes $calc $cb $cd $ceil $chan $chanmodes " +
|
28
|
+
"$chantypes $chat $chr $cid $clevel $click $cmdbox $cmdline $cnick $color " +
|
29
|
+
"$com $comcall $comchan $comerr $compact $compress $comval $cos $count " +
|
30
|
+
"$cr $crc $creq $crlf $ctime $ctimer $ctrlenter $date $day $daylight " +
|
31
|
+
"$dbuh $dbuw $dccignore $dccport $dde $ddename $debug $decode $decompress " +
|
32
|
+
"$deltok $devent $dialog $did $didreg $didtok $didwm $disk $dlevel $dll " +
|
33
|
+
"$dllcall $dname $dns $duration $ebeeps $editbox $emailaddr $encode $error " +
|
34
|
+
"$eval $event $exist $feof $ferr $fgetc $file $filename $filtered $finddir " +
|
35
|
+
"$finddirn $findfile $findfilen $findtok $fline $floor $fopen $fread $fserve " +
|
36
|
+
"$fulladdress $fulldate $fullname $fullscreen $get $getdir $getdot $gettok $gmt " +
|
37
|
+
"$group $halted $hash $height $hfind $hget $highlight $hnick $hotline " +
|
38
|
+
"$hotlinepos $ial $ialchan $ibl $idle $iel $ifmatch $ignore $iif $iil " +
|
39
|
+
"$inelipse $ini $inmidi $inpaste $inpoly $input $inrect $inroundrect " +
|
40
|
+
"$insong $instok $int $inwave $ip $isalias $isbit $isdde $isdir $isfile " +
|
41
|
+
"$isid $islower $istok $isupper $keychar $keyrpt $keyval $knick $lactive " +
|
42
|
+
"$lactivecid $lactivewid $left $len $level $lf $line $lines $link $lock " +
|
43
|
+
"$lock $locked $log $logstamp $logstampfmt $longfn $longip $lower $ltimer " +
|
44
|
+
"$maddress $mask $matchkey $matchtok $md5 $me $menu $menubar $menucontext " +
|
45
|
+
"$menutype $mid $middir $mircdir $mircexe $mircini $mklogfn $mnick $mode " +
|
46
|
+
"$modefirst $modelast $modespl $mouse $msfile $network $newnick $nick $nofile " +
|
47
|
+
"$nopath $noqt $not $notags $notify $null $numeric $numok $oline $onpoly " +
|
48
|
+
"$opnick $or $ord $os $passivedcc $pic $play $pnick $port $portable $portfree " +
|
49
|
+
"$pos $prefix $prop $protect $puttok $qt $query $rand $r $rawmsg $read $readomo " +
|
50
|
+
"$readn $regex $regml $regsub $regsubex $remove $remtok $replace $replacex " +
|
51
|
+
"$reptok $result $rgb $right $round $scid $scon $script $scriptdir $scriptline " +
|
52
|
+
"$sdir $send $server $serverip $sfile $sha1 $shortfn $show $signal $sin " +
|
53
|
+
"$site $sline $snick $snicks $snotify $sock $sockbr $sockerr $sockname " +
|
54
|
+
"$sorttok $sound $sqrt $ssl $sreq $sslready $status $strip $str $stripped " +
|
55
|
+
"$syle $submenu $switchbar $tan $target $ticks $time $timer $timestamp " +
|
56
|
+
"$timestampfmt $timezone $tip $titlebar $toolbar $treebar $trust $ulevel " +
|
57
|
+
"$ulist $upper $uptime $url $usermode $v1 $v2 $var $vcmd $vcmdstat $vcmdver " +
|
58
|
+
"$version $vnick $vol $wid $width $wildsite $wildtok $window $wrap $xor");
|
59
|
+
var keywords = parseWords("abook ajinvite alias aline ame amsg anick aop auser autojoin avoice " +
|
60
|
+
"away background ban bcopy beep bread break breplace bset btrunc bunset bwrite " +
|
61
|
+
"channel clear clearall cline clipboard close cnick color comclose comopen " +
|
62
|
+
"comreg continue copy creq ctcpreply ctcps dcc dccserver dde ddeserver " +
|
63
|
+
"debug dec describe dialog did didtok disable disconnect dlevel dline dll " +
|
64
|
+
"dns dqwindow drawcopy drawdot drawfill drawline drawpic drawrect drawreplace " +
|
65
|
+
"drawrot drawsave drawscroll drawtext ebeeps echo editbox emailaddr enable " +
|
66
|
+
"events exit fclose filter findtext finger firewall flash flist flood flush " +
|
67
|
+
"flushini font fopen fseek fsend fserve fullname fwrite ghide gload gmove " +
|
68
|
+
"gopts goto gplay gpoint gqreq groups gshow gsize gstop gtalk gunload hadd " +
|
69
|
+
"halt haltdef hdec hdel help hfree hinc hload hmake hop hsave ial ialclear " +
|
70
|
+
"ialmark identd if ignore iline inc invite iuser join kick linesep links list " +
|
71
|
+
"load loadbuf localinfo log mdi me menubar mkdir mnick mode msg nick noop notice " +
|
72
|
+
"notify omsg onotice part partall pdcc perform play playctrl pop protect pvoice " +
|
73
|
+
"qme qmsg query queryn quit raw reload remini remote remove rename renwin " +
|
74
|
+
"reseterror resetidle return rlevel rline rmdir run ruser save savebuf saveini " +
|
75
|
+
"say scid scon server set showmirc signam sline sockaccept sockclose socklist " +
|
76
|
+
"socklisten sockmark sockopen sockpause sockread sockrename sockudp sockwrite " +
|
77
|
+
"sound speak splay sreq strip switchbar timer timestamp titlebar tnick tokenize " +
|
78
|
+
"toolbar topic tray treebar ulist unload unset unsetall updatenl url uwho " +
|
79
|
+
"var vcadd vcmd vcrem vol while whois window winhelp write writeint if isalnum " +
|
80
|
+
"isalpha isaop isavoice isban ischan ishop isignore isin isincs isletter islower " +
|
81
|
+
"isnotify isnum ison isop isprotect isreg isupper isvoice iswm iswmcs " +
|
82
|
+
"elseif else goto menu nicklist status title icon size option text edit " +
|
83
|
+
"button check radio box scroll list combo link tab item");
|
84
|
+
var functions = parseWords("if elseif else and not or eq ne in ni for foreach while switch");
|
85
|
+
var isOperatorChar = /[+\-*&%=<>!?^\/\|]/;
|
86
|
+
function chain(stream, state, f) {
|
87
|
+
state.tokenize = f;
|
88
|
+
return f(stream, state);
|
89
|
+
}
|
90
|
+
function tokenBase(stream, state) {
|
91
|
+
var beforeParams = state.beforeParams;
|
92
|
+
state.beforeParams = false;
|
93
|
+
var ch = stream.next();
|
94
|
+
if (/[\[\]{}\(\),\.]/.test(ch)) {
|
95
|
+
if (ch == "(" && beforeParams) state.inParams = true;
|
96
|
+
else if (ch == ")") state.inParams = false;
|
97
|
+
return null;
|
98
|
+
}
|
99
|
+
else if (/\d/.test(ch)) {
|
100
|
+
stream.eatWhile(/[\w\.]/);
|
101
|
+
return "number";
|
102
|
+
}
|
103
|
+
else if (ch == "\\") {
|
104
|
+
stream.eat("\\");
|
105
|
+
stream.eat(/./);
|
106
|
+
return "number";
|
107
|
+
}
|
108
|
+
else if (ch == "/" && stream.eat("*")) {
|
109
|
+
return chain(stream, state, tokenComment);
|
110
|
+
}
|
111
|
+
else if (ch == ";" && stream.match(/ *\( *\(/)) {
|
112
|
+
return chain(stream, state, tokenUnparsed);
|
113
|
+
}
|
114
|
+
else if (ch == ";" && !state.inParams) {
|
115
|
+
stream.skipToEnd();
|
116
|
+
return "comment";
|
117
|
+
}
|
118
|
+
else if (ch == '"') {
|
119
|
+
stream.eat(/"/);
|
120
|
+
return "keyword";
|
121
|
+
}
|
122
|
+
else if (ch == "$") {
|
123
|
+
stream.eatWhile(/[$_a-z0-9A-Z\.:]/);
|
124
|
+
if (specials && specials.propertyIsEnumerable(stream.current().toLowerCase())) {
|
125
|
+
return "keyword";
|
126
|
+
}
|
127
|
+
else {
|
128
|
+
state.beforeParams = true;
|
129
|
+
return "builtin";
|
130
|
+
}
|
131
|
+
}
|
132
|
+
else if (ch == "%") {
|
133
|
+
stream.eatWhile(/[^,^\s^\(^\)]/);
|
134
|
+
state.beforeParams = true;
|
135
|
+
return "string";
|
136
|
+
}
|
137
|
+
else if (isOperatorChar.test(ch)) {
|
138
|
+
stream.eatWhile(isOperatorChar);
|
139
|
+
return "operator";
|
140
|
+
}
|
141
|
+
else {
|
142
|
+
stream.eatWhile(/[\w\$_{}]/);
|
143
|
+
var word = stream.current().toLowerCase();
|
144
|
+
if (keywords && keywords.propertyIsEnumerable(word))
|
145
|
+
return "keyword";
|
146
|
+
if (functions && functions.propertyIsEnumerable(word)) {
|
147
|
+
state.beforeParams = true;
|
148
|
+
return "keyword";
|
149
|
+
}
|
150
|
+
return null;
|
151
|
+
}
|
152
|
+
}
|
153
|
+
function tokenComment(stream, state) {
|
154
|
+
var maybeEnd = false, ch;
|
155
|
+
while (ch = stream.next()) {
|
156
|
+
if (ch == "/" && maybeEnd) {
|
157
|
+
state.tokenize = tokenBase;
|
158
|
+
break;
|
159
|
+
}
|
160
|
+
maybeEnd = (ch == "*");
|
161
|
+
}
|
162
|
+
return "comment";
|
163
|
+
}
|
164
|
+
function tokenUnparsed(stream, state) {
|
165
|
+
var maybeEnd = 0, ch;
|
166
|
+
while (ch = stream.next()) {
|
167
|
+
if (ch == ";" && maybeEnd == 2) {
|
168
|
+
state.tokenize = tokenBase;
|
169
|
+
break;
|
170
|
+
}
|
171
|
+
if (ch == ")")
|
172
|
+
maybeEnd++;
|
173
|
+
else if (ch != " ")
|
174
|
+
maybeEnd = 0;
|
175
|
+
}
|
176
|
+
return "meta";
|
177
|
+
}
|
178
|
+
return {
|
179
|
+
startState: function() {
|
180
|
+
return {
|
181
|
+
tokenize: tokenBase,
|
182
|
+
beforeParams: false,
|
183
|
+
inParams: false
|
184
|
+
};
|
185
|
+
},
|
186
|
+
token: function(stream, state) {
|
187
|
+
if (stream.eatSpace()) return null;
|
188
|
+
return state.tokenize(stream, state);
|
189
|
+
}
|
190
|
+
};
|
191
|
+
});
|
192
|
+
|
193
|
+
});
|
@@ -0,0 +1,205 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
(function(mod) {
|
5
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6
|
+
mod(require("../../lib/codemirror"));
|
7
|
+
else if (typeof define == "function" && define.amd) // AMD
|
8
|
+
define(["../../lib/codemirror"], mod);
|
9
|
+
else // Plain browser env
|
10
|
+
mod(CodeMirror);
|
11
|
+
})(function(CodeMirror) {
|
12
|
+
"use strict";
|
13
|
+
|
14
|
+
CodeMirror.defineMode('mllike', function(_config, parserConfig) {
|
15
|
+
var words = {
|
16
|
+
'let': 'keyword',
|
17
|
+
'rec': 'keyword',
|
18
|
+
'in': 'keyword',
|
19
|
+
'of': 'keyword',
|
20
|
+
'and': 'keyword',
|
21
|
+
'if': 'keyword',
|
22
|
+
'then': 'keyword',
|
23
|
+
'else': 'keyword',
|
24
|
+
'for': 'keyword',
|
25
|
+
'to': 'keyword',
|
26
|
+
'while': 'keyword',
|
27
|
+
'do': 'keyword',
|
28
|
+
'done': 'keyword',
|
29
|
+
'fun': 'keyword',
|
30
|
+
'function': 'keyword',
|
31
|
+
'val': 'keyword',
|
32
|
+
'type': 'keyword',
|
33
|
+
'mutable': 'keyword',
|
34
|
+
'match': 'keyword',
|
35
|
+
'with': 'keyword',
|
36
|
+
'try': 'keyword',
|
37
|
+
'open': 'builtin',
|
38
|
+
'ignore': 'builtin',
|
39
|
+
'begin': 'keyword',
|
40
|
+
'end': 'keyword'
|
41
|
+
};
|
42
|
+
|
43
|
+
var extraWords = parserConfig.extraWords || {};
|
44
|
+
for (var prop in extraWords) {
|
45
|
+
if (extraWords.hasOwnProperty(prop)) {
|
46
|
+
words[prop] = parserConfig.extraWords[prop];
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
function tokenBase(stream, state) {
|
51
|
+
var ch = stream.next();
|
52
|
+
|
53
|
+
if (ch === '"') {
|
54
|
+
state.tokenize = tokenString;
|
55
|
+
return state.tokenize(stream, state);
|
56
|
+
}
|
57
|
+
if (ch === '(') {
|
58
|
+
if (stream.eat('*')) {
|
59
|
+
state.commentLevel++;
|
60
|
+
state.tokenize = tokenComment;
|
61
|
+
return state.tokenize(stream, state);
|
62
|
+
}
|
63
|
+
}
|
64
|
+
if (ch === '~') {
|
65
|
+
stream.eatWhile(/\w/);
|
66
|
+
return 'variable-2';
|
67
|
+
}
|
68
|
+
if (ch === '`') {
|
69
|
+
stream.eatWhile(/\w/);
|
70
|
+
return 'quote';
|
71
|
+
}
|
72
|
+
if (ch === '/' && parserConfig.slashComments && stream.eat('/')) {
|
73
|
+
stream.skipToEnd();
|
74
|
+
return 'comment';
|
75
|
+
}
|
76
|
+
if (/\d/.test(ch)) {
|
77
|
+
stream.eatWhile(/[\d]/);
|
78
|
+
if (stream.eat('.')) {
|
79
|
+
stream.eatWhile(/[\d]/);
|
80
|
+
}
|
81
|
+
return 'number';
|
82
|
+
}
|
83
|
+
if ( /[+\-*&%=<>!?|]/.test(ch)) {
|
84
|
+
return 'operator';
|
85
|
+
}
|
86
|
+
stream.eatWhile(/\w/);
|
87
|
+
var cur = stream.current();
|
88
|
+
return words[cur] || 'variable';
|
89
|
+
}
|
90
|
+
|
91
|
+
function tokenString(stream, state) {
|
92
|
+
var next, end = false, escaped = false;
|
93
|
+
while ((next = stream.next()) != null) {
|
94
|
+
if (next === '"' && !escaped) {
|
95
|
+
end = true;
|
96
|
+
break;
|
97
|
+
}
|
98
|
+
escaped = !escaped && next === '\\';
|
99
|
+
}
|
100
|
+
if (end && !escaped) {
|
101
|
+
state.tokenize = tokenBase;
|
102
|
+
}
|
103
|
+
return 'string';
|
104
|
+
};
|
105
|
+
|
106
|
+
function tokenComment(stream, state) {
|
107
|
+
var prev, next;
|
108
|
+
while(state.commentLevel > 0 && (next = stream.next()) != null) {
|
109
|
+
if (prev === '(' && next === '*') state.commentLevel++;
|
110
|
+
if (prev === '*' && next === ')') state.commentLevel--;
|
111
|
+
prev = next;
|
112
|
+
}
|
113
|
+
if (state.commentLevel <= 0) {
|
114
|
+
state.tokenize = tokenBase;
|
115
|
+
}
|
116
|
+
return 'comment';
|
117
|
+
}
|
118
|
+
|
119
|
+
return {
|
120
|
+
startState: function() {return {tokenize: tokenBase, commentLevel: 0};},
|
121
|
+
token: function(stream, state) {
|
122
|
+
if (stream.eatSpace()) return null;
|
123
|
+
return state.tokenize(stream, state);
|
124
|
+
},
|
125
|
+
|
126
|
+
blockCommentStart: "(*",
|
127
|
+
blockCommentEnd: "*)",
|
128
|
+
lineComment: parserConfig.slashComments ? "//" : null
|
129
|
+
};
|
130
|
+
});
|
131
|
+
|
132
|
+
CodeMirror.defineMIME('text/x-ocaml', {
|
133
|
+
name: 'mllike',
|
134
|
+
extraWords: {
|
135
|
+
'succ': 'keyword',
|
136
|
+
'trace': 'builtin',
|
137
|
+
'exit': 'builtin',
|
138
|
+
'print_string': 'builtin',
|
139
|
+
'print_endline': 'builtin',
|
140
|
+
'true': 'atom',
|
141
|
+
'false': 'atom',
|
142
|
+
'raise': 'keyword'
|
143
|
+
}
|
144
|
+
});
|
145
|
+
|
146
|
+
CodeMirror.defineMIME('text/x-fsharp', {
|
147
|
+
name: 'mllike',
|
148
|
+
extraWords: {
|
149
|
+
'abstract': 'keyword',
|
150
|
+
'as': 'keyword',
|
151
|
+
'assert': 'keyword',
|
152
|
+
'base': 'keyword',
|
153
|
+
'class': 'keyword',
|
154
|
+
'default': 'keyword',
|
155
|
+
'delegate': 'keyword',
|
156
|
+
'downcast': 'keyword',
|
157
|
+
'downto': 'keyword',
|
158
|
+
'elif': 'keyword',
|
159
|
+
'exception': 'keyword',
|
160
|
+
'extern': 'keyword',
|
161
|
+
'finally': 'keyword',
|
162
|
+
'global': 'keyword',
|
163
|
+
'inherit': 'keyword',
|
164
|
+
'inline': 'keyword',
|
165
|
+
'interface': 'keyword',
|
166
|
+
'internal': 'keyword',
|
167
|
+
'lazy': 'keyword',
|
168
|
+
'let!': 'keyword',
|
169
|
+
'member' : 'keyword',
|
170
|
+
'module': 'keyword',
|
171
|
+
'namespace': 'keyword',
|
172
|
+
'new': 'keyword',
|
173
|
+
'null': 'keyword',
|
174
|
+
'override': 'keyword',
|
175
|
+
'private': 'keyword',
|
176
|
+
'public': 'keyword',
|
177
|
+
'return': 'keyword',
|
178
|
+
'return!': 'keyword',
|
179
|
+
'select': 'keyword',
|
180
|
+
'static': 'keyword',
|
181
|
+
'struct': 'keyword',
|
182
|
+
'upcast': 'keyword',
|
183
|
+
'use': 'keyword',
|
184
|
+
'use!': 'keyword',
|
185
|
+
'val': 'keyword',
|
186
|
+
'when': 'keyword',
|
187
|
+
'yield': 'keyword',
|
188
|
+
'yield!': 'keyword',
|
189
|
+
|
190
|
+
'List': 'builtin',
|
191
|
+
'Seq': 'builtin',
|
192
|
+
'Map': 'builtin',
|
193
|
+
'Set': 'builtin',
|
194
|
+
'int': 'builtin',
|
195
|
+
'string': 'builtin',
|
196
|
+
'raise': 'builtin',
|
197
|
+
'failwith': 'builtin',
|
198
|
+
'not': 'builtin',
|
199
|
+
'true': 'builtin',
|
200
|
+
'false': 'builtin'
|
201
|
+
},
|
202
|
+
slashComments: true
|
203
|
+
});
|
204
|
+
|
205
|
+
});
|