+Closure Stylesheets (GSS) mode
+
+
+
+ A mode for Closure Stylesheets (GSS).
+ MIME type defined: text/x-gss
.
+
+ Parsing/Highlighting Tests: normal, verbose.
+
+
diff --git a/public/vendor/codemirror/mode/css/gss_test.js b/public/vendor/codemirror/mode/css/gss_test.js
new file mode 100644
index 00000000..d56e5928
--- /dev/null
+++ b/public/vendor/codemirror/mode/css/gss_test.js
@@ -0,0 +1,17 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function() {
+ "use strict";
+
+ var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-gss");
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "gss"); }
+
+ MT("atComponent",
+ "[def @component] {",
+ "[tag foo] {",
+ " [property color]: [keyword black];",
+ "}",
+ "}");
+
+})();
diff --git a/public/vendor/codemirror/mode/css/index.html b/public/vendor/codemirror/mode/css/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/css/less.html b/public/vendor/codemirror/mode/css/less.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/css/less_test.js b/public/vendor/codemirror/mode/css/less_test.js
old mode 100755
new mode 100644
index 7b77f584..dd821558
--- a/public/vendor/codemirror/mode/css/less_test.js
+++ b/public/vendor/codemirror/mode/css/less_test.js
@@ -26,10 +26,10 @@
MT("mixin",
"[qualifier .mixin] ([variable dark]; [variable-2 @color]) {",
- " [property color]: [variable darken]([variable-2 @color], [number 10%]);",
+ " [property color]: [atom darken]([variable-2 @color], [number 10%]);",
"}",
"[qualifier .mixin] ([variable light]; [variable-2 @color]) {",
- " [property color]: [variable lighten]([variable-2 @color], [number 10%]);",
+ " [property color]: [atom lighten]([variable-2 @color], [number 10%]);",
"}",
"[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {",
" [property display]: [atom block];",
diff --git a/public/vendor/codemirror/mode/css/scss.html b/public/vendor/codemirror/mode/css/scss.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/css/scss_test.js b/public/vendor/codemirror/mode/css/scss_test.js
old mode 100755
new mode 100644
index 26c226a1..785921b3
--- a/public/vendor/codemirror/mode/css/scss_test.js
+++ b/public/vendor/codemirror/mode/css/scss_test.js
@@ -95,7 +95,7 @@
MT('indent_parentheses',
"[tag foo] {",
- " [property color]: [variable darken]([variable-2 $blue],",
+ " [property color]: [atom darken]([variable-2 $blue],",
" [number 9%]);",
"}");
diff --git a/public/vendor/codemirror/mode/css/test.js b/public/vendor/codemirror/mode/css/test.js
old mode 100755
new mode 100644
index 55ae676e..7a496fb0
--- a/public/vendor/codemirror/mode/css/test.js
+++ b/public/vendor/codemirror/mode/css/test.js
@@ -6,7 +6,7 @@
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
// Error, because "foobarhello" is neither a known type or property, but
- // property was expected (after "and"), and it should be in parenthese.
+ // property was expected (after "and"), and it should be in parentheses.
MT("atMediaUnknownType",
"[def @media] [attribute screen] [keyword and] [error foobarhello] { }");
@@ -18,6 +18,12 @@
MT("atMediaMaxWidthNested",
"[def @media] [attribute screen] [keyword and] ([property max-width]: [number 25px]) { [tag foo] { } }");
+ MT("atMediaFeatureValueKeyword",
+ "[def @media] ([property orientation]: [keyword landscape]) { }");
+
+ MT("atMediaUnknownFeatureValueKeyword",
+ "[def @media] ([property orientation]: [error upsidedown]) { }");
+
MT("tagSelector",
"[tag foo] { }");
@@ -49,11 +55,17 @@
MT("tagColorHex3",
"[tag foo] { [property background]: [atom #fff]; }");
+ MT("tagColorHex4",
+ "[tag foo] { [property background]: [atom #ffff]; }");
+
MT("tagColorHex6",
"[tag foo] { [property background]: [atom #ffffff]; }");
- MT("tagColorHex4",
- "[tag foo] { [property background]: [atom&error #ffff]; }");
+ MT("tagColorHex8",
+ "[tag foo] { [property background]: [atom #ffffffff]; }");
+
+ MT("tagColorHex5Invalid",
+ "[tag foo] { [property background]: [atom&error #fffff]; }");
MT("tagColorHexInvalid",
"[tag foo] { [property background]: [atom&error #ffg]; }");
@@ -114,7 +126,7 @@
"}");
MT("empty_url",
- "[def @import] [tag url]() [tag screen];");
+ "[def @import] [atom url]() [attribute screen];");
MT("parens",
"[qualifier .foo] {",
@@ -150,7 +162,7 @@
" [tag foo] {",
" [property font-family]: [variable Verdana], [atom sans-serif];",
" }",
- " }");
+ "}");
MT("document_url",
"[def @document] [tag url]([string http://blah]) { [qualifier .class] { } }");
diff --git a/public/vendor/codemirror/mode/cypher/cypher.js b/public/vendor/codemirror/mode/cypher/cypher.js
old mode 100755
new mode 100644
index e218d473..107e4f6d
--- a/public/vendor/codemirror/mode/cypher/cypher.js
+++ b/public/vendor/codemirror/mode/cypher/cypher.js
@@ -60,9 +60,9 @@
};
var indentUnit = config.indentUnit;
var curPunc;
- var funcs = wordRegexp(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "keys", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "right", "round", "rtrim", "shortestPath", "sign", "sin", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "trim", "type", "upper"]);
- var preds = wordRegexp(["all", "and", "any", "has", "in", "none", "not", "or", "single", "xor"]);
- var keywords = wordRegexp(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "distinct", "drop", "else", "end", "explain", "false", "fieldterminator", "foreach", "from", "headers", "in", "index", "is", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "profile", "remove", "return", "scan", "set", "skip", "start", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with"]);
+ var funcs = wordRegexp(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "keys", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "reverse", "right", "round", "rtrim", "shortestPath", "sign", "sin", "size", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "toString", "trim", "type", "upper"]);
+ var preds = wordRegexp(["all", "and", "any", "contains", "exists", "has", "in", "none", "not", "or", "single", "xor"]);
+ var keywords = wordRegexp(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "detach", "distinct", "drop", "else", "end", "ends", "explain", "false", "fieldterminator", "foreach", "from", "headers", "in", "index", "is", "join", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "profile", "remove", "return", "scan", "set", "skip", "start", "starts", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with"]);
var operatorChars = /[*+\-<>=&|~%^]/;
return {
diff --git a/public/vendor/codemirror/mode/cypher/index.html b/public/vendor/codemirror/mode/cypher/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/d/d.js b/public/vendor/codemirror/mode/d/d.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/d/index.html b/public/vendor/codemirror/mode/d/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/dart/dart.js b/public/vendor/codemirror/mode/dart/dart.js
old mode 100755
new mode 100644
index a49e218c..d92eb519
--- a/public/vendor/codemirror/mode/dart/dart.js
+++ b/public/vendor/codemirror/mode/dart/dart.js
@@ -15,7 +15,7 @@
"implements get native operator set typedef with enum throw rethrow " +
"assert break case continue default in return new deferred async await " +
"try catch finally do else for if switch while import library export " +
- "part of show hide is").split(" ");
+ "part of show hide is as").split(" ");
var blockKeywords = "try catch finally do else for if switch while".split(" ");
var atoms = "true false null".split(" ");
var builtins = "void bool num int double dynamic var String".split(" ");
@@ -26,21 +26,101 @@
return obj;
}
+ function pushInterpolationStack(state) {
+ (state.interpolationStack || (state.interpolationStack = [])).push(state.tokenize);
+ }
+
+ function popInterpolationStack(state) {
+ return (state.interpolationStack || (state.interpolationStack = [])).pop();
+ }
+
+ function sizeInterpolationStack(state) {
+ return state.interpolationStack ? state.interpolationStack.length : 0;
+ }
+
CodeMirror.defineMIME("application/dart", {
name: "clike",
keywords: set(keywords),
- multiLineStrings: true,
blockKeywords: set(blockKeywords),
builtin: set(builtins),
atoms: set(atoms),
hooks: {
"@": function(stream) {
- stream.eatWhile(/[\w\$_]/);
+ stream.eatWhile(/[\w\$_\.]/);
return "meta";
+ },
+
+ // custom string handling to deal with triple-quoted strings and string interpolation
+ "'": function(stream, state) {
+ return tokenString("'", stream, state, false);
+ },
+ "\"": function(stream, state) {
+ return tokenString("\"", stream, state, false);
+ },
+ "r": function(stream, state) {
+ var peek = stream.peek();
+ if (peek == "'" || peek == "\"") {
+ return tokenString(stream.next(), stream, state, true);
+ }
+ return false;
+ },
+
+ "}": function(_stream, state) {
+ // "}" is end of interpolation, if interpolation stack is non-empty
+ if (sizeInterpolationStack(state) > 0) {
+ state.tokenize = popInterpolationStack(state);
+ return null;
+ }
+ return false;
}
}
});
+ function tokenString(quote, stream, state, raw) {
+ var tripleQuoted = false;
+ if (stream.eat(quote)) {
+ if (stream.eat(quote)) tripleQuoted = true;
+ else return "string"; //empty string
+ }
+ function tokenStringHelper(stream, state) {
+ var escaped = false;
+ while (!stream.eol()) {
+ if (!raw && !escaped && stream.peek() == "$") {
+ pushInterpolationStack(state);
+ state.tokenize = tokenInterpolation;
+ return "string";
+ }
+ var next = stream.next();
+ if (next == quote && !escaped && (!tripleQuoted || stream.match(quote + quote))) {
+ state.tokenize = null;
+ break;
+ }
+ escaped = !raw && !escaped && next == "\\";
+ }
+ return "string";
+ }
+ state.tokenize = tokenStringHelper;
+ return tokenStringHelper(stream, state);
+ }
+
+ function tokenInterpolation(stream, state) {
+ stream.eat("$");
+ if (stream.eat("{")) {
+ // let clike handle the content of ${...},
+ // we take over again when "}" appears (see hooks).
+ state.tokenize = null;
+ } else {
+ state.tokenize = tokenInterpolationIdentifier;
+ }
+ return null;
+ }
+
+ function tokenInterpolationIdentifier(stream, state) {
+ stream.eatWhile(/[\w_]/);
+ state.tokenize = popInterpolationStack(state);
+ return "variable";
+ }
+
CodeMirror.registerHelper("hintWords", "application/dart", keywords.concat(atoms).concat(builtins));
// This is needed to make loading through meta.js work.
diff --git a/public/vendor/codemirror/mode/dart/index.html b/public/vendor/codemirror/mode/dart/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/diff/diff.js b/public/vendor/codemirror/mode/diff/diff.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/diff/index.html b/public/vendor/codemirror/mode/diff/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/django/django.js b/public/vendor/codemirror/mode/django/django.js
old mode 100755
new mode 100644
index 2f08b063..eb8d6591
--- a/public/vendor/codemirror/mode/django/django.js
+++ b/public/vendor/codemirror/mode/django/django.js
@@ -14,14 +14,14 @@
"use strict";
CodeMirror.defineMode("django:inner", function() {
- var keywords = ["block", "endblock", "for", "endfor", "true", "false",
- "loop", "none", "self", "super", "if", "endif", "as",
- "else", "import", "with", "endwith", "without", "context", "ifequal", "endifequal",
- "ifnotequal", "endifnotequal", "extends", "include", "load", "comment",
- "endcomment", "empty", "url", "static", "trans", "blocktrans", "now", "regroup",
- "lorem", "ifchanged", "endifchanged", "firstof", "debug", "cycle", "csrf_token",
- "autoescape", "endautoescape", "spaceless", "ssi", "templatetag",
- "verbatim", "endverbatim", "widthratio"],
+ var keywords = ["block", "endblock", "for", "endfor", "true", "false", "filter", "endfilter",
+ "loop", "none", "self", "super", "if", "elif", "endif", "as", "else", "import",
+ "with", "endwith", "without", "context", "ifequal", "endifequal", "ifnotequal",
+ "endifnotequal", "extends", "include", "load", "comment", "endcomment",
+ "empty", "url", "static", "trans", "blocktrans", "endblocktrans", "now",
+ "regroup", "lorem", "ifchanged", "endifchanged", "firstof", "debug", "cycle",
+ "csrf_token", "autoescape", "endautoescape", "spaceless", "endspaceless",
+ "ssi", "templatetag", "verbatim", "endverbatim", "widthratio"],
filters = ["add", "addslashes", "capfirst", "center", "cut", "date",
"default", "default_if_none", "dictsort",
"dictsortreversed", "divisibleby", "escape", "escapejs",
@@ -35,11 +35,13 @@
"truncatechars_html", "truncatewords", "truncatewords_html",
"unordered_list", "upper", "urlencode", "urlize",
"urlizetrunc", "wordcount", "wordwrap", "yesno"],
- operators = ["==", "!=", "<", ">", "<=", ">=", "in", "not", "or", "and"];
+ operators = ["==", "!=", "<", ">", "<=", ">="],
+ wordOperators = ["in", "not", "or", "and"];
keywords = new RegExp("^\\b(" + keywords.join("|") + ")\\b");
filters = new RegExp("^\\b(" + filters.join("|") + ")\\b");
operators = new RegExp("^\\b(" + operators.join("|") + ")\\b");
+ wordOperators = new RegExp("^\\b(" + wordOperators.join("|") + ")\\b");
// We have to return "null" instead of null, in order to avoid string
// styling as the default, when using Django templates inside HTML
@@ -270,6 +272,11 @@
return "operator";
}
+ // Attempt to match a word operator
+ if (stream.match(wordOperators)) {
+ return "keyword";
+ }
+
// Attempt to match a keyword
var keywordMatch = stream.match(keywords);
if (keywordMatch) {
diff --git a/public/vendor/codemirror/mode/django/index.html b/public/vendor/codemirror/mode/django/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/dockerfile/dockerfile.js b/public/vendor/codemirror/mode/dockerfile/dockerfile.js
old mode 100755
new mode 100644
index 6d517750..4419009a
--- a/public/vendor/codemirror/mode/dockerfile/dockerfile.js
+++ b/public/vendor/codemirror/mode/dockerfile/dockerfile.js
@@ -69,7 +69,10 @@
token: null,
next: "start"
}
- ]
+ ],
+ meta: {
+ lineComment: "#"
+ }
});
CodeMirror.defineMIME("text/x-dockerfile", "dockerfile");
diff --git a/public/vendor/codemirror/mode/dockerfile/index.html b/public/vendor/codemirror/mode/dockerfile/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/dtd/dtd.js b/public/vendor/codemirror/mode/dtd/dtd.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/dtd/index.html b/public/vendor/codemirror/mode/dtd/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/dylan/dylan.js b/public/vendor/codemirror/mode/dylan/dylan.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/dylan/index.html b/public/vendor/codemirror/mode/dylan/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/ebnf/ebnf.js b/public/vendor/codemirror/mode/ebnf/ebnf.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/ebnf/index.html b/public/vendor/codemirror/mode/ebnf/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/ecl/ecl.js b/public/vendor/codemirror/mode/ecl/ecl.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/ecl/index.html b/public/vendor/codemirror/mode/ecl/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/eiffel/eiffel.js b/public/vendor/codemirror/mode/eiffel/eiffel.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/eiffel/index.html b/public/vendor/codemirror/mode/eiffel/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/elm/elm.js b/public/vendor/codemirror/mode/elm/elm.js
old mode 100755
new mode 100644
index 7124c50a..b31e6637
--- a/public/vendor/codemirror/mode/elm/elm.js
+++ b/public/vendor/codemirror/mode/elm/elm.js
@@ -202,4 +202,4 @@
});
CodeMirror.defineMIME("text/x-elm", "elm");
-})();
+});
diff --git a/public/vendor/codemirror/mode/elm/index.html b/public/vendor/codemirror/mode/elm/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/erlang/erlang.js b/public/vendor/codemirror/mode/erlang/erlang.js
old mode 100755
new mode 100644
index fbca292f..5aed76a5
--- a/public/vendor/codemirror/mode/erlang/erlang.js
+++ b/public/vendor/codemirror/mode/erlang/erlang.js
@@ -220,8 +220,6 @@ CodeMirror.defineMode("erlang", function(cmCfg) {
}else{
return rval(state,stream,"function");
}
- }else if (is_member(w,operatorAtomWords)) {
- return rval(state,stream,"operator");
}else if (lookahead(stream) == ":") {
if (w == "erlang") {
return rval(state,stream,"builtin");
@@ -230,8 +228,6 @@ CodeMirror.defineMode("erlang", function(cmCfg) {
}
}else if (is_member(w,["true","false"])) {
return rval(state,stream,"boolean");
- }else if (is_member(w,["true","false"])) {
- return rval(state,stream,"boolean");
}else{
return rval(state,stream,"atom");
}
diff --git a/public/vendor/codemirror/mode/erlang/index.html b/public/vendor/codemirror/mode/erlang/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/factor/factor.js b/public/vendor/codemirror/mode/factor/factor.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/factor/index.html b/public/vendor/codemirror/mode/factor/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/forth/forth.js b/public/vendor/codemirror/mode/forth/forth.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/forth/index.html b/public/vendor/codemirror/mode/forth/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/fortran/fortran.js b/public/vendor/codemirror/mode/fortran/fortran.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/fortran/index.html b/public/vendor/codemirror/mode/fortran/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/gas/gas.js b/public/vendor/codemirror/mode/gas/gas.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/gas/index.html b/public/vendor/codemirror/mode/gas/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/gfm/gfm.js b/public/vendor/codemirror/mode/gfm/gfm.js
old mode 100755
new mode 100644
index 80a8e2c8..6e74ad4f
--- a/public/vendor/codemirror/mode/gfm/gfm.js
+++ b/public/vendor/codemirror/mode/gfm/gfm.js
@@ -11,6 +11,8 @@
})(function(CodeMirror) {
"use strict";
+var urlRE = /^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i
+
CodeMirror.defineMode("gfm", function(config, modeConfig) {
var codeDepth = 0;
function blankLine(state) {
@@ -37,7 +39,7 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) {
// Hack to prevent formatting override inside code blocks (block and inline)
if (state.codeBlock) {
- if (stream.match(/^```/)) {
+ if (stream.match(/^```+/)) {
state.codeBlock = false;
return null;
}
@@ -47,7 +49,7 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) {
if (stream.sol()) {
state.code = false;
}
- if (stream.sol() && stream.match(/^```/)) {
+ if (stream.sol() && stream.match(/^```+/)) {
stream.skipToEnd();
state.codeBlock = true;
return null;
@@ -78,25 +80,29 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) {
}
if (stream.sol() || state.ateSpace) {
state.ateSpace = false;
- if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)) {
- // User/Project@SHA
- // User@SHA
- // SHA
- state.combineTokens = true;
- return "link";
- } else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) {
- // User/Project#Num
- // User#Num
- // #Num
- state.combineTokens = true;
- return "link";
+ if (modeConfig.gitHubSpice !== false) {
+ if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)) {
+ // User/Project@SHA
+ // User@SHA
+ // SHA
+ state.combineTokens = true;
+ return "link";
+ } else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) {
+ // User/Project#Num
+ // User#Num
+ // #Num
+ state.combineTokens = true;
+ return "link";
+ }
}
}
- if (stream.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i) &&
- stream.string.slice(stream.start - 2, stream.start) != "](") {
+ if (stream.match(urlRE) &&
+ stream.string.slice(stream.start - 2, stream.start) != "](" &&
+ (stream.start == 0 || /\W/.test(stream.string.charAt(stream.start - 1)))) {
// URLs
// Taken from http://daringfireball.net/2010/07/improved_regex_for_matching_urls
// And then (issue #1160) simplified to make it not crash the Chrome Regexp engine
+ // And then limited url schemes to the CommonMark list, so foo:bar isn't matched as a URL
state.combineTokens = true;
return "link";
}
@@ -109,15 +115,16 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) {
var markdownConfig = {
underscoresBreakWords: false,
taskLists: true,
- fencedCodeBlocks: true,
+ fencedCodeBlocks: '```',
strikethrough: true
};
for (var attr in modeConfig) {
markdownConfig[attr] = modeConfig[attr];
}
markdownConfig.name = "markdown";
- CodeMirror.defineMIME("gfmBase", markdownConfig);
- return CodeMirror.overlayMode(CodeMirror.getMode(config, "gfmBase"), gfmOverlay);
+ return CodeMirror.overlayMode(CodeMirror.getMode(config, markdownConfig), gfmOverlay);
+
}, "markdown");
+ CodeMirror.defineMIME("text/x-gfm", "gfm");
});
diff --git a/public/vendor/codemirror/mode/gfm/index.html b/public/vendor/codemirror/mode/gfm/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/gfm/test.js b/public/vendor/codemirror/mode/gfm/test.js
old mode 100755
new mode 100644
index c2bc38fd..0dcd3619
--- a/public/vendor/codemirror/mode/gfm/test.js
+++ b/public/vendor/codemirror/mode/gfm/test.js
@@ -51,6 +51,11 @@
"[comment ```]",
"bar");
+ MT("fencedCodeBlocksNoTildes",
+ "~~~",
+ "foo",
+ "~~~");
+
MT("taskListAsterisk",
"[variable-2 * []] foo]", // Invalid; must have space or x between []
"[variable-2 * [ ]]bar]", // Invalid; must have space after ]
@@ -133,6 +138,15 @@
MT("vanillaLink",
"foo [link http://www.example.com/] bar");
+ MT("vanillaLinkNoScheme",
+ "foo [link www.example.com] bar");
+
+ MT("vanillaLinkHttps",
+ "foo [link https://www.example.com/] bar");
+
+ MT("vanillaLinkDataSchema",
+ "foo [link data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==] bar");
+
MT("vanillaLinkPunctuation",
"foo [link http://www.example.com/]. bar");
@@ -142,6 +156,9 @@
MT("vanillaLinkEmphasis",
"foo [em *][em&link http://www.example.com/index.html][em *] bar");
+ MT("notALink",
+ "foo asfd:asdf bar");
+
MT("notALink",
"[comment ```css]",
"[tag foo] {[property color]:[keyword black];}",
@@ -152,8 +169,8 @@
MT("notALink",
"[comment `foo]",
- "[link http://www.example.com/]",
- "[comment `foo]",
+ "[comment&link http://www.example.com/]",
+ "[comment `] foo",
"",
"[link http://www.example.com/]");
diff --git a/public/vendor/codemirror/mode/gherkin/gherkin.js b/public/vendor/codemirror/mode/gherkin/gherkin.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/gherkin/index.html b/public/vendor/codemirror/mode/gherkin/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/go/go.js b/public/vendor/codemirror/mode/go/go.js
old mode 100755
new mode 100644
index b121f4e6..21fe9a2d
--- a/public/vendor/codemirror/mode/go/go.js
+++ b/public/vendor/codemirror/mode/go/go.js
@@ -86,7 +86,7 @@ CodeMirror.defineMode("go", function(config) {
var escaped = false, next, end = false;
while ((next = stream.next()) != null) {
if (next == quote && !escaped) {end = true; break;}
- escaped = !escaped && next == "\\";
+ escaped = !escaped && quote != "`" && next == "\\";
}
if (end || !(escaped || quote == "`"))
state.tokenize = tokenBase;
diff --git a/public/vendor/codemirror/mode/go/index.html b/public/vendor/codemirror/mode/go/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/groovy/groovy.js b/public/vendor/codemirror/mode/groovy/groovy.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/groovy/index.html b/public/vendor/codemirror/mode/groovy/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/haml/haml.js b/public/vendor/codemirror/mode/haml/haml.js
old mode 100755
new mode 100644
index 8fe63b02..03ce8335
--- a/public/vendor/codemirror/mode/haml/haml.js
+++ b/public/vendor/codemirror/mode/haml/haml.js
@@ -85,8 +85,10 @@
state.tokenize = rubyInQuote(")");
return state.tokenize(stream, state);
} else if (ch == "{") {
- state.tokenize = rubyInQuote("}");
- return state.tokenize(stream, state);
+ if (!stream.match(/^\{%.*/)) {
+ state.tokenize = rubyInQuote("}");
+ return state.tokenize(stream, state);
+ }
}
}
diff --git a/public/vendor/codemirror/mode/haml/index.html b/public/vendor/codemirror/mode/haml/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/haml/test.js b/public/vendor/codemirror/mode/haml/test.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/handlebars/handlebars.js b/public/vendor/codemirror/mode/handlebars/handlebars.js
old mode 100755
new mode 100644
index 40dfea42..2174e538
--- a/public/vendor/codemirror/mode/handlebars/handlebars.js
+++ b/public/vendor/codemirror/mode/handlebars/handlebars.js
@@ -3,15 +3,15 @@
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
- mod(require("../../lib/codemirror"), require("../../addon/mode/simple"));
+ mod(require("../../lib/codemirror"), require("../../addon/mode/simple"), require("../../addon/mode/multiplex"));
else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror", "../../addon/mode/simple"], mod);
+ define(["../../lib/codemirror", "../../addon/mode/simple", "../../addon/mode/multiplex"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
- CodeMirror.defineSimpleMode("handlebars", {
+ CodeMirror.defineSimpleMode("handlebars-tags", {
start: [
{ regex: /\{\{!--/, push: "dash_comment", token: "comment" },
{ regex: /\{\{!/, push: "comment", token: "comment" },
@@ -21,8 +21,8 @@
{ regex: /\}\}/, pop: true, token: "tag" },
// Double and single quotes
- { regex: /"(?:[^\\]|\\.)*?"/, token: "string" },
- { regex: /'(?:[^\\]|\\.)*?'/, token: "string" },
+ { regex: /"(?:[^\\"]|\\.)*"?/, token: "string" },
+ { regex: /'(?:[^\\']|\\.)*'?/, token: "string" },
// Handlebars keywords
{ regex: />|[#\/]([A-Za-z_]\w*)/, token: "keyword" },
@@ -49,5 +49,14 @@
]
});
+ CodeMirror.defineMode("handlebars", function(config, parserConfig) {
+ var handlebars = CodeMirror.getMode(config, "handlebars-tags");
+ if (!parserConfig || !parserConfig.base) return handlebars;
+ return CodeMirror.multiplexingMode(
+ CodeMirror.getMode(config, parserConfig.base),
+ {open: "{{", close: "}}", mode: handlebars, parseDelimiters: true}
+ );
+ });
+
CodeMirror.defineMIME("text/x-handlebars-template", "handlebars");
});
diff --git a/public/vendor/codemirror/mode/handlebars/index.html b/public/vendor/codemirror/mode/handlebars/index.html
old mode 100755
new mode 100644
index beaef87a..4f82d602
--- a/public/vendor/codemirror/mode/handlebars/index.html
+++ b/public/vendor/codemirror/mode/handlebars/index.html
@@ -1,4 +1,4 @@
-
+
Handlebars syntax highlighting for CodeMirror.
+ Haskell literate mode
+
+
+ MIME types
+ defined: text/x-literate-haskell
.
+
+ Parser configuration parameters recognized: base
to
+ set the base mode (defaults to "haskell"
).
+
+
+
+
diff --git a/public/vendor/codemirror/mode/haskell/haskell.js b/public/vendor/codemirror/mode/haskell/haskell.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/haskell/index.html b/public/vendor/codemirror/mode/haskell/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/haxe/haxe.js b/public/vendor/codemirror/mode/haxe/haxe.js
old mode 100755
new mode 100644
index d49ad70f..a9573dd7
--- a/public/vendor/codemirror/mode/haxe/haxe.js
+++ b/public/vendor/codemirror/mode/haxe/haxe.js
@@ -16,23 +16,21 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
// Tokenizer
- var keywords = function(){
- function kw(type) {return {type: type, style: "keyword"};}
- var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
- var operator = kw("operator"), atom = {type: "atom", style: "atom"}, attribute = {type:"attribute", style: "attribute"};
+ function kw(type) {return {type: type, style: "keyword"};}
+ var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
+ var operator = kw("operator"), atom = {type: "atom", style: "atom"}, attribute = {type:"attribute", style: "attribute"};
var type = kw("typedef");
- return {
- "if": A, "while": A, "else": B, "do": B, "try": B,
- "return": C, "break": C, "continue": C, "new": C, "throw": C,
- "var": kw("var"), "inline":attribute, "static": attribute, "using":kw("import"),
+ var keywords = {
+ "if": A, "while": A, "else": B, "do": B, "try": B,
+ "return": C, "break": C, "continue": C, "new": C, "throw": C,
+ "var": kw("var"), "inline":attribute, "static": attribute, "using":kw("import"),
"public": attribute, "private": attribute, "cast": kw("cast"), "import": kw("import"), "macro": kw("macro"),
- "function": kw("function"), "catch": kw("catch"), "untyped": kw("untyped"), "callback": kw("cb"),
- "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
- "in": operator, "never": kw("property_access"), "trace":kw("trace"),
+ "function": kw("function"), "catch": kw("catch"), "untyped": kw("untyped"), "callback": kw("cb"),
+ "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
+ "in": operator, "never": kw("property_access"), "trace":kw("trace"),
"class": type, "abstract":type, "enum":type, "interface":type, "typedef":type, "extends":type, "implements":type, "dynamic":type,
- "true": atom, "false": atom, "null": atom
- };
- }();
+ "true": atom, "false": atom, "null": atom
+ };
var isOperatorChar = /[+\-*&%=<>!?|]/;
@@ -41,14 +39,13 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
return f(stream, state);
}
- function nextUntilUnescaped(stream, end) {
+ function toUnescaped(stream, end) {
var escaped = false, next;
while ((next = stream.next()) != null) {
if (next == end && !escaped)
- return false;
+ return true;
escaped = !escaped && next == "\\";
}
- return escaped;
}
// Used as scratch variables to communicate multiple values without
@@ -61,70 +58,58 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
function haxeTokenBase(stream, state) {
var ch = stream.next();
- if (ch == '"' || ch == "'")
+ if (ch == '"' || ch == "'") {
return chain(stream, state, haxeTokenString(ch));
- else if (/[\[\]{}\(\),;\:\.]/.test(ch))
+ } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
return ret(ch);
- else if (ch == "0" && stream.eat(/x/i)) {
+ } else if (ch == "0" && stream.eat(/x/i)) {
stream.eatWhile(/[\da-f]/i);
return ret("number", "number");
- }
- else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) {
- stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);
+ } else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) {
+ stream.match(/^\d*(?:\.\d*(?!\.))?(?:[eE][+\-]?\d+)?/);
return ret("number", "number");
- }
- else if (state.reAllowed && (ch == "~" && stream.eat(/\//))) {
- nextUntilUnescaped(stream, "/");
+ } else if (state.reAllowed && (ch == "~" && stream.eat(/\//))) {
+ toUnescaped(stream, "/");
stream.eatWhile(/[gimsu]/);
return ret("regexp", "string-2");
- }
- else if (ch == "/") {
+ } else if (ch == "/") {
if (stream.eat("*")) {
return chain(stream, state, haxeTokenComment);
- }
- else if (stream.eat("/")) {
+ } else if (stream.eat("/")) {
stream.skipToEnd();
return ret("comment", "comment");
- }
- else {
+ } else {
stream.eatWhile(isOperatorChar);
return ret("operator", null, stream.current());
}
- }
- else if (ch == "#") {
+ } else if (ch == "#") {
stream.skipToEnd();
return ret("conditional", "meta");
- }
- else if (ch == "@") {
+ } else if (ch == "@") {
stream.eat(/:/);
stream.eatWhile(/[\w_]/);
return ret ("metadata", "meta");
- }
- else if (isOperatorChar.test(ch)) {
+ } else if (isOperatorChar.test(ch)) {
stream.eatWhile(isOperatorChar);
return ret("operator", null, stream.current());
- }
- else {
- var word;
- if(/[A-Z]/.test(ch))
- {
- stream.eatWhile(/[\w_<>]/);
- word = stream.current();
- return ret("type", "variable-3", word);
- }
- else
- {
+ } else {
+ var word;
+ if(/[A-Z]/.test(ch)) {
+ stream.eatWhile(/[\w_<>]/);
+ word = stream.current();
+ return ret("type", "variable-3", word);
+ } else {
stream.eatWhile(/[\w_]/);
var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];
return (known && state.kwAllowed) ? ret(known.type, known.style, word) :
ret("variable", "variable", word);
- }
+ }
}
}
function haxeTokenString(quote) {
return function(stream, state) {
- if (!nextUntilUnescaped(stream, quote))
+ if (toUnescaped(stream, quote))
state.tokenize = haxeTokenBase;
return ret("string", "string");
};
@@ -176,27 +161,25 @@ CodeMirror.defineMode("haxe", function(config, parserConfig) {
cc.pop()();
if (cx.marked) return cx.marked;
if (type == "variable" && inScope(state, content)) return "variable-2";
- if (type == "variable" && imported(state, content)) return "variable-3";
+ if (type == "variable" && imported(state, content)) return "variable-3";
return style;
}
}
}
- function imported(state, typename)
- {
- if (/[a-z]/.test(typename.charAt(0)))
- return false;
- var len = state.importedtypes.length;
- for (var i = 0; i") {
- // Script block: mode to change to depends on type attribute
- var scriptType = stream.string.slice(Math.max(0, stream.pos - 100), stream.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);
- scriptType = scriptType ? scriptType[1] : "";
- if (scriptType && /[\"\']/.test(scriptType.charAt(0))) scriptType = scriptType.slice(1, scriptType.length - 1);
- for (var i = 0; i < scriptTypes.length; ++i) {
- var tp = scriptTypes[i];
- if (typeof tp.matches == "string" ? scriptType == tp.matches : tp.matches.test(scriptType)) {
- if (tp.mode) {
- state.token = script;
- state.localMode = tp.mode;
- state.localState = tp.mode.startState && tp.mode.startState(htmlMode.indent(state.htmlState, ""));
- }
- break;
- }
- }
- } else if (tagName == "style" && /\btag\b/.test(style) && stream.current() == ">") {
- state.token = css;
- state.localMode = cssMode;
- state.localState = cssMode.startState(htmlMode.indent(state.htmlState, ""));
- }
- return style;
- }
+ "use strict";
+
+ var defaultTags = {
+ script: [
+ ["lang", /(javascript|babel)/i, "javascript"],
+ ["type", /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i, "javascript"],
+ ["type", /./, "text/plain"],
+ [null, null, "javascript"]
+ ],
+ style: [
+ ["lang", /^css$/i, "css"],
+ ["type", /^(text\/)?(x-)?(stylesheet|css)$/i, "css"],
+ ["type", /./, "text/plain"],
+ [null, null, "css"]
+ ]
+ };
+
function maybeBackup(stream, pat, style) {
- var cur = stream.current();
- var close = cur.search(pat);
- if (close > -1) stream.backUp(cur.length - close);
- else if (cur.match(/<\/?$/)) {
+ var cur = stream.current(), close = cur.search(pat);
+ if (close > -1) {
+ stream.backUp(cur.length - close);
+ } else if (cur.match(/<\/?$/)) {
stream.backUp(cur.length);
if (!stream.match(pat, false)) stream.match(cur);
}
return style;
}
- function script(stream, state) {
- if (stream.match(/^<\/\s*script\s*>/i, false)) {
- state.token = html;
- state.localState = state.localMode = null;
- return null;
- }
- return maybeBackup(stream, /<\/\s*script\s*>/,
- state.localMode.token(stream, state.localState));
+
+ var attrRegexpCache = {};
+ function getAttrRegexp(attr) {
+ var regexp = attrRegexpCache[attr];
+ if (regexp) return regexp;
+ return attrRegexpCache[attr] = new RegExp("\\s+" + attr + "\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*");
+ }
+
+ function getAttrValue(stream, attr) {
+ var pos = stream.pos, match;
+ while (pos >= 0 && stream.string.charAt(pos) !== "<") pos--;
+ if (pos < 0) return pos;
+ if (match = stream.string.slice(pos, stream.pos).match(getAttrRegexp(attr)))
+ return match[2];
+ return "";
+ }
+
+ function getTagRegexp(tagName, anchored) {
+ return new RegExp((anchored ? "^" : "") + "<\/\s*" + tagName + "\s*>", "i");
}
- function css(stream, state) {
- if (stream.match(/^<\/\s*style\s*>/i, false)) {
- state.token = html;
- state.localState = state.localMode = null;
- return null;
+
+ function addTags(from, to) {
+ for (var tag in from) {
+ var dest = to[tag] || (to[tag] = []);
+ var source = from[tag];
+ for (var i = source.length - 1; i >= 0; i--)
+ dest.unshift(source[i])
}
- return maybeBackup(stream, /<\/\s*style\s*>/,
- cssMode.token(stream, state.localState));
}
- return {
- startState: function() {
- var state = htmlMode.startState();
- return {token: html, localMode: null, localState: null, htmlState: state};
- },
-
- copyState: function(state) {
- if (state.localState)
- var local = CodeMirror.copyState(state.localMode, state.localState);
- return {token: state.token, localMode: state.localMode, localState: local,
- htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};
- },
-
- token: function(stream, state) {
- return state.token(stream, state);
- },
-
- indent: function(state, textAfter) {
- if (!state.localMode || /^\s*<\//.test(textAfter))
- return htmlMode.indent(state.htmlState, textAfter);
- else if (state.localMode.indent)
- return state.localMode.indent(state.localState, textAfter);
- else
- return CodeMirror.Pass;
- },
-
- innerMode: function(state) {
- return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode};
+ function findMatchingMode(tagInfo, stream) {
+ for (var i = 0; i < tagInfo.length; i++) {
+ var spec = tagInfo[i];
+ if (!spec[0] || spec[1].test(getAttrValue(stream, spec[0]))) return spec[2];
}
- };
-}, "xml", "javascript", "css");
+ }
+
+ CodeMirror.defineMode("htmlmixed", function (config, parserConfig) {
+ var htmlMode = CodeMirror.getMode(config, {
+ name: "xml",
+ htmlMode: true,
+ multilineTagIndentFactor: parserConfig.multilineTagIndentFactor,
+ multilineTagIndentPastTag: parserConfig.multilineTagIndentPastTag
+ });
+
+ var tags = {};
+ var configTags = parserConfig && parserConfig.tags, configScript = parserConfig && parserConfig.scriptTypes;
+ addTags(defaultTags, tags);
+ if (configTags) addTags(configTags, tags);
+ if (configScript) for (var i = configScript.length - 1; i >= 0; i--)
+ tags.script.unshift(["type", configScript[i].matches, configScript[i].mode])
+
+ function html(stream, state) {
+ var tagName = state.htmlState.tagName && state.htmlState.tagName.toLowerCase();
+ var tagInfo = tagName && tags.hasOwnProperty(tagName) && tags[tagName];
+
+ var style = htmlMode.token(stream, state.htmlState), modeSpec;
+
+ if (tagInfo && /\btag\b/.test(style) && stream.current() === ">" &&
+ (modeSpec = findMatchingMode(tagInfo, stream))) {
+ var mode = CodeMirror.getMode(config, modeSpec);
+ var endTagA = getTagRegexp(tagName, true), endTag = getTagRegexp(tagName, false);
+ state.token = function (stream, state) {
+ if (stream.match(endTagA, false)) {
+ state.token = html;
+ state.localState = state.localMode = null;
+ return null;
+ }
+ return maybeBackup(stream, endTag, state.localMode.token(stream, state.localState));
+ };
+ state.localMode = mode;
+ state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, ""));
+ }
+ return style;
+ };
+
+ return {
+ startState: function () {
+ var state = htmlMode.startState();
+ return {token: html, localMode: null, localState: null, htmlState: state};
+ },
+
+ copyState: function (state) {
+ var local;
+ if (state.localState) {
+ local = CodeMirror.copyState(state.localMode, state.localState);
+ }
+ return {token: state.token, localMode: state.localMode, localState: local,
+ htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};
+ },
+
+ token: function (stream, state) {
+ return state.token(stream, state);
+ },
-CodeMirror.defineMIME("text/html", "htmlmixed");
+ indent: function (state, textAfter) {
+ if (!state.localMode || /^\s*<\//.test(textAfter))
+ return htmlMode.indent(state.htmlState, textAfter);
+ else if (state.localMode.indent)
+ return state.localMode.indent(state.localState, textAfter);
+ else
+ return CodeMirror.Pass;
+ },
+
+ innerMode: function (state) {
+ return {state: state.localState || state.htmlState, mode: state.localMode || htmlMode};
+ }
+ };
+ }, "xml", "javascript", "css");
+ CodeMirror.defineMIME("text/html", "htmlmixed");
});
diff --git a/public/vendor/codemirror/mode/htmlmixed/index.html b/public/vendor/codemirror/mode/htmlmixed/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/http/http.js b/public/vendor/codemirror/mode/http/http.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/http/index.html b/public/vendor/codemirror/mode/http/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/idl/idl.js b/public/vendor/codemirror/mode/idl/idl.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/idl/index.html b/public/vendor/codemirror/mode/idl/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/index.html b/public/vendor/codemirror/mode/index.html
old mode 100755
new mode 100644
index 8c6d0a43..a6c293ec
--- a/public/vendor/codemirror/mode/index.html
+++ b/public/vendor/codemirror/mode/index.html
@@ -33,12 +33,16 @@ option.
APL
ASN.1
Asterisk dialplan
+ Brainfuck
C, C++, C#
+ Ceylon
Clojure
+ Closure Stylesheets (GSS)
CMake
COBOL
CoffeeScript
Common Lisp
+ Crystal
CSS
Cypher
Cython
@@ -64,7 +68,7 @@ option.
Groovy
HAML
Handlebars
- Haskell
+ Haskell (Literate)
Haxe
HTML embedded (JSP, ASP.NET)
HTML mixed-mode
@@ -72,7 +76,7 @@ option.
IDL
Java
Jade
- JavaScript
+ JavaScript (JSX)
Jinja2
Julia
Kotlin
@@ -83,12 +87,15 @@ option.
Mathematica
mIRC
Modelica
+ MscGen
MUMPS
Nginx
+ NSIS
NTriples
Objective C
OCaml
Octave (MATLAB)
+ Oz
Pascal
PEG.js
Perl
@@ -119,6 +126,7 @@ option.
Stylus
SQL (several dialects)
SPARQL
+ Squirrel
Swift
sTeX, LaTeX
Tcl
@@ -136,9 +144,12 @@ option.
VBScript
Velocity
Verilog/SystemVerilog
+ VHDL
+ Vue.js app
XML/HTML
XQuery
YAML
+ YAML frontmatter
Z80
diff --git a/public/vendor/codemirror/mode/jade/index.html b/public/vendor/codemirror/mode/jade/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/jade/jade.js b/public/vendor/codemirror/mode/jade/jade.js
old mode 100755
new mode 100644
index 96fadb19..1db069a9
--- a/public/vendor/codemirror/mode/jade/jade.js
+++ b/public/vendor/codemirror/mode/jade/jade.js
@@ -74,7 +74,7 @@ CodeMirror.defineMode('jade', function (config) {
res.javaScriptArguments = this.javaScriptArguments;
res.javaScriptArgumentsDepth = this.javaScriptArgumentsDepth;
res.isInterpolating = this.isInterpolating;
- res.interpolationNesting = this.intpolationNesting;
+ res.interpolationNesting = this.interpolationNesting;
res.jsState = CodeMirror.copyState(jsMode, this.jsState);
@@ -167,7 +167,7 @@ CodeMirror.defineMode('jade', function (config) {
if (state.interpolationNesting < 0) {
stream.next();
state.isInterpolating = false;
- return 'puncutation';
+ return 'punctuation';
}
} else if (stream.peek() === '{') {
state.interpolationNesting++;
@@ -583,7 +583,7 @@ CodeMirror.defineMode('jade', function (config) {
copyState: copyState,
token: nextToken
};
-});
+}, 'javascript', 'css', 'htmlmixed');
CodeMirror.defineMIME('text/x-jade', 'jade');
diff --git a/public/vendor/codemirror/mode/javascript/index.html b/public/vendor/codemirror/mode/javascript/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/javascript/javascript.js b/public/vendor/codemirror/mode/javascript/javascript.js
old mode 100755
new mode 100644
index c86f49e1..fa5721d5
--- a/public/vendor/codemirror/mode/javascript/javascript.js
+++ b/public/vendor/codemirror/mode/javascript/javascript.js
@@ -13,6 +13,11 @@
})(function(CodeMirror) {
"use strict";
+function expressionAllowed(stream, state, backUp) {
+ return /^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(state.lastType) ||
+ (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))
+}
+
CodeMirror.defineMode("javascript", function(config, parserConfig) {
var indentUnit = config.indentUnit;
var statementIndent = parserConfig.statementIndent;
@@ -30,13 +35,13 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
var jsKeywords = {
"if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
- "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, "debugger": C,
+ "return": C, "break": C, "continue": C, "new": kw("new"), "delete": C, "throw": C, "debugger": C,
"var": kw("var"), "const": kw("var"), "let": kw("var"),
"function": kw("function"), "catch": kw("catch"),
"for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
"in": operator, "typeof": operator, "instanceof": operator,
"true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
- "this": kw("this"), "module": kw("module"), "class": kw("class"), "super": kw("atom"),
+ "this": kw("this"), "class": kw("class"), "super": kw("atom"),
"yield": C, "export": kw("export"), "import": kw("import"), "extends": C
};
@@ -45,18 +50,23 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
var type = {type: "variable", style: "variable-3"};
var tsKeywords = {
// object-like things
- "interface": kw("interface"),
- "extends": kw("extends"),
- "constructor": kw("constructor"),
+ "interface": kw("class"),
+ "implements": C,
+ "namespace": C,
+ "module": kw("module"),
+ "enum": kw("module"),
// scope modifiers
- "public": kw("public"),
- "private": kw("private"),
- "protected": kw("protected"),
- "static": kw("static"),
+ "public": kw("modifier"),
+ "private": kw("modifier"),
+ "protected": kw("modifier"),
+ "abstract": kw("modifier"),
+
+ // operators
+ "as": operator,
// types
- "string": type, "number": type, "bool": type, "any": type
+ "string": type, "number": type, "boolean": type, "any": type
};
for (var attr in tsKeywords) {
@@ -105,6 +115,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
} else if (ch == "0" && stream.eat(/x/i)) {
stream.eatWhile(/[\da-f]/i);
return ret("number", "number");
+ } else if (ch == "0" && stream.eat(/o/i)) {
+ stream.eatWhile(/[0-7]/i);
+ return ret("number", "number");
+ } else if (ch == "0" && stream.eat(/b/i)) {
+ stream.eatWhile(/[01]/i);
+ return ret("number", "number");
} else if (/\d/.test(ch)) {
stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);
return ret("number", "number");
@@ -115,8 +131,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
} else if (stream.eat("/")) {
stream.skipToEnd();
return ret("comment", "comment");
- } else if (state.lastType == "operator" || state.lastType == "keyword c" ||
- state.lastType == "sof" || /^[\[{}\(,;:]$/.test(state.lastType)) {
+ } else if (expressionAllowed(stream, state, 1)) {
readRegexp(stream);
stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);
return ret("regexp", "string-2");
@@ -275,8 +290,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
return false;
}
var state = cx.state;
+ cx.marked = "def";
if (state.context) {
- cx.marked = "def";
if (inList(state.localVars)) return;
state.localVars = {name: varname, next: state.localVars};
} else {
@@ -347,10 +362,10 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (type == "default") return cont(expect(":"));
if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
statement, poplex, popcontext);
- if (type == "module") return cont(pushlex("form"), pushcontext, afterModule, popcontext, poplex);
if (type == "class") return cont(pushlex("form"), className, poplex);
- if (type == "export") return cont(pushlex("form"), afterExport, poplex);
- if (type == "import") return cont(pushlex("form"), afterImport, poplex);
+ if (type == "export") return cont(pushlex("stat"), afterExport, poplex);
+ if (type == "import") return cont(pushlex("stat"), afterImport, poplex);
+ if (type == "module") return cont(pushlex("form"), pattern, pushlex("}"), expect("{"), block, poplex, poplex)
return pass(pushlex("stat"), expression, expect(";"), poplex);
}
function expression(type) {
@@ -374,7 +389,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression);
if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop);
if (type == "{") return contCommasep(objprop, "}", null, maybeop);
- if (type == "quasi") { return pass(quasi, maybeop); }
+ if (type == "quasi") return pass(quasi, maybeop);
+ if (type == "new") return cont(maybeTarget(noComma));
return cont();
}
function maybeexpression(type) {
@@ -425,6 +441,18 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
findFatArrow(cx.stream, cx.state);
return pass(type == "{" ? statement : expressionNoComma);
}
+ function maybeTarget(noComma) {
+ return function(type) {
+ if (type == ".") return cont(noComma ? targetNoComma : target);
+ else return pass(noComma ? expressionNoComma : expression);
+ };
+ }
+ function target(_, value) {
+ if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); }
+ }
+ function targetNoComma(_, value) {
+ if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); }
+ }
function maybelabel(type) {
if (type == ":") return cont(poplex, statement);
return pass(maybeoperatorComma, expect(";"), poplex);
@@ -442,8 +470,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
return cont(afterprop);
} else if (type == "jsonld-keyword") {
return cont(afterprop);
+ } else if (type == "modifier") {
+ return cont(objprop)
} else if (type == "[") {
return cont(expression, expect("]"), afterprop);
+ } else if (type == "spread") {
+ return cont(expression);
}
}
function getterSetter(type) {
@@ -492,7 +524,9 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
return pass(pattern, maybetype, maybeAssign, vardefCont);
}
function pattern(type, value) {
+ if (type == "modifier") return cont(pattern)
if (type == "variable") { register(value); return cont(); }
+ if (type == "spread") return cont(pattern);
if (type == "[") return contCommasep(pattern, "]");
if (type == "{") return contCommasep(proppattern, "}");
}
@@ -502,6 +536,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
return cont(maybeAssign);
}
if (type == "variable") cx.marked = "property";
+ if (type == "spread") return cont(pattern);
+ if (type == "}") return pass();
return cont(expect(":"), pattern, maybeAssign);
}
function maybeAssign(_type, value) {
@@ -572,10 +608,6 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
cx.marked = "property";
return cont();
}
- function afterModule(type, value) {
- if (type == "string") return cont(statement);
- if (type == "variable") { register(value); return cont(maybeFrom); }
- }
function afterExport(_type, value) {
if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); }
if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); }
@@ -628,7 +660,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false),
localVars: parserConfig.localVars,
context: parserConfig.localVars && {vars: parserConfig.localVars},
- indented: 0
+ indented: basecolumn || 0
};
if (parserConfig.globalVars && typeof parserConfig.globalVars == "object")
state.globalVars = parserConfig.globalVars;
@@ -684,7 +716,13 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
helperType: jsonMode ? "json" : "javascript",
jsonldMode: jsonldMode,
- jsonMode: jsonMode
+ jsonMode: jsonMode,
+
+ expressionAllowed: expressionAllowed,
+ skipExpression: function(state) {
+ var top = state.cc[state.cc.length - 1]
+ if (top == expression || top == expressionNoComma) state.cc.pop()
+ }
};
});
diff --git a/public/vendor/codemirror/mode/javascript/json-ld.html b/public/vendor/codemirror/mode/javascript/json-ld.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/javascript/test.js b/public/vendor/codemirror/mode/javascript/test.js
old mode 100755
new mode 100644
index 092d25dc..cb43d089
--- a/public/vendor/codemirror/mode/javascript/test.js
+++ b/public/vendor/codemirror/mode/javascript/test.js
@@ -6,7 +6,7 @@
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
MT("locals",
- "[keyword function] [variable foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }");
+ "[keyword function] [def foo]([def a], [def b]) { [keyword var] [def c] [operator =] [number 10]; [keyword return] [variable-2 a] [operator +] [variable-2 c] [operator +] [variable d]; }");
MT("comma-and-binop",
"[keyword function](){ [keyword var] [def x] [operator =] [number 1] [operator +] [number 2], [def y]; }");
@@ -17,8 +17,12 @@
" [[[variable-2 c], [variable y] ]] [operator =] [variable-2 c];",
"})();");
+ MT("destructure_trailing_comma",
+ "[keyword let] {[def a], [def b],} [operator =] [variable foo];",
+ "[keyword let] [def c];"); // Parser still in good state?
+
MT("class_body",
- "[keyword class] [variable Foo] {",
+ "[keyword class] [def Foo] {",
" [property constructor]() {}",
" [property sayName]() {",
" [keyword return] [string-2 `foo${][variable foo][string-2 }oo`];",
@@ -26,7 +30,7 @@
"}");
MT("class",
- "[keyword class] [variable Point] [keyword extends] [variable SuperThing] {",
+ "[keyword class] [def Point] [keyword extends] [variable SuperThing] {",
" [property get] [property prop]() { [keyword return] [number 24]; }",
" [property constructor]([def x], [def y]) {",
" [keyword super]([string 'something']);",
@@ -34,52 +38,45 @@
" }",
"}");
- MT("module",
- "[keyword module] [string 'foo'] {",
- " [keyword export] [keyword let] [def x] [operator =] [number 42];",
- " [keyword export] [keyword *] [keyword from] [string 'somewhere'];",
- "}");
-
MT("import",
- "[keyword function] [variable foo]() {",
+ "[keyword function] [def foo]() {",
" [keyword import] [def $] [keyword from] [string 'jquery'];",
- " [keyword module] [def crypto] [keyword from] [string 'crypto'];",
" [keyword import] { [def encrypt], [def decrypt] } [keyword from] [string 'crypto'];",
"}");
MT("const",
- "[keyword function] [variable f]() {",
+ "[keyword function] [def f]() {",
" [keyword const] [[ [def a], [def b] ]] [operator =] [[ [number 1], [number 2] ]];",
"}");
MT("for/of",
- "[keyword for]([keyword let] [variable of] [keyword of] [variable something]) {}");
+ "[keyword for]([keyword let] [def of] [keyword of] [variable something]) {}");
MT("generator",
- "[keyword function*] [variable repeat]([def n]) {",
+ "[keyword function*] [def repeat]([def n]) {",
" [keyword for]([keyword var] [def i] [operator =] [number 0]; [variable-2 i] [operator <] [variable-2 n]; [operator ++][variable-2 i])",
" [keyword yield] [variable-2 i];",
"}");
MT("quotedStringAddition",
- "[keyword let] [variable f] [operator =] [variable a] [operator +] [string 'fatarrow'] [operator +] [variable c];");
+ "[keyword let] [def f] [operator =] [variable a] [operator +] [string 'fatarrow'] [operator +] [variable c];");
MT("quotedFatArrow",
- "[keyword let] [variable f] [operator =] [variable a] [operator +] [string '=>'] [operator +] [variable c];");
+ "[keyword let] [def f] [operator =] [variable a] [operator +] [string '=>'] [operator +] [variable c];");
MT("fatArrow",
"[variable array].[property filter]([def a] [operator =>] [variable-2 a] [operator +] [number 1]);",
"[variable a];", // No longer in scope
- "[keyword let] [variable f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];",
+ "[keyword let] [def f] [operator =] ([[ [def a], [def b] ]], [def c]) [operator =>] [variable-2 a] [operator +] [variable-2 c];",
"[variable c];");
MT("spread",
- "[keyword function] [variable f]([def a], [meta ...][def b]) {",
+ "[keyword function] [def f]([def a], [meta ...][def b]) {",
" [variable something]([variable-2 a], [meta ...][variable-2 b]);",
"}");
MT("comprehension",
- "[keyword function] [variable f]() {",
+ "[keyword function] [def f]() {",
" [[([variable x] [operator +] [number 1]) [keyword for] ([keyword var] [def x] [keyword in] [variable y]) [keyword if] [variable pred]([variable-2 x]) ]];",
" ([variable u] [keyword for] ([keyword var] [def u] [keyword of] [variable generateValues]()) [keyword if] ([variable-2 u].[property color] [operator ===] [string 'blue']));",
"}");
@@ -91,7 +88,7 @@
"[variable x] [operator =] [string-2 `fofdlakj${][variable x] [operator +] [string-2 `foo`] [operator +] [number 1][string-2 }fdsa`] [operator +] [number 2]");
MT("indent_statement",
- "[keyword var] [variable x] [operator =] [number 10]",
+ "[keyword var] [def x] [operator =] [number 10]",
"[variable x] [operator +=] [variable y] [operator +]",
" [atom Infinity]",
"[keyword debugger];");
@@ -112,14 +109,14 @@
"}");
MT("indent_for",
- "[keyword for] ([keyword var] [variable i] [operator =] [number 0];",
+ "[keyword for] ([keyword var] [def i] [operator =] [number 0];",
" [variable i] [operator <] [number 100];",
" [variable i][operator ++])",
" [variable doSomething]([variable i]);",
"[keyword debugger];");
MT("indent_c_style",
- "[keyword function] [variable foo]()",
+ "[keyword function] [def foo]()",
"{",
" [keyword debugger];",
"}");
@@ -147,24 +144,32 @@
"[number 2];");
MT("multilinestring",
- "[keyword var] [variable x] [operator =] [string 'foo\\]",
+ "[keyword var] [def x] [operator =] [string 'foo\\]",
"[string bar'];");
MT("scary_regexp",
"[string-2 /foo[[/]]bar/];");
MT("indent_strange_array",
- "[keyword var] [variable x] [operator =] [[",
+ "[keyword var] [def x] [operator =] [[",
" [number 1],,",
" [number 2],",
"]];",
"[number 10];");
MT("param_default",
- "[keyword function] [variable foo]([def x] [operator =] [string-2 `foo${][number 10][string-2 }bar`]) {",
+ "[keyword function] [def foo]([def x] [operator =] [string-2 `foo${][number 10][string-2 }bar`]) {",
" [keyword return] [variable-2 x];",
"}");
+ MT("new_target",
+ "[keyword function] [def F]([def target]) {",
+ " [keyword if] ([variable-2 target] [operator &&] [keyword new].[keyword target].[property name]) {",
+ " [keyword return] [keyword new]",
+ " .[keyword target];",
+ " }",
+ "}");
+
var jsonld_mode = CodeMirror.getMode(
{indentUnit: 2},
{name: "javascript", jsonld: true}
diff --git a/public/vendor/codemirror/mode/javascript/typescript.html b/public/vendor/codemirror/mode/javascript/typescript.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/jinja2/index.html b/public/vendor/codemirror/mode/jinja2/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/jinja2/jinja2.js b/public/vendor/codemirror/mode/jinja2/jinja2.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/jsx/index.html b/public/vendor/codemirror/mode/jsx/index.html
new file mode 100644
index 00000000..cb51edb3
--- /dev/null
+++ b/public/vendor/codemirror/mode/jsx/index.html
@@ -0,0 +1,89 @@
+
+
+CodeMirror: JSX mode
+
+
+
+
+
+
+
+
+
+
+
+
+JSX mode
+
+
+
+
+
+JSX Mode for React's
+JavaScript syntax extension.
+
+MIME types defined: text/jsx
.
+
+
diff --git a/public/vendor/codemirror/mode/jsx/jsx.js b/public/vendor/codemirror/mode/jsx/jsx.js
new file mode 100644
index 00000000..bc2ea797
--- /dev/null
+++ b/public/vendor/codemirror/mode/jsx/jsx.js
@@ -0,0 +1,147 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"))
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript"], mod)
+ else // Plain browser env
+ mod(CodeMirror)
+})(function(CodeMirror) {
+ "use strict"
+
+ // Depth means the amount of open braces in JS context, in XML
+ // context 0 means not in tag, 1 means in tag, and 2 means in tag
+ // and js block comment.
+ function Context(state, mode, depth, prev) {
+ this.state = state; this.mode = mode; this.depth = depth; this.prev = prev
+ }
+
+ function copyContext(context) {
+ return new Context(CodeMirror.copyState(context.mode, context.state),
+ context.mode,
+ context.depth,
+ context.prev && copyContext(context.prev))
+ }
+
+ CodeMirror.defineMode("jsx", function(config) {
+ var xmlMode = CodeMirror.getMode(config, {name: "xml", allowMissing: true, multilineTagIndentPastTag: false})
+ var jsMode = CodeMirror.getMode(config, "javascript")
+
+ function flatXMLIndent(state) {
+ var tagName = state.tagName
+ state.tagName = null
+ var result = xmlMode.indent(state, "")
+ state.tagName = tagName
+ return result
+ }
+
+ function token(stream, state) {
+ if (state.context.mode == xmlMode)
+ return xmlToken(stream, state, state.context)
+ else
+ return jsToken(stream, state, state.context)
+ }
+
+ function xmlToken(stream, state, cx) {
+ if (cx.depth == 2) { // Inside a JS /* */ comment
+ if (stream.match(/^.*?\*\//)) cx.depth = 1
+ else stream.skipToEnd()
+ return "comment"
+ }
+
+ if (stream.peek() == "{") {
+ xmlMode.skipAttribute(cx.state)
+
+ var indent = flatXMLIndent(cx.state), xmlContext = cx.state.context
+ // If JS starts on same line as tag
+ if (xmlContext && stream.match(/^[^>]*>\s*$/, false)) {
+ while (xmlContext.prev && !xmlContext.startOfLine)
+ xmlContext = xmlContext.prev
+ // If tag starts the line, use XML indentation level
+ if (xmlContext.startOfLine) indent -= config.indentUnit
+ // Else use JS indentation level
+ else if (cx.prev.state.lexical) indent = cx.prev.state.lexical.indented
+ // Else if inside of tag
+ } else if (cx.depth == 1) {
+ indent += config.indentUnit
+ }
+
+ state.context = new Context(CodeMirror.startState(jsMode, indent),
+ jsMode, 0, state.context)
+ return null
+ }
+
+ if (cx.depth == 1) { // Inside of tag
+ if (stream.peek() == "<") { // Tag inside of tag
+ xmlMode.skipAttribute(cx.state)
+ state.context = new Context(CodeMirror.startState(xmlMode, flatXMLIndent(cx.state)),
+ xmlMode, 0, state.context)
+ return null
+ } else if (stream.match("//")) {
+ stream.skipToEnd()
+ return "comment"
+ } else if (stream.match("/*")) {
+ cx.depth = 2
+ return token(stream, state)
+ }
+ }
+
+ var style = xmlMode.token(stream, cx.state), cur = stream.current(), stop
+ if (/\btag\b/.test(style)) {
+ if (/>$/.test(cur)) {
+ if (cx.state.context) cx.depth = 0
+ else state.context = state.context.prev
+ } else if (/^ -1) {
+ stream.backUp(cur.length - stop)
+ }
+ return style
+ }
+
+ function jsToken(stream, state, cx) {
+ if (stream.peek() == "<" && jsMode.expressionAllowed(stream, cx.state)) {
+ jsMode.skipExpression(cx.state)
+ state.context = new Context(CodeMirror.startState(xmlMode, jsMode.indent(cx.state, "")),
+ xmlMode, 0, state.context)
+ return null
+ }
+
+ var style = jsMode.token(stream, cx.state)
+ if (!style && cx.depth != null) {
+ var cur = stream.current()
+ if (cur == "{") {
+ cx.depth++
+ } else if (cur == "}") {
+ if (--cx.depth == 0) state.context = state.context.prev
+ }
+ }
+ return style
+ }
+
+ return {
+ startState: function() {
+ return {context: new Context(CodeMirror.startState(jsMode), jsMode)}
+ },
+
+ copyState: function(state) {
+ return {context: copyContext(state.context)}
+ },
+
+ token: token,
+
+ indent: function(state, textAfter, fullLine) {
+ return state.context.mode.indent(state.context.state, textAfter, fullLine)
+ },
+
+ innerMode: function(state) {
+ return state.context
+ }
+ }
+ }, "xml", "javascript")
+
+ CodeMirror.defineMIME("text/jsx", "jsx")
+})
diff --git a/public/vendor/codemirror/mode/jsx/test.js b/public/vendor/codemirror/mode/jsx/test.js
new file mode 100644
index 00000000..c54a8b24
--- /dev/null
+++ b/public/vendor/codemirror/mode/jsx/test.js
@@ -0,0 +1,69 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function() {
+ var mode = CodeMirror.getMode({indentUnit: 2}, "jsx")
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)) }
+
+ MT("selfclose",
+ "[keyword var] [def x] [operator =] [bracket&tag <] [tag foo] [bracket&tag />] [operator +] [number 1];")
+
+ MT("openclose",
+ "([bracket&tag <][tag foo][bracket&tag >]hello [atom &][bracket&tag ][tag foo][bracket&tag >][operator ++])")
+
+ MT("attr",
+ "([bracket&tag <][tag foo] [attribute abc]=[string 'value'][bracket&tag >]hello [atom &][bracket&tag ][tag foo][bracket&tag >][operator ++])")
+
+ MT("braced_attr",
+ "([bracket&tag <][tag foo] [attribute abc]={[number 10]}[bracket&tag >]hello [atom &][bracket&tag ][tag foo][bracket&tag >][operator ++])")
+
+ MT("braced_text",
+ "([bracket&tag <][tag foo][bracket&tag >]hello {[number 10]} [atom &][bracket&tag ][tag foo][bracket&tag >][operator ++])")
+
+ MT("nested_tag",
+ "([bracket&tag <][tag foo][bracket&tag ><][tag bar][bracket&tag >][tag bar][bracket&tag >][tag foo][bracket&tag >][operator ++])")
+
+ MT("nested_jsx",
+ "[keyword return] (",
+ " [bracket&tag <][tag foo][bracket&tag >]",
+ " say {[number 1] [operator +] [bracket&tag <][tag bar] [attribute attr]={[number 10]}[bracket&tag />]}!",
+ " [bracket&tag ][tag foo][bracket&tag >][operator ++]",
+ ")")
+
+ MT("preserve_js_context",
+ "[variable x] [operator =] [string-2 `quasi${][bracket&tag <][tag foo][bracket&tag />][string-2 }quoted`]")
+
+ MT("line_comment",
+ "([bracket&tag <][tag foo] [comment // hello]",
+ " [bracket&tag >][tag foo][bracket&tag >][operator ++])")
+
+ MT("line_comment_not_in_tag",
+ "([bracket&tag <][tag foo][bracket&tag >] // hello",
+ " [bracket&tag ][tag foo][bracket&tag >][operator ++])")
+
+ MT("block_comment",
+ "([bracket&tag <][tag foo] [comment /* hello]",
+ "[comment line 2]",
+ "[comment line 3 */] [bracket&tag >][tag foo][bracket&tag >][operator ++])")
+
+ MT("block_comment_not_in_tag",
+ "([bracket&tag <][tag foo][bracket&tag >]/* hello",
+ " line 2",
+ " line 3 */ [bracket&tag ][tag foo][bracket&tag >][operator ++])")
+
+ MT("missing_attr",
+ "([bracket&tag <][tag foo] [attribute selected][bracket&tag />][operator ++])")
+
+ MT("indent_js",
+ "([bracket&tag <][tag foo][bracket&tag >]",
+ " [bracket&tag <][tag bar] [attribute baz]={[keyword function]() {",
+ " [keyword return] [number 10]",
+ " }}[bracket&tag />]",
+ " [bracket&tag ][tag foo][bracket&tag >])")
+
+ MT("spread",
+ "([bracket&tag <][tag foo] [attribute bar]={[meta ...][variable baz] [operator /][number 2]}[bracket&tag />])")
+
+ MT("tag_attribute",
+ "([bracket&tag <][tag foo] [attribute bar]=[bracket&tag <][tag foo][bracket&tag />/>][operator ++])")
+})()
diff --git a/public/vendor/codemirror/mode/julia/index.html b/public/vendor/codemirror/mode/julia/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/julia/julia.js b/public/vendor/codemirror/mode/julia/julia.js
old mode 100755
new mode 100644
index d0a74cef..4471896b
--- a/public/vendor/codemirror/mode/julia/julia.js
+++ b/public/vendor/codemirror/mode/julia/julia.js
@@ -18,35 +18,34 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
return new RegExp("^((" + words.join(")|(") + "))\\b");
}
- var operators = parserConf.operators || /^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b/;
+ var operators = parserConf.operators || /^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b(?!\()|[\u2208\u2209](?!\()/;
var delimiters = parserConf.delimiters || /^[;,()[\]{}]/;
- var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/;
+ var identifiers = parserConf.identifiers || /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/;
var blockOpeners = ["begin", "function", "type", "immutable", "let", "macro", "for", "while", "quote", "if", "else", "elseif", "try", "finally", "catch", "do"];
var blockClosers = ["end", "else", "elseif", "catch", "finally"];
- var keywordList = ['if', 'else', 'elseif', 'while', 'for', 'begin', 'let', 'end', 'do', 'try', 'catch', 'finally', 'return', 'break', 'continue', 'global', 'local', 'const', 'export', 'import', 'importall', 'using', 'function', 'macro', 'module', 'baremodule', 'type', 'immutable', 'quote', 'typealias', 'abstract', 'bitstype', 'ccall'];
- var builtinList = ['true', 'false', 'enumerate', 'open', 'close', 'nothing', 'NaN', 'Inf', 'print', 'println', 'Int', 'Int8', 'Uint8', 'Int16', 'Uint16', 'Int32', 'Uint32', 'Int64', 'Uint64', 'Int128', 'Uint128', 'Bool', 'Char', 'Float16', 'Float32', 'Float64', 'Array', 'Vector', 'Matrix', 'String', 'UTF8String', 'ASCIIString', 'error', 'warn', 'info', '@printf'];
+ var keywordList = ['if', 'else', 'elseif', 'while', 'for', 'begin', 'let', 'end', 'do', 'try', 'catch', 'finally', 'return', 'break', 'continue', 'global', 'local', 'const', 'export', 'import', 'importall', 'using', 'function', 'macro', 'module', 'baremodule', 'type', 'immutable', 'quote', 'typealias', 'abstract', 'bitstype'];
+ var builtinList = ['true', 'false', 'nothing', 'NaN', 'Inf'];
//var stringPrefixes = new RegExp("^[br]?('|\")")
- var stringPrefixes = /^(`|'|"{3}|([br]?"))/;
+ var stringPrefixes = /^(`|'|"{3}|([brv]?"))/;
var keywords = wordRegexp(keywordList);
var builtins = wordRegexp(builtinList);
var openers = wordRegexp(blockOpeners);
var closers = wordRegexp(blockClosers);
var macro = /^@[_A-Za-z][_A-Za-z0-9]*/;
- var symbol = /^:[_A-Za-z][_A-Za-z0-9]*/;
+ var symbol = /^:[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/;
+ var typeAnnotation = /^::[^.,;"{()=$\s]+({[^}]*}+)*/;
- function in_array(state) {
- var ch = cur_scope(state);
- if(ch=="[" || ch=="{") {
+ function inArray(state) {
+ var ch = currentScope(state);
+ if (ch == '[') {
return true;
}
- else {
- return false;
- }
+ return false;
}
- function cur_scope(state) {
- if(state.scopes.length==0) {
+ function currentScope(state) {
+ if (state.scopes.length == 0) {
return null;
}
return state.scopes[state.scopes.length - 1];
@@ -54,20 +53,34 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
// tokenizers
function tokenBase(stream, state) {
+ //Handle multiline comments
+ if (stream.match(/^#=\s*/)) {
+ state.scopes.push('#=');
+ }
+ if (currentScope(state) == '#=' && stream.match(/^=#/)) {
+ state.scopes.pop();
+ return 'comment';
+ }
+ if (state.scopes.indexOf('#=') >= 0) {
+ if (!stream.match(/.*?(?=(#=|=#))/)) {
+ stream.skipToEnd();
+ }
+ return 'comment';
+ }
+
// Handle scope changes
- var leaving_expr = state.leaving_expr;
- if(stream.sol()) {
- leaving_expr = false;
+ var leavingExpr = state.leavingExpr;
+ if (stream.sol()) {
+ leavingExpr = false;
}
- state.leaving_expr = false;
- if(leaving_expr) {
- if(stream.match(/^'+/)) {
+ state.leavingExpr = false;
+ if (leavingExpr) {
+ if (stream.match(/^'+/)) {
return 'operator';
}
-
}
- if(stream.match(/^\.{2,3}/)) {
+ if (stream.match(/^\.{2,3}/)) {
return 'operator';
}
@@ -76,56 +89,51 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
}
var ch = stream.peek();
- // Handle Comments
+
+ // Handle single line comments
if (ch === '#') {
- stream.skipToEnd();
- return 'comment';
- }
- if(ch==='[') {
- state.scopes.push("[");
+ stream.skipToEnd();
+ return 'comment';
}
- if(ch==='{') {
- state.scopes.push("{");
+ if (ch === '[') {
+ state.scopes.push('[');
}
- var scope=cur_scope(state);
+ var scope = currentScope(state);
- if(scope==='[' && ch===']') {
+ if (scope == '[' && ch === ']') {
state.scopes.pop();
- state.leaving_expr=true;
+ state.leavingExpr = true;
}
- if(scope==='{' && ch==='}') {
+ if (scope == '(' && ch === ')') {
state.scopes.pop();
- state.leaving_expr=true;
- }
-
- if(ch===')') {
- state.leaving_expr = true;
+ state.leavingExpr = true;
}
var match;
- if(!in_array(state) && (match=stream.match(openers, false))) {
+ if (!inArray(state) && (match=stream.match(openers, false))) {
state.scopes.push(match);
}
- if(!in_array(state) && stream.match(closers, false)) {
+ if (!inArray(state) && stream.match(closers, false)) {
state.scopes.pop();
}
- if(in_array(state)) {
- if(stream.match(/^end/)) {
+ if (inArray(state)) {
+ if (state.lastToken == 'end' && stream.match(/^:/)) {
+ return 'operator';
+ }
+ if (stream.match(/^end/)) {
return 'number';
}
-
}
- if(stream.match(/^=>/)) {
+ if (stream.match(/^=>/)) {
return 'operator';
}
-
// Handle Number Literals
if (stream.match(/^[0-9\.]/, false)) {
var imMatcher = RegExp(/^im\b/);
@@ -134,10 +142,11 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
if (stream.match(/^\d*\.(?!\.)\d+([ef][\+\-]?\d+)?/i)) { floatLiteral = true; }
if (stream.match(/^\d+\.(?!\.)\d*/)) { floatLiteral = true; }
if (stream.match(/^\.\d+/)) { floatLiteral = true; }
+ if (stream.match(/^0x\.[0-9a-f]+p[\+\-]?\d+/i)) { floatLiteral = true; }
if (floatLiteral) {
// Float literals may be "imaginary"
stream.match(imMatcher);
- state.leaving_expr = true;
+ state.leavingExpr = true;
return 'number';
}
// Integers
@@ -157,18 +166,27 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
if (intLiteral) {
// Integer literals may be "long"
stream.match(imMatcher);
- state.leaving_expr = true;
+ state.leavingExpr = true;
return 'number';
}
}
- if(stream.match(/^(::)|(<:)/)) {
+ if (stream.match(/^<:/)) {
return 'operator';
}
+ if (stream.match(typeAnnotation)) {
+ return 'builtin';
+ }
+
// Handle symbols
- if(!leaving_expr && stream.match(symbol)) {
- return 'string';
+ if (!leavingExpr && stream.match(symbol) || stream.match(/:\./)) {
+ return 'builtin';
+ }
+
+ // Handle parametric types
+ if (stream.match(/^{[^}]*}(?=\()/)) {
+ return 'builtin';
}
// Handle operators and Delimiters
@@ -176,7 +194,6 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
return 'operator';
}
-
// Handle Strings
if (stream.match(stringPrefixes)) {
state.tokenize = tokenStringFactory(stream.current());
@@ -187,7 +204,6 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
return 'meta';
}
-
if (stream.match(delimiters)) {
return null;
}
@@ -200,21 +216,74 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
return 'builtin';
}
+ var isDefinition = state.isDefinition ||
+ state.lastToken == 'function' ||
+ state.lastToken == 'macro' ||
+ state.lastToken == 'type' ||
+ state.lastToken == 'immutable';
if (stream.match(identifiers)) {
- state.leaving_expr=true;
+ if (isDefinition) {
+ if (stream.peek() === '.') {
+ state.isDefinition = true;
+ return 'variable';
+ }
+ state.isDefinition = false;
+ return 'def';
+ }
+ if (stream.match(/^({[^}]*})*\(/, false)) {
+ return callOrDef(stream, state);
+ }
+ state.leavingExpr = true;
return 'variable';
}
+
// Handle non-detected items
stream.next();
return ERRORCLASS;
}
+ function callOrDef(stream, state) {
+ var match = stream.match(/^(\(\s*)/);
+ if (match) {
+ if (state.firstParenPos < 0)
+ state.firstParenPos = state.scopes.length;
+ state.scopes.push('(');
+ state.charsAdvanced += match[1].length;
+ }
+ if (currentScope(state) == '(' && stream.match(/^\)/)) {
+ state.scopes.pop();
+ state.charsAdvanced += 1;
+ if (state.scopes.length <= state.firstParenPos) {
+ var isDefinition = stream.match(/^\s*?=(?!=)/, false);
+ stream.backUp(state.charsAdvanced);
+ state.firstParenPos = -1;
+ state.charsAdvanced = 0;
+ if (isDefinition)
+ return 'def';
+ return 'builtin';
+ }
+ }
+ // Unfortunately javascript does not support multiline strings, so we have
+ // to undo anything done upto here if a function call or definition splits
+ // over two or more lines.
+ if (stream.match(/^$/g, false)) {
+ stream.backUp(state.charsAdvanced);
+ while (state.scopes.length > state.firstParenPos + 1)
+ state.scopes.pop();
+ state.firstParenPos = -1;
+ state.charsAdvanced = 0;
+ return 'builtin';
+ }
+ state.charsAdvanced += stream.match(/^([^()]*)/)[1].length;
+ return callOrDef(stream, state);
+ }
+
function tokenStringFactory(delimiter) {
- while ('rub'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) {
+ while ('bruv'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) {
delimiter = delimiter.substr(1);
}
- var singleline = delimiter.length == 1;
+ var singleline = delimiter == "'";
var OUTCLASS = 'string';
function tokenString(stream, state) {
@@ -245,45 +314,41 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
return tokenString;
}
- function tokenLexer(stream, state) {
- var style = state.tokenize(stream, state);
- var current = stream.current();
-
- // Handle '.' connected identifiers
- if (current === '.') {
- style = stream.match(identifiers, false) ? null : ERRORCLASS;
- if (style === null && state.lastStyle === 'meta') {
- // Apply 'meta' style to '.' connected identifiers when
- // appropriate.
- style = 'meta';
- }
- return style;
- }
-
- return style;
- }
-
var external = {
startState: function() {
return {
tokenize: tokenBase,
scopes: [],
- leaving_expr: false
+ lastToken: null,
+ leavingExpr: false,
+ isDefinition: false,
+ charsAdvanced: 0,
+ firstParenPos: -1
};
},
token: function(stream, state) {
- var style = tokenLexer(stream, state);
- state.lastStyle = style;
+ var style = state.tokenize(stream, state);
+ var current = stream.current();
+
+ if (current && style) {
+ state.lastToken = current;
+ }
+
+ // Handle '.' connected identifiers
+ if (current === '.') {
+ style = stream.match(identifiers, false) || stream.match(macro, false) ||
+ stream.match(/\(/, false) ? 'operator' : ERRORCLASS;
+ }
return style;
},
indent: function(state, textAfter) {
var delta = 0;
- if(textAfter=="end" || textAfter=="]" || textAfter=="}" || textAfter=="else" || textAfter=="elseif" || textAfter=="catch" || textAfter=="finally") {
+ if (textAfter == "end" || textAfter == "]" || textAfter == "}" || textAfter == "else" || textAfter == "elseif" || textAfter == "catch" || textAfter == "finally") {
delta = -1;
}
- return (state.scopes.length + delta) * 4;
+ return (state.scopes.length + delta) * _conf.indentUnit;
},
lineComment: "#",
diff --git a/public/vendor/codemirror/mode/kotlin/index.html b/public/vendor/codemirror/mode/kotlin/index.html
deleted file mode 100755
index 859e109f..00000000
--- a/public/vendor/codemirror/mode/kotlin/index.html
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-CodeMirror: Kotlin mode
-
-
-
-
-
-
-
-
-
-
-Kotlin mode
-
-
-
-
-
- Mode for Kotlin (http://kotlin.jetbrains.org/)
- Developed by Hadi Hariri (https://github.com/hhariri).
- MIME type defined: text/x-kotlin
.
-
diff --git a/public/vendor/codemirror/mode/kotlin/kotlin.js b/public/vendor/codemirror/mode/kotlin/kotlin.js
deleted file mode 100755
index e9a6a94e..00000000
--- a/public/vendor/codemirror/mode/kotlin/kotlin.js
+++ /dev/null
@@ -1,284 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function(mod) {
- if (typeof exports == "object" && typeof module == "object") // CommonJS
- mod(require("../../lib/codemirror"));
- else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror"], mod);
- else // Plain browser env
- mod(CodeMirror);
-})(function(CodeMirror) {
-"use strict";
-
-CodeMirror.defineMode("kotlin", function (config, parserConfig) {
- function words(str) {
- var obj = {}, words = str.split(" ");
- for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
- return obj;
- }
-
- var multiLineStrings = parserConfig.multiLineStrings;
-
- var keywords = words(
- "package continue return object while break class data trait interface throw super" +
- " when type this else This try val var fun for is in if do as true false null get set");
- var softKeywords = words("import" +
- " where by get set abstract enum open annotation override private public internal" +
- " protected catch out vararg inline finally final ref");
- var blockKeywords = words("catch class do else finally for if where try while enum");
- var atoms = words("null true false this");
-
- var curPunc;
-
- function tokenBase(stream, state) {
- var ch = stream.next();
- if (ch == '"' || ch == "'") {
- return startString(ch, stream, state);
- }
- // Wildcard import w/o trailing semicolon (import smth.*)
- if (ch == "." && stream.eat("*")) {
- return "word";
- }
- if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
- curPunc = ch;
- return null;
- }
- if (/\d/.test(ch)) {
- if (stream.eat(/eE/)) {
- stream.eat(/\+\-/);
- stream.eatWhile(/\d/);
- }
- return "number";
- }
- if (ch == "/") {
- if (stream.eat("*")) {
- state.tokenize.push(tokenComment);
- return tokenComment(stream, state);
- }
- if (stream.eat("/")) {
- stream.skipToEnd();
- return "comment";
- }
- if (expectExpression(state.lastToken)) {
- return startString(ch, stream, state);
- }
- }
- // Commented
- if (ch == "-" && stream.eat(">")) {
- curPunc = "->";
- return null;
- }
- if (/[\-+*&%=<>!?|\/~]/.test(ch)) {
- stream.eatWhile(/[\-+*&%=<>|~]/);
- return "operator";
- }
- stream.eatWhile(/[\w\$_]/);
-
- var cur = stream.current();
- if (atoms.propertyIsEnumerable(cur)) {
- return "atom";
- }
- if (softKeywords.propertyIsEnumerable(cur)) {
- if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
- return "softKeyword";
- }
-
- if (keywords.propertyIsEnumerable(cur)) {
- if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
- return "keyword";
- }
- return "word";
- }
-
- tokenBase.isBase = true;
-
- function startString(quote, stream, state) {
- var tripleQuoted = false;
- if (quote != "/" && stream.eat(quote)) {
- if (stream.eat(quote)) tripleQuoted = true;
- else return "string";
- }
- function t(stream, state) {
- var escaped = false, next, end = !tripleQuoted;
-
- while ((next = stream.next()) != null) {
- if (next == quote && !escaped) {
- if (!tripleQuoted) {
- break;
- }
- if (stream.match(quote + quote)) {
- end = true;
- break;
- }
- }
-
- if (quote == '"' && next == "$" && !escaped && stream.eat("{")) {
- state.tokenize.push(tokenBaseUntilBrace());
- return "string";
- }
-
- if (next == "$" && !escaped && !stream.eat(" ")) {
- state.tokenize.push(tokenBaseUntilSpace());
- return "string";
- }
- escaped = !escaped && next == "\\";
- }
- if (multiLineStrings)
- state.tokenize.push(t);
- if (end) state.tokenize.pop();
- return "string";
- }
-
- state.tokenize.push(t);
- return t(stream, state);
- }
-
- function tokenBaseUntilBrace() {
- var depth = 1;
-
- function t(stream, state) {
- if (stream.peek() == "}") {
- depth--;
- if (depth == 0) {
- state.tokenize.pop();
- return state.tokenize[state.tokenize.length - 1](stream, state);
- }
- } else if (stream.peek() == "{") {
- depth++;
- }
- return tokenBase(stream, state);
- }
-
- t.isBase = true;
- return t;
- }
-
- function tokenBaseUntilSpace() {
- function t(stream, state) {
- if (stream.eat(/[\w]/)) {
- var isWord = stream.eatWhile(/[\w]/);
- if (isWord) {
- state.tokenize.pop();
- return "word";
- }
- }
- state.tokenize.pop();
- return "string";
- }
-
- t.isBase = true;
- return t;
- }
-
- function tokenComment(stream, state) {
- var maybeEnd = false, ch;
- while (ch = stream.next()) {
- if (ch == "/" && maybeEnd) {
- state.tokenize.pop();
- break;
- }
- maybeEnd = (ch == "*");
- }
- return "comment";
- }
-
- function expectExpression(last) {
- return !last || last == "operator" || last == "->" || /[\.\[\{\(,;:]/.test(last) ||
- last == "newstatement" || last == "keyword" || last == "proplabel";
- }
-
- function Context(indented, column, type, align, prev) {
- this.indented = indented;
- this.column = column;
- this.type = type;
- this.align = align;
- this.prev = prev;
- }
-
- function pushContext(state, col, type) {
- return state.context = new Context(state.indented, col, type, null, state.context);
- }
-
- function popContext(state) {
- var t = state.context.type;
- if (t == ")" || t == "]" || t == "}")
- state.indented = state.context.indented;
- return state.context = state.context.prev;
- }
-
- // Interface
-
- return {
- startState: function (basecolumn) {
- return {
- tokenize: [tokenBase],
- context: new Context((basecolumn || 0) - config.indentUnit, 0, "top", false),
- indented: 0,
- startOfLine: true,
- lastToken: null
- };
- },
-
- token: function (stream, state) {
- var ctx = state.context;
- if (stream.sol()) {
- if (ctx.align == null) ctx.align = false;
- state.indented = stream.indentation();
- state.startOfLine = true;
- // Automatic semicolon insertion
- if (ctx.type == "statement" && !expectExpression(state.lastToken)) {
- popContext(state);
- ctx = state.context;
- }
- }
- if (stream.eatSpace()) return null;
- curPunc = null;
- var style = state.tokenize[state.tokenize.length - 1](stream, state);
- if (style == "comment") return style;
- if (ctx.align == null) ctx.align = true;
- if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state);
- // Handle indentation for {x -> \n ... }
- else if (curPunc == "->" && ctx.type == "statement" && ctx.prev.type == "}") {
- popContext(state);
- state.context.align = false;
- }
- else if (curPunc == "{") pushContext(state, stream.column(), "}");
- else if (curPunc == "[") pushContext(state, stream.column(), "]");
- else if (curPunc == "(") pushContext(state, stream.column(), ")");
- else if (curPunc == "}") {
- while (ctx.type == "statement") ctx = popContext(state);
- if (ctx.type == "}") ctx = popContext(state);
- while (ctx.type == "statement") ctx = popContext(state);
- }
- else if (curPunc == ctx.type) popContext(state);
- else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement"))
- pushContext(state, stream.column(), "statement");
- state.startOfLine = false;
- state.lastToken = curPunc || style;
- return style;
- },
-
- indent: function (state, textAfter) {
- if (!state.tokenize[state.tokenize.length - 1].isBase) return 0;
- var firstChar = textAfter && textAfter.charAt(0), ctx = state.context;
- if (ctx.type == "statement" && !expectExpression(state.lastToken)) ctx = ctx.prev;
- var closing = firstChar == ctx.type;
- if (ctx.type == "statement") {
- return ctx.indented + (firstChar == "{" ? 0 : config.indentUnit);
- }
- else if (ctx.align) return ctx.column + (closing ? 0 : 1);
- else return ctx.indented + (closing ? 0 : config.indentUnit);
- },
-
- closeBrackets: {triples: "'\""},
- electricChars: "{}",
- blockCommentStart: "/*",
- blockCommentEnd: "*/",
- lineComment: "//"
- };
-});
-
-CodeMirror.defineMIME("text/x-kotlin", "kotlin");
-
-});
diff --git a/public/vendor/codemirror/mode/livescript/index.html b/public/vendor/codemirror/mode/livescript/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/livescript/livescript.js b/public/vendor/codemirror/mode/livescript/livescript.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/lua/index.html b/public/vendor/codemirror/mode/lua/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/lua/lua.js b/public/vendor/codemirror/mode/lua/lua.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/markdown/index.html b/public/vendor/codemirror/mode/markdown/index.html
old mode 100755
new mode 100644
index c3bb8df9..15660c26
--- a/public/vendor/codemirror/mode/markdown/index.html
+++ b/public/vendor/codemirror/mode/markdown/index.html
@@ -350,8 +350,10 @@ Output:
});
- Optionally depends on the XML mode for properly highlighted inline XML blocks.
+ You might want to use the Github-Flavored Markdown mode instead, which adds support for fenced code blocks and a few other things.
+ Optionally depends on the XML mode for properly highlighted inline XML blocks.
+
MIME types defined: text/x-markdown
.
Parsing/Highlighting Tests: normal, verbose.
diff --git a/public/vendor/codemirror/mode/markdown/markdown.js b/public/vendor/codemirror/mode/markdown/markdown.js
old mode 100755
new mode 100644
index bef37b8a..70889205
--- a/public/vendor/codemirror/mode/markdown/markdown.js
+++ b/public/vendor/codemirror/mode/markdown/markdown.js
@@ -39,8 +39,10 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
if (modeCfg.underscoresBreakWords === undefined)
modeCfg.underscoresBreakWords = true;
- // Turn on fenced code blocks? ("```" to start/end)
- if (modeCfg.fencedCodeBlocks === undefined) modeCfg.fencedCodeBlocks = false;
+ // Use `fencedCodeBlocks` to configure fenced code blocks. false to
+ // disable, string to specify a precise regexp that the fence should
+ // match, and true to allow three or more backticks or tildes (as
+ // per CommonMark).
// Turn on task lists? ("- [ ] " and "- [x] ")
if (modeCfg.taskLists === undefined) modeCfg.taskLists = false;
@@ -49,32 +51,46 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
if (modeCfg.strikethrough === undefined)
modeCfg.strikethrough = false;
+ // Allow token types to be overridden by user-provided token types.
+ if (modeCfg.tokenTypeOverrides === undefined)
+ modeCfg.tokenTypeOverrides = {};
+
var codeDepth = 0;
- var header = 'header'
- , code = 'comment'
- , quote = 'quote'
- , list1 = 'variable-2'
- , list2 = 'variable-3'
- , list3 = 'keyword'
- , hr = 'hr'
- , image = 'tag'
- , formatting = 'formatting'
- , linkinline = 'link'
- , linkemail = 'link'
- , linktext = 'link'
- , linkhref = 'string'
- , em = 'em'
- , strong = 'strong'
- , strikethrough = 'strikethrough';
+ var tokenTypes = {
+ header: "header",
+ code: "comment",
+ quote: "quote",
+ list1: "variable-2",
+ list2: "variable-3",
+ list3: "keyword",
+ hr: "hr",
+ image: "tag",
+ formatting: "formatting",
+ linkInline: "link",
+ linkEmail: "link",
+ linkText: "link",
+ linkHref: "string",
+ em: "em",
+ strong: "strong",
+ strikethrough: "strikethrough"
+ };
+
+ for (var tokenType in tokenTypes) {
+ if (tokenTypes.hasOwnProperty(tokenType) && modeCfg.tokenTypeOverrides[tokenType]) {
+ tokenTypes[tokenType] = modeCfg.tokenTypeOverrides[tokenType];
+ }
+ }
var hrRE = /^([*\-_])(?:\s*\1){2,}\s*$/
, ulRE = /^[*\-+]\s+/
, olRE = /^[0-9]+([.)])\s+/
, taskListRE = /^\[(x| )\](?=\s)/ // Must follow ulRE or olRE
- , atxHeaderRE = /^(#+)(?: |$)/
+ , atxHeaderRE = modeCfg.allowAtxHeaderWithoutSpace ? /^(#+)/ : /^(#+)(?: |$)/
, setextHeaderRE = /^ *(?:\={1,}|-{1,})\s*$/
- , textRE = /^[^#!\[\]*_\\<>` "'(~]+/;
+ , textRE = /^[^#!\[\]*_\\<>` "'(~]+/
+ , fencedCodeRE = new RegExp("^(" + (modeCfg.fencedCodeBlocks === true ? "~~~+|```+" : modeCfg.fencedCodeBlocks) +
+ ")[ \\t]*([\\w+#]*)");
function switchInline(stream, state, f) {
state.f = state.inline = f;
@@ -86,6 +102,9 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
return f(stream, state);
}
+ function lineIsEmpty(line) {
+ return !line || !/\S/.test(line.string)
+ }
// Blocks
@@ -110,7 +129,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
state.trailingSpace = 0;
state.trailingSpaceNewLine = false;
// Mark this line as blank
- state.thisLineHasContent = false;
+ state.prevLine = state.thisLine
+ state.thisLine = null
return null;
}
@@ -141,10 +161,10 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
var match = null;
if (state.indentationDiff >= 4) {
stream.skipToEnd();
- if (prevLineIsIndentedCode || !state.prevLineHasContent) {
+ if (prevLineIsIndentedCode || lineIsEmpty(state.prevLine)) {
state.indentation -= 4;
state.indentedCode = true;
- return code;
+ return tokenTypes.code;
} else {
return null;
}
@@ -155,7 +175,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
if (modeCfg.highlightFormatting) state.formatting = "header";
state.f = state.inline;
return getType(state);
- } else if (state.prevLineHasContent && !state.quote && !prevLineIsList && !prevLineIsIndentedCode && (match = stream.match(setextHeaderRE))) {
+ } else if (!lineIsEmpty(state.prevLine) && !state.quote && !prevLineIsList &&
+ !prevLineIsIndentedCode && (match = stream.match(setextHeaderRE))) {
state.header = match[0].charAt(0) == '=' ? 1 : 2;
if (modeCfg.highlightFormatting) state.formatting = "header";
state.f = state.inline;
@@ -169,8 +190,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
return switchInline(stream, state, footnoteLink);
} else if (stream.match(hrRE, true)) {
state.hr = true;
- return hr;
- } else if ((!state.prevLineHasContent || prevLineIsList) && (stream.match(ulRE, false) || stream.match(olRE, false))) {
+ return tokenTypes.hr;
+ } else if ((lineIsEmpty(state.prevLine) || prevLineIsList) && (stream.match(ulRE, false) || stream.match(olRE, false))) {
var listType = null;
if (stream.match(ulRE, true)) {
listType = 'ul';
@@ -178,7 +199,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
stream.match(olRE, true);
listType = 'ol';
}
- state.indentation += 4;
+ state.indentation = stream.column() + stream.current().length;
state.list = true;
state.listDepth++;
if (modeCfg.taskLists && stream.match(taskListRE, false)) {
@@ -187,9 +208,10 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
state.f = state.inline;
if (modeCfg.highlightFormatting) state.formatting = ["list", "list-" + listType];
return getType(state);
- } else if (modeCfg.fencedCodeBlocks && stream.match(/^```[ \t]*([\w+#]*)/, true)) {
+ } else if (modeCfg.fencedCodeBlocks && (match = stream.match(fencedCodeRE, true))) {
+ state.fencedChars = match[1]
// try switching mode
- state.localMode = getMode(RegExp.$1);
+ state.localMode = getMode(match[2]);
if (state.localMode) state.localState = state.localMode.startState();
state.f = state.block = local;
if (modeCfg.highlightFormatting) state.formatting = "code-block";
@@ -202,7 +224,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
function htmlBlock(stream, state) {
var style = htmlMode.token(stream, state.htmlState);
- if ((htmlFound && state.htmlState.tagStart === null && !state.htmlState.context) ||
+ if ((htmlFound && state.htmlState.tagStart === null &&
+ (!state.htmlState.context && state.htmlState.tokenize.isInText)) ||
(state.md_inside && stream.current().indexOf(">") > -1)) {
state.f = inlineNormal;
state.block = blockNormal;
@@ -212,7 +235,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
}
function local(stream, state) {
- if (stream.sol() && stream.match("```", false)) {
+ if (stream.sol() && state.fencedChars && stream.match(state.fencedChars, false)) {
state.localMode = state.localState = null;
state.f = state.block = leavingLocal;
return null;
@@ -220,14 +243,15 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
return state.localMode.token(stream, state.localState);
} else {
stream.skipToEnd();
- return code;
+ return tokenTypes.code;
}
}
function leavingLocal(stream, state) {
- stream.match("```");
+ stream.match(state.fencedChars);
state.block = blockNormal;
state.f = inlineNormal;
+ state.fencedChars = null;
if (modeCfg.highlightFormatting) state.formatting = "code-block";
state.code = true;
var returnType = getType(state);
@@ -240,22 +264,22 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
var styles = [];
if (state.formatting) {
- styles.push(formatting);
+ styles.push(tokenTypes.formatting);
if (typeof state.formatting === "string") state.formatting = [state.formatting];
for (var i = 0; i < state.formatting.length; i++) {
- styles.push(formatting + "-" + state.formatting[i]);
+ styles.push(tokenTypes.formatting + "-" + state.formatting[i]);
if (state.formatting[i] === "header") {
- styles.push(formatting + "-" + state.formatting[i] + "-" + state.header);
+ styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.header);
}
// Add `formatting-quote` and `formatting-quote-#` for blockquotes
// Add `error` instead if the maximum blockquote nesting depth is passed
if (state.formatting[i] === "quote") {
if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) {
- styles.push(formatting + "-" + state.formatting[i] + "-" + state.quote);
+ styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.quote);
} else {
styles.push("error");
}
@@ -273,38 +297,36 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
}
if (state.linkHref) {
- styles.push(linkhref, "url");
+ styles.push(tokenTypes.linkHref, "url");
} else { // Only apply inline styles to non-url text
- if (state.strong) { styles.push(strong); }
- if (state.em) { styles.push(em); }
- if (state.strikethrough) { styles.push(strikethrough); }
-
- if (state.linkText) { styles.push(linktext); }
-
- if (state.code) { styles.push(code); }
+ if (state.strong) { styles.push(tokenTypes.strong); }
+ if (state.em) { styles.push(tokenTypes.em); }
+ if (state.strikethrough) { styles.push(tokenTypes.strikethrough); }
+ if (state.linkText) { styles.push(tokenTypes.linkText); }
+ if (state.code) { styles.push(tokenTypes.code); }
}
- if (state.header) { styles.push(header); styles.push(header + "-" + state.header); }
+ if (state.header) { styles.push(tokenTypes.header, tokenTypes.header + "-" + state.header); }
if (state.quote) {
- styles.push(quote);
+ styles.push(tokenTypes.quote);
// Add `quote-#` where the maximum for `#` is modeCfg.maxBlockquoteDepth
if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) {
- styles.push(quote + "-" + state.quote);
+ styles.push(tokenTypes.quote + "-" + state.quote);
} else {
- styles.push(quote + "-" + modeCfg.maxBlockquoteDepth);
+ styles.push(tokenTypes.quote + "-" + modeCfg.maxBlockquoteDepth);
}
}
if (state.list !== false) {
var listMod = (state.listDepth - 1) % 3;
if (!listMod) {
- styles.push(list1);
+ styles.push(tokenTypes.list1);
} else if (listMod === 1) {
- styles.push(list2);
+ styles.push(tokenTypes.list2);
} else {
- styles.push(list3);
+ styles.push(tokenTypes.list3);
}
}
@@ -360,7 +382,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
stream.next();
if (modeCfg.highlightFormatting) {
var type = getType(state);
- return type ? type + " formatting-escape" : "formatting-escape";
+ var formattingEscape = tokenTypes.formatting + "-escape";
+ return type ? type + " " + formattingEscape : formattingEscape;
}
}
@@ -374,7 +397,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
matchCh = (matchCh+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh;
if (stream.match(new RegExp(regex), true)) {
- return linkhref;
+ return tokenTypes.linkHref;
}
}
@@ -405,7 +428,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
if (ch === '!' && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) {
stream.match(/\[[^\]]*\]/);
state.inline = state.f = linkHref;
- return image;
+ return tokenTypes.image;
}
if (ch === '[' && stream.match(/.*\](\(.*\)| ?\[.*\])/, false)) {
@@ -431,7 +454,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
} else {
type = "";
}
- return type + linkinline;
+ return type + tokenTypes.linkInline;
}
if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, false)) {
@@ -443,15 +466,14 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
} else {
type = "";
}
- return type + linkemail;
+ return type + tokenTypes.linkEmail;
}
- if (ch === '<' && stream.match(/^\w/, false)) {
- if (stream.string.indexOf(">") != -1) {
- var atts = stream.string.substring(1,stream.string.indexOf(">"));
- if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) {
- state.md_inside = true;
- }
+ if (ch === '<' && stream.match(/^(!--|\w)/, false)) {
+ var end = stream.string.indexOf(">", stream.pos);
+ if (end != -1) {
+ var atts = stream.string.substring(stream.start, end);
+ if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) state.md_inside = true;
}
stream.backUp(1);
state.htmlState = CodeMirror.startState(htmlMode);
@@ -553,12 +575,12 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
} else {
type = "";
}
- return type + linkinline;
+ return type + tokenTypes.linkInline;
}
stream.match(/^[^>]+/, true);
- return linkinline;
+ return tokenTypes.linkInline;
}
function linkHref(stream, state) {
@@ -598,7 +620,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
}
function footnoteLink(stream, state) {
- if (stream.match(/^[^\]]*\]:/, false)) {
+ if (stream.match(/^([^\]\\]|\\.)*\]:/, false)) {
state.f = footnoteLinkInside;
stream.next(); // Consume [
if (modeCfg.highlightFormatting) state.formatting = "link";
@@ -617,9 +639,9 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
return returnType;
}
- stream.match(/^[^\]]+/, true);
+ stream.match(/^([^\]\\]|\\.)+/, true);
- return linktext;
+ return tokenTypes.linkText;
}
function footnoteUrl(stream, state) {
@@ -636,7 +658,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true);
}
state.f = state.inline = inlineNormal;
- return linkhref + " url";
+ return tokenTypes.linkHref + " url";
}
var savedInlineRE = [];
@@ -656,8 +678,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
return {
f: blockNormal,
- prevLineHasContent: false,
- thisLineHasContent: false,
+ prevLine: null,
+ thisLine: null,
block: blockNormal,
htmlState: null,
@@ -680,7 +702,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
quote: 0,
trailingSpace: 0,
trailingSpaceNewLine: false,
- strikethrough: false
+ strikethrough: false,
+ fencedChars: null
};
},
@@ -688,8 +711,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
return {
f: s.f,
- prevLineHasContent: s.prevLineHasContent,
- thisLineHasContent: s.thisLineHasContent,
+ prevLine: s.prevLine,
+ thisLine: s.thisLine,
block: s.block,
htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState),
@@ -702,6 +725,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
text: s.text,
formatting: false,
linkTitle: s.linkTitle,
+ code: s.code,
em: s.em,
strong: s.strong,
strikethrough: s.strikethrough,
@@ -714,7 +738,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
indentedCode: s.indentedCode,
trailingSpace: s.trailingSpace,
trailingSpaceNewLine: s.trailingSpaceNewLine,
- md_inside: s.md_inside
+ md_inside: s.md_inside,
+ fencedChars: s.fencedChars
};
},
@@ -723,28 +748,25 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
// Reset state.formatting
state.formatting = false;
- if (stream.sol()) {
- var forceBlankLine = !!state.header || state.hr;
+ if (stream != state.thisLine) {
+ var forceBlankLine = state.header || state.hr;
// Reset state.header and state.hr
state.header = 0;
state.hr = false;
if (stream.match(/^\s*$/, true) || forceBlankLine) {
- state.prevLineHasContent = false;
blankLine(state);
- return forceBlankLine ? this.token(stream, state) : null;
- } else {
- state.prevLineHasContent = state.thisLineHasContent;
- state.thisLineHasContent = true;
+ if (!forceBlankLine) return null
+ state.prevLine = null
}
+ state.prevLine = state.thisLine
+ state.thisLine = stream
+
// Reset state.taskList
state.taskList = false;
- // Reset state.code
- state.code = false;
-
// Reset state.trailingSpace
state.trailingSpace = 0;
state.trailingSpaceNewLine = false;
diff --git a/public/vendor/codemirror/mode/markdown/test.js b/public/vendor/codemirror/mode/markdown/test.js
old mode 100755
new mode 100644
index 7cd0bf4b..6d7829fa
--- a/public/vendor/codemirror/mode/markdown/test.js
+++ b/public/vendor/codemirror/mode/markdown/test.js
@@ -6,6 +6,39 @@
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "markdown", highlightFormatting: true});
function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); }
+ var modeAtxNoSpace = CodeMirror.getMode({tabSize: 4}, {name: "markdown", allowAtxHeaderWithoutSpace: true});
+ function AtxNoSpaceTest(name) { test.mode(name, modeAtxNoSpace, Array.prototype.slice.call(arguments, 1)); }
+ var modeFenced = CodeMirror.getMode({tabSize: 4}, {name: "markdown", fencedCodeBlocks: true});
+ function FencedTest(name) { test.mode(name, modeFenced, Array.prototype.slice.call(arguments, 1)); }
+ var modeOverrideClasses = CodeMirror.getMode({tabsize: 4}, {
+ name: "markdown",
+ strikethrough: true,
+ tokenTypeOverrides: {
+ "header" : "override-header",
+ "code" : "override-code",
+ "quote" : "override-quote",
+ "list1" : "override-list1",
+ "list2" : "override-list2",
+ "list3" : "override-list3",
+ "hr" : "override-hr",
+ "image" : "override-image",
+ "linkInline" : "override-link-inline",
+ "linkEmail" : "override-link-email",
+ "linkText" : "override-link-text",
+ "linkHref" : "override-link-href",
+ "em" : "override-em",
+ "strong" : "override-strong",
+ "strikethrough" : "override-strikethrough"
+ }});
+ function TokenTypeOverrideTest(name) { test.mode(name, modeOverrideClasses, Array.prototype.slice.call(arguments, 1)); }
+ var modeFormattingOverride = CodeMirror.getMode({tabsize: 4}, {
+ name: "markdown",
+ highlightFormatting: true,
+ tokenTypeOverrides: {
+ "formatting" : "override-formatting"
+ }});
+ function FormatTokenTypeOverrideTest(name) { test.mode(name, modeFormattingOverride, Array.prototype.slice.call(arguments, 1)); }
+
FT("formatting_emAsterisk",
"[em&formatting&formatting-em *][em foo][em&formatting&formatting-em *]");
@@ -110,7 +143,7 @@
// Block code using single backtick (shouldn't work)
MT("blockCodeSingleBacktick",
"[comment `]",
- "foo",
+ "[comment foo]",
"[comment `]");
// Unclosed backticks
@@ -173,6 +206,16 @@
MT("noAtxH1WithoutSpace",
"#5 bolt");
+ // CommonMark requires a space after # but most parsers don't
+ AtxNoSpaceTest("atxNoSpaceAllowed_H1NoSpace",
+ "[header&header-1 #foo]");
+
+ AtxNoSpaceTest("atxNoSpaceAllowed_H4NoSpace",
+ "[header&header-4 ####foo]");
+
+ AtxNoSpaceTest("atxNoSpaceAllowed_H1Space",
+ "[header&header-1 # foo]");
+
// Inline styles should be parsed inside headers
MT("atxH1inline",
"[header&header-1 # foo ][header&header-1&em *bar*]");
@@ -498,14 +541,14 @@
"",
" [variable-3 * bar]",
"",
- " [variable-2 hello]"
+ " [variable-3 hello]"
);
MT("listNested",
"[variable-2 * foo]",
"",
" [variable-3 * bar]",
"",
- " [variable-3 * foo]"
+ " [keyword * foo]"
);
// Code followed by text
@@ -653,6 +696,15 @@
"[link [[foo]]:] [string&url http://example.com/]",
"(bar\" hello");
+ MT("labelEscape",
+ "[link [[foo \\]] ]]:] [string&url http://example.com/]");
+
+ MT("labelEscapeColon",
+ "[link [[foo \\]]: bar]]:] [string&url http://example.com/]");
+
+ MT("labelEscapeEnd",
+ "[[foo\\]]: http://example.com/");
+
MT("linkWeb",
"[link ] foo");
@@ -760,16 +812,128 @@
"\\",
"[em *foo*]");
+ // Class override tests
+ TokenTypeOverrideTest("overrideHeader1",
+ "[override-header&override-header-1 # Foo]");
+
+ TokenTypeOverrideTest("overrideHeader2",
+ "[override-header&override-header-2 ## Foo]");
+
+ TokenTypeOverrideTest("overrideHeader3",
+ "[override-header&override-header-3 ### Foo]");
+
+ TokenTypeOverrideTest("overrideHeader4",
+ "[override-header&override-header-4 #### Foo]");
+
+ TokenTypeOverrideTest("overrideHeader5",
+ "[override-header&override-header-5 ##### Foo]");
+
+ TokenTypeOverrideTest("overrideHeader6",
+ "[override-header&override-header-6 ###### Foo]");
+
+ TokenTypeOverrideTest("overrideCode",
+ "[override-code `foo`]");
+
+ TokenTypeOverrideTest("overrideCodeBlock",
+ "[override-code ```]",
+ "[override-code foo]",
+ "[override-code ```]");
+
+ TokenTypeOverrideTest("overrideQuote",
+ "[override-quote&override-quote-1 > foo]",
+ "[override-quote&override-quote-1 > bar]");
+
+ TokenTypeOverrideTest("overrideQuoteNested",
+ "[override-quote&override-quote-1 > foo]",
+ "[override-quote&override-quote-1 >][override-quote&override-quote-2 > bar]",
+ "[override-quote&override-quote-1 >][override-quote&override-quote-2 >][override-quote&override-quote-3 > baz]");
+
+ TokenTypeOverrideTest("overrideLists",
+ "[override-list1 - foo]",
+ "",
+ " [override-list2 + bar]",
+ "",
+ " [override-list3 * baz]",
+ "",
+ " [override-list1 1. qux]",
+ "",
+ " [override-list2 - quux]");
+
+ TokenTypeOverrideTest("overrideHr",
+ "[override-hr * * *]");
+
+ TokenTypeOverrideTest("overrideImage",
+ "[override-image ![[foo]]][override-link-href&url (http://example.com/)]")
+
+ TokenTypeOverrideTest("overrideLinkText",
+ "[override-link-text [[foo]]][override-link-href&url (http://example.com)]");
+
+ TokenTypeOverrideTest("overrideLinkEmailAndInline",
+ "[override-link-email <][override-link-inline foo@example.com>]");
+
+ TokenTypeOverrideTest("overrideEm",
+ "[override-em *foo*]");
+
+ TokenTypeOverrideTest("overrideStrong",
+ "[override-strong **foo**]");
+
+ TokenTypeOverrideTest("overrideStrikethrough",
+ "[override-strikethrough ~~foo~~]");
+
+ FormatTokenTypeOverrideTest("overrideFormatting",
+ "[override-formatting-escape \\*]");
// Tests to make sure GFM-specific things aren't getting through
MT("taskList",
"[variable-2 * [ ]] bar]");
- MT("fencedCodeBlocks",
- "[comment ```]",
+ MT("noFencedCodeBlocks",
+ "~~~",
"foo",
- "[comment ```]");
+ "~~~");
+
+ FencedTest("fencedCodeBlocks",
+ "[comment ```]",
+ "[comment foo]",
+ "[comment ```]",
+ "bar");
+
+ FencedTest("fencedCodeBlocksMultipleChars",
+ "[comment `````]",
+ "[comment foo]",
+ "[comment ```]",
+ "[comment foo]",
+ "[comment `````]",
+ "bar");
+
+ FencedTest("fencedCodeBlocksTildes",
+ "[comment ~~~]",
+ "[comment foo]",
+ "[comment ~~~]",
+ "bar");
+
+ FencedTest("fencedCodeBlocksTildesMultipleChars",
+ "[comment ~~~~~]",
+ "[comment ~~~]",
+ "[comment foo]",
+ "[comment ~~~~~]",
+ "bar");
+
+ FencedTest("fencedCodeBlocksMultipleChars",
+ "[comment `````]",
+ "[comment foo]",
+ "[comment ```]",
+ "[comment foo]",
+ "[comment `````]",
+ "bar");
+
+ FencedTest("fencedCodeBlocksMixed",
+ "[comment ~~~]",
+ "[comment ```]",
+ "[comment foo]",
+ "[comment ~~~]",
+ "bar");
// Tests that require XML mode
diff --git a/public/vendor/codemirror/mode/mathematica/index.html b/public/vendor/codemirror/mode/mathematica/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/mathematica/mathematica.js b/public/vendor/codemirror/mode/mathematica/mathematica.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/meta.js b/public/vendor/codemirror/mode/meta.js
old mode 100755
new mode 100644
index bb30c80f..49520717
--- a/public/vendor/codemirror/mode/meta.js
+++ b/public/vendor/codemirror/mode/meta.js
@@ -14,18 +14,21 @@
CodeMirror.modeInfo = [
{name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]},
{name: "PGP", mimes: ["application/pgp", "application/pgp-keys", "application/pgp-signature"], mode: "asciiarmor", ext: ["pgp"]},
- {name: "ASN.1", mime: "text/x-ttcn-asn", mode: "asn.1", ext: ["asn, asn1"]},
+ {name: "ASN.1", mime: "text/x-ttcn-asn", mode: "asn.1", ext: ["asn", "asn1"]},
{name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i},
+ {name: "Brainfuck", mime: "text/x-brainfuck", mode: "brainfuck", ext: ["b", "bf"]},
{name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h"]},
{name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]},
{name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]},
{name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp"]},
{name: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj"]},
+ {name: "Closure Stylesheets (GSS)", mime: "text/x-gss", mode: "css", ext: ["gss"]},
{name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists.txt$/},
{name: "CoffeeScript", mime: "text/x-coffeescript", mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]},
{name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]},
{name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]},
{name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]},
+ {name: "Crystal", mime: "text/x-crystal", mode: "crystal", ext: ["cr"]},
{name: "CSS", mime: "text/css", mode: "css", ext: ["css"]},
{name: "CQL", mime: "text/x-cassandra", mode: "sql", ext: ["cql"]},
{name: "D", mime: "text/x-d", mode: "d", ext: ["d"]},
@@ -53,6 +56,7 @@
{name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy"]},
{name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]},
{name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]},
+ {name: "Haskell (Literate)", mime: "text/x-literate-haskell", mode: "haskell-literate", ext: ["lhs"]},
{name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]},
{name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]},
{name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"]},
@@ -66,9 +70,10 @@
mode: "javascript", ext: ["js"], alias: ["ecmascript", "js", "node"]},
{name: "JSON", mimes: ["application/json", "application/x-json"], mode: "javascript", ext: ["json", "map"], alias: ["json5"]},
{name: "JSON-LD", mime: "application/ld+json", mode: "javascript", ext: ["jsonld"], alias: ["jsonld"]},
+ {name: "JSX", mime: "text/jsx", mode: "jsx", ext: ["jsx"]},
{name: "Jinja2", mime: "null", mode: "jinja2"},
{name: "Julia", mime: "text/x-julia", mode: "julia", ext: ["jl"]},
- {name: "Kotlin", mime: "text/x-kotlin", mode: "kotlin", ext: ["kt"]},
+ {name: "Kotlin", mime: "text/x-kotlin", mode: "clike", ext: ["kt"]},
{name: "LESS", mime: "text/x-less", mode: "css", ext: ["less"]},
{name: "LiveScript", mime: "text/x-livescript", mode: "livescript", ext: ["ls"], alias: ["ls"]},
{name: "Lua", mime: "text/x-lua", mode: "lua", ext: ["lua"]},
@@ -81,10 +86,12 @@
{name: "MS SQL", mime: "text/x-mssql", mode: "sql"},
{name: "MySQL", mime: "text/x-mysql", mode: "sql"},
{name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i},
+ {name: "NSIS", mime: "text/x-nsis", mode: "nsis", ext: ["nsh", "nsi"]},
{name: "NTriples", mime: "text/n-triples", mode: "ntriples", ext: ["nt"]},
{name: "Objective C", mime: "text/x-objectivec", mode: "clike", ext: ["m", "mm"]},
{name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"]},
{name: "Octave", mime: "text/x-octave", mode: "octave", ext: ["m"]},
+ {name: "Oz", mime: "text/x-oz", mode: "oz", ext: ["oz"]},
{name: "Pascal", mime: "text/x-pascal", mode: "pascal", ext: ["p", "pas"]},
{name: "PEG.js", mime: "null", mode: "pegjs", ext: ["jsonld"]},
{name: "Perl", mime: "text/x-perl", mode: "perl", ext: ["pl", "pm"]},
@@ -106,7 +113,7 @@
{name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"]},
{name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"]},
{name: "SCSS", mime: "text/x-scss", mode: "css", ext: ["scss"]},
- {name: "Shell", mime: "text/x-sh", mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"]},
+ {name: "Shell", mime: "text/x-sh", mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"], file: /^PKGBUILD$/},
{name: "Sieve", mime: "application/sieve", mode: "sieve", ext: ["siv", "sieve"]},
{name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim", ext: ["slim"]},
{name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]},
@@ -116,6 +123,7 @@
{name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]},
{name: "Spreadsheet", mime: "text/x-spreadsheet", mode: "spreadsheet", alias: ["excel", "formula"]},
{name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]},
+ {name: "Squirrel", mime: "text/x-squirrel", mode: "clike", ext: ["nut"]},
{name: "Swift", mime: "text/x-swift", mode: "swift", ext: ["swift"]},
{name: "MariaDB", mime: "text/x-mariadb", mode: "sql"},
{name: "sTeX", mime: "text/x-stex", mode: "stex"},
@@ -137,10 +145,14 @@
{name: "VBScript", mime: "text/vbscript", mode: "vbscript", ext: ["vbs"]},
{name: "Velocity", mime: "text/velocity", mode: "velocity", ext: ["vtl"]},
{name: "Verilog", mime: "text/x-verilog", mode: "verilog", ext: ["v"]},
+ {name: "VHDL", mime: "text/x-vhdl", mode: "vhdl", ext: ["vhd", "vhdl"]},
{name: "XML", mimes: ["application/xml", "text/xml"], mode: "xml", ext: ["xml", "xsl", "xsd"], alias: ["rss", "wsdl", "xsd"]},
{name: "XQuery", mime: "application/xquery", mode: "xquery", ext: ["xy", "xquery"]},
{name: "YAML", mime: "text/x-yaml", mode: "yaml", ext: ["yaml", "yml"], alias: ["yml"]},
- {name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]}
+ {name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]},
+ {name: "mscgen", mime: "text/x-mscgen", mode: "mscgen", ext: ["mscgen", "mscin", "msc"]},
+ {name: "xu", mime: "text/x-xu", mode: "mscgen", ext: ["xu"]},
+ {name: "msgenny", mime: "text/x-msgenny", mode: "mscgen", ext: ["msgenny"]}
];
// Ensure all modes have a mime property for backwards compatibility
for (var i = 0; i < CodeMirror.modeInfo.length; i++) {
diff --git a/public/vendor/codemirror/mode/mirc/index.html b/public/vendor/codemirror/mode/mirc/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/mirc/mirc.js b/public/vendor/codemirror/mode/mirc/mirc.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/mllike/index.html b/public/vendor/codemirror/mode/mllike/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/mllike/mllike.js b/public/vendor/codemirror/mode/mllike/mllike.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/modelica/index.html b/public/vendor/codemirror/mode/modelica/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/modelica/modelica.js b/public/vendor/codemirror/mode/modelica/modelica.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/mscgen/index.html b/public/vendor/codemirror/mode/mscgen/index.html
new file mode 100644
index 00000000..8c28ee62
--- /dev/null
+++ b/public/vendor/codemirror/mode/mscgen/index.html
@@ -0,0 +1,151 @@
+
+
+CodeMirror: MscGen mode
+
+
+
+
+
+
+
+
+
+
+MscGen mode
+
+
+
+Xù mode
+
+
+
+MsGenny mode
+
+
+
+ Simple mode for highlighting MscGen and two derived sequence
+ chart languages.
+
+
+
+
+ MIME types defined:
+ text/x-mscgen
+ text/x-xu
+ text/x-msgenny
+
+
+
diff --git a/public/vendor/codemirror/mode/mscgen/mscgen.js b/public/vendor/codemirror/mode/mscgen/mscgen.js
new file mode 100644
index 00000000..d61b4706
--- /dev/null
+++ b/public/vendor/codemirror/mode/mscgen/mscgen.js
@@ -0,0 +1,169 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+// mode(s) for the sequence chart dsl's mscgen, xù and msgenny
+// For more information on mscgen, see the site of the original author:
+// http://www.mcternan.me.uk/mscgen
+//
+// This mode for mscgen and the two derivative languages were
+// originally made for use in the mscgen_js interpreter
+// (https://sverweij.github.io/mscgen_js)
+
+(function(mod) {
+ if ( typeof exports == "object" && typeof module == "object")// CommonJS
+ mod(require("../../lib/codemirror"));
+ else if ( typeof define == "function" && define.amd)// AMD
+ define(["../../lib/codemirror"], mod);
+ else// Plain browser env
+ mod(CodeMirror);
+})(function(CodeMirror) {
+ "use strict";
+
+ var languages = {
+ mscgen: {
+ "keywords" : ["msc"],
+ "options" : ["hscale", "width", "arcgradient", "wordwraparcs"],
+ "attributes" : ["label", "idurl", "id", "url", "linecolor", "linecolour", "textcolor", "textcolour", "textbgcolor", "textbgcolour", "arclinecolor", "arclinecolour", "arctextcolor", "arctextcolour", "arctextbgcolor", "arctextbgcolour", "arcskip"],
+ "brackets" : ["\\{", "\\}"], // [ and ] are brackets too, but these get handled in with lists
+ "arcsWords" : ["note", "abox", "rbox", "box"],
+ "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"],
+ "singlecomment" : ["//", "#"],
+ "operators" : ["="]
+ },
+ xu: {
+ "keywords" : ["msc"],
+ "options" : ["hscale", "width", "arcgradient", "wordwraparcs", "watermark"],
+ "attributes" : ["label", "idurl", "id", "url", "linecolor", "linecolour", "textcolor", "textcolour", "textbgcolor", "textbgcolour", "arclinecolor", "arclinecolour", "arctextcolor", "arctextcolour", "arctextbgcolor", "arctextbgcolour", "arcskip"],
+ "brackets" : ["\\{", "\\}"], // [ and ] are brackets too, but these get handled in with lists
+ "arcsWords" : ["note", "abox", "rbox", "box", "alt", "else", "opt", "break", "par", "seq", "strict", "neg", "critical", "ignore", "consider", "assert", "loop", "ref", "exc"],
+ "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"],
+ "singlecomment" : ["//", "#"],
+ "operators" : ["="]
+ },
+ msgenny: {
+ "keywords" : null,
+ "options" : ["hscale", "width", "arcgradient", "wordwraparcs", "watermark"],
+ "attributes" : null,
+ "brackets" : ["\\{", "\\}"],
+ "arcsWords" : ["note", "abox", "rbox", "box", "alt", "else", "opt", "break", "par", "seq", "strict", "neg", "critical", "ignore", "consider", "assert", "loop", "ref", "exc"],
+ "arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"],
+ "singlecomment" : ["//", "#"],
+ "operators" : ["="]
+ }
+ }
+
+ CodeMirror.defineMode("mscgen", function(_, modeConfig) {
+ var language = languages[modeConfig && modeConfig.language || "mscgen"]
+ return {
+ startState: startStateFn,
+ copyState: copyStateFn,
+ token: produceTokenFunction(language),
+ lineComment : "#",
+ blockCommentStart : "/*",
+ blockCommentEnd : "*/"
+ };
+ });
+
+ CodeMirror.defineMIME("text/x-mscgen", "mscgen");
+ CodeMirror.defineMIME("text/x-xu", {name: "mscgen", language: "xu"});
+ CodeMirror.defineMIME("text/x-msgenny", {name: "mscgen", language: "msgenny"});
+
+ function wordRegexpBoundary(pWords) {
+ return new RegExp("\\b(" + pWords.join("|") + ")\\b", "i");
+ }
+
+ function wordRegexp(pWords) {
+ return new RegExp("(" + pWords.join("|") + ")", "i");
+ }
+
+ function startStateFn() {
+ return {
+ inComment : false,
+ inString : false,
+ inAttributeList : false,
+ inScript : false
+ };
+ }
+
+ function copyStateFn(pState) {
+ return {
+ inComment : pState.inComment,
+ inString : pState.inString,
+ inAttributeList : pState.inAttributeList,
+ inScript : pState.inScript
+ };
+ }
+
+ function produceTokenFunction(pConfig) {
+
+ return function(pStream, pState) {
+ if (pStream.match(wordRegexp(pConfig.brackets), true, true)) {
+ return "bracket";
+ }
+ /* comments */
+ if (!pState.inComment) {
+ if (pStream.match(/\/\*[^\*\/]*/, true, true)) {
+ pState.inComment = true;
+ return "comment";
+ }
+ if (pStream.match(wordRegexp(pConfig.singlecomment), true, true)) {
+ pStream.skipToEnd();
+ return "comment";
+ }
+ }
+ if (pState.inComment) {
+ if (pStream.match(/[^\*\/]*\*\//, true, true))
+ pState.inComment = false;
+ else
+ pStream.skipToEnd();
+ return "comment";
+ }
+ /* strings */
+ if (!pState.inString && pStream.match(/\"(\\\"|[^\"])*/, true, true)) {
+ pState.inString = true;
+ return "string";
+ }
+ if (pState.inString) {
+ if (pStream.match(/[^\"]*\"/, true, true))
+ pState.inString = false;
+ else
+ pStream.skipToEnd();
+ return "string";
+ }
+ /* keywords & operators */
+ if (!!pConfig.keywords && pStream.match(wordRegexpBoundary(pConfig.keywords), true, true))
+ return "keyword";
+
+ if (pStream.match(wordRegexpBoundary(pConfig.options), true, true))
+ return "keyword";
+
+ if (pStream.match(wordRegexpBoundary(pConfig.arcsWords), true, true))
+ return "keyword";
+
+ if (pStream.match(wordRegexp(pConfig.arcsOthers), true, true))
+ return "keyword";
+
+ if (!!pConfig.operators && pStream.match(wordRegexp(pConfig.operators), true, true))
+ return "operator";
+
+ /* attribute lists */
+ if (!pConfig.inAttributeList && !!pConfig.attributes && pStream.match(/\[/, true, true)) {
+ pConfig.inAttributeList = true;
+ return "bracket";
+ }
+ if (pConfig.inAttributeList) {
+ if (pConfig.attributes !== null && pStream.match(wordRegexpBoundary(pConfig.attributes), true, true)) {
+ return "attribute";
+ }
+ if (pStream.match(/]/, true, true)) {
+ pConfig.inAttributeList = false;
+ return "bracket";
+ }
+ }
+
+ pStream.next();
+ return "base";
+ };
+ }
+
+});
diff --git a/public/vendor/codemirror/mode/mscgen/mscgen_test.js b/public/vendor/codemirror/mode/mscgen/mscgen_test.js
new file mode 100644
index 00000000..e319a399
--- /dev/null
+++ b/public/vendor/codemirror/mode/mscgen/mscgen_test.js
@@ -0,0 +1,75 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function() {
+ var mode = CodeMirror.getMode({indentUnit: 2}, "mscgen");
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
+
+ MT("empty chart",
+ "[keyword msc][bracket {]",
+ "[base ]",
+ "[bracket }]"
+ );
+
+ MT("comments",
+ "[comment // a single line comment]",
+ "[comment # another single line comment /* and */ ignored here]",
+ "[comment /* A multi-line comment even though it contains]",
+ "[comment msc keywords and \"quoted text\"*/]");
+
+ MT("strings",
+ "[string \"// a string\"]",
+ "[string \"a string running over]",
+ "[string two lines\"]",
+ "[string \"with \\\"escaped quote\"]"
+ );
+
+ MT("xù/ msgenny keywords classify as 'base'",
+ "[base watermark]",
+ "[base alt loop opt ref else break par seq assert]"
+ );
+
+ MT("mscgen options classify as keyword",
+ "[keyword hscale]", "[keyword width]", "[keyword arcgradient]", "[keyword wordwraparcs]"
+ );
+
+ MT("mscgen arcs classify as keyword",
+ "[keyword note]","[keyword abox]","[keyword rbox]","[keyword box]",
+ "[keyword |||...---]", "[keyword ..--==::]",
+ "[keyword ->]", "[keyword <-]", "[keyword <->]",
+ "[keyword =>]", "[keyword <=]", "[keyword <=>]",
+ "[keyword =>>]", "[keyword <<=]", "[keyword <<=>>]",
+ "[keyword >>]", "[keyword <<]", "[keyword <<>>]",
+ "[keyword -x]", "[keyword x-]", "[keyword -X]", "[keyword X-]",
+ "[keyword :>]", "[keyword <:]", "[keyword <:>]"
+ );
+
+ MT("within an attribute list, attributes classify as attribute",
+ "[bracket [[][attribute label]",
+ "[attribute id]","[attribute url]","[attribute idurl]",
+ "[attribute linecolor]","[attribute linecolour]","[attribute textcolor]","[attribute textcolour]","[attribute textbgcolor]","[attribute textbgcolour]",
+ "[attribute arclinecolor]","[attribute arclinecolour]","[attribute arctextcolor]","[attribute arctextcolour]","[attribute arctextbgcolor]","[attribute arctextbgcolour]",
+ "[attribute arcskip][bracket ]]]"
+ );
+
+ MT("outside an attribute list, attributes classify as base",
+ "[base label]",
+ "[base id]","[base url]","[base idurl]",
+ "[base linecolor]","[base linecolour]","[base textcolor]","[base textcolour]","[base textbgcolor]","[base textbgcolour]",
+ "[base arclinecolor]","[base arclinecolour]","[base arctextcolor]","[base arctextcolour]","[base arctextbgcolor]","[base arctextbgcolour]",
+ "[base arcskip]"
+ );
+
+ MT("a typical program",
+ "[comment # typical mscgen program]",
+ "[keyword msc][base ][bracket {]",
+ "[keyword wordwraparcs][operator =][string \"true\"][base , ][keyword hscale][operator =][string \"0.8\"][keyword arcgradient][operator =][base 30;]",
+ "[base a][bracket [[][attribute label][operator =][string \"Entity A\"][bracket ]]][base ,]",
+ "[base b][bracket [[][attribute label][operator =][string \"Entity B\"][bracket ]]][base ,]",
+ "[base c][bracket [[][attribute label][operator =][string \"Entity C\"][bracket ]]][base ;]",
+ "[base a ][keyword =>>][base b][bracket [[][attribute label][operator =][string \"Hello entity B\"][bracket ]]][base ;]",
+ "[base a ][keyword <<][base b][bracket [[][attribute label][operator =][string \"Here's an answer dude!\"][bracket ]]][base ;]",
+ "[base c ][keyword :>][base *][bracket [[][attribute label][operator =][string \"What about me?\"][base , ][attribute textcolor][operator =][base red][bracket ]]][base ;]",
+ "[bracket }]"
+ );
+})();
diff --git a/public/vendor/codemirror/mode/mscgen/msgenny_test.js b/public/vendor/codemirror/mode/mscgen/msgenny_test.js
new file mode 100644
index 00000000..80173de0
--- /dev/null
+++ b/public/vendor/codemirror/mode/mscgen/msgenny_test.js
@@ -0,0 +1,71 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function() {
+ var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-msgenny");
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "msgenny"); }
+
+ MT("comments",
+ "[comment // a single line comment]",
+ "[comment # another single line comment /* and */ ignored here]",
+ "[comment /* A multi-line comment even though it contains]",
+ "[comment msc keywords and \"quoted text\"*/]");
+
+ MT("strings",
+ "[string \"// a string\"]",
+ "[string \"a string running over]",
+ "[string two lines\"]",
+ "[string \"with \\\"escaped quote\"]"
+ );
+
+ MT("xù/ msgenny keywords classify as 'keyword'",
+ "[keyword watermark]",
+ "[keyword alt]","[keyword loop]","[keyword opt]","[keyword ref]","[keyword else]","[keyword break]","[keyword par]","[keyword seq]","[keyword assert]"
+ );
+
+ MT("mscgen options classify as keyword",
+ "[keyword hscale]", "[keyword width]", "[keyword arcgradient]", "[keyword wordwraparcs]"
+ );
+
+ MT("mscgen arcs classify as keyword",
+ "[keyword note]","[keyword abox]","[keyword rbox]","[keyword box]",
+ "[keyword |||...---]", "[keyword ..--==::]",
+ "[keyword ->]", "[keyword <-]", "[keyword <->]",
+ "[keyword =>]", "[keyword <=]", "[keyword <=>]",
+ "[keyword =>>]", "[keyword <<=]", "[keyword <<=>>]",
+ "[keyword >>]", "[keyword <<]", "[keyword <<>>]",
+ "[keyword -x]", "[keyword x-]", "[keyword -X]", "[keyword X-]",
+ "[keyword :>]", "[keyword <:]", "[keyword <:>]"
+ );
+
+ MT("within an attribute list, mscgen/ xù attributes classify as base",
+ "[base [[label]",
+ "[base idurl id url]",
+ "[base linecolor linecolour textcolor textcolour textbgcolor textbgcolour]",
+ "[base arclinecolor arclinecolour arctextcolor arctextcolour arctextbgcolor arctextbgcolour]",
+ "[base arcskip]]]"
+ );
+
+ MT("outside an attribute list, mscgen/ xù attributes classify as base",
+ "[base label]",
+ "[base idurl id url]",
+ "[base linecolor linecolour textcolor textcolour textbgcolor textbgcolour]",
+ "[base arclinecolor arclinecolour arctextcolor arctextcolour arctextbgcolor arctextbgcolour]",
+ "[base arcskip]"
+ );
+
+ MT("a typical program",
+ "[comment # typical msgenny program]",
+ "[keyword wordwraparcs][operator =][string \"true\"][base , ][keyword hscale][operator =][string \"0.8\"][base , ][keyword arcgradient][operator =][base 30;]",
+ "[base a : ][string \"Entity A\"][base ,]",
+ "[base b : Entity B,]",
+ "[base c : Entity C;]",
+ "[base a ][keyword =>>][base b: ][string \"Hello entity B\"][base ;]",
+ "[base a ][keyword alt][base c][bracket {]",
+ "[base a ][keyword <<][base b: ][string \"Here's an answer dude!\"][base ;]",
+ "[keyword ---][base : ][string \"sorry, won't march - comm glitch\"]",
+ "[base a ][keyword x-][base b: ][string \"Here's an answer dude! (won't arrive...)\"][base ;]",
+ "[bracket }]",
+ "[base c ][keyword :>][base *: What about me?;]"
+ );
+})();
diff --git a/public/vendor/codemirror/mode/mscgen/xu_test.js b/public/vendor/codemirror/mode/mscgen/xu_test.js
new file mode 100644
index 00000000..f9a50f0a
--- /dev/null
+++ b/public/vendor/codemirror/mode/mscgen/xu_test.js
@@ -0,0 +1,75 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function() {
+ var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-xu");
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "xu"); }
+
+ MT("empty chart",
+ "[keyword msc][bracket {]",
+ "[base ]",
+ "[bracket }]"
+ );
+
+ MT("comments",
+ "[comment // a single line comment]",
+ "[comment # another single line comment /* and */ ignored here]",
+ "[comment /* A multi-line comment even though it contains]",
+ "[comment msc keywords and \"quoted text\"*/]");
+
+ MT("strings",
+ "[string \"// a string\"]",
+ "[string \"a string running over]",
+ "[string two lines\"]",
+ "[string \"with \\\"escaped quote\"]"
+ );
+
+ MT("xù/ msgenny keywords classify as 'keyword'",
+ "[keyword watermark]",
+ "[keyword alt]","[keyword loop]","[keyword opt]","[keyword ref]","[keyword else]","[keyword break]","[keyword par]","[keyword seq]","[keyword assert]"
+ );
+
+ MT("mscgen options classify as keyword",
+ "[keyword hscale]", "[keyword width]", "[keyword arcgradient]", "[keyword wordwraparcs]"
+ );
+
+ MT("mscgen arcs classify as keyword",
+ "[keyword note]","[keyword abox]","[keyword rbox]","[keyword box]",
+ "[keyword |||...---]", "[keyword ..--==::]",
+ "[keyword ->]", "[keyword <-]", "[keyword <->]",
+ "[keyword =>]", "[keyword <=]", "[keyword <=>]",
+ "[keyword =>>]", "[keyword <<=]", "[keyword <<=>>]",
+ "[keyword >>]", "[keyword <<]", "[keyword <<>>]",
+ "[keyword -x]", "[keyword x-]", "[keyword -X]", "[keyword X-]",
+ "[keyword :>]", "[keyword <:]", "[keyword <:>]"
+ );
+
+ MT("within an attribute list, attributes classify as attribute",
+ "[bracket [[][attribute label]",
+ "[attribute id]","[attribute url]","[attribute idurl]",
+ "[attribute linecolor]","[attribute linecolour]","[attribute textcolor]","[attribute textcolour]","[attribute textbgcolor]","[attribute textbgcolour]",
+ "[attribute arclinecolor]","[attribute arclinecolour]","[attribute arctextcolor]","[attribute arctextcolour]","[attribute arctextbgcolor]","[attribute arctextbgcolour]",
+ "[attribute arcskip][bracket ]]]"
+ );
+
+ MT("outside an attribute list, attributes classify as base",
+ "[base label]",
+ "[base id]","[base url]","[base idurl]",
+ "[base linecolor]","[base linecolour]","[base textcolor]","[base textcolour]","[base textbgcolor]","[base textbgcolour]",
+ "[base arclinecolor]","[base arclinecolour]","[base arctextcolor]","[base arctextcolour]","[base arctextbgcolor]","[base arctextbgcolour]",
+ "[base arcskip]"
+ );
+
+ MT("a typical program",
+ "[comment # typical mscgen program]",
+ "[keyword msc][base ][bracket {]",
+ "[keyword wordwraparcs][operator =][string \"true\"][keyword hscale][operator =][string \"0.8\"][keyword arcgradient][operator =][base 30;]",
+ "[base a][bracket [[][attribute label][operator =][string \"Entity A\"][bracket ]]][base ,]",
+ "[base b][bracket [[][attribute label][operator =][string \"Entity B\"][bracket ]]][base ,]",
+ "[base c][bracket [[][attribute label][operator =][string \"Entity C\"][bracket ]]][base ;]",
+ "[base a ][keyword =>>][base b][bracket [[][attribute label][operator =][string \"Hello entity B\"][bracket ]]][base ;]",
+ "[base a ][keyword <<][base b][bracket [[][attribute label][operator =][string \"Here's an answer dude!\"][bracket ]]][base ;]",
+ "[base c ][keyword :>][base *][bracket [[][attribute label][operator =][string \"What about me?\"][base , ][attribute textcolor][operator =][base red][bracket ]]][base ;]",
+ "[bracket }]"
+ );
+})();
diff --git a/public/vendor/codemirror/mode/mumps/index.html b/public/vendor/codemirror/mode/mumps/index.html
old mode 100755
new mode 100644
index bd1f69ae..b1f92c21
--- a/public/vendor/codemirror/mode/mumps/index.html
+++ b/public/vendor/codemirror/mode/mumps/index.html
@@ -1,4 +1,4 @@
-
+
CodeMirror: MUMPS mode
@@ -73,7 +73,7 @@ SET2() ;EF. Return error code (also called from XUSRB)
IF '$LENGTH($PIECE(XUSER(1),U,2)) QUIT 21 ;p419, p434
Q 0
;
-
+
+
+
+
+
+
+
+
+NSIS mode
+
+
+
+
+
+
+MIME types defined: text/x-nsis
.
+
\ No newline at end of file
diff --git a/public/vendor/codemirror/mode/nsis/nsis.js b/public/vendor/codemirror/mode/nsis/nsis.js
new file mode 100644
index 00000000..172207c5
--- /dev/null
+++ b/public/vendor/codemirror/mode/nsis/nsis.js
@@ -0,0 +1,95 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+// Author: Jan T. Sott (http://github.com/idleberg)
+
+(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";
+
+CodeMirror.defineSimpleMode("nsis",{
+ start:[
+ // Numbers
+ {regex: /(?:[+-]?)(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\d+.?\d*)/, token: "number"},
+
+ // Strings
+ { regex: /"(?:[^\\"]|\\.)*"?/, token: "string" },
+ { regex: /'(?:[^\\']|\\.)*'?/, token: "string" },
+ { regex: /`(?:[^\\`]|\\.)*`?/, token: "string" },
+
+ // Compile Time Commands
+ {regex: /(?:\!(include|addincludedir|addplugindir|appendfile|cd|delfile|echo|error|execute|packhdr|finalize|getdllversion|system|tempfile|warning|verbose|define|undef|insertmacro|makensis|searchparse|searchreplace))\b/, token: "keyword"},
+
+ // Conditional Compilation
+ {regex: /(?:\!(if(?:n?def)?|ifmacron?def|macro))\b/, token: "keyword", indent: true},
+ {regex: /(?:\!(else|endif|macroend))\b/, token: "keyword", dedent: true},
+
+ // Runtime Commands
+ {regex: /\b(?:Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetLabelAddress|GetTempFileName|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|IntCmp|IntCmpU|IntFmt|IntOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetPluginUnload|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Unicode|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegStr|WriteUninstaller|XPStyle)\b/, token: "keyword"},
+ {regex: /\b(?:Function|PageEx|Section(?:Group)?)\b/, token: "keyword", indent: true},
+ {regex: /\b(?:(Function|PageEx|Section(?:Group)?)End)\b/, token: "keyword", dedent: true},
+
+ // Command Options
+ {regex: /\b(?:ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HIDDEN|HKCC|HKCR|HKCU|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM|HKPD|HKU|IDABORT|IDCANCEL|IDD_DIR|IDD_INST|IDD_INSTFILES|IDD_LICENSE|IDD_SELCOM|IDD_UNINST|IDD_VERIFY|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|MB_YESNOCANCEL|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SW_HIDE|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWNORMAL|SYSTEM|TEMPORARY)\b/, token: "atom"},
+ {regex: /\b(?:admin|all|auto|both|bottom|bzip2|components|current|custom|directory|force|hide|highest|ifdiff|ifnewer|instfiles|lastused|leave|left|license|listonly|lzma|nevershow|none|normal|notset|right|show|silent|silentlog|textonly|top|try|un\.components|un\.custom|un\.directory|un\.instfiles|un\.license|uninstConfirm|user|Win10|Win7|Win8|WinVista|zlib)\b/, token: "builtin"},
+
+ // LogicLib.nsh
+ {regex: /\$\{(?:And(?:If(?:Not)?|Unless)|Break|Case(?:Else)?|Continue|Default|Do(?:Until|While)?|Else(?:If(?:Not)?|Unless)?|End(?:If|Select|Switch)|Exit(?:Do|For|While)|For(?:Each)?|If(?:Cmd|Not(?:Then)?|Then)?|Loop(?:Until|While)?|Or(?:If(?:Not)?|Unless)|Select|Switch|Unless|While)\}/, token: "variable-2", indent: true},
+
+ // FileFunc.nsh
+ {regex: /\$\{(?:BannerTrimPath|DirState|DriveSpace|Get(BaseName|Drives|ExeName|ExePath|FileAttributes|FileExt|FileName|FileVersion|Options|OptionsS|Parameters|Parent|Root|Size|Time)|Locate|RefreshShellIcons)\}/, token: "variable-2", dedent: true},
+
+ // Memento.nsh
+ {regex: /\$\{(?:Memento(?:Section(?:Done|End|Restore|Save)?|UnselectedSection))\}/, token: "variable-2", dedent: true},
+
+ // TextFunc.nsh
+ {regex: /\$\{(?:Config(?:Read|ReadS|Write|WriteS)|File(?:Join|ReadFromEnd|Recode)|Line(?:Find|Read|Sum)|Text(?:Compare|CompareS)|TrimNewLines)\}/, token: "variable-2", dedent: true},
+
+ // WinVer.nsh
+ {regex: /\$\{(?:(?:At(?:Least|Most)|Is)(?:ServicePack|Win(?:7|8|10|95|98|200(?:0|3|8(?:R2)?)|ME|NT4|Vista|XP))|Is(?:NT|Server))\}/, token: "variable", dedent: true},
+
+ // WordFunc.nsh
+ {regex: /\$\{(?:StrFilterS?|Version(?:Compare|Convert)|Word(?:AddS?|Find(?:(?:2|3)X)?S?|InsertS?|ReplaceS?))\}/, token: "variable-2", dedent: true},
+
+ // x64.nsh
+ {regex: /\$\{(?:RunningX64)\}/, token: "variable", dedent: true},
+ {regex: /\$\{(?:Disable|Enable)X64FSRedirection\}/, token: "variable-2", dedent: true},
+
+ // Line Comment
+ {regex: /(#|;).*/, token: "comment"},
+
+ // Block Comment
+ {regex: /\/\*/, token: "comment", next: "comment"},
+
+ // Operator
+ {regex: /[-+\/*=<>!]+/, token: "operator"},
+
+ // Variable
+ {regex: /\$[\w]+/, token: "variable"},
+
+ // Constant
+ {regex: /\${[\w]+}/,token: "variable-2"},
+
+ // Language String
+ {regex: /\$\([\w]+\)/,token: "variable-3"}
+ ],
+ comment: [
+ {regex: /.*?\*\//, token: "comment", next: "start"},
+ {regex: /.*/, token: "comment"}
+ ],
+ meta: {
+ electricInput: /^\s*((Function|PageEx|Section|Section(Group)?)End|(\!(endif|macroend))|\$\{(End(If|Unless|While)|Loop(Until)|Next)\})$/,
+ blockCommentStart: "/*",
+ blockCommentEnd: "*/",
+ lineComment: ["#", ";"]
+ }
+});
+
+CodeMirror.defineMIME("text/x-nsis", "nsis");
+});
diff --git a/public/vendor/codemirror/mode/ntriples/index.html b/public/vendor/codemirror/mode/ntriples/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/ntriples/ntriples.js b/public/vendor/codemirror/mode/ntriples/ntriples.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/octave/index.html b/public/vendor/codemirror/mode/octave/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/octave/octave.js b/public/vendor/codemirror/mode/octave/octave.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/oz/index.html b/public/vendor/codemirror/mode/oz/index.html
new file mode 100644
index 00000000..febd82a5
--- /dev/null
+++ b/public/vendor/codemirror/mode/oz/index.html
@@ -0,0 +1,59 @@
+
+
+CodeMirror: Oz mode
+
+
+
+
+
+
+
+
+
+
+
+Oz mode
+
+MIME type defined: text/x-oz
.
+
+
+
diff --git a/public/vendor/codemirror/mode/oz/oz.js b/public/vendor/codemirror/mode/oz/oz.js
new file mode 100644
index 00000000..ee8cb0ad
--- /dev/null
+++ b/public/vendor/codemirror/mode/oz/oz.js
@@ -0,0 +1,252 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"));
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror"], mod);
+ else // Plain browser env
+ mod(CodeMirror);
+})(function(CodeMirror) {
+"use strict";
+
+CodeMirror.defineMode("oz", function (conf) {
+
+ function wordRegexp(words) {
+ return new RegExp("^((" + words.join(")|(") + "))\\b");
+ }
+
+ var singleOperators = /[\^@!\|<>#~\.\*\-\+\\/,=]/;
+ var doubleOperators = /(<-)|(:=)|(=<)|(>=)|(<=)|(<:)|(>:)|(=:)|(\\=)|(\\=:)|(!!)|(==)|(::)/;
+ var tripleOperators = /(:::)|(\.\.\.)|(=<:)|(>=:)/;
+
+ var middle = ["in", "then", "else", "of", "elseof", "elsecase", "elseif", "catch",
+ "finally", "with", "require", "prepare", "import", "export", "define", "do"];
+ var end = ["end"];
+
+ var atoms = wordRegexp(["true", "false", "nil", "unit"]);
+ var commonKeywords = wordRegexp(["andthen", "at", "attr", "declare", "feat", "from", "lex",
+ "mod", "mode", "orelse", "parser", "prod", "prop", "scanner", "self", "syn", "token"]);
+ var openingKeywords = wordRegexp(["local", "proc", "fun", "case", "class", "if", "cond", "or", "dis",
+ "choice", "not", "thread", "try", "raise", "lock", "for", "suchthat", "meth", "functor"]);
+ var middleKeywords = wordRegexp(middle);
+ var endKeywords = wordRegexp(end);
+
+ // Tokenizers
+ function tokenBase(stream, state) {
+ if (stream.eatSpace()) {
+ return null;
+ }
+
+ // Brackets
+ if(stream.match(/[{}]/)) {
+ return "bracket";
+ }
+
+ // Special [] keyword
+ if (stream.match(/(\[])/)) {
+ return "keyword"
+ }
+
+ // Operators
+ if (stream.match(tripleOperators) || stream.match(doubleOperators)) {
+ return "operator";
+ }
+
+ // Atoms
+ if(stream.match(atoms)) {
+ return 'atom';
+ }
+
+ // Opening keywords
+ var matched = stream.match(openingKeywords);
+ if (matched) {
+ if (!state.doInCurrentLine)
+ state.currentIndent++;
+ else
+ state.doInCurrentLine = false;
+
+ // Special matching for signatures
+ if(matched[0] == "proc" || matched[0] == "fun")
+ state.tokenize = tokenFunProc;
+ else if(matched[0] == "class")
+ state.tokenize = tokenClass;
+ else if(matched[0] == "meth")
+ state.tokenize = tokenMeth;
+
+ return 'keyword';
+ }
+
+ // Middle and other keywords
+ if (stream.match(middleKeywords) || stream.match(commonKeywords)) {
+ return "keyword"
+ }
+
+ // End keywords
+ if (stream.match(endKeywords)) {
+ state.currentIndent--;
+ return 'keyword';
+ }
+
+ // Eat the next char for next comparisons
+ var ch = stream.next();
+
+ // Strings
+ if (ch == '"' || ch == "'") {
+ state.tokenize = tokenString(ch);
+ return state.tokenize(stream, state);
+ }
+
+ // Numbers
+ if (/[~\d]/.test(ch)) {
+ if (ch == "~") {
+ if(! /^[0-9]/.test(stream.peek()))
+ return null;
+ else if (( stream.next() == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) || stream.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/))
+ return "number";
+ }
+
+ if ((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) || stream.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/))
+ return "number";
+
+ return null;
+ }
+
+ // Comments
+ if (ch == "%") {
+ stream.skipToEnd();
+ return 'comment';
+ }
+ else if (ch == "/") {
+ if (stream.eat("*")) {
+ state.tokenize = tokenComment;
+ return tokenComment(stream, state);
+ }
+ }
+
+ // Single operators
+ if(singleOperators.test(ch)) {
+ return "operator";
+ }
+
+ // If nothing match, we skip the entire alphanumerical block
+ stream.eatWhile(/\w/);
+
+ return "variable";
+ }
+
+ function tokenClass(stream, state) {
+ if (stream.eatSpace()) {
+ return null;
+ }
+ stream.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)/);
+ state.tokenize = tokenBase;
+ return "variable-3"
+ }
+
+ function tokenMeth(stream, state) {
+ if (stream.eatSpace()) {
+ return null;
+ }
+ stream.match(/([a-zA-Z][A-Za-z0-9_]*)|(`.+`)/);
+ state.tokenize = tokenBase;
+ return "def"
+ }
+
+ function tokenFunProc(stream, state) {
+ if (stream.eatSpace()) {
+ return null;
+ }
+
+ if(!state.hasPassedFirstStage && stream.eat("{")) {
+ state.hasPassedFirstStage = true;
+ return "bracket";
+ }
+ else if(state.hasPassedFirstStage) {
+ stream.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)|\$/);
+ state.hasPassedFirstStage = false;
+ state.tokenize = tokenBase;
+ return "def"
+ }
+ else {
+ state.tokenize = tokenBase;
+ return null;
+ }
+ }
+
+ function tokenComment(stream, state) {
+ var maybeEnd = false, ch;
+ while (ch = stream.next()) {
+ if (ch == "/" && maybeEnd) {
+ state.tokenize = tokenBase;
+ break;
+ }
+ maybeEnd = (ch == "*");
+ }
+ return "comment";
+ }
+
+ function tokenString(quote) {
+ return function (stream, state) {
+ var escaped = false, next, end = false;
+ while ((next = stream.next()) != null) {
+ if (next == quote && !escaped) {
+ end = true;
+ break;
+ }
+ escaped = !escaped && next == "\\";
+ }
+ if (end || !escaped)
+ state.tokenize = tokenBase;
+ return "string";
+ };
+ }
+
+ function buildElectricInputRegEx() {
+ // Reindentation should occur on [] or on a match of any of
+ // the block closing keywords, at the end of a line.
+ var allClosings = middle.concat(end);
+ return new RegExp("[\\[\\]]|(" + allClosings.join("|") + ")$");
+ }
+
+ return {
+
+ startState: function () {
+ return {
+ tokenize: tokenBase,
+ currentIndent: 0,
+ doInCurrentLine: false,
+ hasPassedFirstStage: false
+ };
+ },
+
+ token: function (stream, state) {
+ if (stream.sol())
+ state.doInCurrentLine = 0;
+
+ return state.tokenize(stream, state);
+ },
+
+ indent: function (state, textAfter) {
+ var trueText = textAfter.replace(/^\s+|\s+$/g, '');
+
+ if (trueText.match(endKeywords) || trueText.match(middleKeywords) || trueText.match(/(\[])/))
+ return conf.indentUnit * (state.currentIndent - 1);
+
+ if (state.currentIndent < 0)
+ return 0;
+
+ return state.currentIndent * conf.indentUnit;
+ },
+ fold: "indent",
+ electricInput: buildElectricInputRegEx(),
+ lineComment: "%",
+ blockCommentStart: "/*",
+ blockCommentEnd: "*/"
+ };
+});
+
+CodeMirror.defineMIME("text/x-oz", "oz");
+
+});
diff --git a/public/vendor/codemirror/mode/pascal/index.html b/public/vendor/codemirror/mode/pascal/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/pascal/pascal.js b/public/vendor/codemirror/mode/pascal/pascal.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/pegjs/index.html b/public/vendor/codemirror/mode/pegjs/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/pegjs/pegjs.js b/public/vendor/codemirror/mode/pegjs/pegjs.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/perl/index.html b/public/vendor/codemirror/mode/perl/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/perl/perl.js b/public/vendor/codemirror/mode/perl/perl.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/php/index.html b/public/vendor/codemirror/mode/php/index.html
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/php/php.js b/public/vendor/codemirror/mode/php/php.js
old mode 100755
new mode 100644
index 0c3f21e5..22494467
--- a/public/vendor/codemirror/mode/php/php.js
+++ b/public/vendor/codemirror/mode/php/php.js
@@ -86,7 +86,7 @@
"die echo empty exit eval include include_once isset list require require_once return " +
"print unset __halt_compiler self static parent yield insteadof finally";
var phpAtoms = "true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__";
- var phpBuiltin = "func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";
+ var phpBuiltin = "func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";
CodeMirror.registerHelper("hintWords", "php", [phpKeywords, phpAtoms, phpBuiltin].join(" ").split(" "));
CodeMirror.registerHelper("wordChars", "php", /[\w$]/);
@@ -105,14 +105,15 @@
return "variable-2";
},
"<": function(stream, state) {
- if (stream.match(/<)) {
- var nowDoc = stream.eat("'");
+ var before;
+ if (before = stream.match(/<<\s*/)) {
+ var quoted = stream.eat(/['"]/);
stream.eatWhile(/[\w\.]/);
- var delim = stream.current().slice(3 + (nowDoc ? 1 : 0));
- if (nowDoc) stream.eat("'");
+ var delim = stream.current().slice(before[0].length + (quoted ? 2 : 1));
+ if (quoted) stream.eat(quoted);
if (delim) {
(state.tokStack || (state.tokStack = [])).push(delim, 0);
- state.tokenize = phpString(delim, nowDoc ? false : true);
+ state.tokenize = phpString(delim, quoted != "'");
return "string";
}
}
@@ -159,6 +160,7 @@
if (!isPHP) {
if (stream.match(/^<\?\w*/)) {
state.curMode = phpMode;
+ if (!state.php) state.php = CodeMirror.startState(phpMode, htmlMode.indent(state.html, ""))
state.curState = state.php;
return "meta";
}
@@ -182,6 +184,7 @@
} else if (isPHP && state.php.tokenize == null && stream.match("?>")) {
state.curMode = htmlMode;
state.curState = state.html;
+ if (!state.php.context.prev) state.php = null;
return "meta";
} else {
return phpMode.token(stream, state.curState);
@@ -190,7 +193,8 @@
return {
startState: function() {
- var html = CodeMirror.startState(htmlMode), php = CodeMirror.startState(phpMode);
+ var html = CodeMirror.startState(htmlMode)
+ var php = parserConfig.startOpen ? CodeMirror.startState(phpMode) : null
return {html: html,
php: php,
curMode: parserConfig.startOpen ? phpMode : htmlMode,
@@ -200,7 +204,7 @@
copyState: function(state) {
var html = state.html, htmlNew = CodeMirror.copyState(htmlMode, html),
- php = state.php, phpNew = CodeMirror.copyState(phpMode, php), cur;
+ php = state.php, phpNew = php && CodeMirror.copyState(phpMode, php), cur;
if (state.curMode == htmlMode) cur = htmlNew;
else cur = phpNew;
return {html: htmlNew, php: phpNew, curMode: state.curMode, curState: cur,
diff --git a/public/vendor/codemirror/mode/php/test.js b/public/vendor/codemirror/mode/php/test.js
old mode 100755
new mode 100644
diff --git a/public/vendor/codemirror/mode/pig/index.html b/public/vendor/codemirror/mode/pig/index.html
old mode 100755
new mode 100644
index 984c9a18..ea77f704
--- a/public/vendor/codemirror/mode/pig/index.html
+++ b/public/vendor/codemirror/mode/pig/index.html
@@ -1,5 +1,4 @@
-
-
+
CodeMirror: Pig Latin mode
@@ -51,5 +50,4 @@ STORE c INTO "\path\to\output";
MIME type defined: text/x-pig
(PIG code)
-