diff --git a/src/external/code-mirror/mode/clojure/test.js b/src/external/code-mirror/mode/clojure/test.js new file mode 100644 index 000000000..18ee645db --- /dev/null +++ b/src/external/code-mirror/mode/clojure/test.js @@ -0,0 +1,384 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/5/LICENSE + +(function () { + var mode = CodeMirror.getMode({indentUnit: 2}, "clojure"); + + function MT(name) { + test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); + } + + MT("atoms", + "[atom false]", + "[atom nil]", + "[atom true]" + ); + + MT("keywords", + "[atom :foo]", + "[atom ::bar]", + "[atom :foo/bar]", + "[atom :foo.bar/baz]" + ); + + MT("numbers", + "[number 42] [number +42] [number -421]", + "[number 42N] [number +42N] [number -42N]", + "[number 0.42] [number +0.42] [number -0.42]", + "[number 42M] [number +42M] [number -42M]", + "[number 42.42M] [number +42.42M] [number -42.42M]", + "[number 1/42] [number +1/42] [number -1/42]", + "[number 0x42af] [number +0x42af] [number -0x42af]", + "[number 0x42AF] [number +0x42AF] [number -0x42AF]", + "[number 1e2] [number 1e+2] [number 1e-2]", + "[number +1e2] [number +1e+2] [number +1e-2]", + "[number -1e2] [number -1e+2] [number -1e-2]", + "[number -1.0e2] [number -0.1e+2] [number -1.01e-2]", + "[number 1E2] [number 1E+2] [number 1E-2]", + "[number +1E2] [number +1E+2] [number +1E-2]", + "[number -1E2] [number -1E+2] [number -1E-2]", + "[number -1.0E2] [number -0.1E+2] [number -1.01E-2]", + "[number 2r101010] [number +2r101010] [number -2r101010]", + "[number 2r101010] [number +2r101010] [number -2r101010]", + "[number 8r52] [number +8r52] [number -8r52]", + "[number 36rhello] [number +36rhello] [number -36rhello]", + "[number 36rz] [number +36rz] [number -36rz]", + "[number 36rZ] [number +36rZ] [number -36rZ]", + + // invalid numbers + "[error 42foo]", + "[error 42Nfoo]", + "[error 42Mfoo]", + "[error 42.42Mfoo]", + "[error 42.42M!]", + "[error 42!]", + "[error 0x42afm]" + ); + + MT("characters", + "[string-2 \\1]", + "[string-2 \\a]", + "[string-2 \\a\\b\\c]", + "[string-2 \\#]", + "[string-2 \\\\]", + "[string-2 \\\"]", + "[string-2 \\(]", + "[string-2 \\A]", + "[string-2 \\backspace]", + "[string-2 \\formfeed]", + "[string-2 \\newline]", + "[string-2 \\space]", + "[string-2 \\return]", + "[string-2 \\tab]", + "[string-2 \\u1000]", + "[string-2 \\uAaAa]", + "[string-2 \\u9F9F]", + "[string-2 \\o123]", + "[string-2 \\符]", + "[string-2 \\シ]", + "[string-2 \\ۇ]", + // FIXME + // "[string-2 \\🙂]", + + // invalid character literals + "[error \\abc]", + "[error \\a123]", + "[error \\a!]", + "[error \\newlines]", + "[error \\NEWLINE]", + "[error \\u9F9FF]", + "[error \\o1234]" + ); + + MT("strings", + "[string \"I'm a teapot.\"]", + "[string \"I'm a \\\"teapot\\\".\"]", + "[string \"I'm]", // this is + "[string a]", // a multi-line + "[string teapot.\"]" // string + + // TODO unterminated (multi-line) strings? + ); + + MT("comments", + "[comment ; this is an in-line comment.]", + "[comment ;; this is a line comment.]", + "[keyword comment]", + "[bracket (][comment comment (foo 1 2 3)][bracket )]" + ); + + MT("reader macro characters", + "[meta #][variable _]", + "[meta #][variable -Inf]", + "[meta ##][variable Inf]", + "[meta ##][variable NaN]", + "[meta @][variable x]", + "[meta ^][bracket {][atom :tag] [variable String][bracket }]", + "[meta `][bracket (][builtin f] [variable x][bracket )]", + "[meta ~][variable foo#]", + "[meta '][number 1]", + "[meta '][atom :foo]", + "[meta '][string \"foo\"]", + "[meta '][variable x]", + "[meta '][bracket (][builtin a] [variable b] [variable c][bracket )]", + "[meta '][bracket [[][variable a] [variable b] [variable c][bracket ]]]", + "[meta '][bracket {][variable a] [number 1] [atom :foo] [number 2] [variable c] [number 3][bracket }]", + "[meta '#][bracket {][variable a] [number 1] [atom :foo][bracket }]" + ); + + MT("symbols", + "[variable foo!]", + "[variable foo#]", + "[variable foo$]", + "[variable foo&]", + "[variable foo']", + "[variable foo*]", + "[variable foo+]", + "[variable foo-]", + "[variable foo.]", + "[variable foo/bar]", + "[variable foo:bar]", + "[variable foo<]", + "[variable foo=]", + "[variable foo>]", + "[variable foo?]", + "[variable foo_]", + "[variable foo|]", + "[variable foobarBaz]", + "[variable foo¡]", + "[variable 符号]", + "[variable シンボル]", + "[variable ئۇيغۇر]", + "[variable 🙂❤🇺🇸]", + + // invalid symbols + "[error 3foo]", + "[error 3+]", + "[error 3|]", + "[error 3_]" + ); + + MT("numbers and other forms", + "[number 42][bracket (][builtin foo][bracket )]", + "[number 42][bracket [[][variable foo][bracket ]]]", + "[number 42][meta #][bracket {][variable foo][bracket }]", + "[number 42][bracket {][atom :foo] [variable bar][bracket }]", + "[number 42][meta `][variable foo]", + "[number 42][meta ~][variable foo]", + "[number 42][meta #][variable foo]" + ); + + var specialForms = [".", "catch", "def", "do", "if", "monitor-enter", + "monitor-exit", "new", "quote", "recur", "set!", "throw", "try", "var"]; + + MT("should highlight special forms as keywords", + typeTokenPairs("keyword", specialForms) + ); + + var coreSymbols1 = [ + "*", "*'", "*1", "*2", "*3", "*agent*", "*allow-unresolved-vars*", "*assert*", + "*clojure-version*", "*command-line-args*", "*compile-files*", "*compile-path*", "*compiler-options*", + "*data-readers*", "*default-data-reader-fn*", "*e", "*err*", "*file*", "*flush-on-newline*", "*fn-loader*", + "*in*", "*math-context*", "*ns*", "*out*", "*print-dup*", "*print-length*", "*print-level*", "*print-meta*", + "*print-namespace-maps*", "*print-readably*", "*read-eval*", "*reader-resolver*", "*source-path*", + "*suppress-read*", "*unchecked-math*", "*use-context-classloader*", "*verbose-defrecords*", + "*warn-on-reflection*", "+", "+'", "-", "-'", "->", "->>", "->ArrayChunk", "->Eduction", "->Vec", "->VecNode", + "->VecSeq", "-cache-protocol-fn", "-reset-methods", "..", "/", "<", "<=", "=", "==", ">", ">=", + "EMPTY-NODE", "Inst", "StackTraceElement->vec", "Throwable->map", "accessor", "aclone", "add-classpath", + "add-watch", "agent", "agent-error", "agent-errors", "aget", "alength", "alias", "all-ns", "alter", + "alter-meta!", "alter-var-root", "amap", "ancestors", "and", "any?", "apply", "areduce", "array-map", + "as->", "aset", "aset-boolean", "aset-byte", "aset-char", "aset-double", "aset-float", "aset-int", + "aset-long", "aset-short", "assert", "assoc", "assoc!", "assoc-in", "associative?", "atom", "await", + "await-for", "await1", "bases", "bean", "bigdec", "bigint", "biginteger", "binding", "bit-and", "bit-and-not", + "bit-clear", "bit-flip", "bit-not", "bit-or", "bit-set", "bit-shift-left", "bit-shift-right", "bit-test", + "bit-xor", "boolean", "boolean-array", "boolean?", "booleans", "bound-fn", "bound-fn*", "bound?", + "bounded-count", "butlast", "byte", "byte-array", "bytes", "bytes?", "case", "cast", "cat", "char", + "char-array", "char-escape-string", "char-name-string", "char?", "chars", "chunk", "chunk-append", + "chunk-buffer", "chunk-cons", "chunk-first", "chunk-next", "chunk-rest", "chunked-seq?", "class", "class?", + "clear-agent-errors", "clojure-version", "coll?", "comment", "commute", "comp", "comparator", "compare", + "compare-and-set!", "compile", "complement", "completing", "concat", "cond", "cond->", "cond->>", "condp", + "conj", "conj!", "cons", "constantly", "construct-proxy", "contains?", "count", "counted?", "create-ns", + "create-struct", "cycle", "dec", "dec'", "decimal?", "declare", "dedupe", "default-data-readers", "definline", + "definterface", "defmacro", "defmethod", "defmulti", "defn", "defn-", "defonce", "defprotocol", "defrecord", + "defstruct", "deftype", "delay", "delay?", "deliver", "denominator", "deref", "derive", "descendants", + "destructure", "disj", "disj!", "dissoc", "dissoc!", "distinct", "distinct?", "doall", "dorun", "doseq", + "dosync", "dotimes", "doto", "double", "double-array", "double?", "doubles", "drop", "drop-last", "drop-while", + "eduction", "empty", "empty?", "ensure", "ensure-reduced", "enumeration-seq", "error-handler", "error-mode", + "eval", "even?", "every-pred", "every?", "ex-data", "ex-info", "extend", "extend-protocol", "extend-type", + "extenders", "extends?", "false?", "ffirst", "file-seq", "filter", "filterv", "find", "find-keyword", "find-ns", + "find-protocol-impl", "find-protocol-method", "find-var", "first", "flatten", "float", "float-array", "float?", + "floats", "flush", "fn", "fn?", "fnext", "fnil", "for", "force", "format", "frequencies", "future", "future-call", + "future-cancel", "future-cancelled?", "future-done?", "future?", "gen-class", "gen-interface", "gensym", "get", + "get-in", "get-method", "get-proxy-class", "get-thread-bindings", "get-validator", "group-by", "halt-when", "hash", + "hash-combine", "hash-map", "hash-ordered-coll", "hash-set", "hash-unordered-coll", "ident?", "identical?", + "identity", "if-let", "if-not", "if-some", "ifn?", "import", "in-ns", "inc", "inc'", "indexed?", "init-proxy", + "inst-ms", "inst-ms*", "inst?", "instance?", "int", "int-array", "int?", "integer?", "interleave", "intern", + "interpose", "into", "into-array", "ints", "io!", "isa?", "iterate", "iterator-seq", "juxt", "keep", "keep-indexed", + "key", "keys", "keyword", "keyword?", "last", "lazy-cat", "lazy-seq", "let", "letfn", "line-seq", "list", "list*", + "list?", "load", "load-file", "load-reader", "load-string", "loaded-libs", "locking", "long", "long-array", "longs", + "loop", "macroexpand", "macroexpand-1", "make-array", "make-hierarchy", "map", "map-entry?", "map-indexed", "map?", + "mapcat", "mapv", "max", "max-key", "memfn", "memoize", "merge", "merge-with", "meta", "method-sig", "methods"]; + + var coreSymbols2 = [ + "min", "min-key", "mix-collection-hash", "mod", "munge", "name", "namespace", "namespace-munge", "nat-int?", + "neg-int?", "neg?", "newline", "next", "nfirst", "nil?", "nnext", "not", "not-any?", "not-empty", "not-every?", + "not=", "ns", "ns-aliases", "ns-imports", "ns-interns", "ns-map", "ns-name", "ns-publics", "ns-refers", "ns-resolve", + "ns-unalias", "ns-unmap", "nth", "nthnext", "nthrest", "num", "number?", "numerator", "object-array", "odd?", "or", + "parents", "partial", "partition", "partition-all", "partition-by", "pcalls", "peek", "persistent!", "pmap", "pop", + "pop!", "pop-thread-bindings", "pos-int?", "pos?", "pr", "pr-str", "prefer-method", "prefers", + "primitives-classnames", "print", "print-ctor", "print-dup", "print-method", "print-simple", "print-str", "printf", + "println", "println-str", "prn", "prn-str", "promise", "proxy", "proxy-call-with-super", "proxy-mappings", + "proxy-name", "proxy-super", "push-thread-bindings", "pvalues", "qualified-ident?", "qualified-keyword?", + "qualified-symbol?", "quot", "rand", "rand-int", "rand-nth", "random-sample", "range", "ratio?", "rational?", + "rationalize", "re-find", "re-groups", "re-matcher", "re-matches", "re-pattern", "re-seq", "read", "read-line", + "read-string", "reader-conditional", "reader-conditional?", "realized?", "record?", "reduce", "reduce-kv", "reduced", + "reduced?", "reductions", "ref", "ref-history-count", "ref-max-history", "ref-min-history", "ref-set", "refer", + "refer-clojure", "reify", "release-pending-sends", "rem", "remove", "remove-all-methods", "remove-method", "remove-ns", + "remove-watch", "repeat", "repeatedly", "replace", "replicate", "require", "reset!", "reset-meta!", "reset-vals!", + "resolve", "rest", "restart-agent", "resultset-seq", "reverse", "reversible?", "rseq", "rsubseq", "run!", "satisfies?", + "second", "select-keys", "send", "send-off", "send-via", "seq", "seq?", "seqable?", "seque", "sequence", "sequential?", + "set", "set-agent-send-executor!", "set-agent-send-off-executor!", "set-error-handler!", "set-error-mode!", + "set-validator!", "set?", "short", "short-array", "shorts", "shuffle", "shutdown-agents", "simple-ident?", + "simple-keyword?", "simple-symbol?", "slurp", "some", "some->", "some->>", "some-fn", "some?", "sort", "sort-by", + "sorted-map", "sorted-map-by", "sorted-set", "sorted-set-by", "sorted?", "special-symbol?", "spit", "split-at", + "split-with", "str", "string?", "struct", "struct-map", "subs", "subseq", "subvec", "supers", "swap!", "swap-vals!", + "symbol", "symbol?", "sync", "tagged-literal", "tagged-literal?", "take", "take-last", "take-nth", "take-while", "test", + "the-ns", "thread-bound?", "time", "to-array", "to-array-2d", "trampoline", "transduce", "transient", "tree-seq", + "true?", "type", "unchecked-add", "unchecked-add-int", "unchecked-byte", "unchecked-char", "unchecked-dec", + "unchecked-dec-int", "unchecked-divide-int", "unchecked-double", "unchecked-float", "unchecked-inc", "unchecked-inc-int", + "unchecked-int", "unchecked-long", "unchecked-multiply", "unchecked-multiply-int", "unchecked-negate", + "unchecked-negate-int", "unchecked-remainder-int", "unchecked-short", "unchecked-subtract", "unchecked-subtract-int", + "underive", "unquote", "unquote-splicing", "unreduced", "unsigned-bit-shift-right", "update", "update-in", + "update-proxy", "uri?", "use", "uuid?", "val", "vals", "var-get", "var-set", "var?", "vary-meta", "vec", "vector", + "vector-of", "vector?", "volatile!", "volatile?", "vreset!", "vswap!", "when", "when-first", "when-let", "when-not", + "when-some", "while", "with-bindings", "with-bindings*", "with-in-str", "with-loading-context", "with-local-vars", + "with-meta", "with-open", "with-out-str", "with-precision", "with-redefs", "with-redefs-fn", "xml-seq", "zero?", + "zipmap" + ]; + + MT("should highlight core symbols as keywords (part 1/2)", + typeTokenPairs("keyword", coreSymbols1) + ); + + MT("should highlight core symbols as keywords (part 2/2)", + typeTokenPairs("keyword", coreSymbols2) + ); + + MT("should properly indent forms in list literals", + "[bracket (][builtin foo] [atom :a] [number 1] [atom true] [atom nil][bracket )]", + "", + "[bracket (][builtin foo] [atom :a]", + " [number 1]", + " [atom true]", + " [atom nil][bracket )]", + "", + "[bracket (][builtin foo] [atom :a] [number 1]", + " [atom true]", + " [atom nil][bracket )]", + "", + "[bracket (]", + " [builtin foo]", + " [atom :a]", + " [number 1]", + " [atom true]", + " [atom nil][bracket )]", + "", + "[bracket (][builtin foo] [bracket [[][atom :a][bracket ]]]", + " [number 1]", + " [atom true]", + " [atom nil][bracket )]" + ); + + MT("should properly indent forms in vector literals", + "[bracket [[][atom :a] [number 1] [atom true] [atom nil][bracket ]]]", + "", + "[bracket [[][atom :a]", + " [number 1]", + " [atom true]", + " [atom nil][bracket ]]]", + "", + "[bracket [[][atom :a] [number 1]", + " [atom true]", + " [atom nil][bracket ]]]", + "", + "[bracket [[]", + " [variable foo]", + " [atom :a]", + " [number 1]", + " [atom true]", + " [atom nil][bracket ]]]" + ); + + MT("should properly indent forms in map literals", + "[bracket {][atom :a] [atom :a] [atom :b] [number 1] [atom :c] [atom true] [atom :d] [atom nil] [bracket }]", + "", + "[bracket {][atom :a] [atom :a]", + " [atom :b] [number 1]", + " [atom :c] [atom true]", + " [atom :d] [atom nil][bracket }]", + "", + "[bracket {][atom :a]", + " [atom :a]", + " [atom :b]", + " [number 1]", + " [atom :c]", + " [atom true]", + " [atom :d]", + " [atom nil][bracket }]", + "", + "[bracket {]", + " [atom :a] [atom :a]", + " [atom :b] [number 1]", + " [atom :c] [atom true]", + " [atom :d] [atom nil][bracket }]" + ); + + MT("should properly indent forms in set literals", + "[meta #][bracket {][atom :a] [number 1] [atom true] [atom nil] [bracket }]", + "", + "[meta #][bracket {][atom :a]", + " [number 1]", + " [atom true]", + " [atom nil][bracket }]", + "", + "[meta #][bracket {]", + " [atom :a]", + " [number 1]", + " [atom true]", + " [atom nil][bracket }]" + ); + + var haveBodyParameter = [ + "->", "->>", "as->", "binding", "bound-fn", "case", "catch", "cond", + "cond->", "cond->>", "condp", "def", "definterface", "defmethod", "defn", + "defmacro", "defprotocol", "defrecord", "defstruct", "deftype", "do", + "doseq", "dotimes", "doto", "extend", "extend-protocol", "extend-type", + "fn", "for", "future", "if", "if-let", "if-not", "if-some", "let", + "letfn", "locking", "loop", "ns", "proxy", "reify", "some->", "some->>", + "struct-map", "try", "when", "when-first", "when-let", "when-not", + "when-some", "while", "with-bindings", "with-bindings*", "with-in-str", + "with-loading-context", "with-local-vars", "with-meta", "with-open", + "with-out-str", "with-precision", "with-redefs", "with-redefs-fn"]; + + function testFormsThatHaveBodyParameter(forms) { + for (var i = 0; i < forms.length; i++) { + MT("should indent body argument of `" + forms[i] + "` by `options.indentUnit` spaces", + "[bracket (][keyword " + forms[i] + "] [variable foo] [variable bar]", + " [variable baz]", + " [variable qux][bracket )]" + ); + } + } + + testFormsThatHaveBodyParameter(haveBodyParameter); + + MT("should indent body argument of `comment` by `options.indentUnit` spaces", + "[bracket (][comment comment foo bar]", + "[comment baz]", + "[comment qux][bracket )]" + ); + + function typeTokenPairs(type, tokens) { + return "[" + type + " " + tokens.join("] [" + type + " ") + "]"; + } +})(); diff --git a/src/external/code-mirror/mode/d/test.js b/src/external/code-mirror/mode/d/test.js new file mode 100644 index 000000000..69745fad1 --- /dev/null +++ b/src/external/code-mirror/mode/d/test.js @@ -0,0 +1,11 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/5/LICENSE + +(function() { + var mode = CodeMirror.getMode({indentUnit: 2}, "d"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + MT("nested_comments", + "[comment /+]","[comment comment]","[comment +/]","[variable void] [variable main](){}"); + +})(); diff --git a/src/external/code-mirror/mode/dockerfile/test.js b/src/external/code-mirror/mode/dockerfile/test.js new file mode 100644 index 000000000..812e6287c --- /dev/null +++ b/src/external/code-mirror/mode/dockerfile/test.js @@ -0,0 +1,128 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/5/LICENSE + +(function() { + var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-dockerfile"); + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + MT("simple_nodejs_dockerfile", + "[keyword FROM] node:carbon", + "[comment # Create app directory]", + "[keyword WORKDIR] /usr/src/app", + "[comment # Install app dependencies]", + "[comment # A wildcard is used to ensure both package.json AND package-lock.json are copied]", + "[comment # where available (npm@5+)]", + "[keyword COPY] package*.json ./", + "[keyword RUN] npm install", + "[keyword COPY] . .", + "[keyword EXPOSE] [number 8080] [number 3000]", + "[keyword ENV] NODE_ENV development", + "[keyword CMD] [[ [string \"npm\"], [string \"start\"] ]]"); + + // Ideally the last space should not be highlighted. + MT("instruction_without_args_1", + "[keyword CMD] "); + + MT("instruction_without_args_2", + "[comment # An instruction without args...]", + "[keyword ARG] [error #...is an error]"); + + MT("multiline", + "[keyword RUN] apt-get update && apt-get install -y \\", + " mercurial \\", + " subversion \\", + " && apt-get clean \\", + " && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*"); + + MT("from_comment", + " [keyword FROM] debian:stretch # I tend to use stable as that is more stable", + " [keyword FROM] debian:stretch [keyword AS] stable # I am even more stable", + " [keyword FROM] [error # this is an error]"); + + MT("from_as", + "[keyword FROM] golang:1.9.2-alpine3.6 [keyword AS] build", + "[keyword COPY] --from=build /bin/project /bin/project", + "[keyword ENTRYPOINT] [[ [string \"/bin/project\"] ]]", + "[keyword CMD] [[ [string \"--help\"] ]]"); + + MT("arg", + "[keyword ARG] VERSION=latest", + "[keyword FROM] busybox:$VERSION", + "[keyword ARG] VERSION", + "[keyword RUN] echo $VERSION > image_version"); + + MT("label", + "[keyword LABEL] com.example.label-with-value=[string \"foo\"]"); + + MT("label_multiline", + "[keyword LABEL] description=[string \"This text illustrates ]\\", + "[string that label-values can span multiple lines.\"]"); + + MT("maintainer", + "[keyword MAINTAINER] Foo Bar [string \"foo@bar.com\"] ", + "[keyword MAINTAINER] Bar Baz "); + + MT("env", + "[keyword ENV] BUNDLE_PATH=[string \"$GEM_HOME\"] \\", + " BUNDLE_APP_CONFIG=[string \"$GEM_HOME\"]"); + + MT("verify_keyword", + "[keyword RUN] add-apt-repository ppa:chris-lea/node.js"); + + MT("scripts", + "[comment # Set an entrypoint, to automatically install node modules]", + "[keyword ENTRYPOINT] [[ [string \"/bin/bash\"], [string \"-c\"], [string \"if [[ ! -d node_modules ]]; then npm install; fi; exec \\\"${@:0}\\\";\"] ]]", + "[keyword CMD] npm start", + "[keyword RUN] npm run build && \\", + "[comment # a comment between the shell commands]", + " npm run test"); + + MT("strings_single", + "[keyword FROM] buildpack-deps:stretch", + "[keyword RUN] { \\", + " echo [string 'install: --no-document']; \\", + " echo [string 'update: --no-document']; \\", + " } >> /usr/local/etc/gemrc"); + + MT("strings_single_multiline", + "[keyword RUN] set -ex \\", + " \\", + " && buildDeps=[string ' ]\\", + "[string bison ]\\", + "[string dpkg-dev ]\\", + "[string libgdbm-dev ]\\", + "[string ruby ]\\", + "[string '] \\", + " && apt-get update"); + + MT("strings_single_multiline_2", + "[keyword RUN] echo [string 'say \\' ]\\", + "[string it works'] "); + + MT("strings_double", + "[keyword RUN] apt-get install -y --no-install-recommends $buildDeps \\", + " \\", + " && wget -O ruby.tar.xz [string \"https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz\"] \\", + " && echo [string \"$RUBY_DOWNLOAD_SHA256 *ruby.tar.xz\"] | sha256sum -c - "); + + MT("strings_double_multiline", + "[keyword RUN] echo [string \"say \\\" ]\\", + "[string it works\"] "); + + MT("escape", + "[comment # escape=`]", + "[keyword FROM] microsoft/windowsservercore", + "[keyword RUN] powershell.exe -Command `", + " $ErrorActionPreference = [string 'Stop']; `", + " wget https://www.python.org/ftp/python/3.5.1/python-3.5.1.exe -OutFile c:\python-3.5.1.exe ; `", + " Start-Process c:\python-3.5.1.exe -ArgumentList [string '/quiet InstallAllUsers=1 PrependPath=1'] -Wait ; `", + " Remove-Item c:\python-3.5.1.exe -Force)"); + + MT("escape_strings", + "[comment # escape=`]", + "[keyword FROM] python:3.6-windowsservercore [keyword AS] python", + "[keyword RUN] $env:PATH = [string 'C:\\Python;C:\\Python\\Scripts;{0}'] -f $env:PATH ; `", + // It should not consider \' as escaped. + // " Set-ItemProperty -Path [string 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\\'] -Name Path -Value $env:PATH ;"); + " Set-ItemProperty -Path [string 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\\' -Name Path -Value $env:PATH ;]"); +})(); diff --git a/src/external/code-mirror/mode/sass/test.js b/src/external/code-mirror/mode/sass/test.js new file mode 100644 index 000000000..4ed129093 --- /dev/null +++ b/src/external/code-mirror/mode/sass/test.js @@ -0,0 +1,122 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/5/LICENSE + +(function() { + var mode = CodeMirror.getMode({indentUnit: 2}, "sass"); + // Since Sass has an indent-based syntax, is almost impossible to test correctly the indentation in all cases. + // So disable it for tests. + mode.indent = undefined; + function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } + + MT("comment", + "[comment // this is a comment]", + "[comment also this is a comment]") + + MT("comment_multiline", + "[comment /* this is a comment]", + "[comment also this is a comment]") + + MT("variable", + "[variable-2 $page-width][operator :] [number 800][unit px]") + + MT("global_attributes", + "[tag body]", + " [property font][operator :]", + " [property family][operator :] [atom sans-serif]", + " [property size][operator :] [number 30][unit em]", + " [property weight][operator :] [atom bold]") + + MT("scoped_styles", + "[builtin #contents]", + " [property width][operator :] [variable-2 $page-width]", + " [builtin #sidebar]", + " [property float][operator :] [atom right]", + " [property width][operator :] [variable-2 $sidebar-width]", + " [builtin #main]", + " [property width][operator :] [variable-2 $page-width] [operator -] [variable-2 $sidebar-width]", + " [property background][operator :] [variable-2 $primary-color]", + " [tag h2]", + " [property color][operator :] [keyword blue]") + + // Sass allows to write the colon as first char instead of a "separator". + // :color red + // Not supported + // MT("property_syntax", + // "[qualifier .foo]", + // " [operator :][property color] [keyword red]") + + MT("import", + "[def @import] [string \"sass/variables\"]", + // Probably it should parsed as above: as a string even without the " or ' + // "[def @import] [string sass/baz]" + "[def @import] [tag sass][operator /][tag baz]") + + MT("def", + "[def @if] [variable-2 $foo] [def @else]") + + MT("tag_on_more_lines", + "[tag td],", + "[tag th]", + " [property font-family][operator :] [string \"Arial\"], [atom serif]") + + MT("important", + "[qualifier .foo]", + " [property text-decoration][operator :] [atom none] [keyword !important]", + "[tag h1]", + " [property font-size][operator :] [number 2.5][unit em]") + + MT("selector", + // SCSS doesn't highlight the : + // "[tag h1]:[variable-3 before],", + // "[tag h2]:[variable-3 before]", + "[tag h1][variable-3 :before],", + "[tag h2][variable-3 :before]", + " [property content][operator :] [string \"::\"]") + + MT("definition_mixin_equal", + "[variable-2 $defined-bs-type][operator :] [atom border-box] [keyword !default]", + "[meta =bs][operator (][variable-2 $bs-type][operator :] [variable-2 $defined-bs-type][operator )]", + " [meta -webkit-][property box-sizing][operator :] [variable-2 $bs-type]", + " [property box-sizing][operator :] [variable-2 $bs-type]") + + MT("definition_mixin_with_space", + "[variable-2 $defined-bs-type][operator :] [atom border-box] [keyword !default]", + "[def @mixin] [tag bs][operator (][variable-2 $bs-type][operator :] [variable-2 $defined-bs-type][operator )] ", + " [meta -moz-][property box-sizing][operator :] [variable-2 $bs-type]", + " [property box-sizing][operator :] [variable-2 $bs-type]") + + MT("numbers_start_dot_include_plus", + // The % is not highlighted correctly + // "[meta =button-links][operator (][variable-2 $button-base][operator :] [atom darken][operator (][variable-2 $color11], [number 10][unit %][operator )][operator )]", + "[meta =button-links][operator (][variable-2 $button-base][operator :] [atom darken][operator (][variable-2 $color11], [number 10][operator %))]", + " [property padding][operator :] [number .3][unit em] [number .6][unit em]", + " [variable-3 +border-radius][operator (][number 8][unit px][operator )]", + " [property background-color][operator :] [variable-2 $button-base]") + + MT("include", + "[qualifier .bar]", + " [def @include] [tag border-radius][operator (][number 8][unit px][operator )]") + + MT("reference_parent", + "[qualifier .col]", + " [property clear][operator :] [atom both]", + // SCSS doesn't highlight the : + // " &:[variable-3 after]", + " &[variable-3 :after]", + " [property content][operator :] [string '']", + " [property clear][operator :] [atom both]") + + MT("reference_parent_with_spaces", + "[tag section]", + " [property border-left][operator :] [number 20][unit px] [atom transparent] [atom solid] ", + " &[qualifier .section3]", + " [qualifier .title]", + " [property color][operator :] [keyword white] ", + " [qualifier .vermas]", + " [property display][operator :] [atom none]") + + MT("font_face", + "[def @font-face]", + " [property font-family][operator :] [string 'icomoon']", + " [property src][operator :] [atom url][operator (][string fonts/icomoon.ttf][operator )]") +})(); diff --git a/src/external/code-mirror/mode/wast/index.html b/src/external/code-mirror/mode/wast/index.html new file mode 100644 index 000000000..977dfe8b6 --- /dev/null +++ b/src/external/code-mirror/mode/wast/index.html @@ -0,0 +1,73 @@ + + +CodeMirror: WebAssembly mode + + + + + + + + + + +
+

WebAssembly mode

+ + +
+ + + +

MIME types defined: text/webassembly.

+
diff --git a/src/external/code-mirror/mode/wast/test.js b/src/external/code-mirror/mode/wast/test.js new file mode 100644 index 000000000..b5f7c7108 --- /dev/null +++ b/src/external/code-mirror/mode/wast/test.js @@ -0,0 +1,424 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/5/LICENSE + +(function() { + var mode = CodeMirror.getMode({indentUnit: 4}, "wast"); + function MT(name) {test.mode(name, mode, Array.prototype.slice.call(arguments, 1));} + + MT('number-test', + '[number 0]', + '[number 123]', + '[number nan]', + '[number inf]', + '[number infinity]', + '[number 0.1]', + '[number 123.0]', + '[number 12E+99]'); + + MT('string-literals-test', + '[string "foo"]', + '[string "\\"foo\\""]', + '[string "foo #\\"# bar"]'); + + MT('atom-test', + '[atom funcref]', + '[atom externref]', + '[atom i32]', + '[atom i64]', + '[atom f32]', + '[atom f64]'); + + MT('keyword-test', + '[keyword br]', + '[keyword if]', + '[keyword loop]', + '[keyword i32.add]', + '[keyword local.get]'); + + MT('control-instructions', + '[keyword unreachable]', + '[keyword nop]', + '[keyword br] [variable-2 $label0]', + '[keyword br_if] [variable-2 $label0]', + '[keyword br_table] [variable-2 $label0] [variable-2 $label1] [variable-2 $label3]', + '[keyword return]', + '[keyword call] [variable-2 $func0]', + '[keyword call_indirect] [variable-2 $table] ([keyword param] [atom f32] [atom f64]) ([keyword result] [atom i32] [atom i64])', + '[keyword return_call] [variable-2 $func0]', + '[keyword return_call_indirect] ([keyword param] [atom f32] [atom f64]) ([keyword result] [atom i32] [atom i64])', + '[keyword select] ([keyword local.get] [number 1]) ([keyword local.get] [number 2]) ([keyword local.get] [number 3])', + '[keyword try] ([keyword result] [atom i32])', + '[keyword throw] [number 0]', + '[keyword rethrow] [number 0]', + '[keyword catch] [number 0]', + '[keyword catch_all]', + '[keyword delegate] [number 0]', + '[keyword unwind]'); + + + MT('memory-instructions', + '[keyword i32.load] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword i32.load8_s] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword i32.load8_u] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword i32.load16_s] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword i32.load16_u] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword i32.store] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword i32.store8] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword i32.store16] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword i64.store] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword i64.load] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword i64.load8_s] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword i64.load8_u] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword i64.load16_s] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword i64.load16_u] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword i64.load32_s] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword i64.load32_u] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword i64.store8] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword i64.store16] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword i64.store32] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword f32.load] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword f32.store] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword f64.load] [keyword offset]=[number 4] [keyword align]=[number 4]', + '[keyword f64.store] [keyword offset]=[number 4] [keyword align]=[number 4]'); + + MT('atomic-memory-instructions', + '[keyword memory.atomic.notify] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword memory.atomic.wait32] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword memory.atomic.wait64] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.load] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.load8_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.load16_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.store] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.store8] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.store16] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.load] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.load8_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.load16_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.load32_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.store] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.store8] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.store16] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.store32] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw.add] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw8.add_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw16.add_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw.add] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw8.add_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw16.add_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw32.add_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw.sub] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw8.sub_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw16.sub_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw.sub] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw8.sub_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw16.sub_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw32.sub_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw.and] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw8.and_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw16.and_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw.and] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw8.and_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw16.and_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw32.and_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw.or] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw8.or_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw16.or_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw.or] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw8.or_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw16.or_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw32.or_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw.xor] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw8.xor_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw16.xor_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw.xor] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw8.xor_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw16.xor_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw32.xor_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw.xchg] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw8.xchg_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw16.xchg_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw.xchg] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw8.xchg_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw16.xchg_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw32.xchg_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw.cmpxchg] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw8.cmpxchg_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i32.atomic.rmw16.cmpxchg_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw.cmpxchg] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw8.cmpxchg_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw16.cmpxchg_u] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword i64.atomic.rmw32.cmpxchg_u] [keyword offset]=[number 32] [keyword align]=[number 4]'); + + MT('simd-instructions', + '[keyword v128.load] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword v128.load8x8_s] [keyword offset]=[number 64] [keyword align]=[number 0]', + '[keyword v128.load8x8_u] [keyword offset]=[number 64] [keyword align]=[number 0]', + '[keyword v128.load16x4_s] [keyword offset]=[number 64] [keyword align]=[number 0]', + '[keyword v128.load16x4_u] [keyword offset]=[number 64] [keyword align]=[number 0]', + '[keyword v128.load32x2_s] [keyword offset]=[number 64] [keyword align]=[number 0]', + '[keyword v128.load32x2_u] [keyword offset]=[number 64] [keyword align]=[number 0]', + '[keyword v128.load8_splat] [keyword offset]=[number 64] [keyword align]=[number 0]', + '[keyword v128.load16_splat] [keyword offset]=[number 64] [keyword align]=[number 0]', + '[keyword v128.load32_splat] [keyword offset]=[number 64] [keyword align]=[number 0]', + '[keyword v128.load64_splat] [keyword offset]=[number 64] [keyword align]=[number 0]', + '[keyword v128.store] [keyword offset]=[number 32] [keyword align]=[number 4]', + '[keyword v128.const] [number 0] [number 1] [number 2] [number 3] [number 4] [number 5] [number 6] [number 7] [number 8] [number 9] [number 10] [number 11] [number 12] [number 13] [number 14] [number 15]', + '[keyword i8x16.shuffle] [number 0] [number 1] [number 2] [number 3] [number 4] [number 5] [number 6] [number 7] [number 8] [number 9] [number 10] [number 11] [number 12] [number 13] [number 14] [number 15]', + '[keyword i8x16.swizzle]', + '[keyword i8x16.splat]', + '[keyword i16x8.splat]', + '[keyword i32x4.splat]', + '[keyword i64x2.splat]', + '[keyword f32x4.splat]', + '[keyword f64x2.splat]', + '[keyword i8x16.extract_lane_s] [number 1]', + '[keyword i8x16.extract_lane_u] [number 1]', + '[keyword i8x16.replace_lane] [number 1]', + '[keyword i16x8.extract_lane_s] [number 1]', + '[keyword i16x8.extract_lane_u] [number 1]', + '[keyword i16x8.replace_lane] [number 1]', + '[keyword i32x4.extract_lane] [number 1]', + '[keyword i32x4.replace_lane] [number 1]', + '[keyword i64x2.extract_lane] [number 1]', + '[keyword i64x2.replace_lane] [number 1]', + '[keyword f32x4.extract_lane] [number 1]', + '[keyword f32x4.replace_lane] [number 1]', + '[keyword f64x2.extract_lane] [number 1]', + '[keyword f64x2.replace_lane] [number 1]', + '[keyword i8x16.eq]', + '[keyword i8x16.ne]', + '[keyword i8x16.lt_s]', + '[keyword i8x16.lt_u]', + '[keyword i8x16.gt_s]', + '[keyword i8x16.gt_u]', + '[keyword i8x16.le_s]', + '[keyword i8x16.le_u]', + '[keyword i8x16.ge_s]', + '[keyword i8x16.ge_u]', + '[keyword i16x8.eq]', + '[keyword i16x8.ne]', + '[keyword i16x8.lt_s]', + '[keyword i16x8.lt_u]', + '[keyword i16x8.gt_s]', + '[keyword i16x8.gt_u]', + '[keyword i16x8.le_s]', + '[keyword i16x8.le_u]', + '[keyword i16x8.ge_s]', + '[keyword i16x8.ge_u]', + '[keyword i32x4.eq]', + '[keyword i32x4.ne]', + '[keyword i32x4.lt_s]', + '[keyword i32x4.lt_u]', + '[keyword i32x4.gt_s]', + '[keyword i32x4.gt_u]', + '[keyword i32x4.le_s]', + '[keyword i32x4.le_u]', + '[keyword i32x4.ge_s]', + '[keyword i32x4.ge_u]', + '[keyword f32x4.eq]', + '[keyword f32x4.ne]', + '[keyword f32x4.lt]', + '[keyword f32x4.gt]', + '[keyword f32x4.le]', + '[keyword f32x4.ge]', + '[keyword f64x2.eq]', + '[keyword f64x2.ne]', + '[keyword f64x2.lt]', + '[keyword f64x2.gt]', + '[keyword f64x2.le]', + '[keyword f64x2.ge]', + '[keyword v128.not]', + '[keyword v128.and]', + '[keyword v128.andnot]', + '[keyword v128.or]', + '[keyword v128.xor]', + '[keyword v128.bitselect]', + '[keyword v128.any_true]', + '[keyword v128.load8_lane] [keyword offset]=[number 64] [keyword align]=[number 0] [number 1]', + '[keyword v128.load16_lane] [keyword offset]=[number 64] [keyword align]=[number 0] [number 1]', + '[keyword v128.load32_lane] [keyword offset]=[number 64] [keyword align]=[number 0] [number 1]', + '[keyword v128.load64_lane] [keyword offset]=[number 64] [keyword align]=[number 0] [number 1]', + '[keyword v128.store8_lane] [keyword offset]=[number 64] [keyword align]=[number 0] [number 1]', + '[keyword v128.store16_lane] [keyword offset]=[number 64] [keyword align]=[number 0] [number 1]', + '[keyword v128.store32_lane] [keyword offset]=[number 64] [keyword align]=[number 0] [number 1]', + '[keyword v128.store64_lane] [keyword offset]=[number 64] [keyword align]=[number 0] [number 1]', + '[keyword v128.load32_zero] [keyword offset]=[number 64] [keyword align]=[number 0]', + '[keyword v128.load64_zero] [keyword offset]=[number 64] [keyword align]=[number 0]', + '[keyword f32x4.demote_f64x2_zero]', + '[keyword f64x2.promote_low_f32x4]', + '[keyword i8x16.abs]', + '[keyword i8x16.neg]', + '[keyword i8x16.popcnt]', + '[keyword i8x16.all_true]', + '[keyword i8x16.bitmask]', + '[keyword i8x16.narrow_i16x8_s]', + '[keyword i8x16.narrow_i16x8_u]', + '[keyword f32x4.ceil]', + '[keyword f32x4.floor]', + '[keyword f32x4.trunc]', + '[keyword f32x4.nearest]', + '[keyword i8x16.shl]', + '[keyword i8x16.shr_s]', + '[keyword i8x16.shr_u]', + '[keyword i8x16.add]', + '[keyword i8x16.add_sat_s]', + '[keyword i8x16.add_sat_u]', + '[keyword i8x16.sub]', + '[keyword i8x16.sub_sat_s]', + '[keyword i8x16.sub_sat_u]', + '[keyword f64x2.ceil]', + '[keyword f64x2.floor]', + '[keyword i8x16.min_s]', + '[keyword i8x16.min_u]', + '[keyword i8x16.max_s]', + '[keyword i8x16.max_u]', + '[keyword f64x2.trunc]', + '[keyword i8x16.avgr_u]', + '[keyword i16x8.extadd_pairwise_i8x16_s]', + '[keyword i16x8.extadd_pairwise_i8x16_u]', + '[keyword i32x4.extadd_pairwise_i16x8_s]', + '[keyword i32x4.extadd_pairwise_i16x8_u]', + '[keyword i16x8.abs]', + '[keyword i16x8.neg]', + '[keyword i16x8.q15mulr_sat_s]', + '[keyword i16x8.all_true]', + '[keyword i16x8.bitmask]', + '[keyword i16x8.narrow_i32x4_s]', + '[keyword i16x8.narrow_i32x4_u]', + '[keyword i16x8.extend_low_i8x16_s]', + '[keyword i16x8.extend_high_i8x16_s]', + '[keyword i16x8.extend_low_i8x16_u]', + '[keyword i16x8.extend_high_i8x16_u]', + '[keyword i16x8.shl]', + '[keyword i16x8.shr_s]', + '[keyword i16x8.shr_u]', + '[keyword i16x8.add]', + '[keyword i16x8.add_sat_s]', + '[keyword i16x8.add_sat_u]', + '[keyword i16x8.sub]', + '[keyword i16x8.sub_sat_s]', + '[keyword i16x8.sub_sat_u]', + '[keyword f64x2.nearest]', + '[keyword i16x8.mul]', + '[keyword i16x8.min_s]', + '[keyword i16x8.min_u]', + '[keyword i16x8.max_s]', + '[keyword i16x8.max_u]', + '[keyword i16x8.avgr_u]', + '[keyword i16x8.extmul_low_i8x16_s]', + '[keyword i16x8.extmul_high_i8x16_s]', + '[keyword i16x8.extmul_low_i8x16_u]', + '[keyword i16x8.extmul_high_i8x16_u]', + '[keyword i32x4.abs]', + '[keyword i32x4.neg]', + '[keyword i32x4.all_true]', + '[keyword i32x4.bitmask]', + '[keyword i32x4.extend_low_i16x8_s]', + '[keyword i32x4.extend_high_i16x8_s]', + '[keyword i32x4.extend_low_i16x8_u]', + '[keyword i32x4.extend_high_i16x8_u]', + '[keyword i32x4.shl]', + '[keyword i32x4.shr_s]', + '[keyword i32x4.shr_u]', + '[keyword i32x4.add]', + '[keyword i32x4.sub]', + '[keyword i32x4.mul]', + '[keyword i32x4.min_s]', + '[keyword i32x4.min_u]', + '[keyword i32x4.max_s]', + '[keyword i32x4.max_u]', + '[keyword i32x4.dot_i16x8_s]', + '[keyword i32x4.extmul_low_i16x8_s]', + '[keyword i32x4.extmul_high_i16x8_s]', + '[keyword i32x4.extmul_low_i16x8_u]', + '[keyword i32x4.extmul_high_i16x8_u]', + '[keyword i64x2.abs]', + '[keyword i64x2.neg]', + '[keyword i64x2.all_true]', + '[keyword i64x2.bitmask]', + '[keyword i64x2.extend_low_i32x4_s]', + '[keyword i64x2.extend_high_i32x4_s]', + '[keyword i64x2.extend_low_i32x4_u]', + '[keyword i64x2.extend_high_i32x4_u]', + '[keyword i64x2.shl]', + '[keyword i64x2.shr_s]', + '[keyword i64x2.shr_u]', + '[keyword i64x2.add]', + '[keyword i64x2.sub]', + '[keyword i64x2.mul]', + '[keyword i64x2.eq]', + '[keyword i64x2.ne]', + '[keyword i64x2.lt_s]', + '[keyword i64x2.gt_s]', + '[keyword i64x2.le_s]', + '[keyword i64x2.ge_s]', + '[keyword i64x2.extmul_low_i32x4_s]', + '[keyword i64x2.extmul_high_i32x4_s]', + '[keyword i64x2.extmul_low_i32x4_u]', + '[keyword i64x2.extmul_high_i32x4_u]', + '[keyword f32x4.abs]', + '[keyword f32x4.neg]', + '[keyword f32x4.sqrt]', + '[keyword f32x4.add]', + '[keyword f32x4.sub]', + '[keyword f32x4.mul]', + '[keyword f32x4.div]', + '[keyword f32x4.min]', + '[keyword f32x4.max]', + '[keyword f64x2.abs]', + '[keyword f64x2.neg]', + '[keyword f64x2.sqrt]', + '[keyword f64x2.add]', + '[keyword f64x2.sub]', + '[keyword f64x2.mul]', + '[keyword f64x2.div]', + '[keyword f64x2.min]', + '[keyword f64x2.max]', + '[keyword i32x4.trunc_sat_f32x4_s]', + '[keyword i32x4.trunc_sat_f32x4_u]', + '[keyword f32x4.convert_i32x4_s]', + '[keyword f32x4.convert_i32x4_u]', + '[keyword i32x4.trunc_sat_f64x2_s_zero]', + '[keyword i32x4.trunc_sat_f64x2_u_zero]', + '[keyword f64x2.convert_low_i32x4_s]', + '[keyword f64x2.convert_low_i32x4_u]'); + + MT('reference-type-instructions', + '[keyword ref.null] [keyword extern]', + '[keyword ref.null] [keyword func]', + '[keyword ref.is_null] ([keyword ref.func] [variable-2 $f])', + '[keyword ref.func] [variable-2 $f]'); + + MT('table-instructions', + '[keyword table.get] [variable-2 $t] ([keyword i32.const] [number 5])', + '[keyword table.set] [variable-2 $t] ([keyword i32.const] [number 5]) ([keyword ref.func] [variable-2 $f])', + '[keyword table.size] [variable-2 $t]', + '[keyword table.grow] [variable-2 $t] ([keyword ref.null] [keyword extern]) ([keyword i32.const] [number 5])', + '[keyword table.fill] [variable-2 $t] ([keyword i32.const] [number 5]) ([keyword param] [variable-2 $r] [atom externref]) ([keyword i32.const] [number 5])', + '[keyword table.init] [variable-2 $t] [number 1] ([keyword i32.const] [number 5]) ([keyword i32.const] [number 10]) ([keyword i32.const] [number 15])', + '[keyword table.copy] [variable-2 $t] [variable-2 $t2] ([keyword i32.const] [number 5]) ([keyword i32.const] [number 10]) ([keyword i32.const] [number 15])' + ); + MT('gc-proposal', + '[keyword call_ref] [keyword return_call_ref]', + '[keyword ref.as_non_null] [keyword br_on_null] [keyword ref.eq]'); + MT('gc-proposal-structs', + '[keyword struct.new_with_rtt] [keyword struct.new_default_with_rtt]', + '[keyword struct.get] [keyword struct.get_s] [keyword struct.get_u]', + '[keyword struct.set]'); + MT('gc-proposal-arrays', + '[keyword array.new_with_rtt] [keyword array.new_default_with_rtt]', + '[keyword array.get] [keyword array.get_s] [keyword array.get_u]', + '[keyword array.len] [keyword array.set]'); + MT('gc-proposal-i31', + '[keyword i31.new] [keyword i31.get_s] [keyword i31.get_u]'); + MT('gc-proposal-rtt', + '[keyword rtt.canon] [keyword rtt.sub]'); + MT('gc-proposal-typechecks', + '[keyword ref.test] [keyword ref.cast] [keyword br_on_cast]', + '[keyword ref.is_func] [keyword ref.is_data] [keyword ref.is_i31]', + '[keyword ref.as_func] [keyword ref.as_data] [keyword ref.as_i31]', + '[keyword br_on_func] [keyword br_on_data] [keyword br_on_i31]'); + MT('gc-proposal-types', + '[atom i8] [atom i16]', + '[atom anyref] [atom dataref] [atom eqref] [atom i31ref]'); +})(); diff --git a/src/external/code-mirror/mode/wast/wast.js b/src/external/code-mirror/mode/wast/wast.js new file mode 100644 index 000000000..0a0af853d --- /dev/null +++ b/src/external/code-mirror/mode/wast/wast.js @@ -0,0 +1,132 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/5/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../../addon/mode/simple")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../../addon/mode/simple"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +var kKeywords = [ + "align", + "block", + "br(_if|_table|_on_(cast|data|func|i31|null))?", + "call(_indirect|_ref)?", + "current_memory", + "\\bdata\\b", + "catch(_all)?", + "delegate", + "drop", + "elem", + "else", + "end", + "export", + "\\bextern\\b", + "\\bfunc\\b", + "global(\\.(get|set))?", + "if", + "import", + "local(\\.(get|set|tee))?", + "loop", + "module", + "mut", + "nop", + "offset", + "param", + "result", + "rethrow", + "return(_call(_indirect|_ref)?)?", + "select", + "start", + "table(\\.(size|get|set|size|grow|fill|init|copy))?", + "then", + "throw", + "try", + "type", + "unreachable", + "unwind", + + // Numeric opcodes. + "i(32|64)\\.(store(8|16)|(load(8|16)_[su]))", + "i64\\.(load32_[su]|store32)", + "[fi](32|64)\\.(const|load|store)", + "f(32|64)\\.(abs|add|ceil|copysign|div|eq|floor|[gl][et]|max|min|mul|nearest|neg?|sqrt|sub|trunc)", + "i(32|64)\\.(a[dn]d|c[lt]z|(div|rem)_[su]|eqz?|[gl][te]_[su]|mul|ne|popcnt|rot[lr]|sh(l|r_[su])|sub|x?or)", + "i64\\.extend_[su]_i32", + "i32\\.wrap_i64", + "i(32|64)\\.trunc_f(32|64)_[su]", + "f(32|64)\\.convert_i(32|64)_[su]", + "f64\\.promote_f32", + "f32\\.demote_f64", + "f32\\.reinterpret_i32", + "i32\\.reinterpret_f32", + "f64\\.reinterpret_i64", + "i64\\.reinterpret_f64", + // Atomics. + "memory(\\.((atomic\\.(notify|wait(32|64)))|grow|size))?", + "i64\.atomic\\.(load32_u|store32|rmw32\\.(a[dn]d|sub|x?or|(cmp)?xchg)_u)", + "i(32|64)\\.atomic\\.(load((8|16)_u)?|store(8|16)?|rmw(\\.(a[dn]d|sub|x?or|(cmp)?xchg)|(8|16)\\.(a[dn]d|sub|x?or|(cmp)?xchg)_u))", + // SIMD. + "v128\\.load(8x8|16x4|32x2)_[su]", + "v128\\.load(8|16|32|64)_splat", + "v128\\.(load|store)(8|16|32|64)_lane", + "v128\\.load(32|64)_zero", + "v128\.(load|store|const|not|andnot|and|or|xor|bitselect|any_true)", + "i(8x16|16x8)\\.(extract_lane_[su]|(add|sub)_sat_[su]|avgr_u)", + "i(8x16|16x8|32x4|64x2)\\.(neg|add|sub|abs|shl|shr_[su]|all_true|bitmask|eq|ne|[lg][te]_s)", + "(i(8x16|16x8|32x4|64x2)|f(32x4|64x2))\.(splat|replace_lane)", + "i(8x16|16x8|32x4)\\.(([lg][te]_u)|((min|max)_[su]))", + "f(32x4|64x2)\\.(neg|add|sub|abs|nearest|eq|ne|[lg][te]|sqrt|mul|div|min|max|ceil|floor|trunc)", + "[fi](32x4|64x2)\\.extract_lane", + "i8x16\\.(shuffle|swizzle|popcnt|narrow_i16x8_[su])", + "i16x8\\.(narrow_i32x4_[su]|mul|extadd_pairwise_i8x16_[su]|q15mulr_sat_s)", + "i16x8\\.(extend|extmul)_(low|high)_i8x16_[su]", + "i32x4\\.(mul|dot_i16x8_s|trunc_sat_f64x2_[su]_zero)", + "i32x4\\.((extend|extmul)_(low|high)_i16x8_|trunc_sat_f32x4_|extadd_pairwise_i16x8_)[su]", + "i64x2\\.(mul|(extend|extmul)_(low|high)_i32x4_[su])", + "f32x4\\.(convert_i32x4_[su]|demote_f64x2_zero)", + "f64x2\\.(promote_low_f32x4|convert_low_i32x4_[su])", + // Reference types, function references, and GC. + "\\bany\\b", + "array\\.len", + "(array|struct)(\\.(new_(default_)?with_rtt|get(_[su])?|set))?", + "\\beq\\b", + "field", + "i31\\.(new|get_[su])", + "\\bnull\\b", + "ref(\\.(([ai]s_(data|func|i31))|cast|eq|func|(is_|as_non_)?null|test))?", + "rtt(\\.(canon|sub))?", +]; + +CodeMirror.defineSimpleMode('wast', { + start: [ + {regex: /[+\-]?(?:nan(?::0x[0-9a-fA-F]+)?|infinity|inf|0x[0-9a-fA-F]+\.?[0-9a-fA-F]*p[+\/-]?\d+|\d+(?:\.\d*)?[eE][+\-]?\d*|\d+\.\d*|0x[0-9a-fA-F]+|\d+)/, token: "number"}, + {regex: new RegExp(kKeywords.join('|')), token: "keyword"}, + {regex: /\b((any|data|eq|extern|i31|func)ref|[fi](32|64)|i(8|16))\b/, token: "atom"}, + {regex: /\$([a-zA-Z0-9_`\+\-\*\/\\\^~=<>!\?@#$%&|:\.]+)/, token: "variable-2"}, + {regex: /"(?:[^"\\\x00-\x1f\x7f]|\\[nt\\'"]|\\[0-9a-fA-F][0-9a-fA-F])*"/, token: "string"}, + {regex: /\(;.*?/, token: "comment", next: "comment"}, + {regex: /;;.*$/, token: "comment"}, + {regex: /\(/, indent: true}, + {regex: /\)/, dedent: true}, + ], + + comment: [ + {regex: /.*?;\)/, token: "comment", next: "start"}, + {regex: /.*/, token: "comment"}, + ], + + meta: { + dontIndentStates: ['comment'], + }, +}); + +// https://github.com/WebAssembly/design/issues/981 mentions text/webassembly, +// which seems like a reasonable choice, although it's not standard right now. +CodeMirror.defineMIME("text/webassembly", "wast"); + +}); diff --git a/src/external/code-mirror/src/addon/runmode/codemirror-standalone.js b/src/external/code-mirror/src/addon/runmode/codemirror-standalone.js new file mode 100644 index 000000000..f13f32b2f --- /dev/null +++ b/src/external/code-mirror/src/addon/runmode/codemirror-standalone.js @@ -0,0 +1,24 @@ +import StringStream from "../../util/StringStream.js" +import { countColumn } from "../../util/misc.js" +import * as modeMethods from "../../modes.js" + +// declare global: globalThis, CodeMirror + +// Create a minimal CodeMirror needed to use runMode, and assign to root. +var root = typeof globalThis !== 'undefined' ? globalThis : window +root.CodeMirror = {} + +// Copy StringStream and mode methods into CodeMirror object. +CodeMirror.StringStream = StringStream +for (var exported in modeMethods) CodeMirror[exported] = modeMethods[exported] + +// Minimal default mode. +CodeMirror.defineMode("null", () => ({token: stream => stream.skipToEnd()})) +CodeMirror.defineMIME("text/plain", "null") + +CodeMirror.registerHelper = CodeMirror.registerGlobalHelper = Math.min +CodeMirror.splitLines = function(string) { return string.split(/\r?\n|\r/) } +CodeMirror.countColumn = countColumn + +CodeMirror.defaults = { indentUnit: 2 } +export default CodeMirror diff --git a/src/external/code-mirror/src/addon/runmode/codemirror.node.js b/src/external/code-mirror/src/addon/runmode/codemirror.node.js new file mode 100644 index 000000000..58efc5286 --- /dev/null +++ b/src/external/code-mirror/src/addon/runmode/codemirror.node.js @@ -0,0 +1,21 @@ +import StringStream from "../../util/StringStream.js" +import * as modeMethods from "../../modes.js" +import {countColumn} from "../../util/misc.js" + +// Copy StringStream and mode methods into exports (CodeMirror) object. +exports.StringStream = StringStream +exports.countColumn = countColumn +for (var exported in modeMethods) exports[exported] = modeMethods[exported] + +// Shim library CodeMirror with the minimal CodeMirror defined above. +require.cache[require.resolve("../../lib/codemirror")] = require.cache[require.resolve("./runmode.node")] +require.cache[require.resolve("../../addon/runmode/runmode")] = require.cache[require.resolve("./runmode.node")] + +// Minimal default mode. +exports.defineMode("null", () => ({token: stream => stream.skipToEnd()})) +exports.defineMIME("text/plain", "null") + +exports.registerHelper = exports.registerGlobalHelper = Math.min +exports.splitLines = function(string) { return string.split(/\r?\n|\r/) } + +exports.defaults = { indentUnit: 2 } diff --git a/src/external/code-mirror/src/addon/runmode/runmode-standalone.js b/src/external/code-mirror/src/addon/runmode/runmode-standalone.js new file mode 100644 index 000000000..0d7aa6bb2 --- /dev/null +++ b/src/external/code-mirror/src/addon/runmode/runmode-standalone.js @@ -0,0 +1,2 @@ +import "./codemirror-standalone.js" +import "../../../addon/runmode/runmode.js" \ No newline at end of file diff --git a/src/external/code-mirror/src/addon/runmode/runmode.node.js b/src/external/code-mirror/src/addon/runmode/runmode.node.js new file mode 100644 index 000000000..4f2ed817f --- /dev/null +++ b/src/external/code-mirror/src/addon/runmode/runmode.node.js @@ -0,0 +1,2 @@ +import "./codemirror.node.js" +import "../../../addon/runmode/runmode.js" \ No newline at end of file diff --git a/src/external/code-mirror/src/input/movement.js b/src/external/code-mirror/src/input/movement.js new file mode 100644 index 000000000..479f221f9 --- /dev/null +++ b/src/external/code-mirror/src/input/movement.js @@ -0,0 +1,111 @@ +import { Pos } from "../line/pos.js" +import { prepareMeasureForLine, measureCharPrepared, wrappedLineExtentChar } from "../measurement/position_measurement.js" +import { getBidiPartAt, getOrder } from "../util/bidi.js" +import { findFirst, lst, skipExtendingChars } from "../util/misc.js" + +function moveCharLogically(line, ch, dir) { + let target = skipExtendingChars(line.text, ch + dir, dir) + return target < 0 || target > line.text.length ? null : target +} + +export function moveLogically(line, start, dir) { + let ch = moveCharLogically(line, start.ch, dir) + return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before") +} + +export function endOfLine(visually, cm, lineObj, lineNo, dir) { + if (visually) { + if (cm.doc.direction == "rtl") dir = -dir + let order = getOrder(lineObj, cm.doc.direction) + if (order) { + let part = dir < 0 ? lst(order) : order[0] + let moveInStorageOrder = (dir < 0) == (part.level == 1) + let sticky = moveInStorageOrder ? "after" : "before" + let ch + // With a wrapped rtl chunk (possibly spanning multiple bidi parts), + // it could be that the last bidi part is not on the last visual line, + // since visual lines contain content order-consecutive chunks. + // Thus, in rtl, we are looking for the first (content-order) character + // in the rtl chunk that is on the last line (that is, the same line + // as the last (content-order) character). + if (part.level > 0 || cm.doc.direction == "rtl") { + let prep = prepareMeasureForLine(cm, lineObj) + ch = dir < 0 ? lineObj.text.length - 1 : 0 + let targetTop = measureCharPrepared(cm, prep, ch).top + ch = findFirst(ch => measureCharPrepared(cm, prep, ch).top == targetTop, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch) + if (sticky == "before") ch = moveCharLogically(lineObj, ch, 1) + } else ch = dir < 0 ? part.to : part.from + return new Pos(lineNo, ch, sticky) + } + } + return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after") +} + +export function moveVisually(cm, line, start, dir) { + let bidi = getOrder(line, cm.doc.direction) + if (!bidi) return moveLogically(line, start, dir) + if (start.ch >= line.text.length) { + start.ch = line.text.length + start.sticky = "before" + } else if (start.ch <= 0) { + start.ch = 0 + start.sticky = "after" + } + let partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos] + if (cm.doc.direction == "ltr" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) { + // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines, + // nothing interesting happens. + return moveLogically(line, start, dir) + } + + let mv = (pos, dir) => moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir) + let prep + let getWrappedLineExtent = ch => { + if (!cm.options.lineWrapping) return {begin: 0, end: line.text.length} + prep = prep || prepareMeasureForLine(cm, line) + return wrappedLineExtentChar(cm, line, prep, ch) + } + let wrappedLineExtent = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch) + + if (cm.doc.direction == "rtl" || part.level == 1) { + let moveInStorageOrder = (part.level == 1) == (dir < 0) + let ch = mv(start, moveInStorageOrder ? 1 : -1) + if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) { + // Case 2: We move within an rtl part or in an rtl editor on the same visual line + let sticky = moveInStorageOrder ? "before" : "after" + return new Pos(start.line, ch, sticky) + } + } + + // Case 3: Could not move within this bidi part in this visual line, so leave + // the current bidi part + + let searchInVisualLine = (partPos, dir, wrappedLineExtent) => { + let getRes = (ch, moveInStorageOrder) => moveInStorageOrder + ? new Pos(start.line, mv(ch, 1), "before") + : new Pos(start.line, ch, "after") + + for (; partPos >= 0 && partPos < bidi.length; partPos += dir) { + let part = bidi[partPos] + let moveInStorageOrder = (dir > 0) == (part.level != 1) + let ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1) + if (part.from <= ch && ch < part.to) return getRes(ch, moveInStorageOrder) + ch = moveInStorageOrder ? part.from : mv(part.to, -1) + if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) return getRes(ch, moveInStorageOrder) + } + } + + // Case 3a: Look for other bidi parts on the same visual line + let res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent) + if (res) return res + + // Case 3b: Look for other bidi parts on the next visual line + let nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1) + if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) { + res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh)) + if (res) return res + } + + // Case 4: Nowhere to move + return null +} diff --git a/src/external/code-mirror/theme/abbott.css b/src/external/code-mirror/theme/abbott.css new file mode 100644 index 000000000..3e516a67f --- /dev/null +++ b/src/external/code-mirror/theme/abbott.css @@ -0,0 +1,268 @@ +/* + * abbott.css + * A warm, dark theme for prose and code, with pastels and pretty greens. + * + * Ported from abbott.vim (https://github.com/bcat/abbott.vim) version 2.1. + * Original design and CodeMirror port by Jonathan Rascher. + * + * This theme shares the following color palette with the Vim color scheme. + * + * Brown shades: + * bistre: #231c14 + * chocolate: #3c3022 + * cocoa: #745d42 + * vanilla_cream: #fef3b4 + * + * Red shades: + * crimson: #d80450 + * cinnabar: #f63f05 + * + * Green shades: + * dark_olive: #273900 + * forest_green: #24a507 + * chartreuse: #a0ea00 + * pastel_chartreuse: #d8ff84 + * + * Yellow shades: + * marigold: #fbb32f + * lemon_meringue: #fbec5d + * + * Blue shades: + * cornflower_blue: #3f91f1 + * periwinkle_blue: #8ccdf0 + * + * Magenta shades: + * french_pink: #ec6c99 + * lavender: #e6a2f3 + * + * Cyan shades: + * zomp: #39a78d + * seafoam_green: #00ff7f + */ + +/* Style the UI: */ + +/* Equivalent to Vim's Normal group. */ +.cm-s-abbott.CodeMirror { + background: #231c14 /* bistre */; + color: #d8ff84 /* pastel_chartreuse */; +} + +/* Roughly equivalent to Vim's LineNr group. */ +.cm-s-abbott .CodeMirror-gutters { + background: #231c14 /* bistre */; + border: none; +} +.cm-s-abbott .CodeMirror-linenumber { color: #fbec5d /* lemon_meringue */; } + +.cm-s-abbott .CodeMirror-guttermarker { color: #f63f05 /* cinnabar */; } + +/* Roughly equivalent to Vim's FoldColumn group. */ +.cm-s-abbott .CodeMirror-guttermarker-subtle { color: #fbb32f /* marigold */; } + +/* + * Roughly equivalent to Vim's CursorColumn group. (We use a brighter color + * since Vim's cursorcolumn option highlights a whole column, whereas + * CodeMirror's rule just highlights a thin line.) + */ +.cm-s-abbott .CodeMirror-ruler { border-color: #745d42 /* cocoa */; } + +/* Equivalent to Vim's Cursor group in insert mode. */ +.cm-s-abbott .CodeMirror-cursor { border-color: #a0ea00 /* chartreuse */; } + +/* Equivalent to Vim's Cursor group in normal mode. */ +.cm-s-abbott.cm-fat-cursor .CodeMirror-cursor, +.cm-s-abbott .cm-animate-fat-cursor { + /* + * CodeMirror doesn't allow changing the foreground color of the character + * under the cursor, so we can't use a reverse video effect for the cursor. + * Instead, make it semitransparent. + */ + background: rgba(160, 234, 0, 0.5) /* chartreuse */; +} +.cm-s-abbott.cm-fat-cursor .CodeMirror-cursors { + /* + * Boost the z-index so the fat cursor shows up on top of text and + * matchingbracket/matchingtag highlights. + */ + z-index: 3; +} + +/* Equivalent to Vim's Cursor group in replace mode. */ +.cm-s-abbott .CodeMirror-overwrite .CodeMirror-cursor { + border-bottom: 1px solid #a0ea00 /* chartreuse */; + border-left: none; + width: auto; +} + +/* Roughly equivalent to Vim's CursorIM group. */ +.cm-s-abbott .CodeMirror-secondarycursor { + border-color: #00ff7f /* seafoam_green */; +} + +/* Roughly equivalent to Vim's Visual group. */ +.cm-s-abbott .CodeMirror-selected, +.cm-s-abbott.CodeMirror-focused .CodeMirror-selected { + background: #273900 /* dark_olive */; +} +.cm-s-abbott .CodeMirror-line::selection, +.cm-s-abbott .CodeMirror-line > span::selection, +.cm-s-abbott .CodeMirror-line > span > span::selection { + background: #273900 /* dark_olive */; +} +.cm-s-abbott .CodeMirror-line::-moz-selection, +.cm-s-abbott .CodeMirror-line > span::-moz-selection, +.cm-s-abbott .CodeMirror-line > span > span::-moz-selection { + background: #273900 /* dark_olive */; +} + +/* Roughly equivalent to Vim's SpecialKey group. */ +.cm-s-abbott .cm-tab { color: #00ff7f /* seafoam_green */; } + +/* Equivalent to Vim's Search group. */ +.cm-s-abbott .cm-searching { + background: #fef3b4 /* vanilla_cream */ !important; + color: #231c14 /* bistre */ !important; +} + +/* Style syntax highlighting modes: */ + +/* Equivalent to Vim's Comment group. */ +.cm-s-abbott span.cm-comment { + color: #fbb32f /* marigold */; + font-style: italic; +} + +/* Equivalent to Vim's String group. */ +.cm-s-abbott span.cm-string, +.cm-s-abbott span.cm-string-2 { + color: #e6a2f3 /* lavender */; +} + +/* Equivalent to Vim's Constant group. */ +.cm-s-abbott span.cm-number, +.cm-s-abbott span.cm-string.cm-url { color: #f63f05 /* cinnabar */; } + +/* Roughly equivalent to Vim's SpecialKey group. */ +.cm-s-abbott span.cm-invalidchar { color: #00ff7f /* seafoam_green */; } + +/* Equivalent to Vim's Special group. */ +.cm-s-abbott span.cm-atom { color: #fef3b4 /* vanilla_cream */; } + +/* Equivalent to Vim's Delimiter group. */ +.cm-s-abbott span.cm-bracket, +.cm-s-abbott span.cm-punctuation { + color: #fef3b4 /* vanilla_cream */; +} + +/* Equivalent Vim's Operator group. */ +.cm-s-abbott span.cm-operator { font-weight: bold; } + +/* Roughly equivalent to Vim's Identifier group. */ +.cm-s-abbott span.cm-def, +.cm-s-abbott span.cm-variable, +.cm-s-abbott span.cm-variable-2, +.cm-s-abbott span.cm-variable-3 { + color: #8ccdf0 /* periwinkle_blue */; +} + +/* Roughly equivalent to Vim's Function group. */ +.cm-s-abbott span.cm-builtin, +.cm-s-abbott span.cm-property, +.cm-s-abbott span.cm-qualifier { + color: #3f91f1 /* cornflower_blue */; +} + +/* Equivalent to Vim's Type group. */ +.cm-s-abbott span.cm-type { color: #24a507 /* forest_green */; } + +/* Equivalent to Vim's Keyword group. */ +.cm-s-abbott span.cm-keyword { + color: #d80450 /* crimson */; + font-weight: bold; +} + +/* Equivalent to Vim's PreProc group. */ +.cm-s-abbott span.cm-meta { color: #ec6c99 /* french_pink */; } + +/* Equivalent to Vim's htmlTagName group (linked to Statement). */ +.cm-s-abbott span.cm-tag { + color: #d80450 /* crimson */; + font-weight: bold; +} + +/* Equivalent to Vim's htmlArg group (linked to Type). */ +.cm-s-abbott span.cm-attribute { color: #24a507 /* forest_green */; } + +/* Equivalent to Vim's htmlH1, markdownH1, etc. groups (linked to Title). */ +.cm-s-abbott span.cm-header { + color: #d80450 /* crimson */; + font-weight: bold; +} + +/* Equivalent to Vim's markdownRule group (linked to PreProc). */ +.cm-s-abbott span.cm-hr { color: #ec6c99 /* french_pink */; } + +/* Roughly equivalent to Vim's Underlined group. */ +.cm-s-abbott span.cm-link { color: #e6a2f3 /* lavender */; } + +/* Equivalent to Vim's diffRemoved group. */ +.cm-s-abbott span.cm-negative { + background: #d80450 /* crimson */; + color: #231c14 /* bistre */; +} + +/* Equivalent to Vim's diffAdded group. */ +.cm-s-abbott span.cm-positive { + background: #a0ea00 /* chartreuse */; + color: #231c14 /* bistre */; + font-weight: bold; +} + +/* Equivalent to Vim's Error group. */ +.cm-s-abbott span.cm-error { + background: #d80450 /* crimson */; + color: #231c14 /* bistre */; +} + +/* Style addons: */ + +/* Equivalent to Vim's MatchParen group. */ +.cm-s-abbott span.CodeMirror-matchingbracket { + background: #745d42 /* cocoa */ !important; + color: #231c14 /* bistre */ !important; + font-weight: bold; +} + +/* + * Roughly equivalent to Vim's Error group. (Vim doesn't seem to have a direct + * equivalent in its own matchparen plugin, but many syntax highlighting plugins + * mark mismatched brackets as Error.) + */ +.cm-s-abbott span.CodeMirror-nonmatchingbracket { + background: #d80450 /* crimson */ !important; + color: #231c14 /* bistre */ !important; +} + +.cm-s-abbott .CodeMirror-matchingtag, +.cm-s-abbott .cm-matchhighlight { + outline: 1px solid #39a78d /* zomp */; +} + +/* Equivalent to Vim's CursorLine group. */ +.cm-s-abbott .CodeMirror-activeline-background, +.cm-s-abbott .CodeMirror-activeline-gutter { + background: #3c3022 /* chocolate */; +} + +/* Equivalent to Vim's CursorLineNr group. */ +.cm-s-abbott .CodeMirror-activeline-gutter .CodeMirror-linenumber { + color: #d8ff84 /* pastel_chartreuse */; + font-weight: bold; +} + +/* Roughly equivalent to Vim's Folded group. */ +.cm-s-abbott .CodeMirror-foldmarker { + color: #f63f05 /* cinnabar */; + text-shadow: none; +} diff --git a/src/external/code-mirror/theme/ayu-dark.css b/src/external/code-mirror/theme/ayu-dark.css new file mode 100644 index 000000000..13656b94b --- /dev/null +++ b/src/external/code-mirror/theme/ayu-dark.css @@ -0,0 +1,44 @@ +/* Based on https://github.com/dempfi/ayu */ + +.cm-s-ayu-dark.CodeMirror { background: #0a0e14; color: #b3b1ad; } +.cm-s-ayu-dark div.CodeMirror-selected { background: #273747; } +.cm-s-ayu-dark .CodeMirror-line::selection, .cm-s-ayu-dark .CodeMirror-line > span::selection, .cm-s-ayu-dark .CodeMirror-line > span > span::selection { background: rgba(39, 55, 71, 99); } +.cm-s-ayu-dark .CodeMirror-line::-moz-selection, .cm-s-ayu-dark .CodeMirror-line > span::-moz-selection, .cm-s-ayu-dark .CodeMirror-line > span > span::-moz-selection { background: rgba(39, 55, 71, 99); } +.cm-s-ayu-dark .CodeMirror-gutters { background: #0a0e14; border-right: 0px; } +.cm-s-ayu-dark .CodeMirror-guttermarker { color: white; } +.cm-s-ayu-dark .CodeMirror-guttermarker-subtle { color: #3d424d; } +.cm-s-ayu-dark .CodeMirror-linenumber { color: #3d424d; } +.cm-s-ayu-dark .CodeMirror-cursor { border-left: 1px solid #e6b450; } +.cm-s-ayu-dark.cm-fat-cursor .CodeMirror-cursor { background-color: #a2a8a175 !important; } +.cm-s-ayu-dark .cm-animate-fat-cursor { background-color: #a2a8a175 !important; } + +.cm-s-ayu-dark span.cm-comment { color: #626a73; } +.cm-s-ayu-dark span.cm-atom { color: #ae81ff; } +.cm-s-ayu-dark span.cm-number { color: #e6b450; } + +.cm-s-ayu-dark span.cm-comment.cm-attribute { color: #ffb454; } +.cm-s-ayu-dark span.cm-comment.cm-def { color: rgba(57, 186, 230, 80); } +.cm-s-ayu-dark span.cm-comment.cm-tag { color: #39bae6; } +.cm-s-ayu-dark span.cm-comment.cm-type { color: #5998a6; } + +.cm-s-ayu-dark span.cm-property, .cm-s-ayu-dark span.cm-attribute { color: #ffb454; } +.cm-s-ayu-dark span.cm-keyword { color: #ff8f40; } +.cm-s-ayu-dark span.cm-builtin { color: #e6b450; } +.cm-s-ayu-dark span.cm-string { color: #c2d94c; } + +.cm-s-ayu-dark span.cm-variable { color: #b3b1ad; } +.cm-s-ayu-dark span.cm-variable-2 { color: #f07178; } +.cm-s-ayu-dark span.cm-variable-3 { color: #39bae6; } +.cm-s-ayu-dark span.cm-type { color: #ff8f40; } +.cm-s-ayu-dark span.cm-def { color: #ffee99; } +.cm-s-ayu-dark span.cm-bracket { color: #f8f8f2; } +.cm-s-ayu-dark span.cm-tag { color: rgba(57, 186, 230, 80); } +.cm-s-ayu-dark span.cm-header { color: #c2d94c; } +.cm-s-ayu-dark span.cm-link { color: #39bae6; } +.cm-s-ayu-dark span.cm-error { color: #ff3333; } + +.cm-s-ayu-dark .CodeMirror-activeline-background { background: #01060e; } +.cm-s-ayu-dark .CodeMirror-matchingbracket { + text-decoration: underline; + color: white !important; +} diff --git a/src/external/code-mirror/theme/ayu-mirage.css b/src/external/code-mirror/theme/ayu-mirage.css new file mode 100644 index 000000000..19403cefb --- /dev/null +++ b/src/external/code-mirror/theme/ayu-mirage.css @@ -0,0 +1,45 @@ +/* Based on https://github.com/dempfi/ayu */ + +.cm-s-ayu-mirage.CodeMirror { background: #1f2430; color: #cbccc6; } +.cm-s-ayu-mirage div.CodeMirror-selected { background: #34455a; } +.cm-s-ayu-mirage .CodeMirror-line::selection, .cm-s-ayu-mirage .CodeMirror-line > span::selection, .cm-s-ayu-mirage .CodeMirror-line > span > span::selection { background: #34455a; } +.cm-s-ayu-mirage .CodeMirror-line::-moz-selection, .cm-s-ayu-mirage .CodeMirror-line > span::-moz-selection, .cm-s-ayu-mirage .CodeMirror-line > span > span::-moz-selection { background: rgba(25, 30, 42, 99); } +.cm-s-ayu-mirage .CodeMirror-gutters { background: #1f2430; border-right: 0px; } +.cm-s-ayu-mirage .CodeMirror-guttermarker { color: white; } +.cm-s-ayu-mirage .CodeMirror-guttermarker-subtle { color: rgba(112, 122, 140, 66); } +.cm-s-ayu-mirage .CodeMirror-linenumber { color: rgba(61, 66, 77, 99); } +.cm-s-ayu-mirage .CodeMirror-cursor { border-left: 1px solid #ffcc66; } +.cm-s-ayu-mirage.cm-fat-cursor .CodeMirror-cursor {background-color: #a2a8a175 !important;} +.cm-s-ayu-mirage .cm-animate-fat-cursor { background-color: #a2a8a175 !important; } + +.cm-s-ayu-mirage span.cm-comment { color: #5c6773; font-style:italic; } +.cm-s-ayu-mirage span.cm-atom { color: #ae81ff; } +.cm-s-ayu-mirage span.cm-number { color: #ffcc66; } + +.cm-s-ayu-mirage span.cm-comment.cm-attribute { color: #ffd580; } +.cm-s-ayu-mirage span.cm-comment.cm-def { color: #d4bfff; } +.cm-s-ayu-mirage span.cm-comment.cm-tag { color: #5ccfe6; } +.cm-s-ayu-mirage span.cm-comment.cm-type { color: #5998a6; } + +.cm-s-ayu-mirage span.cm-property { color: #f29e74; } +.cm-s-ayu-mirage span.cm-attribute { color: #ffd580; } +.cm-s-ayu-mirage span.cm-keyword { color: #ffa759; } +.cm-s-ayu-mirage span.cm-builtin { color: #ffcc66; } +.cm-s-ayu-mirage span.cm-string { color: #bae67e; } + +.cm-s-ayu-mirage span.cm-variable { color: #cbccc6; } +.cm-s-ayu-mirage span.cm-variable-2 { color: #f28779; } +.cm-s-ayu-mirage span.cm-variable-3 { color: #5ccfe6; } +.cm-s-ayu-mirage span.cm-type { color: #ffa759; } +.cm-s-ayu-mirage span.cm-def { color: #ffd580; } +.cm-s-ayu-mirage span.cm-bracket { color: rgba(92, 207, 230, 80); } +.cm-s-ayu-mirage span.cm-tag { color: #5ccfe6; } +.cm-s-ayu-mirage span.cm-header { color: #bae67e; } +.cm-s-ayu-mirage span.cm-link { color: #5ccfe6; } +.cm-s-ayu-mirage span.cm-error { color: #ff3333; } + +.cm-s-ayu-mirage .CodeMirror-activeline-background { background: #191e2a; } +.cm-s-ayu-mirage .CodeMirror-matchingbracket { + text-decoration: underline; + color: white !important; +} diff --git a/src/external/code-mirror/theme/darcula.css b/src/external/code-mirror/theme/darcula.css new file mode 100644 index 000000000..2ec81a355 --- /dev/null +++ b/src/external/code-mirror/theme/darcula.css @@ -0,0 +1,53 @@ +/** + Name: IntelliJ IDEA darcula theme + From IntelliJ IDEA by JetBrains + */ + +.cm-s-darcula { font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;} +.cm-s-darcula.CodeMirror { background: #2B2B2B; color: #A9B7C6; } + +.cm-s-darcula span.cm-meta { color: #BBB529; } +.cm-s-darcula span.cm-number { color: #6897BB; } +.cm-s-darcula span.cm-keyword { color: #CC7832; line-height: 1em; font-weight: bold; } +.cm-s-darcula span.cm-def { color: #A9B7C6; font-style: italic; } +.cm-s-darcula span.cm-variable { color: #A9B7C6; } +.cm-s-darcula span.cm-variable-2 { color: #A9B7C6; } +.cm-s-darcula span.cm-variable-3 { color: #9876AA; } +.cm-s-darcula span.cm-type { color: #AABBCC; font-weight: bold; } +.cm-s-darcula span.cm-property { color: #FFC66D; } +.cm-s-darcula span.cm-operator { color: #A9B7C6; } +.cm-s-darcula span.cm-string { color: #6A8759; } +.cm-s-darcula span.cm-string-2 { color: #6A8759; } +.cm-s-darcula span.cm-comment { color: #61A151; font-style: italic; } +.cm-s-darcula span.cm-link { color: #CC7832; } +.cm-s-darcula span.cm-atom { color: #CC7832; } +.cm-s-darcula span.cm-error { color: #BC3F3C; } +.cm-s-darcula span.cm-tag { color: #629755; font-weight: bold; font-style: italic; text-decoration: underline; } +.cm-s-darcula span.cm-attribute { color: #6897bb; } +.cm-s-darcula span.cm-qualifier { color: #6A8759; } +.cm-s-darcula span.cm-bracket { color: #A9B7C6; } +.cm-s-darcula span.cm-builtin { color: #FF9E59; } +.cm-s-darcula span.cm-special { color: #FF9E59; } +.cm-s-darcula span.cm-matchhighlight { color: #FFFFFF; background-color: rgba(50, 89, 48, .7); font-weight: normal;} +.cm-s-darcula span.cm-searching { color: #FFFFFF; background-color: rgba(61, 115, 59, .7); font-weight: normal;} + +.cm-s-darcula .CodeMirror-cursor { border-left: 1px solid #A9B7C6; } +.cm-s-darcula .CodeMirror-activeline-background { background: #323232; } +.cm-s-darcula .CodeMirror-gutters { background: #313335; border-right: 1px solid #313335; } +.cm-s-darcula .CodeMirror-guttermarker { color: #FFEE80; } +.cm-s-darcula .CodeMirror-guttermarker-subtle { color: #D0D0D0; } +.cm-s-darcula .CodeMirrir-linenumber { color: #606366; } +.cm-s-darcula .CodeMirror-matchingbracket { background-color: #3B514D; color: #FFEF28 !important; font-weight: bold; } + +.cm-s-darcula div.CodeMirror-selected { background: #214283; } + +.CodeMirror-hints.darcula { + font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; + color: #9C9E9E; + background-color: #3B3E3F !important; +} + +.CodeMirror-hints.darcula .CodeMirror-hint-active { + background-color: #494D4E !important; + color: #9C9E9E !important; +} diff --git a/src/external/code-mirror/theme/gruvbox-dark.css b/src/external/code-mirror/theme/gruvbox-dark.css new file mode 100644 index 000000000..d712dda08 --- /dev/null +++ b/src/external/code-mirror/theme/gruvbox-dark.css @@ -0,0 +1,39 @@ +/* + + Name: gruvbox-dark + Author: kRkk (https://github.com/krkk) + + Original gruvbox color scheme by Pavel Pertsev (https://github.com/morhetz/gruvbox) + +*/ + +.cm-s-gruvbox-dark.CodeMirror, .cm-s-gruvbox-dark .CodeMirror-gutters { background-color: #282828; color: #bdae93; } +.cm-s-gruvbox-dark .CodeMirror-gutters {background: #282828; border-right: 0px;} +.cm-s-gruvbox-dark .CodeMirror-linenumber {color: #7c6f64;} +.cm-s-gruvbox-dark .CodeMirror-cursor { border-left: 1px solid #ebdbb2; } +.cm-s-gruvbox-dark.cm-fat-cursor .CodeMirror-cursor { background-color: #8e8d8875 !important; } +.cm-s-gruvbox-dark .cm-animate-fat-cursor { background-color: #8e8d8875 !important; } +.cm-s-gruvbox-dark div.CodeMirror-selected { background: #928374; } +.cm-s-gruvbox-dark span.cm-meta { color: #83a598; } + +.cm-s-gruvbox-dark span.cm-comment { color: #928374; } +.cm-s-gruvbox-dark span.cm-number, span.cm-atom { color: #d3869b; } +.cm-s-gruvbox-dark span.cm-keyword { color: #f84934; } + +.cm-s-gruvbox-dark span.cm-variable { color: #ebdbb2; } +.cm-s-gruvbox-dark span.cm-variable-2 { color: #ebdbb2; } +.cm-s-gruvbox-dark span.cm-variable-3, .cm-s-gruvbox-dark span.cm-type { color: #fabd2f; } +.cm-s-gruvbox-dark span.cm-operator { color: #ebdbb2; } +.cm-s-gruvbox-dark span.cm-callee { color: #ebdbb2; } +.cm-s-gruvbox-dark span.cm-def { color: #ebdbb2; } +.cm-s-gruvbox-dark span.cm-property { color: #ebdbb2; } +.cm-s-gruvbox-dark span.cm-string { color: #b8bb26; } +.cm-s-gruvbox-dark span.cm-string-2 { color: #8ec07c; } +.cm-s-gruvbox-dark span.cm-qualifier { color: #8ec07c; } +.cm-s-gruvbox-dark span.cm-attribute { color: #8ec07c; } + +.cm-s-gruvbox-dark .CodeMirror-activeline-background { background: #3c3836; } +.cm-s-gruvbox-dark .CodeMirror-matchingbracket { background: #928374; color:#282828 !important; } + +.cm-s-gruvbox-dark span.cm-builtin { color: #fe8019; } +.cm-s-gruvbox-dark span.cm-tag { color: #fe8019; } diff --git a/src/external/code-mirror/theme/idea.css b/src/external/code-mirror/theme/idea.css new file mode 100644 index 000000000..eab36717a --- /dev/null +++ b/src/external/code-mirror/theme/idea.css @@ -0,0 +1,42 @@ +/** + Name: IDEA default theme + From IntelliJ IDEA by JetBrains + */ + +.cm-s-idea span.cm-meta { color: #808000; } +.cm-s-idea span.cm-number { color: #0000FF; } +.cm-s-idea span.cm-keyword { line-height: 1em; font-weight: bold; color: #000080; } +.cm-s-idea span.cm-atom { font-weight: bold; color: #000080; } +.cm-s-idea span.cm-def { color: #000000; } +.cm-s-idea span.cm-variable { color: black; } +.cm-s-idea span.cm-variable-2 { color: black; } +.cm-s-idea span.cm-variable-3, .cm-s-idea span.cm-type { color: black; } +.cm-s-idea span.cm-property { color: black; } +.cm-s-idea span.cm-operator { color: black; } +.cm-s-idea span.cm-comment { color: #808080; } +.cm-s-idea span.cm-string { color: #008000; } +.cm-s-idea span.cm-string-2 { color: #008000; } +.cm-s-idea span.cm-qualifier { color: #555; } +.cm-s-idea span.cm-error { color: #FF0000; } +.cm-s-idea span.cm-attribute { color: #0000FF; } +.cm-s-idea span.cm-tag { color: #000080; } +.cm-s-idea span.cm-link { color: #0000FF; } +.cm-s-idea .CodeMirror-activeline-background { background: #FFFAE3; } + +.cm-s-idea span.cm-builtin { color: #30a; } +.cm-s-idea span.cm-bracket { color: #cc7; } +.cm-s-idea { font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;} + + +.cm-s-idea .CodeMirror-matchingbracket { outline:1px solid grey; color:black !important; } + +.CodeMirror-hints.idea { + font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; + color: #616569; + background-color: #ebf3fd !important; +} + +.CodeMirror-hints.idea .CodeMirror-hint-active { + background-color: #a2b8c9 !important; + color: #5c6065 !important; +} \ No newline at end of file diff --git a/src/external/code-mirror/theme/juejin.css b/src/external/code-mirror/theme/juejin.css new file mode 100644 index 000000000..38cf7fe37 --- /dev/null +++ b/src/external/code-mirror/theme/juejin.css @@ -0,0 +1,30 @@ +.cm-s-juejin.CodeMirror { + background: #f8f9fa; +} +.cm-s-juejin .cm-header, +.cm-s-juejin .cm-def { + color: #1ba2f0; +} +.cm-s-juejin .cm-comment { + color: #009e9d; +} +.cm-s-juejin .cm-quote, +.cm-s-juejin .cm-link, +.cm-s-juejin .cm-strong, +.cm-s-juejin .cm-attribute { + color: #fd7741; +} +.cm-s-juejin .cm-url, +.cm-s-juejin .cm-keyword, +.cm-s-juejin .cm-builtin { + color: #bb51b8; +} +.cm-s-juejin .cm-hr { + color: #909090; +} +.cm-s-juejin .cm-tag { + color: #107000; +} +.cm-s-juejin .cm-variable-2 { + color: #0050a0; +} diff --git a/src/external/code-mirror/theme/lucario.css b/src/external/code-mirror/theme/lucario.css new file mode 100644 index 000000000..17a155103 --- /dev/null +++ b/src/external/code-mirror/theme/lucario.css @@ -0,0 +1,37 @@ +/* + Name: lucario + Author: Raphael Amorim + + Original Lucario color scheme (https://github.com/raphamorim/lucario) +*/ + +.cm-s-lucario.CodeMirror, .cm-s-lucario .CodeMirror-gutters { + background-color: #2b3e50 !important; + color: #f8f8f2 !important; + border: none; +} +.cm-s-lucario .CodeMirror-gutters { color: #2b3e50; } +.cm-s-lucario .CodeMirror-cursor { border-left: solid thin #E6C845; } +.cm-s-lucario .CodeMirror-linenumber { color: #f8f8f2; } +.cm-s-lucario .CodeMirror-selected { background: #243443; } +.cm-s-lucario .CodeMirror-line::selection, .cm-s-lucario .CodeMirror-line > span::selection, .cm-s-lucario .CodeMirror-line > span > span::selection { background: #243443; } +.cm-s-lucario .CodeMirror-line::-moz-selection, .cm-s-lucario .CodeMirror-line > span::-moz-selection, .cm-s-lucario .CodeMirror-line > span > span::-moz-selection { background: #243443; } +.cm-s-lucario span.cm-comment { color: #5c98cd; } +.cm-s-lucario span.cm-string, .cm-s-lucario span.cm-string-2 { color: #E6DB74; } +.cm-s-lucario span.cm-number { color: #ca94ff; } +.cm-s-lucario span.cm-variable { color: #f8f8f2; } +.cm-s-lucario span.cm-variable-2 { color: #f8f8f2; } +.cm-s-lucario span.cm-def { color: #72C05D; } +.cm-s-lucario span.cm-operator { color: #66D9EF; } +.cm-s-lucario span.cm-keyword { color: #ff6541; } +.cm-s-lucario span.cm-atom { color: #bd93f9; } +.cm-s-lucario span.cm-meta { color: #f8f8f2; } +.cm-s-lucario span.cm-tag { color: #ff6541; } +.cm-s-lucario span.cm-attribute { color: #66D9EF; } +.cm-s-lucario span.cm-qualifier { color: #72C05D; } +.cm-s-lucario span.cm-property { color: #f8f8f2; } +.cm-s-lucario span.cm-builtin { color: #72C05D; } +.cm-s-lucario span.cm-variable-3, .cm-s-lucario span.cm-type { color: #ffb86c; } + +.cm-s-lucario .CodeMirror-activeline-background { background: #243443; } +.cm-s-lucario .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } diff --git a/src/external/code-mirror/theme/material-darker.css b/src/external/code-mirror/theme/material-darker.css new file mode 100644 index 000000000..45b64efb2 --- /dev/null +++ b/src/external/code-mirror/theme/material-darker.css @@ -0,0 +1,135 @@ +/* + Name: material + Author: Mattia Astorino (http://github.com/equinusocio) + Website: https://material-theme.site/ +*/ + +.cm-s-material-darker.CodeMirror { + background-color: #212121; + color: #EEFFFF; +} + +.cm-s-material-darker .CodeMirror-gutters { + background: #212121; + color: #545454; + border: none; +} + +.cm-s-material-darker .CodeMirror-guttermarker, +.cm-s-material-darker .CodeMirror-guttermarker-subtle, +.cm-s-material-darker .CodeMirror-linenumber { + color: #545454; +} + +.cm-s-material-darker .CodeMirror-cursor { + border-left: 1px solid #FFCC00; +} + +.cm-s-material-darker div.CodeMirror-selected { + background: rgba(97, 97, 97, 0.2); +} + +.cm-s-material-darker.CodeMirror-focused div.CodeMirror-selected { + background: rgba(97, 97, 97, 0.2); +} + +.cm-s-material-darker .CodeMirror-line::selection, +.cm-s-material-darker .CodeMirror-line>span::selection, +.cm-s-material-darker .CodeMirror-line>span>span::selection { + background: rgba(128, 203, 196, 0.2); +} + +.cm-s-material-darker .CodeMirror-line::-moz-selection, +.cm-s-material-darker .CodeMirror-line>span::-moz-selection, +.cm-s-material-darker .CodeMirror-line>span>span::-moz-selection { + background: rgba(128, 203, 196, 0.2); +} + +.cm-s-material-darker .CodeMirror-activeline-background { + background: rgba(0, 0, 0, 0.5); +} + +.cm-s-material-darker .cm-keyword { + color: #C792EA; +} + +.cm-s-material-darker .cm-operator { + color: #89DDFF; +} + +.cm-s-material-darker .cm-variable-2 { + color: #EEFFFF; +} + +.cm-s-material-darker .cm-variable-3, +.cm-s-material-darker .cm-type { + color: #f07178; +} + +.cm-s-material-darker .cm-builtin { + color: #FFCB6B; +} + +.cm-s-material-darker .cm-atom { + color: #F78C6C; +} + +.cm-s-material-darker .cm-number { + color: #FF5370; +} + +.cm-s-material-darker .cm-def { + color: #82AAFF; +} + +.cm-s-material-darker .cm-string { + color: #C3E88D; +} + +.cm-s-material-darker .cm-string-2 { + color: #f07178; +} + +.cm-s-material-darker .cm-comment { + color: #545454; +} + +.cm-s-material-darker .cm-variable { + color: #f07178; +} + +.cm-s-material-darker .cm-tag { + color: #FF5370; +} + +.cm-s-material-darker .cm-meta { + color: #FFCB6B; +} + +.cm-s-material-darker .cm-attribute { + color: #C792EA; +} + +.cm-s-material-darker .cm-property { + color: #C792EA; +} + +.cm-s-material-darker .cm-qualifier { + color: #DECB6B; +} + +.cm-s-material-darker .cm-variable-3, +.cm-s-material-darker .cm-type { + color: #DECB6B; +} + + +.cm-s-material-darker .cm-error { + color: rgba(255, 255, 255, 1.0); + background-color: #FF5370; +} + +.cm-s-material-darker .CodeMirror-matchingbracket { + text-decoration: underline; + color: white !important; +} \ No newline at end of file diff --git a/src/external/code-mirror/theme/material-ocean.css b/src/external/code-mirror/theme/material-ocean.css new file mode 100644 index 000000000..404178de2 --- /dev/null +++ b/src/external/code-mirror/theme/material-ocean.css @@ -0,0 +1,141 @@ +/* + Name: material + Author: Mattia Astorino (http://github.com/equinusocio) + Website: https://material-theme.site/ +*/ + +.cm-s-material-ocean.CodeMirror { + background-color: #0F111A; + color: #8F93A2; +} + +.cm-s-material-ocean .CodeMirror-gutters { + background: #0F111A; + color: #464B5D; + border: none; +} + +.cm-s-material-ocean .CodeMirror-guttermarker, +.cm-s-material-ocean .CodeMirror-guttermarker-subtle, +.cm-s-material-ocean .CodeMirror-linenumber { + color: #464B5D; +} + +.cm-s-material-ocean .CodeMirror-cursor { + border-left: 1px solid #FFCC00; +} +.cm-s-material-ocean.cm-fat-cursor .CodeMirror-cursor { + background-color: #a2a8a175 !important; +} +.cm-s-material-ocean .cm-animate-fat-cursor { + background-color: #a2a8a175 !important; +} + +.cm-s-material-ocean div.CodeMirror-selected { + background: rgba(113, 124, 180, 0.2); +} + +.cm-s-material-ocean.CodeMirror-focused div.CodeMirror-selected { + background: rgba(113, 124, 180, 0.2); +} + +.cm-s-material-ocean .CodeMirror-line::selection, +.cm-s-material-ocean .CodeMirror-line>span::selection, +.cm-s-material-ocean .CodeMirror-line>span>span::selection { + background: rgba(128, 203, 196, 0.2); +} + +.cm-s-material-ocean .CodeMirror-line::-moz-selection, +.cm-s-material-ocean .CodeMirror-line>span::-moz-selection, +.cm-s-material-ocean .CodeMirror-line>span>span::-moz-selection { + background: rgba(128, 203, 196, 0.2); +} + +.cm-s-material-ocean .CodeMirror-activeline-background { + background: rgba(0, 0, 0, 0.5); +} + +.cm-s-material-ocean .cm-keyword { + color: #C792EA; +} + +.cm-s-material-ocean .cm-operator { + color: #89DDFF; +} + +.cm-s-material-ocean .cm-variable-2 { + color: #EEFFFF; +} + +.cm-s-material-ocean .cm-variable-3, +.cm-s-material-ocean .cm-type { + color: #f07178; +} + +.cm-s-material-ocean .cm-builtin { + color: #FFCB6B; +} + +.cm-s-material-ocean .cm-atom { + color: #F78C6C; +} + +.cm-s-material-ocean .cm-number { + color: #FF5370; +} + +.cm-s-material-ocean .cm-def { + color: #82AAFF; +} + +.cm-s-material-ocean .cm-string { + color: #C3E88D; +} + +.cm-s-material-ocean .cm-string-2 { + color: #f07178; +} + +.cm-s-material-ocean .cm-comment { + color: #464B5D; +} + +.cm-s-material-ocean .cm-variable { + color: #f07178; +} + +.cm-s-material-ocean .cm-tag { + color: #FF5370; +} + +.cm-s-material-ocean .cm-meta { + color: #FFCB6B; +} + +.cm-s-material-ocean .cm-attribute { + color: #C792EA; +} + +.cm-s-material-ocean .cm-property { + color: #C792EA; +} + +.cm-s-material-ocean .cm-qualifier { + color: #DECB6B; +} + +.cm-s-material-ocean .cm-variable-3, +.cm-s-material-ocean .cm-type { + color: #DECB6B; +} + + +.cm-s-material-ocean .cm-error { + color: rgba(255, 255, 255, 1.0); + background-color: #FF5370; +} + +.cm-s-material-ocean .CodeMirror-matchingbracket { + text-decoration: underline; + color: white !important; +} diff --git a/src/external/code-mirror/theme/material-palenight.css b/src/external/code-mirror/theme/material-palenight.css new file mode 100644 index 000000000..6712c43a0 --- /dev/null +++ b/src/external/code-mirror/theme/material-palenight.css @@ -0,0 +1,141 @@ +/* + Name: material + Author: Mattia Astorino (http://github.com/equinusocio) + Website: https://material-theme.site/ +*/ + +.cm-s-material-palenight.CodeMirror { + background-color: #292D3E; + color: #A6ACCD; +} + +.cm-s-material-palenight .CodeMirror-gutters { + background: #292D3E; + color: #676E95; + border: none; +} + +.cm-s-material-palenight .CodeMirror-guttermarker, +.cm-s-material-palenight .CodeMirror-guttermarker-subtle, +.cm-s-material-palenight .CodeMirror-linenumber { + color: #676E95; +} + +.cm-s-material-palenight .CodeMirror-cursor { + border-left: 1px solid #FFCC00; +} +.cm-s-material-palenight.cm-fat-cursor .CodeMirror-cursor { + background-color: #607c8b80 !important; +} +.cm-s-material-palenight .cm-animate-fat-cursor { + background-color: #607c8b80 !important; +} + +.cm-s-material-palenight div.CodeMirror-selected { + background: rgba(113, 124, 180, 0.2); +} + +.cm-s-material-palenight.CodeMirror-focused div.CodeMirror-selected { + background: rgba(113, 124, 180, 0.2); +} + +.cm-s-material-palenight .CodeMirror-line::selection, +.cm-s-material-palenight .CodeMirror-line>span::selection, +.cm-s-material-palenight .CodeMirror-line>span>span::selection { + background: rgba(128, 203, 196, 0.2); +} + +.cm-s-material-palenight .CodeMirror-line::-moz-selection, +.cm-s-material-palenight .CodeMirror-line>span::-moz-selection, +.cm-s-material-palenight .CodeMirror-line>span>span::-moz-selection { + background: rgba(128, 203, 196, 0.2); +} + +.cm-s-material-palenight .CodeMirror-activeline-background { + background: rgba(0, 0, 0, 0.5); +} + +.cm-s-material-palenight .cm-keyword { + color: #C792EA; +} + +.cm-s-material-palenight .cm-operator { + color: #89DDFF; +} + +.cm-s-material-palenight .cm-variable-2 { + color: #EEFFFF; +} + +.cm-s-material-palenight .cm-variable-3, +.cm-s-material-palenight .cm-type { + color: #f07178; +} + +.cm-s-material-palenight .cm-builtin { + color: #FFCB6B; +} + +.cm-s-material-palenight .cm-atom { + color: #F78C6C; +} + +.cm-s-material-palenight .cm-number { + color: #FF5370; +} + +.cm-s-material-palenight .cm-def { + color: #82AAFF; +} + +.cm-s-material-palenight .cm-string { + color: #C3E88D; +} + +.cm-s-material-palenight .cm-string-2 { + color: #f07178; +} + +.cm-s-material-palenight .cm-comment { + color: #676E95; +} + +.cm-s-material-palenight .cm-variable { + color: #f07178; +} + +.cm-s-material-palenight .cm-tag { + color: #FF5370; +} + +.cm-s-material-palenight .cm-meta { + color: #FFCB6B; +} + +.cm-s-material-palenight .cm-attribute { + color: #C792EA; +} + +.cm-s-material-palenight .cm-property { + color: #C792EA; +} + +.cm-s-material-palenight .cm-qualifier { + color: #DECB6B; +} + +.cm-s-material-palenight .cm-variable-3, +.cm-s-material-palenight .cm-type { + color: #DECB6B; +} + + +.cm-s-material-palenight .cm-error { + color: rgba(255, 255, 255, 1.0); + background-color: #FF5370; +} + +.cm-s-material-palenight .CodeMirror-matchingbracket { + text-decoration: underline; + color: white !important; +} diff --git a/src/external/code-mirror/theme/moxer.css b/src/external/code-mirror/theme/moxer.css new file mode 100644 index 000000000..b3ca35e38 --- /dev/null +++ b/src/external/code-mirror/theme/moxer.css @@ -0,0 +1,143 @@ +/* + Name: Moxer Theme + Author: Mattia Astorino (http://github.com/equinusocio) + Website: https://github.com/moxer-theme/moxer-code +*/ + +.cm-s-moxer.CodeMirror { + background-color: #090A0F; + color: #8E95B4; + line-height: 1.8; +} + +.cm-s-moxer .CodeMirror-gutters { + background: #090A0F; + color: #35394B; + border: none; +} + +.cm-s-moxer .CodeMirror-guttermarker, +.cm-s-moxer .CodeMirror-guttermarker-subtle, +.cm-s-moxer .CodeMirror-linenumber { + color: #35394B; +} + + +.cm-s-moxer .CodeMirror-cursor { + border-left: 1px solid #FFCC00; +} + +.cm-s-moxer div.CodeMirror-selected { + background: rgba(128, 203, 196, 0.2); +} + +.cm-s-moxer.CodeMirror-focused div.CodeMirror-selected { + background: #212431; +} + +.cm-s-moxer .CodeMirror-line::selection, +.cm-s-moxer .CodeMirror-line>span::selection, +.cm-s-moxer .CodeMirror-line>span>span::selection { + background: #212431; +} + +.cm-s-moxer .CodeMirror-line::-moz-selection, +.cm-s-moxer .CodeMirror-line>span::-moz-selection, +.cm-s-moxer .CodeMirror-line>span>span::-moz-selection { + background: #212431; +} + +.cm-s-moxer .CodeMirror-activeline-background, +.cm-s-moxer .CodeMirror-activeline-gutter .CodeMirror-linenumber { + background: rgba(33, 36, 49, 0.5); +} + +.cm-s-moxer .cm-keyword { + color: #D46C6C; +} + +.cm-s-moxer .cm-operator { + color: #D46C6C; +} + +.cm-s-moxer .cm-variable-2 { + color: #81C5DA; +} + + +.cm-s-moxer .cm-variable-3, +.cm-s-moxer .cm-type { + color: #f07178; +} + +.cm-s-moxer .cm-builtin { + color: #FFCB6B; +} + +.cm-s-moxer .cm-atom { + color: #A99BE2; +} + +.cm-s-moxer .cm-number { + color: #7CA4C0; +} + +.cm-s-moxer .cm-def { + color: #F5DFA5; +} + +.cm-s-moxer .CodeMirror-line .cm-def ~ .cm-def { + color: #81C5DA; +} + +.cm-s-moxer .cm-string { + color: #B2E4AE; +} + +.cm-s-moxer .cm-string-2 { + color: #f07178; +} + +.cm-s-moxer .cm-comment { + color: #3F445A; +} + +.cm-s-moxer .cm-variable { + color: #8E95B4; +} + +.cm-s-moxer .cm-tag { + color: #FF5370; +} + +.cm-s-moxer .cm-meta { + color: #FFCB6B; +} + +.cm-s-moxer .cm-attribute { + color: #C792EA; +} + +.cm-s-moxer .cm-property { + color: #81C5DA; +} + +.cm-s-moxer .cm-qualifier { + color: #DECB6B; +} + +.cm-s-moxer .cm-variable-3, +.cm-s-moxer .cm-type { + color: #DECB6B; +} + + +.cm-s-moxer .cm-error { + color: rgba(255, 255, 255, 1.0); + background-color: #FF5370; +} + +.cm-s-moxer .CodeMirror-matchingbracket { + text-decoration: underline; + color: white !important; +} \ No newline at end of file diff --git a/src/external/code-mirror/theme/nord.css b/src/external/code-mirror/theme/nord.css new file mode 100644 index 000000000..41a8ad778 --- /dev/null +++ b/src/external/code-mirror/theme/nord.css @@ -0,0 +1,42 @@ +/* Based on arcticicestudio's Nord theme */ +/* https://github.com/arcticicestudio/nord */ + +.cm-s-nord.CodeMirror { background: #2e3440; color: #d8dee9; } +.cm-s-nord div.CodeMirror-selected { background: #434c5e; } +.cm-s-nord .CodeMirror-line::selection, .cm-s-nord .CodeMirror-line > span::selection, .cm-s-nord .CodeMirror-line > span > span::selection { background: #3b4252; } +.cm-s-nord .CodeMirror-line::-moz-selection, .cm-s-nord .CodeMirror-line > span::-moz-selection, .cm-s-nord .CodeMirror-line > span > span::-moz-selection { background: #3b4252; } +.cm-s-nord .CodeMirror-gutters { background: #2e3440; border-right: 0px; } +.cm-s-nord .CodeMirror-guttermarker { color: #4c566a; } +.cm-s-nord .CodeMirror-guttermarker-subtle { color: #4c566a; } +.cm-s-nord .CodeMirror-linenumber { color: #4c566a; } +.cm-s-nord .CodeMirror-cursor { border-left: 1px solid #f8f8f0; } + +.cm-s-nord span.cm-comment { color: #4c566a; } +.cm-s-nord span.cm-atom { color: #b48ead; } +.cm-s-nord span.cm-number { color: #b48ead; } + +.cm-s-nord span.cm-comment.cm-attribute { color: #97b757; } +.cm-s-nord span.cm-comment.cm-def { color: #bc9262; } +.cm-s-nord span.cm-comment.cm-tag { color: #bc6283; } +.cm-s-nord span.cm-comment.cm-type { color: #5998a6; } + +.cm-s-nord span.cm-property, .cm-s-nord span.cm-attribute { color: #8FBCBB; } +.cm-s-nord span.cm-keyword { color: #81A1C1; } +.cm-s-nord span.cm-builtin { color: #81A1C1; } +.cm-s-nord span.cm-string { color: #A3BE8C; } + +.cm-s-nord span.cm-variable { color: #d8dee9; } +.cm-s-nord span.cm-variable-2 { color: #d8dee9; } +.cm-s-nord span.cm-variable-3, .cm-s-nord span.cm-type { color: #d8dee9; } +.cm-s-nord span.cm-def { color: #8FBCBB; } +.cm-s-nord span.cm-bracket { color: #81A1C1; } +.cm-s-nord span.cm-tag { color: #bf616a; } +.cm-s-nord span.cm-header { color: #b48ead; } +.cm-s-nord span.cm-link { color: #b48ead; } +.cm-s-nord span.cm-error { background: #bf616a; color: #f8f8f0; } + +.cm-s-nord .CodeMirror-activeline-background { background: #3b4252; } +.cm-s-nord .CodeMirror-matchingbracket { + text-decoration: underline; + color: white !important; +} diff --git a/src/external/code-mirror/theme/oceanic-next.css b/src/external/code-mirror/theme/oceanic-next.css new file mode 100644 index 000000000..f3d0d08ac --- /dev/null +++ b/src/external/code-mirror/theme/oceanic-next.css @@ -0,0 +1,46 @@ +/* + + Name: oceanic-next + Author: Filype Pereira (https://github.com/fpereira1) + + Original oceanic-next color scheme by Dmitri Voronianski (https://github.com/voronianski/oceanic-next-color-scheme) + +*/ + +.cm-s-oceanic-next.CodeMirror { background: #304148; color: #f8f8f2; } +.cm-s-oceanic-next div.CodeMirror-selected { background: rgba(101, 115, 126, 0.33); } +.cm-s-oceanic-next .CodeMirror-line::selection, .cm-s-oceanic-next .CodeMirror-line > span::selection, .cm-s-oceanic-next .CodeMirror-line > span > span::selection { background: rgba(101, 115, 126, 0.33); } +.cm-s-oceanic-next .CodeMirror-line::-moz-selection, .cm-s-oceanic-next .CodeMirror-line > span::-moz-selection, .cm-s-oceanic-next .CodeMirror-line > span > span::-moz-selection { background: rgba(101, 115, 126, 0.33); } +.cm-s-oceanic-next .CodeMirror-gutters { background: #304148; border-right: 10px; } +.cm-s-oceanic-next .CodeMirror-guttermarker { color: white; } +.cm-s-oceanic-next .CodeMirror-guttermarker-subtle { color: #d0d0d0; } +.cm-s-oceanic-next .CodeMirror-linenumber { color: #d0d0d0; } +.cm-s-oceanic-next .CodeMirror-cursor { border-left: 1px solid #f8f8f0; } +.cm-s-oceanic-next.cm-fat-cursor .CodeMirror-cursor { background-color: #a2a8a175 !important; } +.cm-s-oceanic-next .cm-animate-fat-cursor { background-color: #a2a8a175 !important; } + +.cm-s-oceanic-next span.cm-comment { color: #65737E; } +.cm-s-oceanic-next span.cm-atom { color: #C594C5; } +.cm-s-oceanic-next span.cm-number { color: #F99157; } + +.cm-s-oceanic-next span.cm-property { color: #99C794; } +.cm-s-oceanic-next span.cm-attribute, +.cm-s-oceanic-next span.cm-keyword { color: #C594C5; } +.cm-s-oceanic-next span.cm-builtin { color: #66d9ef; } +.cm-s-oceanic-next span.cm-string { color: #99C794; } + +.cm-s-oceanic-next span.cm-variable, +.cm-s-oceanic-next span.cm-variable-2, +.cm-s-oceanic-next span.cm-variable-3 { color: #f8f8f2; } +.cm-s-oceanic-next span.cm-def { color: #6699CC; } +.cm-s-oceanic-next span.cm-bracket { color: #5FB3B3; } +.cm-s-oceanic-next span.cm-tag { color: #C594C5; } +.cm-s-oceanic-next span.cm-header { color: #C594C5; } +.cm-s-oceanic-next span.cm-link { color: #C594C5; } +.cm-s-oceanic-next span.cm-error { background: #C594C5; color: #f8f8f0; } + +.cm-s-oceanic-next .CodeMirror-activeline-background { background: rgba(101, 115, 126, 0.33); } +.cm-s-oceanic-next .CodeMirror-matchingbracket { + text-decoration: underline; + color: white !important; +} diff --git a/src/external/code-mirror/theme/shadowfox.css b/src/external/code-mirror/theme/shadowfox.css new file mode 100644 index 000000000..32d59b139 --- /dev/null +++ b/src/external/code-mirror/theme/shadowfox.css @@ -0,0 +1,52 @@ +/* + + Name: shadowfox + Author: overdodactyl (http://github.com/overdodactyl) + + Original shadowfox color scheme by Firefox + +*/ + +.cm-s-shadowfox.CodeMirror { background: #2a2a2e; color: #b1b1b3; } +.cm-s-shadowfox div.CodeMirror-selected { background: #353B48; } +.cm-s-shadowfox .CodeMirror-line::selection, .cm-s-shadowfox .CodeMirror-line > span::selection, .cm-s-shadowfox .CodeMirror-line > span > span::selection { background: #353B48; } +.cm-s-shadowfox .CodeMirror-line::-moz-selection, .cm-s-shadowfox .CodeMirror-line > span::-moz-selection, .cm-s-shadowfox .CodeMirror-line > span > span::-moz-selection { background: #353B48; } +.cm-s-shadowfox .CodeMirror-gutters { background: #0c0c0d ; border-right: 1px solid #0c0c0d; } +.cm-s-shadowfox .CodeMirror-guttermarker { color: #555; } +.cm-s-shadowfox .CodeMirror-linenumber { color: #939393; } +.cm-s-shadowfox .CodeMirror-cursor { border-left: 1px solid #fff; } + +.cm-s-shadowfox span.cm-comment { color: #939393; } +.cm-s-shadowfox span.cm-atom { color: #FF7DE9; } +.cm-s-shadowfox span.cm-quote { color: #FF7DE9; } +.cm-s-shadowfox span.cm-builtin { color: #FF7DE9; } +.cm-s-shadowfox span.cm-attribute { color: #FF7DE9; } +.cm-s-shadowfox span.cm-keyword { color: #FF7DE9; } +.cm-s-shadowfox span.cm-error { color: #FF7DE9; } + +.cm-s-shadowfox span.cm-number { color: #6B89FF; } +.cm-s-shadowfox span.cm-string { color: #6B89FF; } +.cm-s-shadowfox span.cm-string-2 { color: #6B89FF; } + +.cm-s-shadowfox span.cm-meta { color: #939393; } +.cm-s-shadowfox span.cm-hr { color: #939393; } + +.cm-s-shadowfox span.cm-header { color: #75BFFF; } +.cm-s-shadowfox span.cm-qualifier { color: #75BFFF; } +.cm-s-shadowfox span.cm-variable-2 { color: #75BFFF; } + +.cm-s-shadowfox span.cm-property { color: #86DE74; } + +.cm-s-shadowfox span.cm-def { color: #75BFFF; } +.cm-s-shadowfox span.cm-bracket { color: #75BFFF; } +.cm-s-shadowfox span.cm-tag { color: #75BFFF; } +.cm-s-shadowfox span.cm-link:visited { color: #75BFFF; } + +.cm-s-shadowfox span.cm-variable { color: #B98EFF; } +.cm-s-shadowfox span.cm-variable-3 { color: #d7d7db; } +.cm-s-shadowfox span.cm-link { color: #737373; } +.cm-s-shadowfox span.cm-operator { color: #b1b1b3; } +.cm-s-shadowfox span.cm-special { color: #d7d7db; } + +.cm-s-shadowfox .CodeMirror-activeline-background { background: rgba(185, 215, 253, .15) } +.cm-s-shadowfox .CodeMirror-matchingbracket { outline: solid 1px rgba(255, 255, 255, .25); color: white !important; } diff --git a/src/external/code-mirror/theme/ssms.css b/src/external/code-mirror/theme/ssms.css new file mode 100644 index 000000000..9494c14c2 --- /dev/null +++ b/src/external/code-mirror/theme/ssms.css @@ -0,0 +1,16 @@ +.cm-s-ssms span.cm-keyword { color: blue; } +.cm-s-ssms span.cm-comment { color: darkgreen; } +.cm-s-ssms span.cm-string { color: red; } +.cm-s-ssms span.cm-def { color: black; } +.cm-s-ssms span.cm-variable { color: black; } +.cm-s-ssms span.cm-variable-2 { color: black; } +.cm-s-ssms span.cm-atom { color: darkgray; } +.cm-s-ssms .CodeMirror-linenumber { color: teal; } +.cm-s-ssms .CodeMirror-activeline-background { background: #ffffff; } +.cm-s-ssms span.cm-string-2 { color: #FF00FF; } +.cm-s-ssms span.cm-operator, +.cm-s-ssms span.cm-bracket, +.cm-s-ssms span.cm-punctuation { color: darkgray; } +.cm-s-ssms .CodeMirror-gutters { border-right: 3px solid #ffee62; background-color: #ffffff; } +.cm-s-ssms div.CodeMirror-selected { background: #ADD6FF; } + diff --git a/src/external/code-mirror/theme/yonce.css b/src/external/code-mirror/theme/yonce.css new file mode 100644 index 000000000..975f0788a --- /dev/null +++ b/src/external/code-mirror/theme/yonce.css @@ -0,0 +1,59 @@ +/* + + Name: yoncé + Author: Thomas MacLean (http://github.com/thomasmaclean) + + Original yoncé color scheme by Mina Markham (https://github.com/minamarkham) + +*/ + +.cm-s-yonce.CodeMirror { background: #1C1C1C; color: #d4d4d4; } /**/ +.cm-s-yonce div.CodeMirror-selected { background: rgba(252, 69, 133, 0.478); } /**/ +.cm-s-yonce .CodeMirror-selectedtext, +.cm-s-yonce .CodeMirror-selected, +.cm-s-yonce .CodeMirror-line::selection, +.cm-s-yonce .CodeMirror-line > span::selection, +.cm-s-yonce .CodeMirror-line > span > span::selection, +.cm-s-yonce .CodeMirror-line::-moz-selection, +.cm-s-yonce .CodeMirror-line > span::-moz-selection, +.cm-s-yonce .CodeMirror-line > span > span::-moz-selection { background: rgba(252, 67, 132, 0.47); } + +.cm-s-yonce.CodeMirror pre { padding-left: 0px; } +.cm-s-yonce .CodeMirror-gutters {background: #1C1C1C; border-right: 0px;} +.cm-s-yonce .CodeMirror-linenumber {color: #777777; padding-right: 10px; } +.cm-s-yonce .CodeMirror-activeline .CodeMirror-linenumber.CodeMirror-gutter-elt { background: #1C1C1C; color: #fc4384; } +.cm-s-yonce .CodeMirror-linenumber { color: #777; } +.cm-s-yonce .CodeMirror-cursor { border-left: 2px solid #FC4384; } +.cm-s-yonce .cm-searching { background: rgba(243, 155, 53, .3) !important; outline: 1px solid #F39B35; } +.cm-s-yonce .cm-searching.CodeMirror-selectedtext { background: rgba(243, 155, 53, .7) !important; color: white; } + +.cm-s-yonce .cm-keyword { color: #00A7AA; } /**/ +.cm-s-yonce .cm-atom { color: #F39B35; } +.cm-s-yonce .cm-number, .cm-s-yonce span.cm-type { color: #A06FCA; } /**/ +.cm-s-yonce .cm-def { color: #98E342; } +.cm-s-yonce .cm-property, +.cm-s-yonce span.cm-variable { color: #D4D4D4; font-style: italic; } +.cm-s-yonce span.cm-variable-2 { color: #da7dae; font-style: italic; } +.cm-s-yonce span.cm-variable-3 { color: #A06FCA; } +.cm-s-yonce .cm-type.cm-def { color: #FC4384; font-style: normal; text-decoration: underline; } +.cm-s-yonce .cm-property.cm-def { color: #FC4384; font-style: normal; } +.cm-s-yonce .cm-callee { color: #FC4384; font-style: normal; } +.cm-s-yonce .cm-operator { color: #FC4384; } /**/ +.cm-s-yonce .cm-qualifier, +.cm-s-yonce .cm-tag { color: #FC4384; } +.cm-s-yonce .cm-tag.cm-bracket { color: #D4D4D4; } +.cm-s-yonce .cm-attribute { color: #A06FCA; } +.cm-s-yonce .cm-comment { color:#696d70; font-style:italic; font-weight:normal; } /**/ +.cm-s-yonce .cm-comment.cm-tag { color: #FC4384 } +.cm-s-yonce .cm-comment.cm-attribute { color: #D4D4D4; } +.cm-s-yonce .cm-string { color:#E6DB74; } /**/ +.cm-s-yonce .cm-string-2 { color:#F39B35; } /*?*/ +.cm-s-yonce .cm-meta { color: #D4D4D4; background: inherit; } +.cm-s-yonce .cm-builtin { color: #FC4384; } /*?*/ +.cm-s-yonce .cm-header { color: #da7dae; } +.cm-s-yonce .cm-hr { color: #98E342; } +.cm-s-yonce .cm-link { color:#696d70; font-style:italic; text-decoration:none; } /**/ +.cm-s-yonce .cm-error { border-bottom: 1px solid #C42412; } + +.cm-s-yonce .CodeMirror-activeline-background { background: #272727; } +.cm-s-yonce .CodeMirror-matchingbracket { outline:1px solid grey; color:#D4D4D4 !important; } diff --git a/src/external/code-mirror5-old.diff b/src/external/code-mirror5-old.diff new file mode 100644 index 000000000..a27a6291d --- /dev/null +++ b/src/external/code-mirror5-old.diff @@ -0,0 +1,161 @@ +diff --git a/src/external/code-mirror/addon/dialog/dialog.js b/src/external/code-mirror/addon/dialog/dialog.js +index f10bb5bf1..8dbc9f06b 100644 +--- a/src/external/code-mirror/addon/dialog/dialog.js ++++ b/src/external/code-mirror/addon/dialog/dialog.js +@@ -11,6 +11,7 @@ + else // Plain browser env + mod(CodeMirror); + })(function(CodeMirror) { ++ + function dialogDiv(cm, template, bottom) { + var wrap = cm.getWrapperElement(); + var dialog; +@@ -75,11 +76,12 @@ + if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) { + inp.blur(); + CodeMirror.e_stop(e); +- close(); ++ close(); + } + if (e.keyCode == 13) callback(inp.value, e); + }); +- ++ ++ // # HACK + if (options.closeOnBlur !== false) CodeMirror.on(inp, "blur", close); + } else if (button = dialog.getElementsByTagName("button")[0]) { + CodeMirror.on(button, "click", function() { +diff --git a/src/external/code-mirror/addon/search/search.js b/src/external/code-mirror/addon/search/search.js +index 753b1afe1..8b2299d7b 100644 +--- a/src/external/code-mirror/addon/search/search.js ++++ b/src/external/code-mirror/addon/search/search.js +@@ -226,8 +226,14 @@ + cm.setSelection(cursor.from(), cursor.to()); + cm.scrollIntoView({from: cursor.from(), to: cursor.to()}); + confirmDialog(cm, doReplaceConfirm, "Replace?", +- [function() {doReplace(match);}, advance, +- function() {replaceAll(cm, query, text)}]); ++ [function() {doReplace(match);}, ++ advance, ++ function() {replaceAll(cm, query, text)}, ++ function() { ++ console.log("stop replace..."); ++ // replacementQueryDialog.remove() ++ } // STOP ++ ],); + }; + var doReplace = function(match) { + cursor.replace(typeof query == "string" ? text : +diff --git a/src/external/code-mirror/addon/tern/tern.js b/src/external/code-mirror/addon/tern/tern.js +index efdf2ed62..2c6a7c0c5 100644 +--- a/src/external/code-mirror/addon/tern/tern.js ++++ b/src/external/code-mirror/addon/tern/tern.js +@@ -22,8 +22,8 @@ + // * showError: A function(editor, message) that can be used to + // override the way errors are displayed. + // * completionTip: Customize the content in tooltips for completions. +-// Is passed a single argument—the completion's data as returned by +-// Tern—and may return a string, DOM node, or null to indicate that ++// Is passed a single argument—the completion's data as returned by ++// Tern—and may return a string, DOM node, or null to indicate that + // no tip should be shown. By default the docstring is shown. + // * typeTip: Like completionTip, but for the tooltips shown for type + // queries. +@@ -259,7 +259,7 @@ + } else { + var tip = elt("span", null, elt("strong", null, data.type || "not found")); + if (data.doc) +- tip.appendChild(document.createTextNode(" — " + data.doc)); ++ tip.appendChild(document.createTextNode(" — " + data.doc)); + if (data.url) { + tip.appendChild(document.createTextNode(" ")); + var child = tip.appendChild(elt("a", null, "[docs]")); +diff --git a/src/external/code-mirror/lib/codemirror.js b/src/external/code-mirror/lib/codemirror.js +index 3e0cc2b24..dbf01262c 100644 +--- a/src/external/code-mirror/lib/codemirror.js ++++ b/src/external/code-mirror/lib/codemirror.js +@@ -1269,7 +1269,7 @@ function hasBadBidiRects(measure) { + + // See if "".split is the broken IE version, if so, provide an + // alternative way to split lines. +-var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) { ++var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string){ + var pos = 0, result = [], l = string.length + while (pos <= l) { + var nl = string.indexOf("\n", pos) +@@ -4063,6 +4063,10 @@ function updateDisplayIfNeeded(cm, update) { + display.renderedView = display.view + // There might have been a widget with a focused element that got + // hidden or updated, if so re-focus it. ++ ++ // #DEV ++ // console.log("[cm] /update_display focuse and activeElt", focused, activeElt() ) ++ + if (focused && activeElt() != focused && focused.offsetHeight) { focused.focus() } + + // Prevent selection and cursors from interfering with the scroll +@@ -9105,6 +9109,9 @@ CodeMirror.defineDocExtension = function (name, func) { + CodeMirror.fromTextArea = fromTextArea + + addLegacyProps(CodeMirror) ++ ++// Lively Hacks ++CodeMirror.posToDOM = posToDOM + + CodeMirror.version = "5.23.0" + +diff --git a/src/external/code-mirror/mode/htmlmixed/htmlmixed.js b/src/external/code-mirror/mode/htmlmixed/htmlmixed.js +index eb21fcc14..21ddb4002 100644 +--- a/src/external/code-mirror/mode/htmlmixed/htmlmixed.js ++++ b/src/external/code-mirror/mode/htmlmixed/htmlmixed.js +@@ -3,7 +3,7 @@ + + (function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS +- mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"), require("../css/css")); ++ mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"),require("../jsx/jsx"), require("../css/css")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript", "../css/css"], mod); + else // Plain browser env +@@ -13,8 +13,8 @@ + + var defaultTags = { + script: [ +- ["lang", /(javascript|babel)/i, "javascript"], +- ["type", /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i, "javascript"], ++ ["lang", /(javascript|babel)/i, "jsx"], ++ ["type", /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i, "jsx"], + ["type", /./, "text/plain"], + [null, null, "javascript"] + ], +diff --git a/src/external/code-mirror/mode/markdown/markdown.js b/src/external/code-mirror/mode/markdown/markdown.js +index 1aeb34414..c9193298f 100644 +--- a/src/external/code-mirror/mode/markdown/markdown.js ++++ b/src/external/code-mirror/mode/markdown/markdown.js +@@ -224,16 +224,19 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { + } + + function htmlBlock(stream, state) { ++ + var style = htmlMode.token(stream, state.htmlState); + if (!htmlModeMissing) { + var inner = CodeMirror.innerMode(htmlMode, state.htmlState) +- if ((inner.mode.name == "xml" && inner.state.tagStart === null && +- (!inner.state.context && inner.state.tokenize.isInText)) || +- (state.md_inside && stream.current().indexOf(">") > -1)) { +- state.f = inlineNormal; +- state.block = blockNormal; +- state.htmlState = null; +- } ++ ++ // #JSX in Script tag requires to disable this ++ // if ((inner.mode.name == "xml" && inner.state.tagStart === null && ++ // (!inner.state.context && inner.state.tokenize.isInText)) || ++ // (state.md_inside && stream.current().indexOf(">") > -1)) { ++ // state.f = inlineNormal; ++ // state.block = blockNormal; ++ // state.htmlState = null; ++ // } + } + return style; + }