summaryrefslogtreecommitdiff
path: root/public/vendor/codemirror/mode
diff options
context:
space:
mode:
Diffstat (limited to 'public/vendor/codemirror/mode')
-rw-r--r--public/vendor/codemirror/mode/clike/clike.js87
-rw-r--r--public/vendor/codemirror/mode/clojure/clojure.js9
-rw-r--r--public/vendor/codemirror/mode/crystal/crystal.js2
-rw-r--r--public/vendor/codemirror/mode/dart/dart.js27
-rw-r--r--public/vendor/codemirror/mode/django/django.js23
-rw-r--r--public/vendor/codemirror/mode/dtd/dtd.js12
-rw-r--r--public/vendor/codemirror/mode/dylan/dylan.js85
-rw-r--r--public/vendor/codemirror/mode/dylan/test.js88
-rw-r--r--public/vendor/codemirror/mode/fcl/fcl.js173
-rw-r--r--public/vendor/codemirror/mode/fcl/index.html108
-rw-r--r--public/vendor/codemirror/mode/gfm/index.html2
-rw-r--r--public/vendor/codemirror/mode/gfm/test.js6
-rw-r--r--public/vendor/codemirror/mode/haml/haml.js2
-rw-r--r--public/vendor/codemirror/mode/handlebars/index.html7
-rw-r--r--public/vendor/codemirror/mode/haskell-literate/haskell-literate.js2
-rw-r--r--public/vendor/codemirror/mode/htmlembedded/index.html2
-rw-r--r--public/vendor/codemirror/mode/htmlmixed/htmlmixed.js42
-rw-r--r--public/vendor/codemirror/mode/index.html6
-rw-r--r--public/vendor/codemirror/mode/jsx/jsx.js6
-rw-r--r--public/vendor/codemirror/mode/julia/julia.js150
-rw-r--r--public/vendor/codemirror/mode/markdown/markdown.js4
-rw-r--r--public/vendor/codemirror/mode/markdown/test.js18
-rw-r--r--public/vendor/codemirror/mode/mathematica/mathematica.js1
-rw-r--r--public/vendor/codemirror/mode/meta.js21
-rw-r--r--public/vendor/codemirror/mode/octave/index.html2
-rw-r--r--public/vendor/codemirror/mode/pegjs/pegjs.js10
-rw-r--r--public/vendor/codemirror/mode/perl/perl.js2
-rw-r--r--public/vendor/codemirror/mode/powershell/index.html204
-rw-r--r--public/vendor/codemirror/mode/powershell/powershell.js396
-rw-r--r--public/vendor/codemirror/mode/powershell/test.js72
-rw-r--r--public/vendor/codemirror/mode/properties/properties.js2
-rw-r--r--public/vendor/codemirror/mode/protobuf/index.html64
-rw-r--r--public/vendor/codemirror/mode/protobuf/protobuf.js68
-rw-r--r--public/vendor/codemirror/mode/puppet/puppet.js2
-rw-r--r--public/vendor/codemirror/mode/python/index.html2
-rw-r--r--public/vendor/codemirror/mode/python/python.js63
-rw-r--r--public/vendor/codemirror/mode/r/r.js2
-rw-r--r--public/vendor/codemirror/mode/sas/index.html81
-rwxr-xr-xpublic/vendor/codemirror/mode/sas/sas.js315
-rw-r--r--public/vendor/codemirror/mode/sparql/sparql.js8
-rw-r--r--public/vendor/codemirror/mode/spreadsheet/spreadsheet.js5
-rw-r--r--public/vendor/codemirror/mode/sql/index.html4
-rw-r--r--public/vendor/codemirror/mode/sql/sql.js28
-rw-r--r--public/vendor/codemirror/mode/swift/swift.js47
-rw-r--r--public/vendor/codemirror/mode/tcl/tcl.js32
-rw-r--r--public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js206
-rw-r--r--public/vendor/codemirror/mode/troff/troff.js4
-rw-r--r--public/vendor/codemirror/mode/twig/twig.js15
-rw-r--r--public/vendor/codemirror/mode/velocity/index.html2
-rw-r--r--public/vendor/codemirror/mode/velocity/velocity.js2
-rw-r--r--public/vendor/codemirror/mode/verilog/index.html2
-rw-r--r--public/vendor/codemirror/mode/verilog/test.js2
-rw-r--r--public/vendor/codemirror/mode/verilog/verilog.js2
-rw-r--r--public/vendor/codemirror/mode/vhdl/vhdl.js2
-rw-r--r--public/vendor/codemirror/mode/webidl/index.html71
-rw-r--r--public/vendor/codemirror/mode/webidl/webidl.js195
-rw-r--r--public/vendor/codemirror/mode/xml/index.html6
-rw-r--r--public/vendor/codemirror/mode/xml/xml.js2
-rw-r--r--public/vendor/codemirror/mode/xquery/xquery.js2
-rw-r--r--public/vendor/codemirror/mode/yacas/index.html87
-rw-r--r--public/vendor/codemirror/mode/yacas/yacas.js138
-rw-r--r--public/vendor/codemirror/mode/yaml-frontmatter/index.html2
-rw-r--r--public/vendor/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js2
63 files changed, 2642 insertions, 392 deletions
diff --git a/public/vendor/codemirror/mode/clike/clike.js b/public/vendor/codemirror/mode/clike/clike.js
index 4f5c0cf3..695d5cef 100644
--- a/public/vendor/codemirror/mode/clike/clike.js
+++ b/public/vendor/codemirror/mode/clike/clike.js
@@ -11,6 +11,42 @@
})(function(CodeMirror) {
"use strict";
+function Context(indented, column, type, align, prev) {
+ this.indented = indented;
+ this.column = column;
+ this.type = type;
+ this.align = align;
+ this.prev = prev;
+}
+function isStatement(type) {
+ return type == "statement" || type == "switchstatement" || type == "namespace";
+}
+function pushContext(state, col, type) {
+ var indent = state.indented;
+ if (state.context && isStatement(state.context.type) && !isStatement(type))
+ indent = state.context.indented;
+ return state.context = new Context(indent, 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;
+}
+
+function typeBefore(stream, state) {
+ if (state.prevToken == "variable" || state.prevToken == "variable-3") return true;
+ if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, stream.start))) return true;
+}
+
+function isTopScope(context) {
+ for (;;) {
+ if (!context || context.type == "top") return true;
+ if (context.type == "}" && context.prev.type != "namespace") return false;
+ context = context.prev;
+ }
+}
+
CodeMirror.defineMode("clike", function(config, parserConfig) {
var indentUnit = config.indentUnit,
statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
@@ -64,7 +100,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
}
}
if (isOperatorChar.test(ch)) {
- stream.eatWhile(isOperatorChar);
+ while (!stream.match(/^\/[\/*]/, false) && stream.eat(isOperatorChar)) {}
return "operator";
}
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
@@ -111,42 +147,6 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
return "comment";
}
- function Context(indented, column, type, align, prev) {
- this.indented = indented;
- this.column = column;
- this.type = type;
- this.align = align;
- this.prev = prev;
- }
- function isStatement(type) {
- return type == "statement" || type == "switchstatement" || type == "namespace";
- }
- function pushContext(state, col, type) {
- var indent = state.indented;
- if (state.context && isStatement(state.context.type) && !isStatement(type))
- indent = state.context.indented;
- return state.context = new Context(indent, 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;
- }
-
- function typeBefore(stream, state) {
- if (state.prevToken == "variable" || state.prevToken == "variable-3") return true;
- if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, stream.start))) return true;
- }
-
- function isTopScope(context) {
- for (;;) {
- if (!context || context.type == "top") return true;
- if (context.type == "}" && context.prev.type != "namespace") return false;
- context = context.prev;
- }
- }
-
// Interface
return {
@@ -497,7 +497,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
),
types: words(
"AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " +
- "Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable " +
+ "Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable " +
"Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " +
"Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " +
"StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector " +
@@ -527,6 +527,15 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
"'": function(stream) {
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
return "atom";
+ },
+ "=": function(stream, state) {
+ var cx = state.context
+ if (cx.type == "}" && cx.align && stream.eat(">")) {
+ state.context = new Context(cx.indented, cx.column, cx.type, null, cx.prev)
+ return "operator"
+ } else {
+ return false
+ }
}
},
modeProps: {closeBrackets: {triples: '"'}}
@@ -658,7 +667,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
def("text/x-objectivec", {
name: "clike",
- keywords: words(cKeywords + "inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in " +
+ keywords: words(cKeywords + "inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in " +
"inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),
types: words(cTypes),
atoms: words("YES NO NULL NILL ON OFF true false"),
diff --git a/public/vendor/codemirror/mode/clojure/clojure.js b/public/vendor/codemirror/mode/clojure/clojure.js
index 44948d04..cd8129f7 100644
--- a/public/vendor/codemirror/mode/clojure/clojure.js
+++ b/public/vendor/codemirror/mode/clojure/clojure.js
@@ -59,7 +59,8 @@ CodeMirror.defineMode("clojure", function (options) {
sign: /[+-]/,
exponent: /e/i,
keyword_char: /[^\s\(\[\;\)\]]/,
- symbol: /[\w*+!\-\._?:<>\/\xa1-\uffff]/
+ symbol: /[\w*+!\-\._?:<>\/\xa1-\uffff]/,
+ block_indent: /^(?:def|with)[^\/]+$|\/(?:def|with)/
};
function stateStack(indent, type, prev) { // represents a state stack object
@@ -142,7 +143,7 @@ CodeMirror.defineMode("clojure", function (options) {
}
// skip spaces
- if (stream.eatSpace()) {
+ if (state.mode != "string" && stream.eatSpace()) {
return null;
}
var returnType = null;
@@ -190,7 +191,7 @@ CodeMirror.defineMode("clojure", function (options) {
}
if (keyWord.length > 0 && (indentKeys.propertyIsEnumerable(keyWord) ||
- /^(?:def|with)/.test(keyWord))) { // indent-word
+ tests.block_indent.test(keyWord))) { // indent-word
pushStack(state, indentTemp + INDENT_WORD_SKIP, ch);
} else { // non-indent word
// we continue eating the spaces
@@ -243,5 +244,7 @@ CodeMirror.defineMode("clojure", function (options) {
});
CodeMirror.defineMIME("text/x-clojure", "clojure");
+CodeMirror.defineMIME("text/x-clojurescript", "clojure");
+CodeMirror.defineMIME("application/edn", "clojure");
});
diff --git a/public/vendor/codemirror/mode/crystal/crystal.js b/public/vendor/codemirror/mode/crystal/crystal.js
index 2e74bee4..e63627ce 100644
--- a/public/vendor/codemirror/mode/crystal/crystal.js
+++ b/public/vendor/codemirror/mode/crystal/crystal.js
@@ -209,7 +209,7 @@
// Operators
if (stream.match(operators)) {
- stream.eat("="); // Operators can follow assigin symbol.
+ stream.eat("="); // Operators can follow assign symbol.
return "operator";
}
diff --git a/public/vendor/codemirror/mode/dart/dart.js b/public/vendor/codemirror/mode/dart/dart.js
index d92eb519..8d383a95 100644
--- a/public/vendor/codemirror/mode/dart/dart.js
+++ b/public/vendor/codemirror/mode/dart/dart.js
@@ -72,6 +72,12 @@
return null;
}
return false;
+ },
+
+ "/": function(stream, state) {
+ if (!stream.eat("*")) return false
+ state.tokenize = tokenNestedComment(1)
+ return state.tokenize(stream, state)
}
}
});
@@ -121,6 +127,27 @@
return "variable";
}
+ function tokenNestedComment(depth) {
+ return function (stream, state) {
+ var ch
+ while (ch = stream.next()) {
+ if (ch == "*" && stream.eat("/")) {
+ if (depth == 1) {
+ state.tokenize = null
+ break
+ } else {
+ state.tokenize = tokenNestedComment(depth - 1)
+ return state.tokenize(stream, state)
+ }
+ } else if (ch == "/" && stream.eat("*")) {
+ state.tokenize = tokenNestedComment(depth + 1)
+ return state.tokenize(stream, state)
+ }
+ }
+ return "comment"
+ }
+ }
+
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/django/django.js b/public/vendor/codemirror/mode/django/django.js
index eb8d6591..7b4ef3b5 100644
--- a/public/vendor/codemirror/mode/django/django.js
+++ b/public/vendor/codemirror/mode/django/django.js
@@ -61,16 +61,16 @@
// Ignore completely any stream series that do not match the
// Django template opening tags.
- while (stream.next() != null && !stream.match("{{", false) && !stream.match("{%", false)) {}
+ while (stream.next() != null && !stream.match(/\{[{%#]/, false)) {}
return null;
}
// A string can be included in either single or double quotes (this is
- // the delimeter). Mark everything as a string until the start delimeter
+ // the delimiter). Mark everything as a string until the start delimiter
// occurs again.
- function inString (delimeter, previousTokenizer) {
+ function inString (delimiter, previousTokenizer) {
return function (stream, state) {
- if (!state.escapeNext && stream.eat(delimeter)) {
+ if (!state.escapeNext && stream.eat(delimiter)) {
state.tokenize = previousTokenizer;
} else {
if (state.escapeNext) {
@@ -80,7 +80,7 @@
var ch = stream.next();
// Take into account the backslash for escaping characters, such as
- // the string delimeter.
+ // the string delimiter.
if (ch == "\\") {
state.escapeNext = true;
}
@@ -100,7 +100,7 @@
return "null";
}
- // Dot folowed by a non-word character should be considered an error.
+ // Dot followed by a non-word character should be considered an error.
if (stream.match(/\.\W+/)) {
return "error";
} else if (stream.eat(".")) {
@@ -119,7 +119,7 @@
return "null";
}
- // Pipe folowed by a non-word character should be considered an error.
+ // Pipe followed by a non-word character should be considered an error.
if (stream.match(/\.\W+/)) {
return "error";
} else if (stream.eat("|")) {
@@ -199,7 +199,7 @@
return "null";
}
- // Dot folowed by a non-word character should be considered an error.
+ // Dot followed by a non-word character should be considered an error.
if (stream.match(/\.\W+/)) {
return "error";
} else if (stream.eat(".")) {
@@ -218,7 +218,7 @@
return "null";
}
- // Pipe folowed by a non-word character should be considered an error.
+ // Pipe followed by a non-word character should be considered an error.
if (stream.match(/\.\W+/)) {
return "error";
} else if (stream.eat("|")) {
@@ -317,9 +317,8 @@
// Mark everything as comment inside the tag and the tag itself.
function inComment (stream, state) {
- if (stream.match("#}")) {
- state.tokenize = tokenBase;
- }
+ if (stream.match(/^.*?#\}/)) state.tokenize = tokenBase
+ else stream.skipToEnd()
return "comment";
}
diff --git a/public/vendor/codemirror/mode/dtd/dtd.js b/public/vendor/codemirror/mode/dtd/dtd.js
index f37029a7..52d76ee1 100644
--- a/public/vendor/codemirror/mode/dtd/dtd.js
+++ b/public/vendor/codemirror/mode/dtd/dtd.js
@@ -114,17 +114,17 @@ CodeMirror.defineMode("dtd", function(config) {
if( textAfter.match(/\]\s+|\]/) )n=n-1;
else if(textAfter.substr(textAfter.length-1, textAfter.length) === ">"){
- if(textAfter.substr(0,1) === "<")n;
- else if( type == "doindent" && textAfter.length > 1 )n;
+ if(textAfter.substr(0,1) === "<") {}
+ else if( type == "doindent" && textAfter.length > 1 ) {}
else if( type == "doindent")n--;
- else if( type == ">" && textAfter.length > 1)n;
- else if( type == "tag" && textAfter !== ">")n;
+ else if( type == ">" && textAfter.length > 1) {}
+ else if( type == "tag" && textAfter !== ">") {}
else if( type == "tag" && state.stack[state.stack.length-1] == "rule")n--;
else if( type == "tag")n++;
else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule" && type === ">")n--;
- else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule")n;
+ else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule") {}
else if( textAfter.substr(0,1) !== "<" && textAfter.substr(0,1) === ">" )n=n-1;
- else if( textAfter === ">")n;
+ else if( textAfter === ">") {}
else n=n-1;
//over rule them all
if(type == null || type == "]")n--;
diff --git a/public/vendor/codemirror/mode/dylan/dylan.js b/public/vendor/codemirror/mode/dylan/dylan.js
index 85f0166c..1b46bc82 100644
--- a/public/vendor/codemirror/mode/dylan/dylan.js
+++ b/public/vendor/codemirror/mode/dylan/dylan.js
@@ -169,15 +169,16 @@ CodeMirror.defineMode("dylan", function(_config) {
} else if (stream.eat("/")) {
stream.skipToEnd();
return "comment";
- } else {
- stream.skipTo(" ");
- return "operator";
}
+ stream.backUp(1);
}
// Decimal
- else if (/\d/.test(ch)) {
- stream.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/);
- return "number";
+ else if (/[+\-\d\.]/.test(ch)) {
+ if (stream.match(/^[+-]?[0-9]*\.[0-9]*([esdx][+-]?[0-9]+)?/i) ||
+ stream.match(/^[+-]?[0-9]+([esdx][+-]?[0-9]+)/i) ||
+ stream.match(/^[+-]?\d+/)) {
+ return "number";
+ }
}
// Hash
else if (ch == "#") {
@@ -186,7 +187,7 @@ CodeMirror.defineMode("dylan", function(_config) {
ch = stream.peek();
if (ch == '"') {
stream.next();
- return chain(stream, state, tokenString('"', "string-2"));
+ return chain(stream, state, tokenString('"', "string"));
}
// Binary number
else if (ch == "b") {
@@ -206,11 +207,51 @@ CodeMirror.defineMode("dylan", function(_config) {
stream.eatWhile(/[0-7]/);
return "number";
}
+ // Token concatenation in macros
+ else if (ch == '#') {
+ stream.next();
+ return "punctuation";
+ }
+ // Sequence literals
+ else if ((ch == '[') || (ch == '(')) {
+ stream.next();
+ return "bracket";
// Hash symbol
- else {
+ } else if (stream.match(/f|t|all-keys|include|key|next|rest/i)) {
+ return "atom";
+ } else {
stream.eatWhile(/[-a-zA-Z]/);
- return "keyword";
+ return "error";
+ }
+ } else if (ch == "~") {
+ stream.next();
+ ch = stream.peek();
+ if (ch == "=") {
+ stream.next();
+ ch = stream.peek();
+ if (ch == "=") {
+ stream.next();
+ return "operator";
+ }
+ return "operator";
}
+ return "operator";
+ } else if (ch == ":") {
+ stream.next();
+ ch = stream.peek();
+ if (ch == "=") {
+ stream.next();
+ return "operator";
+ } else if (ch == ":") {
+ stream.next();
+ return "punctuation";
+ }
+ } else if ("[](){}".indexOf(ch) != -1) {
+ stream.next();
+ return "bracket";
+ } else if (".,".indexOf(ch) != -1) {
+ stream.next();
+ return "punctuation";
} else if (stream.match("end")) {
return "keyword";
}
@@ -223,6 +264,10 @@ CodeMirror.defineMode("dylan", function(_config) {
return patternStyles[name];
}
}
+ if (/[+\-*\/^=<>&|]/.test(ch)) {
+ stream.next();
+ return "operator";
+ }
if (stream.match("define")) {
return "def";
} else {
@@ -240,29 +285,37 @@ CodeMirror.defineMode("dylan", function(_config) {
}
function tokenComment(stream, state) {
- var maybeEnd = false,
- ch;
+ var maybeEnd = false, maybeNested = false, nestedCount = 0, ch;
while ((ch = stream.next())) {
if (ch == "/" && maybeEnd) {
- state.tokenize = tokenBase;
- break;
+ if (nestedCount > 0) {
+ nestedCount--;
+ } else {
+ state.tokenize = tokenBase;
+ break;
+ }
+ } else if (ch == "*" && maybeNested) {
+ nestedCount++;
}
maybeEnd = (ch == "*");
+ maybeNested = (ch == "/");
}
return "comment";
}
function tokenString(quote, style) {
return function(stream, state) {
- var next, end = false;
+ var escaped = false, next, end = false;
while ((next = stream.next()) != null) {
- if (next == quote) {
+ if (next == quote && !escaped) {
end = true;
break;
}
+ escaped = !escaped && next == "\\";
}
- if (end)
+ if (end || !escaped) {
state.tokenize = tokenBase;
+ }
return style;
};
}
diff --git a/public/vendor/codemirror/mode/dylan/test.js b/public/vendor/codemirror/mode/dylan/test.js
new file mode 100644
index 00000000..bf25be27
--- /dev/null
+++ b/public/vendor/codemirror/mode/dylan/test.js
@@ -0,0 +1,88 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function() {
+ var mode = CodeMirror.getMode({indentUnit: 2}, "dylan");
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
+
+ MT('comments',
+ '[comment // This is a line comment]',
+ '[comment /* This is a block comment */]',
+ '[comment /* This is a multi]',
+ '[comment line comment]',
+ '[comment */]',
+ '[comment /* And this is a /*]',
+ '[comment /* nested */ comment */]');
+
+ MT('unary_operators',
+ '[operator -][variable a]',
+ '[operator -] [variable a]',
+ '[operator ~][variable a]',
+ '[operator ~] [variable a]');
+
+ MT('binary_operators',
+ '[variable a] [operator +] [variable b]',
+ '[variable a] [operator -] [variable b]',
+ '[variable a] [operator *] [variable b]',
+ '[variable a] [operator /] [variable b]',
+ '[variable a] [operator ^] [variable b]',
+ '[variable a] [operator =] [variable b]',
+ '[variable a] [operator ==] [variable b]',
+ '[variable a] [operator ~=] [variable b]',
+ '[variable a] [operator ~==] [variable b]',
+ '[variable a] [operator <] [variable b]',
+ '[variable a] [operator <=] [variable b]',
+ '[variable a] [operator >] [variable b]',
+ '[variable a] [operator >=] [variable b]',
+ '[variable a] [operator &] [variable b]',
+ '[variable a] [operator |] [variable b]',
+ '[variable a] [operator :=] [variable b]');
+
+ MT('integers',
+ '[number 1]',
+ '[number 123]',
+ '[number -123]',
+ '[number +456]',
+ '[number #b010]',
+ '[number #o073]',
+ '[number #xabcDEF123]');
+
+ MT('floats',
+ '[number .3]',
+ '[number -1.]',
+ '[number -2.335]',
+ '[number +3.78d1]',
+ '[number 3.78s-1]',
+ '[number -3.32e+5]');
+
+ MT('characters_and_strings',
+ "[string 'a']",
+ "[string '\\\\'']",
+ '[string ""]',
+ '[string "a"]',
+ '[string "abc def"]',
+ '[string "More escaped characters: \\\\\\\\ \\\\a \\\\b \\\\e \\\\f \\\\n \\\\r \\\\t \\\\0 ..."]');
+
+ MT('brackets',
+ '[bracket #[[]]]',
+ '[bracket #()]',
+ '[bracket #(][number 1][bracket )]',
+ '[bracket [[][number 1][punctuation ,] [number 3][bracket ]]]',
+ '[bracket ()]',
+ '[bracket {}]',
+ '[keyword if] [bracket (][variable foo][bracket )]',
+ '[bracket (][number 1][bracket )]',
+ '[bracket [[][number 1][bracket ]]]');
+
+ MT('hash_words',
+ '[punctuation ##]',
+ '[atom #f]', '[atom #F]',
+ '[atom #t]', '[atom #T]',
+ '[atom #all-keys]',
+ '[atom #include]',
+ '[atom #key]',
+ '[atom #next]',
+ '[atom #rest]',
+ '[string #"foo"]',
+ '[error #invalid]');
+})();
diff --git a/public/vendor/codemirror/mode/fcl/fcl.js b/public/vendor/codemirror/mode/fcl/fcl.js
new file mode 100644
index 00000000..51811697
--- /dev/null
+++ b/public/vendor/codemirror/mode/fcl/fcl.js
@@ -0,0 +1,173 @@
+// 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("fcl", function(config) {
+ var indentUnit = config.indentUnit;
+
+ var keywords = {
+ "term": true,
+ "method": true, "accu": true,
+ "rule": true, "then": true, "is": true, "and": true, "or": true,
+ "if": true, "default": true
+ };
+
+ var start_blocks = {
+ "var_input": true,
+ "var_output": true,
+ "fuzzify": true,
+ "defuzzify": true,
+ "function_block": true,
+ "ruleblock": true
+ };
+
+ var end_blocks = {
+ "end_ruleblock": true,
+ "end_defuzzify": true,
+ "end_function_block": true,
+ "end_fuzzify": true,
+ "end_var": true
+ };
+
+ var atoms = {
+ "true": true, "false": true, "nan": true,
+ "real": true, "min": true, "max": true, "cog": true, "cogs": true
+ };
+
+ var isOperatorChar = /[+\-*&^%:=<>!|\/]/;
+
+ function tokenBase(stream, state) {
+ var ch = stream.next();
+
+ if (/[\d\.]/.test(ch)) {
+ if (ch == ".") {
+ stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/);
+ } else if (ch == "0") {
+ stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/);
+ } else {
+ stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/);
+ }
+ return "number";
+ }
+
+ if (ch == "/" || ch == "(") {
+ if (stream.eat("*")) {
+ state.tokenize = tokenComment;
+ return tokenComment(stream, state);
+ }
+ if (stream.eat("/")) {
+ stream.skipToEnd();
+ return "comment";
+ }
+ }
+ if (isOperatorChar.test(ch)) {
+ stream.eatWhile(isOperatorChar);
+ return "operator";
+ }
+ stream.eatWhile(/[\w\$_\xa1-\uffff]/);
+
+ var cur = stream.current().toLowerCase();
+ if (keywords.propertyIsEnumerable(cur) ||
+ start_blocks.propertyIsEnumerable(cur) ||
+ end_blocks.propertyIsEnumerable(cur)) {
+ return "keyword";
+ }
+ if (atoms.propertyIsEnumerable(cur)) return "atom";
+ return "variable";
+ }
+
+
+ function tokenComment(stream, state) {
+ var maybeEnd = false, ch;
+ while (ch = stream.next()) {
+ if ((ch == "/" || ch == ")") && maybeEnd) {
+ state.tokenize = tokenBase;
+ break;
+ }
+ maybeEnd = (ch == "*");
+ }
+ return "comment";
+ }
+
+ 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) {
+ if (!state.context.prev) return;
+ var t = state.context.type;
+ if (t == "end_block")
+ state.indented = state.context.indented;
+ return state.context = state.context.prev;
+ }
+
+ // Interface
+
+ return {
+ startState: function(basecolumn) {
+ return {
+ tokenize: null,
+ context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
+ indented: 0,
+ startOfLine: true
+ };
+ },
+
+ 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;
+ }
+ if (stream.eatSpace()) return null;
+
+ var style = (state.tokenize || tokenBase)(stream, state);
+ if (style == "comment") return style;
+ if (ctx.align == null) ctx.align = true;
+
+ var cur = stream.current().toLowerCase();
+
+ if (start_blocks.propertyIsEnumerable(cur)) pushContext(state, stream.column(), "end_block");
+ else if (end_blocks.propertyIsEnumerable(cur)) popContext(state);
+
+ state.startOfLine = false;
+ return style;
+ },
+
+ indent: function(state, textAfter) {
+ if (state.tokenize != tokenBase && state.tokenize != null) return 0;
+ var ctx = state.context;
+
+ var closing = end_blocks.propertyIsEnumerable(textAfter);
+ if (ctx.align) return ctx.column + (closing ? 0 : 1);
+ else return ctx.indented + (closing ? 0 : indentUnit);
+ },
+
+ electricChars: "ryk",
+ fold: "brace",
+ blockCommentStart: "(*",
+ blockCommentEnd: "*)",
+ lineComment: "//"
+ };
+});
+
+CodeMirror.defineMIME("text/x-fcl", "fcl");
+});
diff --git a/public/vendor/codemirror/mode/fcl/index.html b/public/vendor/codemirror/mode/fcl/index.html
new file mode 100644
index 00000000..3c18d0b3
--- /dev/null
+++ b/public/vendor/codemirror/mode/fcl/index.html
@@ -0,0 +1,108 @@
+<!doctype html>
+
+<title>CodeMirror: FCL mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<link rel="stylesheet" href="../../theme/elegant.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/edit/matchbrackets.js"></script>
+<script src="fcl.js"></script>
+<style>.CodeMirror {border:1px solid #999; background:#ffc}</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">FCL</a>
+ </ul>
+</div>
+
+<article>
+<h2>FCL mode</h2>
+<form><textarea id="code" name="code">
+ FUNCTION_BLOCK Fuzzy_FB
+ VAR_INPUT
+ TimeDay : REAL; (* RANGE(0 .. 23) *)
+ ApplicateHost: REAL;
+ TimeConfiguration: REAL;
+ TimeRequirements: REAL;
+ END_VAR
+
+ VAR_OUTPUT
+ ProbabilityDistribution: REAL;
+ ProbabilityAccess: REAL;
+ END_VAR
+
+ FUZZIFY TimeDay
+ TERM inside := (0, 0) (8, 1) (22,0);
+ TERM outside := (0, 1) (8, 0) (22, 1);
+ END_FUZZIFY
+
+ FUZZIFY ApplicateHost
+ TERM few := (0, 1) (100, 0) (200, 0);
+ TERM many := (0, 0) (100, 0) (200, 1);
+ END_FUZZIFY
+
+ FUZZIFY TimeConfiguration
+ TERM recently := (0, 1) (30, 1) (120, 0);
+ TERM long := (0, 0) (30, 0) (120, 1);
+ END_FUZZIFY
+
+ FUZZIFY TimeRequirements
+ TERM recently := (0, 1) (30, 1) (365, 0);
+ TERM long := (0, 0) (30, 0) (365, 1);
+ END_FUZZIFY
+
+ DEFUZZIFY ProbabilityAccess
+ TERM hight := 1;
+ TERM medium := 0.5;
+ TERM low := 0;
+ ACCU: MAX;
+ METHOD: COGS;
+ DEFAULT := 0;
+ END_DEFUZZIFY
+
+ DEFUZZIFY ProbabilityDistribution
+ TERM hight := 1;
+ TERM medium := 0.5;
+ TERM low := 0;
+ ACCU: MAX;
+ METHOD: COGS;
+ DEFAULT := 0;
+ END_DEFUZZIFY
+
+ RULEBLOCK No1
+ AND : MIN;
+ RULE 1 : IF TimeDay IS outside AND ApplicateHost IS few THEN ProbabilityAccess IS hight;
+ RULE 2 : IF ApplicateHost IS many THEN ProbabilityAccess IS hight;
+ RULE 3 : IF TimeDay IS inside AND ApplicateHost IS few THEN ProbabilityAccess IS low;
+ END_RULEBLOCK
+
+ RULEBLOCK No2
+ AND : MIN;
+ RULE 1 : IF ApplicateHost IS many THEN ProbabilityDistribution IS hight;
+ END_RULEBLOCK
+
+ END_FUNCTION_BLOCK
+</textarea></form>
+
+ <script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ theme: "elegant",
+ matchBrackets: true,
+ indentUnit: 8,
+ tabSize: 8,
+ indentWithTabs: true,
+ mode: "text/x-fcl"
+ });
+ </script>
+
+ <p><strong>MIME type:</strong> <code>text/x-fcl</code></p>
+ </article>
diff --git a/public/vendor/codemirror/mode/gfm/index.html b/public/vendor/codemirror/mode/gfm/index.html
index 7e38c52d..24c90c06 100644
--- a/public/vendor/codemirror/mode/gfm/index.html
+++ b/public/vendor/codemirror/mode/gfm/index.html
@@ -47,7 +47,7 @@ Underscores_are_allowed_between_words.
GFM adds syntax to strikethrough text, which is missing from standard Markdown.
~~Mistaken text.~~
-~~**works with other fomatting**~~
+~~**works with other formatting**~~
~~spans across
lines~~
diff --git a/public/vendor/codemirror/mode/gfm/test.js b/public/vendor/codemirror/mode/gfm/test.js
index 0dcd3619..7a1a4ccf 100644
--- a/public/vendor/codemirror/mode/gfm/test.js
+++ b/public/vendor/codemirror/mode/gfm/test.js
@@ -51,6 +51,12 @@
"[comment ```]",
"bar");
+ MT("fencedCodeBlockModeSwitchingObjc",
+ "[comment ```objective-c]",
+ "[keyword @property] [variable NSString] [operator *] [variable foo];",
+ "[comment ```]",
+ "bar");
+
MT("fencedCodeBlocksNoTildes",
"~~~",
"foo",
diff --git a/public/vendor/codemirror/mode/haml/haml.js b/public/vendor/codemirror/mode/haml/haml.js
index 03ce8335..86def73e 100644
--- a/public/vendor/codemirror/mode/haml/haml.js
+++ b/public/vendor/codemirror/mode/haml/haml.js
@@ -11,7 +11,7 @@
})(function(CodeMirror) {
"use strict";
- // full haml mode. This handled embeded ruby and html fragments too
+ // full haml mode. This handled embedded ruby and html fragments too
CodeMirror.defineMode("haml", function(config) {
var htmlMode = CodeMirror.getMode(config, {name: "htmlmixed"});
var rubyMode = CodeMirror.getMode(config, "ruby");
diff --git a/public/vendor/codemirror/mode/handlebars/index.html b/public/vendor/codemirror/mode/handlebars/index.html
index 4f82d602..b1bfad1c 100644
--- a/public/vendor/codemirror/mode/handlebars/index.html
+++ b/public/vendor/codemirror/mode/handlebars/index.html
@@ -1,4 +1,4 @@
-<!doctype html>
+<!doctype html>
<title>CodeMirror: Handlebars mode</title>
<meta charset="utf-8"/>
@@ -71,4 +71,9 @@
<p>Handlebars syntax highlighting for CodeMirror.</p>
<p><strong>MIME types defined:</strong> <code>text/x-handlebars-template</code></p>
+
+ <p>Supported options: <code>base</code> to set the mode to
+ wrap. For example, use</p>
+ <pre>mode: {name: "handlebars", base: "text/html"}</pre>
+ <p>to highlight an HTML template.</p>
</article>
diff --git a/public/vendor/codemirror/mode/haskell-literate/haskell-literate.js b/public/vendor/codemirror/mode/haskell-literate/haskell-literate.js
index 9358994d..906415b4 100644
--- a/public/vendor/codemirror/mode/haskell-literate/haskell-literate.js
+++ b/public/vendor/codemirror/mode/haskell-literate/haskell-literate.js
@@ -40,4 +40,4 @@
}, "haskell")
CodeMirror.defineMIME("text/x-literate-haskell", "haskell-literate")
-})
+});
diff --git a/public/vendor/codemirror/mode/htmlembedded/index.html b/public/vendor/codemirror/mode/htmlembedded/index.html
index 365ef8f3..f27582ef 100644
--- a/public/vendor/codemirror/mode/htmlembedded/index.html
+++ b/public/vendor/codemirror/mode/htmlembedded/index.html
@@ -52,7 +52,7 @@ This is an example of EJS (embedded javascript)
</script>
<p>Mode for html embedded scripts like JSP and ASP.NET. Depends on HtmlMixed which in turn depends on
- JavaScript, CSS and XML.<br />Other dependancies include those of the scriping language chosen.</p>
+ JavaScript, CSS and XML.<br />Other dependencies include those of the scripting language chosen.</p>
<p><strong>MIME types defined:</strong> <code>application/x-aspx</code> (ASP.NET),
<code>application/x-ejs</code> (Embedded Javascript), <code>application/x-jsp</code> (JavaServer Pages)</p>
diff --git a/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js b/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js
index 21e74f16..6574fbd5 100644
--- a/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js
+++ b/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js
@@ -44,13 +44,9 @@
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 getAttrValue(text, attr) {
+ var match = text.match(getAttrRegexp(attr))
+ return match ? match[2] : ""
}
function getTagRegexp(tagName, anchored) {
@@ -66,10 +62,10 @@
}
}
- function findMatchingMode(tagInfo, stream) {
+ function findMatchingMode(tagInfo, tagText) {
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];
+ if (!spec[0] || spec[1].test(getAttrValue(tagText, spec[0]))) return spec[2];
}
}
@@ -89,15 +85,17 @@
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);
+ var style = htmlMode.token(stream, state.htmlState), tag = /\btag\b/.test(style), tagName
+ if (tag && !/[<>\s\/]/.test(stream.current()) &&
+ (tagName = state.htmlState.tagName && state.htmlState.tagName.toLowerCase()) &&
+ tags.hasOwnProperty(tagName)) {
+ state.inTag = tagName + " "
+ } else if (state.inTag && tag && />$/.test(stream.current())) {
+ var inTag = /^([\S]+) (.*)/.exec(state.inTag)
+ state.inTag = null
+ var modeSpec = stream.current() == ">" && findMatchingMode(tags[inTag[1]], inTag[2])
+ var mode = CodeMirror.getMode(config, modeSpec)
+ var endTagA = getTagRegexp(inTag[1], true), endTag = getTagRegexp(inTag[1], false);
state.token = function (stream, state) {
if (stream.match(endTagA, false)) {
state.token = html;
@@ -108,6 +106,9 @@
};
state.localMode = mode;
state.localState = CodeMirror.startState(mode, htmlMode.indent(state.htmlState, ""));
+ } else if (state.inTag) {
+ state.inTag += stream.current()
+ if (stream.eol()) state.inTag += " "
}
return style;
};
@@ -115,7 +116,7 @@
return {
startState: function () {
var state = htmlMode.startState();
- return {token: html, localMode: null, localState: null, htmlState: state};
+ return {token: html, inTag: null, localMode: null, localState: null, htmlState: state};
},
copyState: function (state) {
@@ -123,7 +124,8 @@
if (state.localState) {
local = CodeMirror.copyState(state.localMode, state.localState);
}
- return {token: state.token, localMode: state.localMode, localState: local,
+ return {token: state.token, inTag: state.inTag,
+ localMode: state.localMode, localState: local,
htmlState: CodeMirror.copyState(htmlMode, state.htmlState)};
},
diff --git a/public/vendor/codemirror/mode/index.html b/public/vendor/codemirror/mode/index.html
index a6c293ec..be583159 100644
--- a/public/vendor/codemirror/mode/index.html
+++ b/public/vendor/codemirror/mode/index.html
@@ -59,6 +59,7 @@ option.</p>
<li><a href="elm/index.html">Elm</a></li>
<li><a href="erlang/index.html">Erlang</a></li>
<li><a href="factor/index.html">Factor</a></li>
+ <li><a href="fcl/index.html">FCL</a></li>
<li><a href="forth/index.html">Forth</a></li>
<li><a href="fortran/index.html">Fortran</a></li>
<li><a href="mllike/index.html">F#</a></li>
@@ -102,7 +103,9 @@ option.</p>
<li><a href="asciiarmor/index.html">PGP (ASCII armor)</a></li>
<li><a href="php/index.html">PHP</a></li>
<li><a href="pig/index.html">Pig Latin</a></li>
+ <li><a href="powershell/index.html">PowerShell</a></li>
<li><a href="properties/index.html">Properties files</a></li>
+ <li><a href="protobuf/index.html">ProtoBuf</a></li>
<li><a href="puppet/index.html">Puppet</a></li>
<li><a href="python/index.html">Python</a></li>
<li><a href="q/index.html">Q</a></li>
@@ -111,6 +114,7 @@ option.</p>
<li><a href="rst/index.html">reStructuredText</a></li>
<li><a href="ruby/index.html">Ruby</a></li>
<li><a href="rust/index.html">Rust</a></li>
+ <li><a href="sas/index.html">SAS</a></li>
<li><a href="sass/index.html">Sass</a></li>
<li><a href="spreadsheet/index.html">Spreadsheet</a></li>
<li><a href="clike/scala.html">Scala</a></li>
@@ -146,8 +150,10 @@ option.</p>
<li><a href="verilog/index.html">Verilog/SystemVerilog</a></li>
<li><a href="vhdl/index.html">VHDL</a></li>
<li><a href="vue/index.html">Vue.js app</a></li>
+ <li><a href="webidl/index.html">Web IDL</a></li>
<li><a href="xml/index.html">XML/HTML</a></li>
<li><a href="xquery/index.html">XQuery</a></li>
+ <li><a href="yacas/index.html">Yacas</a></li>
<li><a href="yaml/index.html">YAML</a></li>
<li><a href="yaml-frontmatter/index.html">YAML frontmatter</a></li>
<li><a href="z80/index.html">Z80</a></li>
diff --git a/public/vendor/codemirror/mode/jsx/jsx.js b/public/vendor/codemirror/mode/jsx/jsx.js
index bc2ea797..aff01b8d 100644
--- a/public/vendor/codemirror/mode/jsx/jsx.js
+++ b/public/vendor/codemirror/mode/jsx/jsx.js
@@ -25,9 +25,9 @@
context.prev && copyContext(context.prev))
}
- CodeMirror.defineMode("jsx", function(config) {
+ CodeMirror.defineMode("jsx", function(config, modeConfig) {
var xmlMode = CodeMirror.getMode(config, {name: "xml", allowMissing: true, multilineTagIndentPastTag: false})
- var jsMode = CodeMirror.getMode(config, "javascript")
+ var jsMode = CodeMirror.getMode(config, modeConfig && modeConfig.base || "javascript")
function flatXMLIndent(state) {
var tagName = state.tagName
@@ -144,4 +144,4 @@
}, "xml", "javascript")
CodeMirror.defineMIME("text/jsx", "jsx")
-})
+});
diff --git a/public/vendor/codemirror/mode/julia/julia.js b/public/vendor/codemirror/mode/julia/julia.js
index 4471896b..004de443 100644
--- a/public/vendor/codemirror/mode/julia/julia.js
+++ b/public/vendor/codemirror/mode/julia/julia.js
@@ -14,27 +14,34 @@
CodeMirror.defineMode("julia", function(_conf, parserConf) {
var ERRORCLASS = 'error';
- function wordRegexp(words) {
- return new RegExp("^((" + words.join(")|(") + "))\\b");
+ function wordRegexp(words, end) {
+ if (typeof end === 'undefined') { end = "\\b"; }
+ return new RegExp("^((" + words.join(")|(") + "))" + end);
}
+ var octChar = "\\\\[0-7]{1,3}";
+ var hexChar = "\\\\x[A-Fa-f0-9]{1,2}";
+ var specialChar = "\\\\[abfnrtv0%?'\"\\\\]";
+ var singleChar = "([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])";
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][\w\u00A1-\uFFFF]*!*/;
+ var charsList = [octChar, hexChar, specialChar, singleChar];
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'];
var builtinList = ['true', 'false', 'nothing', 'NaN', 'Inf'];
//var stringPrefixes = new RegExp("^[br]?('|\")")
- var stringPrefixes = /^(`|'|"{3}|([brv]?"))/;
+ var stringPrefixes = /^(`|"{3}|([brv]?"))/;
+ var chars = wordRegexp(charsList, "'");
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\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/;
- var typeAnnotation = /^::[^.,;"{()=$\s]+({[^}]*}+)*/;
+ var macro = /^@[_A-Za-z][\w]*/;
+ var symbol = /^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/;
+ var typeAnnotation = /^::[^,;"{()=$\s]+({[^}]*}+)*/;
function inArray(state) {
var ch = currentScope(state);
@@ -53,19 +60,10 @@ 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 multiline comments
+ if (stream.match(/^#=/, false)) {
+ state.tokenize = tokenComment;
+ return state.tokenize(stream, state);
}
// Handle scope changes
@@ -100,6 +98,10 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
state.scopes.push('[');
}
+ if (ch === '(') {
+ state.scopes.push('(');
+ }
+
var scope = currentScope(state);
if (scope == '[' && ch === ']') {
@@ -137,33 +139,20 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
// Handle Number Literals
if (stream.match(/^[0-9\.]/, false)) {
var imMatcher = RegExp(/^im\b/);
- var floatLiteral = false;
+ var numberLiteral = false;
// Floats
- 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.leavingExpr = true;
- return 'number';
- }
+ if (stream.match(/^\d*\.(?!\.)\d*([Eef][\+\-]?\d+)?/i)) { numberLiteral = true; }
+ if (stream.match(/^\d+\.(?!\.)\d*/)) { numberLiteral = true; }
+ if (stream.match(/^\.\d+/)) { numberLiteral = true; }
+ if (stream.match(/^0x\.[0-9a-f]+p[\+\-]?\d+/i)) { numberLiteral = true; }
// Integers
- var intLiteral = false;
- // Hex
- if (stream.match(/^0x[0-9a-f]+/i)) { intLiteral = true; }
- // Binary
- if (stream.match(/^0b[01]+/i)) { intLiteral = true; }
- // Octal
- if (stream.match(/^0o[0-7]+/i)) { intLiteral = true; }
- // Decimal
- if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) {
- intLiteral = true;
- }
+ if (stream.match(/^0x[0-9a-f]+/i)) { numberLiteral = true; } // Hex
+ if (stream.match(/^0b[01]+/i)) { numberLiteral = true; } // Binary
+ if (stream.match(/^0o[0-7]+/i)) { numberLiteral = true; } // Octal
+ if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) { numberLiteral = true; } // Decimal
// Zero by itself with no other piece of number.
- if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; }
- if (intLiteral) {
+ if (stream.match(/^0(?![\dx])/i)) { numberLiteral = true; }
+ if (numberLiteral) {
// Integer literals may be "long"
stream.match(imMatcher);
state.leavingExpr = true;
@@ -194,6 +183,12 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
return 'operator';
}
+ // Handle Chars
+ if (stream.match(/^'/)) {
+ state.tokenize = tokenChar;
+ return state.tokenize(stream, state);
+ }
+
// Handle Strings
if (stream.match(stringPrefixes)) {
state.tokenize = tokenStringFactory(stream.current());
@@ -269,7 +264,7 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
// over two or more lines.
if (stream.match(/^$/g, false)) {
stream.backUp(state.charsAdvanced);
- while (state.scopes.length > state.firstParenPos + 1)
+ while (state.scopes.length > state.firstParenPos)
state.scopes.pop();
state.firstParenPos = -1;
state.charsAdvanced = 0;
@@ -279,33 +274,65 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
return callOrDef(stream, state);
}
+ function tokenComment(stream, state) {
+ if (stream.match(/^#=/)) {
+ state.weakScopes++;
+ }
+ if (!stream.match(/.*?(?=(#=|=#))/)) {
+ stream.skipToEnd();
+ }
+ if (stream.match(/^=#/)) {
+ state.weakScopes--;
+ if (state.weakScopes == 0)
+ state.tokenize = tokenBase;
+ }
+ return 'comment';
+ }
+
+ function tokenChar(stream, state) {
+ var isChar = false, match;
+ if (stream.match(chars)) {
+ isChar = true;
+ } else if (match = stream.match(/\\u([a-f0-9]{1,4})(?=')/i)) {
+ var value = parseInt(match[1], 16);
+ if (value <= 55295 || value >= 57344) { // (U+0,U+D7FF), (U+E000,U+FFFF)
+ isChar = true;
+ stream.next();
+ }
+ } else if (match = stream.match(/\\U([A-Fa-f0-9]{5,8})(?=')/)) {
+ var value = parseInt(match[1], 16);
+ if (value <= 1114111) { // U+10FFFF
+ isChar = true;
+ stream.next();
+ }
+ }
+ if (isChar) {
+ state.leavingExpr = true;
+ state.tokenize = tokenBase;
+ return 'string';
+ }
+ if (!stream.match(/^[^']+(?=')/)) { stream.skipToEnd(); }
+ if (stream.match(/^'/)) { state.tokenize = tokenBase; }
+ return ERRORCLASS;
+ }
+
function tokenStringFactory(delimiter) {
while ('bruv'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) {
delimiter = delimiter.substr(1);
}
- var singleline = delimiter == "'";
var OUTCLASS = 'string';
function tokenString(stream, state) {
while (!stream.eol()) {
- stream.eatWhile(/[^'"\\]/);
+ stream.eatWhile(/[^"\\]/);
if (stream.eat('\\')) {
stream.next();
- if (singleline && stream.eol()) {
- return OUTCLASS;
- }
} else if (stream.match(delimiter)) {
state.tokenize = tokenBase;
+ state.leavingExpr = true;
return OUTCLASS;
} else {
- stream.eat(/['"]/);
- }
- }
- if (singleline) {
- if (parserConf.singleLineStringErrors) {
- return ERRORCLASS;
- } else {
- state.tokenize = tokenBase;
+ stream.eat(/["]/);
}
}
return OUTCLASS;
@@ -319,6 +346,7 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
return {
tokenize: tokenBase,
scopes: [],
+ weakScopes: 0,
lastToken: null,
leavingExpr: false,
isDefinition: false,
@@ -345,15 +373,15 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
indent: function(state, textAfter) {
var delta = 0;
- if (textAfter == "end" || textAfter == "]" || textAfter == "}" || textAfter == "else" || textAfter == "elseif" || textAfter == "catch" || textAfter == "finally") {
+ if (textAfter == "]" || textAfter == ")" || textAfter == "end" || textAfter == "else" || textAfter == "elseif" || textAfter == "catch" || textAfter == "finally") {
delta = -1;
}
return (state.scopes.length + delta) * _conf.indentUnit;
},
+ electricInput: /(end|else(if)?|catch|finally)$/,
lineComment: "#",
- fold: "indent",
- electricChars: "edlsifyh]}"
+ fold: "indent"
};
return external;
});
diff --git a/public/vendor/codemirror/mode/markdown/markdown.js b/public/vendor/codemirror/mode/markdown/markdown.js
index 415a6c78..8bd3cc7a 100644
--- a/public/vendor/codemirror/mode/markdown/markdown.js
+++ b/public/vendor/codemirror/mode/markdown/markdown.js
@@ -88,7 +88,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
, setextHeaderRE = /^ *(?:\={1,}|-{1,})\s*$/
, textRE = /^[^#!\[\]*_\\<>` "'(~]+/
, fencedCodeRE = new RegExp("^(" + (modeCfg.fencedCodeBlocks === true ? "~~~+|```+" : modeCfg.fencedCodeBlocks) +
- ")[ \\t]*([\\w+#]*)");
+ ")[ \\t]*([\\w+#\-]*)");
function switchInline(stream, state, f) {
state.f = state.inline = f;
@@ -804,4 +804,4 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
CodeMirror.defineMIME("text/x-markdown", "markdown");
-}); \ No newline at end of file
+});
diff --git a/public/vendor/codemirror/mode/markdown/test.js b/public/vendor/codemirror/mode/markdown/test.js
index 6d7829fa..e2b3a815 100644
--- a/public/vendor/codemirror/mode/markdown/test.js
+++ b/public/vendor/codemirror/mode/markdown/test.js
@@ -452,6 +452,18 @@
"",
"hello");
+ MT("listCommonMarkIndentationCode",
+ "[variable-2 * Code blocks also affect]",
+ " [variable-3 * The next level starts where the contents start.]",
+ " [variable-3 * Anything less than that will keep the item on the same level.]",
+ " [variable-3 * Each list item can indent the first level further and further.]",
+ " [variable-3 * For the most part, this makes sense while writing a list.]",
+ " [keyword * This means two items with same indentation can be different levels.]",
+ " [keyword * Each level has an indent requirement that can change between items.]",
+ " [keyword * A list item that meets this will be part of the next level.]",
+ " [variable-3 * Otherwise, it will be part of the level where it does meet this.]",
+ " [variable-2 * World]");
+
// Blockquote
MT("blockquote",
"[variable-2 * foo]",
@@ -635,7 +647,7 @@
MT("linkReferenceEmStrong",
"[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string&url [[bar]]] hello");
- // Reference-style links with optional space separator (per docuentation)
+ // Reference-style links with optional space separator (per documentation)
// "You can optionally use a space to separate the sets of brackets"
MT("linkReferenceSpace",
"[link [[foo]]] [string&url [[bar]]] hello");
@@ -671,7 +683,7 @@
MT("labelTitleSingleQuotes",
"[link [[foo]]:] [string&url http://example.com/ 'bar']");
- MT("labelTitleParenthese",
+ MT("labelTitleParentheses",
"[link [[foo]]:] [string&url http://example.com/ (bar)]");
MT("labelTitleInvalid",
@@ -688,7 +700,7 @@
"[link [[foo]]:] [string&url http://example.com/]",
"[string 'bar'] hello");
- MT("labelTitleNextParenthese",
+ MT("labelTitleNextParentheses",
"[link [[foo]]:] [string&url http://example.com/]",
"[string (bar)] hello");
diff --git a/public/vendor/codemirror/mode/mathematica/mathematica.js b/public/vendor/codemirror/mode/mathematica/mathematica.js
index 5ae6f55c..d6977088 100644
--- a/public/vendor/codemirror/mode/mathematica/mathematica.js
+++ b/public/vendor/codemirror/mode/mathematica/mathematica.js
@@ -126,6 +126,7 @@ CodeMirror.defineMode('mathematica', function(_config, _parserConfig) {
}
// everything else is an error
+ stream.next(); // advance the stream.
return 'error';
}
diff --git a/public/vendor/codemirror/mode/meta.js b/public/vendor/codemirror/mode/meta.js
index 49520717..6980593f 100644
--- a/public/vendor/codemirror/mode/meta.js
+++ b/public/vendor/codemirror/mode/meta.js
@@ -21,7 +21,8 @@
{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: "Clojure", mime: "text/x-clojure", mode: "clojure", ext: ["clj", "cljc", "cljx"]},
+ {name: "ClojureScript", mime: "text/x-clojurescript", mode: "clojure", ext: ["cljs"]},
{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"]},
@@ -40,12 +41,14 @@
{name: "Dylan", mime: "text/x-dylan", mode: "dylan", ext: ["dylan", "dyl", "intr"]},
{name: "EBNF", mime: "text/x-ebnf", mode: "ebnf"},
{name: "ECL", mime: "text/x-ecl", mode: "ecl", ext: ["ecl"]},
+ {name: "edn", mime: "application/edn", mode: "clojure", ext: ["edn"]},
{name: "Eiffel", mime: "text/x-eiffel", mode: "eiffel", ext: ["e"]},
{name: "Elm", mime: "text/x-elm", mode: "elm", ext: ["elm"]},
{name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]},
{name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]},
{name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]},
{name: "Factor", mime: "text/x-factor", mode: "factor", ext: ["factor"]},
+ {name: "FCL", mime: "text/x-fcl", mode: "fcl"},
{name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]},
{name: "Fortran", mime: "text/x-fortran", mode: "fortran", ext: ["f", "for", "f77", "f90"]},
{name: "F#", mime: "text/x-fsharp", mode: "mllike", ext: ["fs"], alias: ["fsharp"]},
@@ -53,7 +56,7 @@
{name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]},
{name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm", file: /^(readme|contributing|history).md$/i},
{name: "Go", mime: "text/x-go", mode: "go", ext: ["go"]},
- {name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy"]},
+ {name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy", "gradle"]},
{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"]},
@@ -82,13 +85,13 @@
{name: "MariaDB SQL", mime: "text/x-mariadb", mode: "sql"},
{name: "Mathematica", mime: "text/x-mathematica", mode: "mathematica", ext: ["m", "nb"]},
{name: "Modelica", mime: "text/x-modelica", mode: "modelica", ext: ["mo"]},
- {name: "MUMPS", mime: "text/x-mumps", mode: "mumps"},
+ {name: "MUMPS", mime: "text/x-mumps", mode: "mumps", ext: ["mps"]},
{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: "Objective C", mime: "text/x-objectivec", mode: "clike", ext: ["m", "mm"], alias: ["objective-c", "objc"]},
{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"]},
@@ -99,8 +102,10 @@
{name: "Pig", mime: "text/x-pig", mode: "pig", ext: ["pig"]},
{name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"]},
{name: "PLSQL", mime: "text/x-plsql", mode: "sql", ext: ["pls"]},
+ {name: "PowerShell", mime: "application/x-powershell", mode: "powershell", ext: ["ps1", "psd1", "psm1"]},
{name: "Properties files", mime: "text/x-properties", mode: "properties", ext: ["properties", "ini", "in"], alias: ["ini", "properties"]},
- {name: "Python", mime: "text/x-python", mode: "python", ext: ["py", "pyw"]},
+ {name: "ProtoBuf", mime: "text/x-protobuf", mode: "protobuf", ext: ["proto"]},
+ {name: "Python", mime: "text/x-python", mode: "python", ext: ["BUILD", "bzl", "py", "pyw"], file: /^(BUCK|BUILD)$/},
{name: "Puppet", mime: "text/x-puppet", mode: "puppet", ext: ["pp"]},
{name: "Q", mime: "text/x-q", mode: "q", ext: ["q"]},
{name: "R", mime: "text/x-rsrc", mode: "r", ext: ["r"], alias: ["rscript"]},
@@ -109,6 +114,7 @@
{name: "RPM Spec", mime: "text/x-rpm-spec", mode: "rpm", ext: ["spec"]},
{name: "Ruby", mime: "text/x-ruby", mode: "ruby", ext: ["rb"], alias: ["jruby", "macruby", "rake", "rb", "rbx"]},
{name: "Rust", mime: "text/x-rustsrc", mode: "rust", ext: ["rs"]},
+ {name: "SAS", mime: "text/x-sas", mode: "sas", ext: ["sas"]},
{name: "Sass", mime: "text/x-sass", mode: "sass", ext: ["sass"]},
{name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"]},
{name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"]},
@@ -125,7 +131,6 @@
{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"},
{name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx"], alias: ["tex"]},
{name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v"]},
@@ -135,12 +140,13 @@
{name: "Tiki wiki", mime: "text/tiki", mode: "tiki"},
{name: "TOML", mime: "text/x-toml", mode: "toml", ext: ["toml"]},
{name: "Tornado", mime: "text/x-tornado", mode: "tornado"},
- {name: "troff", mime: "troff", mode: "troff", ext: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]},
+ {name: "troff", mime: "text/troff", mode: "troff", ext: ["1", "2", "3", "4", "5", "6", "7", "8", "9"]},
{name: "TTCN", mime: "text/x-ttcn", mode: "ttcn", ext: ["ttcn", "ttcn3", "ttcnpp"]},
{name: "TTCN_CFG", mime: "text/x-ttcn-cfg", mode: "ttcn-cfg", ext: ["cfg"]},
{name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]},
{name: "TypeScript", mime: "application/typescript", mode: "javascript", ext: ["ts"], alias: ["ts"]},
{name: "Twig", mime: "text/x-twig", mode: "twig"},
+ {name: "Web IDL", mime: "text/x-webidl", mode: "webidl", ext: ["webidl"]},
{name: "VB.NET", mime: "text/x-vb", mode: "vb", ext: ["vb"]},
{name: "VBScript", mime: "text/vbscript", mode: "vbscript", ext: ["vbs"]},
{name: "Velocity", mime: "text/velocity", mode: "velocity", ext: ["vtl"]},
@@ -148,6 +154,7 @@
{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: "Yacas", mime: "text/x-yacas", mode: "yacas", ext: ["ys"]},
{name: "YAML", mime: "text/x-yaml", mode: "yaml", ext: ["yaml", "yml"], alias: ["yml"]},
{name: "Z80", mime: "text/x-z80", mode: "z80", ext: ["z80"]},
{name: "mscgen", mime: "text/x-mscgen", mode: "mscgen", ext: ["mscgen", "mscin", "msc"]},
diff --git a/public/vendor/codemirror/mode/octave/index.html b/public/vendor/codemirror/mode/octave/index.html
index 79df5811..3490ee63 100644
--- a/public/vendor/codemirror/mode/octave/index.html
+++ b/public/vendor/codemirror/mode/octave/index.html
@@ -65,7 +65,7 @@ global persistent
%one line comment
%{ multi
-line commment %}
+line comment %}
</textarea></div>
<script>
diff --git a/public/vendor/codemirror/mode/pegjs/pegjs.js b/public/vendor/codemirror/mode/pegjs/pegjs.js
index 306e3768..8e87b59e 100644
--- a/public/vendor/codemirror/mode/pegjs/pegjs.js
+++ b/public/vendor/codemirror/mode/pegjs/pegjs.js
@@ -24,7 +24,7 @@ CodeMirror.defineMode("pegjs", function (config) {
inString: false,
stringType: null,
inComment: false,
- inChracterClass: false,
+ inCharacterClass: false,
braced: 0,
lhs: true,
localState: null
@@ -66,15 +66,15 @@ CodeMirror.defineMode("pegjs", function (config) {
}
}
return "comment";
- } else if (state.inChracterClass) {
- while (state.inChracterClass && !stream.eol()) {
+ } else if (state.inCharacterClass) {
+ while (state.inCharacterClass && !stream.eol()) {
if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) {
- state.inChracterClass = false;
+ state.inCharacterClass = false;
}
}
} else if (stream.peek() === '[') {
stream.next();
- state.inChracterClass = true;
+ state.inCharacterClass = true;
return 'bracket';
} else if (stream.match(/^\/\//)) {
stream.skipToEnd();
diff --git a/public/vendor/codemirror/mode/perl/perl.js b/public/vendor/codemirror/mode/perl/perl.js
index bef62bc7..66e4ed03 100644
--- a/public/vendor/codemirror/mode/perl/perl.js
+++ b/public/vendor/codemirror/mode/perl/perl.js
@@ -268,7 +268,7 @@ CodeMirror.defineMode("perl",function(){
chmod :1, // - changes the permissions on a list of files
chomp :1, // - remove a trailing record separator from a string
chop :1, // - remove the last character from a string
- chown :1, // - change the owership on a list of files
+ chown :1, // - change the ownership on a list of files
chr :1, // - get character this number represents
chroot :1, // - make directory new root for path lookups
close :1, // - close file (or pipe or socket) handle
diff --git a/public/vendor/codemirror/mode/powershell/index.html b/public/vendor/codemirror/mode/powershell/index.html
new file mode 100644
index 00000000..6b235df8
--- /dev/null
+++ b/public/vendor/codemirror/mode/powershell/index.html
@@ -0,0 +1,204 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>CodeMirror: Powershell mode</title>
+ <link rel="stylesheet" href="../../doc/docs.css">
+ <link rel="stylesheet" href="../../lib/codemirror.css">
+ <script src="../../lib/codemirror.js"></script>
+ <script src="powershell.js"></script>
+ <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
+ </head>
+ <body>
+ <div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">JavaScript</a>
+ </ul>
+ </div>
+ <article>
+ <h2>PowerShell mode</h2>
+
+ <div><textarea id="code" name="code">
+# Number Literals
+0 12345
+12kb 12mb 12gB 12Tb 12PB 12L 12D 12lkb 12dtb
+1.234 1.234e56 1. 1.e2 .2 .2e34
+1.2MB 1.kb .1dTb 1.e1gb
+0x1 0xabcdef 0x3tb 0xelmb
+
+# String Literals
+'Literal escaping'''
+'Literal $variable'
+"Escaping 1`""
+"Escaping 2"""
+"Escaped `$variable"
+"Text, $variable and more text"
+"Text, ${variable with spaces} and more text."
+"Text, $($expression + 3) and more text."
+"Text, $("interpolation $("inception")") and more text."
+
+@"
+Multiline
+string
+"@
+# --
+@"
+Multiline
+string with quotes "'
+"@
+# --
+@'
+Multiline literal
+string with quotes "'
+'@
+
+# Array and Hash literals
+@( 'a','b','c' )
+@{ 'key': 'value' }
+
+# Variables
+$Variable = 5
+$global:variable = 5
+${Variable with spaces} = 5
+
+# Operators
+= += -= *= /= %=
+++ -- .. -f * / % + -
+-not ! -bnot
+-split -isplit -csplit
+-join
+-is -isnot -as
+-eq -ieq -ceq -ne -ine -cne
+-gt -igt -cgt -ge -ige -cge
+-lt -ilt -clt -le -ile -cle
+-like -ilike -clike -notlike -inotlike -cnotlike
+-match -imatch -cmatch -notmatch -inotmatch -cnotmatch
+-contains -icontains -ccontains -notcontains -inotcontains -cnotcontains
+-replace -ireplace -creplace
+-band -bor -bxor
+-and -or -xor
+
+# Punctuation
+() [] {} , : ` = ; .
+
+# Keywords
+elseif begin function for foreach return else trap while do data dynamicparam
+until end break if throw param continue finally in switch exit filter from try
+process catch
+
+# Built-in variables
+$$ $? $^ $_
+$args $ConfirmPreference $ConsoleFileName $DebugPreference $Error
+$ErrorActionPreference $ErrorView $ExecutionContext $false $FormatEnumerationLimit
+$HOME $Host $input $MaximumAliasCount $MaximumDriveCount $MaximumErrorCount
+$MaximumFunctionCount $MaximumHistoryCount $MaximumVariableCount $MyInvocation
+$NestedPromptLevel $null $OutputEncoding $PID $PROFILE $ProgressPreference
+$PSBoundParameters $PSCommandPath $PSCulture $PSDefaultParameterValues
+$PSEmailServer $PSHOME $PSScriptRoot $PSSessionApplicationName
+$PSSessionConfigurationName $PSSessionOption $PSUICulture $PSVersionTable $PWD
+$ShellId $StackTrace $true $VerbosePreference $WarningPreference $WhatIfPreference
+$true $false $null
+
+# Built-in functions
+A:
+Add-Computer Add-Content Add-History Add-Member Add-PSSnapin Add-Type
+B:
+C:
+Checkpoint-Computer Clear-Content Clear-EventLog Clear-History Clear-Host Clear-Item
+Clear-ItemProperty Clear-Variable Compare-Object Complete-Transaction Connect-PSSession
+ConvertFrom-Csv ConvertFrom-Json ConvertFrom-SecureString ConvertFrom-StringData
+Convert-Path ConvertTo-Csv ConvertTo-Html ConvertTo-Json ConvertTo-SecureString
+ConvertTo-Xml Copy-Item Copy-ItemProperty
+D:
+Debug-Process Disable-ComputerRestore Disable-PSBreakpoint Disable-PSRemoting
+Disable-PSSessionConfiguration Disconnect-PSSession
+E:
+Enable-ComputerRestore Enable-PSBreakpoint Enable-PSRemoting Enable-PSSessionConfiguration
+Enter-PSSession Exit-PSSession Export-Alias Export-Clixml Export-Console Export-Counter
+Export-Csv Export-FormatData Export-ModuleMember Export-PSSession
+F:
+ForEach-Object Format-Custom Format-List Format-Table Format-Wide
+G:
+Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command Get-ComputerRestorePoint
+Get-Content Get-ControlPanelItem Get-Counter Get-Credential Get-Culture Get-Date
+Get-Event Get-EventLog Get-EventSubscriber Get-ExecutionPolicy Get-FormatData Get-Help
+Get-History Get-Host Get-HotFix Get-Item Get-ItemProperty Get-Job Get-Location Get-Member
+Get-Module Get-PfxCertificate Get-Process Get-PSBreakpoint Get-PSCallStack Get-PSDrive
+Get-PSProvider Get-PSSession Get-PSSessionConfiguration Get-PSSnapin Get-Random Get-Service
+Get-TraceSource Get-Transaction Get-TypeData Get-UICulture Get-Unique Get-Variable Get-Verb
+Get-WinEvent Get-WmiObject Group-Object
+H:
+help
+I:
+Import-Alias Import-Clixml Import-Counter Import-Csv Import-LocalizedData Import-Module
+Import-PSSession ImportSystemModules Invoke-Command Invoke-Expression Invoke-History
+Invoke-Item Invoke-RestMethod Invoke-WebRequest Invoke-WmiMethod
+J:
+Join-Path
+K:
+L:
+Limit-EventLog
+M:
+Measure-Command Measure-Object mkdir more Move-Item Move-ItemProperty
+N:
+New-Alias New-Event New-EventLog New-Item New-ItemProperty New-Module New-ModuleManifest
+New-Object New-PSDrive New-PSSession New-PSSessionConfigurationFile New-PSSessionOption
+New-PSTransportOption New-Service New-TimeSpan New-Variable New-WebServiceProxy
+New-WinEvent
+O:
+oss Out-Default Out-File Out-GridView Out-Host Out-Null Out-Printer Out-String
+P:
+Pause Pop-Location prompt Push-Location
+Q:
+R:
+Read-Host Receive-Job Receive-PSSession Register-EngineEvent Register-ObjectEvent
+Register-PSSessionConfiguration Register-WmiEvent Remove-Computer Remove-Event
+Remove-EventLog Remove-Item Remove-ItemProperty Remove-Job Remove-Module
+Remove-PSBreakpoint Remove-PSDrive Remove-PSSession Remove-PSSnapin Remove-TypeData
+Remove-Variable Remove-WmiObject Rename-Computer Rename-Item Rename-ItemProperty
+Reset-ComputerMachinePassword Resolve-Path Restart-Computer Restart-Service
+Restore-Computer Resume-Job Resume-Service
+S:
+Save-Help Select-Object Select-String Select-Xml Send-MailMessage Set-Acl Set-Alias
+Set-AuthenticodeSignature Set-Content Set-Date Set-ExecutionPolicy Set-Item
+Set-ItemProperty Set-Location Set-PSBreakpoint Set-PSDebug
+Set-PSSessionConfiguration Set-Service Set-StrictMode Set-TraceSource Set-Variable
+Set-WmiInstance Show-Command Show-ControlPanelItem Show-EventLog Sort-Object
+Split-Path Start-Job Start-Process Start-Service Start-Sleep Start-Transaction
+Start-Transcript Stop-Computer Stop-Job Stop-Process Stop-Service Stop-Transcript
+Suspend-Job Suspend-Service
+T:
+TabExpansion2 Tee-Object Test-ComputerSecureChannel Test-Connection
+Test-ModuleManifest Test-Path Test-PSSessionConfigurationFile Trace-Command
+U:
+Unblock-File Undo-Transaction Unregister-Event Unregister-PSSessionConfiguration
+Update-FormatData Update-Help Update-List Update-TypeData Use-Transaction
+V:
+W:
+Wait-Event Wait-Job Wait-Process Where-Object Write-Debug Write-Error Write-EventLog
+Write-Host Write-Output Write-Progress Write-Verbose Write-Warning
+X:
+Y:
+Z:</textarea></div>
+ <script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ mode: "powershell",
+ lineNumbers: true,
+ indentUnit: 4,
+ tabMode: "shift",
+ matchBrackets: true
+ });
+ </script>
+
+ <p><strong>MIME types defined:</strong> <code>application/x-powershell</code>.</p>
+ </article>
+ </body>
+</html>
diff --git a/public/vendor/codemirror/mode/powershell/powershell.js b/public/vendor/codemirror/mode/powershell/powershell.js
new file mode 100644
index 00000000..c443e723
--- /dev/null
+++ b/public/vendor/codemirror/mode/powershell/powershell.js
@@ -0,0 +1,396 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function(mod) {
+ 'use strict';
+ if (typeof exports == 'object' && typeof module == 'object') // CommonJS
+ mod(require('codemirror'));
+ else if (typeof define == 'function' && define.amd) // AMD
+ define(['codemirror'], mod);
+ else // Plain browser env
+ mod(window.CodeMirror);
+})(function(CodeMirror) {
+'use strict';
+
+CodeMirror.defineMode('powershell', function() {
+ function buildRegexp(patterns, options) {
+ options = options || {};
+ var prefix = options.prefix !== undefined ? options.prefix : '^';
+ var suffix = options.suffix !== undefined ? options.suffix : '\\b';
+
+ for (var i = 0; i < patterns.length; i++) {
+ if (patterns[i] instanceof RegExp) {
+ patterns[i] = patterns[i].source;
+ }
+ else {
+ patterns[i] = patterns[i].replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
+ }
+ }
+
+ return new RegExp(prefix + '(' + patterns.join('|') + ')' + suffix, 'i');
+ }
+
+ var notCharacterOrDash = '(?=[^A-Za-z\\d\\-_]|$)';
+ var varNames = /[\w\-:]/
+ var keywords = buildRegexp([
+ /begin|break|catch|continue|data|default|do|dynamicparam/,
+ /else|elseif|end|exit|filter|finally|for|foreach|from|function|if|in/,
+ /param|process|return|switch|throw|trap|try|until|where|while/
+ ], { suffix: notCharacterOrDash });
+
+ var punctuation = /[\[\]{},;`\.]|@[({]/;
+ var wordOperators = buildRegexp([
+ 'f',
+ /b?not/,
+ /[ic]?split/, 'join',
+ /is(not)?/, 'as',
+ /[ic]?(eq|ne|[gl][te])/,
+ /[ic]?(not)?(like|match|contains)/,
+ /[ic]?replace/,
+ /b?(and|or|xor)/
+ ], { prefix: '-' });
+ var symbolOperators = /[+\-*\/%]=|\+\+|--|\.\.|[+\-*&^%:=!|\/]|<(?!#)|(?!#)>/;
+ var operators = buildRegexp([wordOperators, symbolOperators], { suffix: '' });
+
+ var numbers = /^((0x[\da-f]+)|((\d+\.\d+|\d\.|\.\d+|\d+)(e[\+\-]?\d+)?))[ld]?([kmgtp]b)?/i;
+
+ var identifiers = /^[A-Za-z\_][A-Za-z\-\_\d]*\b/;
+
+ var symbolBuiltins = /[A-Z]:|%|\?/i;
+ var namedBuiltins = buildRegexp([
+ /Add-(Computer|Content|History|Member|PSSnapin|Type)/,
+ /Checkpoint-Computer/,
+ /Clear-(Content|EventLog|History|Host|Item(Property)?|Variable)/,
+ /Compare-Object/,
+ /Complete-Transaction/,
+ /Connect-PSSession/,
+ /ConvertFrom-(Csv|Json|SecureString|StringData)/,
+ /Convert-Path/,
+ /ConvertTo-(Csv|Html|Json|SecureString|Xml)/,
+ /Copy-Item(Property)?/,
+ /Debug-Process/,
+ /Disable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/,
+ /Disconnect-PSSession/,
+ /Enable-(ComputerRestore|PSBreakpoint|PSRemoting|PSSessionConfiguration)/,
+ /(Enter|Exit)-PSSession/,
+ /Export-(Alias|Clixml|Console|Counter|Csv|FormatData|ModuleMember|PSSession)/,
+ /ForEach-Object/,
+ /Format-(Custom|List|Table|Wide)/,
+ new RegExp('Get-(Acl|Alias|AuthenticodeSignature|ChildItem|Command|ComputerRestorePoint|Content|ControlPanelItem|Counter|Credential'
+ + '|Culture|Date|Event|EventLog|EventSubscriber|ExecutionPolicy|FormatData|Help|History|Host|HotFix|Item|ItemProperty|Job'
+ + '|Location|Member|Module|PfxCertificate|Process|PSBreakpoint|PSCallStack|PSDrive|PSProvider|PSSession|PSSessionConfiguration'
+ + '|PSSnapin|Random|Service|TraceSource|Transaction|TypeData|UICulture|Unique|Variable|Verb|WinEvent|WmiObject)'),
+ /Group-Object/,
+ /Import-(Alias|Clixml|Counter|Csv|LocalizedData|Module|PSSession)/,
+ /ImportSystemModules/,
+ /Invoke-(Command|Expression|History|Item|RestMethod|WebRequest|WmiMethod)/,
+ /Join-Path/,
+ /Limit-EventLog/,
+ /Measure-(Command|Object)/,
+ /Move-Item(Property)?/,
+ new RegExp('New-(Alias|Event|EventLog|Item(Property)?|Module|ModuleManifest|Object|PSDrive|PSSession|PSSessionConfigurationFile'
+ + '|PSSessionOption|PSTransportOption|Service|TimeSpan|Variable|WebServiceProxy|WinEvent)'),
+ /Out-(Default|File|GridView|Host|Null|Printer|String)/,
+ /Pause/,
+ /(Pop|Push)-Location/,
+ /Read-Host/,
+ /Receive-(Job|PSSession)/,
+ /Register-(EngineEvent|ObjectEvent|PSSessionConfiguration|WmiEvent)/,
+ /Remove-(Computer|Event|EventLog|Item(Property)?|Job|Module|PSBreakpoint|PSDrive|PSSession|PSSnapin|TypeData|Variable|WmiObject)/,
+ /Rename-(Computer|Item(Property)?)/,
+ /Reset-ComputerMachinePassword/,
+ /Resolve-Path/,
+ /Restart-(Computer|Service)/,
+ /Restore-Computer/,
+ /Resume-(Job|Service)/,
+ /Save-Help/,
+ /Select-(Object|String|Xml)/,
+ /Send-MailMessage/,
+ new RegExp('Set-(Acl|Alias|AuthenticodeSignature|Content|Date|ExecutionPolicy|Item(Property)?|Location|PSBreakpoint|PSDebug' +
+ '|PSSessionConfiguration|Service|StrictMode|TraceSource|Variable|WmiInstance)'),
+ /Show-(Command|ControlPanelItem|EventLog)/,
+ /Sort-Object/,
+ /Split-Path/,
+ /Start-(Job|Process|Service|Sleep|Transaction|Transcript)/,
+ /Stop-(Computer|Job|Process|Service|Transcript)/,
+ /Suspend-(Job|Service)/,
+ /TabExpansion2/,
+ /Tee-Object/,
+ /Test-(ComputerSecureChannel|Connection|ModuleManifest|Path|PSSessionConfigurationFile)/,
+ /Trace-Command/,
+ /Unblock-File/,
+ /Undo-Transaction/,
+ /Unregister-(Event|PSSessionConfiguration)/,
+ /Update-(FormatData|Help|List|TypeData)/,
+ /Use-Transaction/,
+ /Wait-(Event|Job|Process)/,
+ /Where-Object/,
+ /Write-(Debug|Error|EventLog|Host|Output|Progress|Verbose|Warning)/,
+ /cd|help|mkdir|more|oss|prompt/,
+ /ac|asnp|cat|cd|chdir|clc|clear|clhy|cli|clp|cls|clv|cnsn|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|dnsn|ebp/,
+ /echo|epal|epcsv|epsn|erase|etsn|exsn|fc|fl|foreach|ft|fw|gal|gbp|gc|gci|gcm|gcs|gdr|ghy|gi|gjb|gl|gm|gmo|gp|gps/,
+ /group|gsn|gsnp|gsv|gu|gv|gwmi|h|history|icm|iex|ihy|ii|ipal|ipcsv|ipmo|ipsn|irm|ise|iwmi|iwr|kill|lp|ls|man|md/,
+ /measure|mi|mount|move|mp|mv|nal|ndr|ni|nmo|npssc|nsn|nv|ogv|oh|popd|ps|pushd|pwd|r|rbp|rcjb|rcsn|rd|rdr|ren|ri/,
+ /rjb|rm|rmdir|rmo|rni|rnp|rp|rsn|rsnp|rujb|rv|rvpa|rwmi|sajb|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls/,
+ /sort|sp|spjb|spps|spsv|start|sujb|sv|swmi|tee|trcm|type|where|wjb|write/
+ ], { prefix: '', suffix: '' });
+ var variableBuiltins = buildRegexp([
+ /[$?^_]|Args|ConfirmPreference|ConsoleFileName|DebugPreference|Error|ErrorActionPreference|ErrorView|ExecutionContext/,
+ /FormatEnumerationLimit|Home|Host|Input|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount/,
+ /MaximumHistoryCount|MaximumVariableCount|MyInvocation|NestedPromptLevel|OutputEncoding|Pid|Profile|ProgressPreference/,
+ /PSBoundParameters|PSCommandPath|PSCulture|PSDefaultParameterValues|PSEmailServer|PSHome|PSScriptRoot|PSSessionApplicationName/,
+ /PSSessionConfigurationName|PSSessionOption|PSUICulture|PSVersionTable|Pwd|ShellId|StackTrace|VerbosePreference/,
+ /WarningPreference|WhatIfPreference/,
+
+ /Event|EventArgs|EventSubscriber|Sender/,
+ /Matches|Ofs|ForEach|LastExitCode|PSCmdlet|PSItem|PSSenderInfo|This/,
+ /true|false|null/
+ ], { prefix: '\\$', suffix: '' });
+
+ var builtins = buildRegexp([symbolBuiltins, namedBuiltins, variableBuiltins], { suffix: notCharacterOrDash });
+
+ var grammar = {
+ keyword: keywords,
+ number: numbers,
+ operator: operators,
+ builtin: builtins,
+ punctuation: punctuation,
+ identifier: identifiers
+ };
+
+ // tokenizers
+ function tokenBase(stream, state) {
+ // Handle Comments
+ //var ch = stream.peek();
+
+ var parent = state.returnStack[state.returnStack.length - 1];
+ if (parent && parent.shouldReturnFrom(state)) {
+ state.tokenize = parent.tokenize;
+ state.returnStack.pop();
+ return state.tokenize(stream, state);
+ }
+
+ if (stream.eatSpace()) {
+ return null;
+ }
+
+ if (stream.eat('(')) {
+ state.bracketNesting += 1;
+ return 'punctuation';
+ }
+
+ if (stream.eat(')')) {
+ state.bracketNesting -= 1;
+ return 'punctuation';
+ }
+
+ for (var key in grammar) {
+ if (stream.match(grammar[key])) {
+ return key;
+ }
+ }
+
+ var ch = stream.next();
+
+ // single-quote string
+ if (ch === "'") {
+ return tokenSingleQuoteString(stream, state);
+ }
+
+ if (ch === '$') {
+ return tokenVariable(stream, state);
+ }
+
+ // double-quote string
+ if (ch === '"') {
+ return tokenDoubleQuoteString(stream, state);
+ }
+
+ if (ch === '<' && stream.eat('#')) {
+ state.tokenize = tokenComment;
+ return tokenComment(stream, state);
+ }
+
+ if (ch === '#') {
+ stream.skipToEnd();
+ return 'comment';
+ }
+
+ if (ch === '@') {
+ var quoteMatch = stream.eat(/["']/);
+ if (quoteMatch && stream.eol()) {
+ state.tokenize = tokenMultiString;
+ state.startQuote = quoteMatch[0];
+ return tokenMultiString(stream, state);
+ } else if (stream.peek().match(/[({]/)) {
+ return 'punctuation';
+ } else if (stream.peek().match(varNames)) {
+ // splatted variable
+ return tokenVariable(stream, state);
+ }
+ }
+ return 'error';
+ }
+
+ function tokenSingleQuoteString(stream, state) {
+ var ch;
+ while ((ch = stream.peek()) != null) {
+ stream.next();
+
+ if (ch === "'" && !stream.eat("'")) {
+ state.tokenize = tokenBase;
+ return 'string';
+ }
+ }
+
+ return 'error';
+ }
+
+ function tokenDoubleQuoteString(stream, state) {
+ var ch;
+ while ((ch = stream.peek()) != null) {
+ if (ch === '$') {
+ state.tokenize = tokenStringInterpolation;
+ return 'string';
+ }
+
+ stream.next();
+ if (ch === '`') {
+ stream.next();
+ continue;
+ }
+
+ if (ch === '"' && !stream.eat('"')) {
+ state.tokenize = tokenBase;
+ return 'string';
+ }
+ }
+
+ return 'error';
+ }
+
+ function tokenStringInterpolation(stream, state) {
+ return tokenInterpolation(stream, state, tokenDoubleQuoteString);
+ }
+
+ function tokenMultiStringReturn(stream, state) {
+ state.tokenize = tokenMultiString;
+ state.startQuote = '"'
+ return tokenMultiString(stream, state);
+ }
+
+ function tokenHereStringInterpolation(stream, state) {
+ return tokenInterpolation(stream, state, tokenMultiStringReturn);
+ }
+
+ function tokenInterpolation(stream, state, parentTokenize) {
+ if (stream.match('$(')) {
+ var savedBracketNesting = state.bracketNesting;
+ state.returnStack.push({
+ /*jshint loopfunc:true */
+ shouldReturnFrom: function(state) {
+ return state.bracketNesting === savedBracketNesting;
+ },
+ tokenize: parentTokenize
+ });
+ state.tokenize = tokenBase;
+ state.bracketNesting += 1;
+ return 'punctuation';
+ } else {
+ stream.next();
+ state.returnStack.push({
+ shouldReturnFrom: function() { return true; },
+ tokenize: parentTokenize
+ });
+ state.tokenize = tokenVariable;
+ return state.tokenize(stream, state);
+ }
+ }
+
+ function tokenComment(stream, state) {
+ var maybeEnd = false, ch;
+ while ((ch = stream.next()) != null) {
+ if (maybeEnd && ch == '>') {
+ state.tokenize = tokenBase;
+ break;
+ }
+ maybeEnd = (ch === '#');
+ }
+ return 'comment';
+ }
+
+ function tokenVariable(stream, state) {
+ var ch = stream.peek();
+ if (stream.eat('{')) {
+ state.tokenize = tokenVariableWithBraces;
+ return tokenVariableWithBraces(stream, state);
+ } else if (ch != undefined && ch.match(varNames)) {
+ stream.eatWhile(varNames);
+ state.tokenize = tokenBase;
+ return 'variable-2';
+ } else {
+ state.tokenize = tokenBase;
+ return 'error';
+ }
+ }
+
+ function tokenVariableWithBraces(stream, state) {
+ var ch;
+ while ((ch = stream.next()) != null) {
+ if (ch === '}') {
+ state.tokenize = tokenBase;
+ break;
+ }
+ }
+ return 'variable-2';
+ }
+
+ function tokenMultiString(stream, state) {
+ var quote = state.startQuote;
+ if (stream.sol() && stream.match(new RegExp(quote + '@'))) {
+ state.tokenize = tokenBase;
+ }
+ else if (quote === '"') {
+ while (!stream.eol()) {
+ var ch = stream.peek();
+ if (ch === '$') {
+ state.tokenize = tokenHereStringInterpolation;
+ return 'string';
+ }
+
+ stream.next();
+ if (ch === '`') {
+ stream.next();
+ }
+ }
+ }
+ else {
+ stream.skipToEnd();
+ }
+
+ return 'string';
+ }
+
+ var external = {
+ startState: function() {
+ return {
+ returnStack: [],
+ bracketNesting: 0,
+ tokenize: tokenBase
+ };
+ },
+
+ token: function(stream, state) {
+ return state.tokenize(stream, state);
+ },
+
+ blockCommentStart: '<#',
+ blockCommentEnd: '#>',
+ lineComment: '#',
+ fold: 'brace'
+ };
+ return external;
+});
+
+CodeMirror.defineMIME('application/x-powershell', 'powershell');
+});
diff --git a/public/vendor/codemirror/mode/powershell/test.js b/public/vendor/codemirror/mode/powershell/test.js
new file mode 100644
index 00000000..59b8e6fc
--- /dev/null
+++ b/public/vendor/codemirror/mode/powershell/test.js
@@ -0,0 +1,72 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function() {
+ var mode = CodeMirror.getMode({indentUnit: 2}, "powershell");
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
+
+ MT('comment', '[number 1][comment # A]');
+ MT('comment_multiline', '[number 1][comment <#]',
+ '[comment ABC]',
+ '[comment #>][number 2]');
+
+ [
+ '0', '1234',
+ '12kb', '12mb', '12Gb', '12Tb', '12PB', '12L', '12D', '12lkb', '12dtb',
+ '1.234', '1.234e56', '1.', '1.e2', '.2', '.2e34',
+ '1.2MB', '1.kb', '.1dTB', '1.e1gb', '.2', '.2e34',
+ '0x1', '0xabcdef', '0x3tb', '0xelmb'
+ ].forEach(function(number) {
+ MT("number_" + number, "[number " + number + "]");
+ });
+
+ MT('string_literal_escaping', "[string 'a''']");
+ MT('string_literal_variable', "[string 'a $x']");
+ MT('string_escaping_1', '[string "a `""]');
+ MT('string_escaping_2', '[string "a """]');
+ MT('string_variable_escaping', '[string "a `$x"]');
+ MT('string_variable', '[string "a ][variable-2 $x][string b"]');
+ MT('string_variable_spaces', '[string "a ][variable-2 ${x y}][string b"]');
+ MT('string_expression', '[string "a ][punctuation $(][variable-2 $x][operator +][number 3][punctuation )][string b"]');
+ MT('string_expression_nested', '[string "A][punctuation $(][string "a][punctuation $(][string "w"][punctuation )][string b"][punctuation )][string B"]');
+
+ MT('string_heredoc', '[string @"]',
+ '[string abc]',
+ '[string "@]');
+ MT('string_heredoc_quotes', '[string @"]',
+ '[string abc "\']',
+ '[string "@]');
+ MT('string_heredoc_variable', '[string @"]',
+ '[string a ][variable-2 $x][string b]',
+ '[string "@]');
+ MT('string_heredoc_nested_string', '[string @"]',
+ '[string a][punctuation $(][string "w"][punctuation )][string b]',
+ '[string "@]');
+ MT('string_heredoc_literal_quotes', "[string @']",
+ '[string abc "\']',
+ "[string '@]");
+
+ MT('array', "[punctuation @(][string 'a'][punctuation ,][string 'b'][punctuation )]");
+ MT('hash', "[punctuation @{][string 'key'][operator :][string 'value'][punctuation }]");
+
+ MT('variable', "[variable-2 $test]");
+ MT('variable_global', "[variable-2 $global:test]");
+ MT('variable_spaces', "[variable-2 ${test test}]");
+ MT('operator_splat', "[variable-2 @x]");
+ MT('variable_builtin', "[builtin $ErrorActionPreference]");
+ MT('variable_builtin_symbols', "[builtin $$]");
+
+ MT('operator', "[operator +]");
+ MT('operator_unary', "[operator +][number 3]");
+ MT('operator_long', "[operator -match]");
+
+ [
+ '(', ')', '[[', ']]', '{', '}', ',', '`', ';', '.'
+ ].forEach(function(punctuation) {
+ MT("punctuation_" + punctuation.replace(/^[\[\]]/,''), "[punctuation " + punctuation + "]");
+ });
+
+ MT('keyword', "[keyword if]");
+
+ MT('call_builtin', "[builtin Get-ChildItem]");
+})();
diff --git a/public/vendor/codemirror/mode/properties/properties.js b/public/vendor/codemirror/mode/properties/properties.js
index 9da5baf4..ef8bf37e 100644
--- a/public/vendor/codemirror/mode/properties/properties.js
+++ b/public/vendor/codemirror/mode/properties/properties.js
@@ -34,7 +34,7 @@ CodeMirror.defineMode("properties", function() {
}
if (sol) {
- while(stream.eatSpace());
+ while(stream.eatSpace()) {}
}
var ch = stream.next();
diff --git a/public/vendor/codemirror/mode/protobuf/index.html b/public/vendor/codemirror/mode/protobuf/index.html
new file mode 100644
index 00000000..cfe7b9dc
--- /dev/null
+++ b/public/vendor/codemirror/mode/protobuf/index.html
@@ -0,0 +1,64 @@
+<!doctype html>
+
+<title>CodeMirror: ProtoBuf mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="protobuf.js"></script>
+<style>.CodeMirror { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">ProtoBuf</a>
+ </ul>
+</div>
+
+<article>
+<h2>ProtoBuf mode</h2>
+<form><textarea id="code" name="code">
+package addressbook;
+
+message Address {
+ required string street = 1;
+ required string postCode = 2;
+}
+
+message PhoneNumber {
+ required string number = 1;
+}
+
+message Person {
+ optional int32 id = 1;
+ required string name = 2;
+ required string surname = 3;
+ optional Address address = 4;
+ repeated PhoneNumber phoneNumbers = 5;
+ optional uint32 age = 6;
+ repeated uint32 favouriteNumbers = 7;
+ optional string license = 8;
+ enum Gender {
+ MALE = 0;
+ FEMALE = 1;
+ }
+ optional Gender gender = 9;
+ optional fixed64 lastUpdate = 10;
+ required bool deleted = 11 [default = false];
+}
+
+</textarea></form>
+ <script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
+ </script>
+
+ <p><strong>MIME types defined:</strong> <code>text/x-protobuf</code>.</p>
+
+ </article>
diff --git a/public/vendor/codemirror/mode/protobuf/protobuf.js b/public/vendor/codemirror/mode/protobuf/protobuf.js
new file mode 100644
index 00000000..bcae276e
--- /dev/null
+++ b/public/vendor/codemirror/mode/protobuf/protobuf.js
@@ -0,0 +1,68 @@
+// 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";
+
+ function wordRegexp(words) {
+ return new RegExp("^((" + words.join(")|(") + "))\\b", "i");
+ };
+
+ var keywordArray = [
+ "package", "message", "import", "syntax",
+ "required", "optional", "repeated", "reserved", "default", "extensions", "packed",
+ "bool", "bytes", "double", "enum", "float", "string",
+ "int32", "int64", "uint32", "uint64", "sint32", "sint64", "fixed32", "fixed64", "sfixed32", "sfixed64"
+ ];
+ var keywords = wordRegexp(keywordArray);
+
+ CodeMirror.registerHelper("hintWords", "protobuf", keywordArray);
+
+ var identifiers = new RegExp("^[_A-Za-z\xa1-\uffff][_A-Za-z0-9\xa1-\uffff]*");
+
+ function tokenBase(stream) {
+ // whitespaces
+ if (stream.eatSpace()) return null;
+
+ // Handle one line Comments
+ if (stream.match("//")) {
+ stream.skipToEnd();
+ return "comment";
+ }
+
+ // Handle Number Literals
+ if (stream.match(/^[0-9\.+-]/, false)) {
+ if (stream.match(/^[+-]?0x[0-9a-fA-F]+/))
+ return "number";
+ if (stream.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/))
+ return "number";
+ if (stream.match(/^[+-]?\d+([EeDd][+-]?\d+)?/))
+ return "number";
+ }
+
+ // Handle Strings
+ if (stream.match(/^"([^"]|(""))*"/)) { return "string"; }
+ if (stream.match(/^'([^']|(''))*'/)) { return "string"; }
+
+ // Handle words
+ if (stream.match(keywords)) { return "keyword"; }
+ if (stream.match(identifiers)) { return "variable"; } ;
+
+ // Handle non-detected items
+ stream.next();
+ return null;
+ };
+
+ CodeMirror.defineMode("protobuf", function() {
+ return {token: tokenBase};
+ });
+
+ CodeMirror.defineMIME("text/x-protobuf", "protobuf");
+});
diff --git a/public/vendor/codemirror/mode/puppet/puppet.js b/public/vendor/codemirror/mode/puppet/puppet.js
index e7f799f7..57041300 100644
--- a/public/vendor/codemirror/mode/puppet/puppet.js
+++ b/public/vendor/codemirror/mode/puppet/puppet.js
@@ -126,7 +126,7 @@ CodeMirror.defineMode("puppet", function () {
if (word && words.hasOwnProperty(word)) {
// Negates the initial next()
stream.backUp(1);
- // Acutally move the stream
+ // rs move the stream
stream.match(/[\w]+/);
// We want to process these words differently
// do to the importance they have in Puppet
diff --git a/public/vendor/codemirror/mode/python/index.html b/public/vendor/codemirror/mode/python/index.html
index 86eb3d52..6116a13b 100644
--- a/public/vendor/codemirror/mode/python/index.html
+++ b/public/vendor/codemirror/mode/python/index.html
@@ -186,7 +186,7 @@ def pairwise_cython(double[:, ::1] X):
<li>singleOperators - RegEx - Regular Expression for single operator matching, default : <pre>^[\\+\\-\\*/%&amp;|\\^~&lt;&gt;!]</pre> including <pre>@</pre> on Python 3</li>
<li>singleDelimiters - RegEx - Regular Expression for single delimiter matching, default : <pre>^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]</pre></li>
<li>doubleOperators - RegEx - Regular Expression for double operators matching, default : <pre>^((==)|(!=)|(&lt;=)|(&gt;=)|(&lt;&gt;)|(&lt;&lt;)|(&gt;&gt;)|(//)|(\\*\\*))</pre></li>
- <li>doubleDelimiters - RegEx - Regular Expressoin for double delimiters matching, default : <pre>^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&amp;=)|(\\|=)|(\\^=))</pre></li>
+ <li>doubleDelimiters - RegEx - Regular Expression for double delimiters matching, default : <pre>^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&amp;=)|(\\|=)|(\\^=))</pre></li>
<li>tripleDelimiters - RegEx - Regular Expression for triple delimiters matching, default : <pre>^((//=)|(&gt;&gt;=)|(&lt;&lt;=)|(\\*\\*=))</pre></li>
<li>identifiers - RegEx - Regular Expression for identifier, default : <pre>^[_A-Za-z][_A-Za-z0-9]*</pre> on Python 2 and <pre>^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*</pre> on Python 3.</li>
<li>extra_keywords - list of string - List of extra words ton consider as keywords</li>
diff --git a/public/vendor/codemirror/mode/python/python.js b/public/vendor/codemirror/mode/python/python.js
index 553f2d6f..196b026c 100644
--- a/public/vendor/codemirror/mode/python/python.js
+++ b/public/vendor/codemirror/mode/python/python.js
@@ -53,7 +53,7 @@
var doubleDelimiters = parserConf.doubleDelimiters || /^(\+=|\-=|\*=|%=|\/=|&=|\|=|\^=)/;
var tripleDelimiters = parserConf.tripleDelimiters || /^(\/\/=|>>=|<<=|\*\*=)/;
- if (parserConf.version && parseInt(parserConf.version, 10) == 3){
+ if (parserConf.version && parseInt(parserConf.version, 10) == 3) {
// since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator
var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!@]/;
var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;
@@ -65,12 +65,12 @@
var hangingIndent = parserConf.hangingIndent || conf.indentUnit;
var myKeywords = commonKeywords, myBuiltins = commonBuiltins;
- if(parserConf.extra_keywords != undefined){
+ if (parserConf.extra_keywords != undefined)
myKeywords = myKeywords.concat(parserConf.extra_keywords);
- }
- if(parserConf.extra_builtins != undefined){
+
+ if (parserConf.extra_builtins != undefined)
myBuiltins = myBuiltins.concat(parserConf.extra_builtins);
- }
+
if (parserConf.version && parseInt(parserConf.version, 10) == 3) {
myKeywords = myKeywords.concat(py3.keywords);
myBuiltins = myBuiltins.concat(py3.builtins);
@@ -85,13 +85,14 @@
// tokenizers
function tokenBase(stream, state) {
+ if (stream.sol()) state.indent = stream.indentation()
// Handle scope changes
if (stream.sol() && top(state).type == "py") {
var scopeOffset = top(state).offset;
if (stream.eatSpace()) {
var lineOffset = stream.indentation();
if (lineOffset > scopeOffset)
- pushScope(stream, state, "py");
+ pushPyScope(state);
else if (lineOffset < scopeOffset && dedent(stream, state))
state.errorToken = true;
return null;
@@ -224,16 +225,18 @@
return tokenString;
}
- function pushScope(stream, state, type) {
- var offset = 0, align = null;
- if (type == "py") {
- while (top(state).type != "py")
- state.scopes.pop();
- }
- offset = top(state).offset + (type == "py" ? conf.indentUnit : hangingIndent);
- if (type != "py" && !stream.match(/^(\s|#.*)*$/, false))
- align = stream.column() + 1;
- state.scopes.push({offset: offset, type: type, align: align});
+ function pushPyScope(state) {
+ while (top(state).type != "py") state.scopes.pop()
+ state.scopes.push({offset: top(state).offset + conf.indentUnit,
+ type: "py",
+ align: null})
+ }
+
+ function pushBracketScope(stream, state, type) {
+ var align = stream.match(/^([\s\[\{\(]|#.*)*$/, false) ? null : stream.column() + 1
+ state.scopes.push({offset: state.indent + hangingIndent,
+ type: type,
+ align: align})
}
function dedent(stream, state) {
@@ -250,12 +253,11 @@
var current = stream.current();
// Handle decorators
- if (current == "@"){
- if(parserConf.version && parseInt(parserConf.version, 10) == 3){
- return stream.match(identifiers, false) ? "meta" : "operator";
- } else {
- return stream.match(identifiers, false) ? "meta" : ERRORCLASS;
- }
+ if (current == "@") {
+ if (parserConf.version && parseInt(parserConf.version, 10) == 3)
+ return stream.match(identifiers, false) ? "meta" : "operator";
+ else
+ return stream.match(identifiers, false) ? "meta" : ERRORCLASS;
}
if ((style == "variable" || style == "builtin")
@@ -268,15 +270,15 @@
if (current == "lambda") state.lambda = true;
if (current == ":" && !state.lambda && top(state).type == "py")
- pushScope(stream, state, "py");
+ pushPyScope(state);
var delimiter_index = current.length == 1 ? "[({".indexOf(current) : -1;
if (delimiter_index != -1)
- pushScope(stream, state, "])}".slice(delimiter_index, delimiter_index+1));
+ pushBracketScope(stream, state, "])}".slice(delimiter_index, delimiter_index+1));
delimiter_index = "])}".indexOf(current);
if (delimiter_index != -1) {
- if (top(state).type == current) state.scopes.pop();
+ if (top(state).type == current) state.indent = state.scopes.pop().offset - hangingIndent
else return ERRORCLASS;
}
if (state.dedent > 0 && stream.eol() && top(state).type == "py") {
@@ -292,6 +294,7 @@
return {
tokenize: tokenBase,
scopes: [{offset: basecolumn || 0, type: "py", align: null}],
+ indent: basecolumn || 0,
lastToken: null,
lambda: false,
dedent: 0
@@ -316,16 +319,14 @@
if (state.tokenize != tokenBase)
return state.tokenize.isString ? CodeMirror.Pass : 0;
- var scope = top(state);
- var closing = textAfter && textAfter.charAt(0) == scope.type;
+ var scope = top(state), closing = scope.type == textAfter.charAt(0)
if (scope.align != null)
- return scope.align - (closing ? 1 : 0);
- else if (closing && state.scopes.length > 1)
- return state.scopes[state.scopes.length - 2].offset;
+ return scope.align - (closing ? 1 : 0)
else
- return scope.offset;
+ return scope.offset - (closing ? hangingIndent : 0)
},
+ electricInput: /^\s*[\}\]\)]$/,
closeBrackets: {triples: "'\""},
lineComment: "#",
fold: "indent"
diff --git a/public/vendor/codemirror/mode/r/r.js b/public/vendor/codemirror/mode/r/r.js
index 1ab4a956..d41d1c54 100644
--- a/public/vendor/codemirror/mode/r/r.js
+++ b/public/vendor/codemirror/mode/r/r.js
@@ -11,6 +11,8 @@
})(function(CodeMirror) {
"use strict";
+CodeMirror.registerHelper("wordChars", "r", /[\w.]/);
+
CodeMirror.defineMode("r", function(config) {
function wordObj(str) {
var words = str.split(" "), res = {};
diff --git a/public/vendor/codemirror/mode/sas/index.html b/public/vendor/codemirror/mode/sas/index.html
new file mode 100644
index 00000000..636e0659
--- /dev/null
+++ b/public/vendor/codemirror/mode/sas/index.html
@@ -0,0 +1,81 @@
+<!doctype html>
+
+<title>CodeMirror: SAS mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../xml/xml.js"></script>
+<script src="sas.js"></script>
+<style type="text/css">
+ .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
+ .cm-s-default .cm-trailing-space-a:before,
+ .cm-s-default .cm-trailing-space-b:before {position: absolute; content: "\00B7"; color: #777;}
+ .cm-s-default .cm-trailing-space-new-line:before {position: absolute; content: "\21B5"; color: #777;}
+</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">SAS</a>
+ </ul>
+</div>
+
+<article>
+<h2>SAS mode</h2>
+<form><textarea id="code" name="code">
+libname foo "/tmp/foobar";
+%let count=1;
+
+/* Multi line
+Comment
+*/
+data _null_;
+ x=ranuni();
+ * single comment;
+ x2=x**2;
+ sx=sqrt(x);
+ if x=x2 then put "x must be 1";
+ else do;
+ put x=;
+ end;
+run;
+
+/* embedded comment
+* comment;
+*/
+
+proc glm data=sashelp.class;
+ class sex;
+ model weight = height sex;
+run;
+
+proc sql;
+ select count(*)
+ from sashelp.class;
+
+ create table foo as
+ select * from sashelp.class;
+
+ select *
+ from foo;
+quit;
+</textarea></form>
+
+<script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ mode: 'sas',
+ lineNumbers: true
+ });
+</script>
+
+<p><strong>MIME types defined:</strong> <code>text/x-sas</code>.</p>
+
+</article>
diff --git a/public/vendor/codemirror/mode/sas/sas.js b/public/vendor/codemirror/mode/sas/sas.js
new file mode 100755
index 00000000..fe114827
--- /dev/null
+++ b/public/vendor/codemirror/mode/sas/sas.js
@@ -0,0 +1,315 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+
+// SAS mode copyright (c) 2016 Jared Dean, SAS Institute
+// Created by Jared Dean
+
+// TODO
+// indent and de-indent
+// identify macro variables
+
+
+//Definitions
+// comment -- text withing * ; or /* */
+// keyword -- SAS language variable
+// variable -- macro variables starts with '&' or variable formats
+// variable-2 -- DATA Step, proc, or macro names
+// string -- text within ' ' or " "
+// operator -- numeric operator + / - * ** le eq ge ... and so on
+// builtin -- proc %macro data run mend
+// atom
+// def
+
+(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("sas", function () {
+ var words = {};
+ var isDoubleOperatorSym = {
+ eq: 'operator',
+ lt: 'operator',
+ le: 'operator',
+ gt: 'operator',
+ ge: 'operator',
+ "in": 'operator',
+ ne: 'operator',
+ or: 'operator'
+ };
+ var isDoubleOperatorChar = /(<=|>=|!=|<>)/;
+ var isSingleOperatorChar = /[=\(:\),{}.*<>+\-\/^\[\]]/;
+
+ // Takes a string of words separated by spaces and adds them as
+ // keys with the value of the first argument 'style'
+ function define(style, string, context) {
+ if (context) {
+ var split = string.split(' ');
+ for (var i = 0; i < split.length; i++) {
+ words[split[i]] = {style: style, state: context};
+ }
+ }
+ }
+ //datastep
+ define('def', 'stack pgm view source debug nesting nolist', ['inDataStep']);
+ define('def', 'if while until for do do; end end; then else cancel', ['inDataStep']);
+ define('def', 'label format _n_ _error_', ['inDataStep']);
+ define('def', 'ALTER BUFNO BUFSIZE CNTLLEV COMPRESS DLDMGACTION ENCRYPT ENCRYPTKEY EXTENDOBSCOUNTER GENMAX GENNUM INDEX LABEL OBSBUF OUTREP PW PWREQ READ REPEMPTY REPLACE REUSE ROLE SORTEDBY SPILL TOBSNO TYPE WRITE FILECLOSE FIRSTOBS IN OBS POINTOBS WHERE WHEREUP IDXNAME IDXWHERE DROP KEEP RENAME', ['inDataStep']);
+ define('def', 'filevar finfo finv fipname fipnamel fipstate first firstobs floor', ['inDataStep']);
+ define('def', 'varfmt varinfmt varlabel varlen varname varnum varray varrayx vartype verify vformat vformatd vformatdx vformatn vformatnx vformatw vformatwx vformatx vinarray vinarrayx vinformat vinformatd vinformatdx vinformatn vinformatnx vinformatw vinformatwx vinformatx vlabel vlabelx vlength vlengthx vname vnamex vnferr vtype vtypex weekday', ['inDataStep']);
+ define('def', 'zipfips zipname zipnamel zipstate', ['inDataStep']);
+ define('def', 'put putc putn', ['inDataStep']);
+ define('builtin', 'data run', ['inDataStep']);
+
+
+ //proc
+ define('def', 'data', ['inProc']);
+
+ // flow control for macros
+ define('def', '%if %end %end; %else %else; %do %do; %then', ['inMacro']);
+
+ //everywhere
+ define('builtin', 'proc run; quit; libname filename %macro %mend option options', ['ALL']);
+
+ define('def', 'footnote title libname ods', ['ALL']);
+ define('def', '%let %put %global %sysfunc %eval ', ['ALL']);
+ // automatic macro variables http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a003167023.htm
+ define('variable', '&sysbuffr &syscc &syscharwidth &syscmd &sysdate &sysdate9 &sysday &sysdevic &sysdmg &sysdsn &sysencoding &sysenv &syserr &syserrortext &sysfilrc &syshostname &sysindex &sysinfo &sysjobid &syslast &syslckrc &syslibrc &syslogapplname &sysmacroname &sysmenv &sysmsg &sysncpu &sysodspath &sysparm &syspbuff &sysprocessid &sysprocessname &sysprocname &sysrc &sysscp &sysscpl &sysscpl &syssite &sysstartid &sysstartname &systcpiphostname &systime &sysuserid &sysver &sysvlong &sysvlong4 &syswarningtext', ['ALL']);
+
+ //footnote[1-9]? title[1-9]?
+
+ //options statement
+ define('def', 'source2 nosource2 page pageno pagesize', ['ALL']);
+
+ //proc and datastep
+ define('def', '_all_ _character_ _cmd_ _freq_ _i_ _infile_ _last_ _msg_ _null_ _numeric_ _temporary_ _type_ abort abs addr adjrsq airy alpha alter altlog altprint and arcos array arsin as atan attrc attrib attrn authserver autoexec awscontrol awsdef awsmenu awsmenumerge awstitle backward band base betainv between blocksize blshift bnot bor brshift bufno bufsize bxor by byerr byline byte calculated call cards cards4 catcache cbufno cdf ceil center cexist change chisq cinv class cleanup close cnonct cntllev coalesce codegen col collate collin column comamid comaux1 comaux2 comdef compbl compound compress config continue convert cos cosh cpuid create cross crosstab css curobs cv daccdb daccdbsl daccsl daccsyd dacctab dairy datalines datalines4 datejul datepart datetime day dbcslang dbcstype dclose ddm delete delimiter depdb depdbsl depsl depsyd deptab dequote descending descript design= device dflang dhms dif digamma dim dinfo display distinct dkricond dkrocond dlm dnum do dopen doptname doptnum dread drop dropnote dsname dsnferr echo else emaildlg emailid emailpw emailserver emailsys encrypt end endsas engine eof eov erf erfc error errorcheck errors exist exp fappend fclose fcol fdelete feedback fetch fetchobs fexist fget file fileclose fileexist filefmt filename fileref fmterr fmtsearch fnonct fnote font fontalias fopen foptname foptnum force formatted formchar formdelim formdlim forward fpoint fpos fput fread frewind frlen from fsep fuzz fwrite gaminv gamma getoption getvarc getvarn go goto group gwindow hbar hbound helpenv helploc hms honorappearance hosthelp hostprint hour hpct html hvar ibessel ibr id if index indexc indexw initcmd initstmt inner input inputc inputn inr insert int intck intnx into intrr invaliddata irr is jbessel join juldate keep kentb kurtosis label lag last lbound leave left length levels lgamma lib library libref line linesize link list log log10 log2 logpdf logpmf logsdf lostcard lowcase lrecl ls macro macrogen maps mautosource max maxdec maxr mdy mean measures median memtype merge merror min minute missing missover mlogic mod mode model modify month mopen mort mprint mrecall msglevel msymtabmax mvarsize myy n nest netpv new news nmiss no nobatch nobs nocaps nocardimage nocenter nocharcode nocmdmac nocol nocum nodate nodbcs nodetails nodmr nodms nodmsbatch nodup nodupkey noduplicates noechoauto noequals noerrorabend noexitwindows nofullstimer noicon noimplmac noint nolist noloadlist nomiss nomlogic nomprint nomrecall nomsgcase nomstored nomultenvappl nonotes nonumber noobs noovp nopad nopercent noprint noprintinit normal norow norsasuser nosetinit nosplash nosymbolgen note notes notitle notitles notsorted noverbose noxsync noxwait npv null number numkeys nummousekeys nway obs on open order ordinal otherwise out outer outp= output over ovp p(1 5 10 25 50 75 90 95 99) pad pad2 paired parm parmcards path pathdll pathname pdf peek peekc pfkey pmf point poisson poke position printer probbeta probbnml probchi probf probgam probhypr probit probnegb probnorm probsig probt procleave prt ps pw pwreq qtr quote r ranbin rancau ranexp rangam range ranks rannor ranpoi rantbl rantri ranuni read recfm register regr remote remove rename repeat replace resolve retain return reuse reverse rewind right round rsquare rtf rtrace rtraceloc s s2 samploc sasautos sascontrol sasfrscr sasmsg sasmstore sasscript sasuser saving scan sdf second select selection separated seq serror set setcomm setot sign simple sin sinh siteinfo skewness skip sle sls sortedby sortpgm sortseq sortsize soundex spedis splashlocation split spool sqrt start std stderr stdin stfips stimer stname stnamel stop stopover subgroup subpopn substr sum sumwgt symbol symbolgen symget symput sysget sysin sysleave sysmsg sysparm sysprint sysprintfont sysprod sysrc system t table tables tan tanh tapeclose tbufsize terminal test then timepart tinv tnonct to today tol tooldef totper transformout translate trantab tranwrd trigamma trim trimn trunc truncover type unformatted uniform union until upcase update user usericon uss validate value var weight when where while wincharset window work workinit workterm write wsum xsync xwait yearcutoff yes yyq min max', ['inDataStep', 'inProc']);
+ define('operator', 'and not ', ['inDataStep', 'inProc']);
+
+ // Main function
+ function tokenize(stream, state) {
+ // Finally advance the stream
+ var ch = stream.next();
+
+ // BLOCKCOMMENT
+ if (ch === '/' && stream.eat('*')) {
+ state.continueComment = true;
+ return "comment";
+ } else if (state.continueComment === true) { // in comment block
+ //comment ends at the beginning of the line
+ if (ch === '*' && stream.peek() === '/') {
+ stream.next();
+ state.continueComment = false;
+ } else if (stream.skipTo('*')) { //comment is potentially later in line
+ stream.skipTo('*');
+ stream.next();
+ if (stream.eat('/'))
+ state.continueComment = false;
+ } else {
+ stream.skipToEnd();
+ }
+ return "comment";
+ }
+
+ // DoubleOperator match
+ var doubleOperator = ch + stream.peek();
+
+ // Match all line comments.
+ var myString = stream.string;
+ var myRegexp = /(?:^\s*|[;]\s*)(\*.*?);/ig;
+ var match = myRegexp.exec(myString);
+ if (match !== null) {
+ if (match.index === 0 && (stream.column() !== (match.index + match[0].length - 1))) {
+ stream.backUp(stream.column());
+ stream.skipTo(';');
+ stream.next();
+ return 'comment';
+ } else if (match.index + 1 < stream.column() && stream.column() < match.index + match[0].length - 1) {
+ // the ';' triggers the match so move one past it to start
+ // the comment block that is why match.index+1
+ stream.backUp(stream.column() - match.index - 1);
+ stream.skipTo(';');
+ stream.next();
+ return 'comment';
+ }
+ } else if (!state.continueString && (ch === '"' || ch === "'")) {
+ // Have we found a string?
+ state.continueString = ch; //save the matching quote in the state
+ return "string";
+ } else if (state.continueString !== null) {
+ if (stream.skipTo(state.continueString)) {
+ // quote found on this line
+ stream.next();
+ state.continueString = null;
+ } else {
+ stream.skipToEnd();
+ }
+ return "string";
+ } else if (state.continueString !== null && stream.eol()) {
+ stream.skipTo(state.continueString) || stream.skipToEnd();
+ return "string";
+ } else if (/[\d\.]/.test(ch)) { //find numbers
+ if (ch === ".")
+ stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/);
+ else if (ch === "0")
+ stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/);
+ else
+ stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/);
+ return "number";
+ } else if (isDoubleOperatorChar.test(ch + stream.peek())) { // TWO SYMBOL TOKENS
+ stream.next();
+ return "operator";
+ } else if (isDoubleOperatorSym.hasOwnProperty(doubleOperator)) {
+ stream.next();
+ if (stream.peek() === ' ')
+ return isDoubleOperatorSym[doubleOperator.toLowerCase()];
+ } else if (isSingleOperatorChar.test(ch)) { // SINGLE SYMBOL TOKENS
+ return "operator";
+ }
+
+ // Matches one whole word -- even if the word is a character
+ var word;
+ if (stream.match(/[%&;\w]+/, false) != null) {
+ word = ch + stream.match(/[%&;\w]+/, true);
+ if (/&/.test(word)) return 'variable'
+ } else {
+ word = ch;
+ }
+ // the word after DATA PROC or MACRO
+ if (state.nextword) {
+ stream.match(/[\w]+/);
+ // match memname.libname
+ if (stream.peek() === '.') stream.skipTo(' ');
+ state.nextword = false;
+ return 'variable-2';
+
+ }
+
+ // Are we in a DATA Step?
+ if (state.inDataStep) {
+ if (word.toLowerCase() === 'run;' || stream.match(/run\s;/)) {
+ state.inDataStep = false;
+ return 'builtin';
+ }
+ // variable formats
+ if ((word) && stream.next() === '.') {
+ //either a format or libname.memname
+ if (/\w/.test(stream.peek())) return 'variable-2';
+ else return 'variable';
+ }
+ // do we have a DATA Step keyword
+ if (word && words.hasOwnProperty(word.toLowerCase()) &&
+ (words[word.toLowerCase()].state.indexOf("inDataStep") !== -1 ||
+ words[word.toLowerCase()].state.indexOf("ALL") !== -1)) {
+ //backup to the start of the word
+ if (stream.start < stream.pos)
+ stream.backUp(stream.pos - stream.start);
+ //advance the length of the word and return
+ for (var i = 0; i < word.length; ++i) stream.next();
+ return words[word.toLowerCase()].style;
+ }
+ }
+ // Are we in an Proc statement?
+ if (state.inProc) {
+ if (word.toLowerCase() === 'run;' || word.toLowerCase() === 'quit;') {
+ state.inProc = false;
+ return 'builtin';
+ }
+ // do we have a proc keyword
+ if (word && words.hasOwnProperty(word.toLowerCase()) &&
+ (words[word.toLowerCase()].state.indexOf("inProc") !== -1 ||
+ words[word.toLowerCase()].state.indexOf("ALL") !== -1)) {
+ stream.match(/[\w]+/);
+ return words[word].style;
+ }
+ }
+ // Are we in a Macro statement?
+ if (state.inMacro) {
+ if (word.toLowerCase() === '%mend') {
+ if (stream.peek() === ';') stream.next();
+ state.inMacro = false;
+ return 'builtin';
+ }
+ if (word && words.hasOwnProperty(word.toLowerCase()) &&
+ (words[word.toLowerCase()].state.indexOf("inMacro") !== -1 ||
+ words[word.toLowerCase()].state.indexOf("ALL") !== -1)) {
+ stream.match(/[\w]+/);
+ return words[word.toLowerCase()].style;
+ }
+
+ return 'atom';
+ }
+ // Do we have Keywords specific words?
+ if (word && words.hasOwnProperty(word.toLowerCase())) {
+ // Negates the initial next()
+ stream.backUp(1);
+ // Actually move the stream
+ stream.match(/[\w]+/);
+ if (word.toLowerCase() === 'data' && /=/.test(stream.peek()) === false) {
+ state.inDataStep = true;
+ state.nextword = true;
+ return 'builtin';
+ }
+ if (word.toLowerCase() === 'proc') {
+ state.inProc = true;
+ state.nextword = true;
+ return 'builtin';
+ }
+ if (word.toLowerCase() === '%macro') {
+ state.inMacro = true;
+ state.nextword = true;
+ return 'builtin';
+ }
+ if (/title[1-9]/i.test(word)) return 'def';
+
+ if (word.toLowerCase() === 'footnote') {
+ stream.eat(/[1-9]/);
+ return 'def';
+ }
+
+ // Returns their value as state in the prior define methods
+ if (state.inDataStep === true && words[word.toLowerCase()].state.indexOf("inDataStep") !== -1)
+ return words[word.toLowerCase()].style;
+ if (state.inProc === true && words[word.toLowerCase()].state.indexOf("inProc") !== -1)
+ return words[word.toLowerCase()].style;
+ if (state.inMacro === true && words[word.toLowerCase()].state.indexOf("inMacro") !== -1)
+ return words[word.toLowerCase()].style;
+ if (words[word.toLowerCase()].state.indexOf("ALL") !== -1)
+ return words[word.toLowerCase()].style;
+ return null;
+ }
+ // Unrecognized syntax
+ return null;
+ }
+
+ return {
+ startState: function () {
+ return {
+ inDataStep: false,
+ inProc: false,
+ inMacro: false,
+ nextword: false,
+ continueString: null,
+ continueComment: false
+ };
+ },
+ token: function (stream, state) {
+ // Strip the spaces, but regex will account for them either way
+ if (stream.eatSpace()) return null;
+ // Go through the main process
+ return tokenize(stream, state);
+ },
+
+ blockCommentStart: "/*",
+ blockCommentEnd: "*/"
+ };
+
+ });
+
+ CodeMirror.defineMIME("text/x-sas", "sas");
+});
diff --git a/public/vendor/codemirror/mode/sparql/sparql.js b/public/vendor/codemirror/mode/sparql/sparql.js
index 0cf40f58..095dcca6 100644
--- a/public/vendor/codemirror/mode/sparql/sparql.js
+++ b/public/vendor/codemirror/mode/sparql/sparql.js
@@ -25,7 +25,7 @@ CodeMirror.defineMode("sparql", function(config) {
"strbefore", "strafter", "year", "month", "day", "hours", "minutes", "seconds",
"timezone", "tz", "now", "uuid", "struuid", "md5", "sha1", "sha256", "sha384",
"sha512", "coalesce", "if", "strlang", "strdt", "isnumeric", "regex", "exists",
- "isblank", "isliteral", "a"]);
+ "isblank", "isliteral", "a", "bind"]);
var keywords = wordRegexp(["base", "prefix", "select", "distinct", "reduced", "construct", "describe",
"ask", "from", "named", "where", "order", "limit", "offset", "filter", "optional",
"graph", "by", "asc", "desc", "as", "having", "undef", "values", "group",
@@ -135,7 +135,11 @@ CodeMirror.defineMode("sparql", function(config) {
else if (curPunc == "{") pushContext(state, "}", stream.column());
else if (/[\]\}\)]/.test(curPunc)) {
while (state.context && state.context.type == "pattern") popContext(state);
- if (state.context && curPunc == state.context.type) popContext(state);
+ if (state.context && curPunc == state.context.type) {
+ popContext(state);
+ if (curPunc == "}" && state.context && state.context.type == "pattern")
+ popContext(state);
+ }
}
else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state);
else if (/atom|string|variable/.test(style) && state.context) {
diff --git a/public/vendor/codemirror/mode/spreadsheet/spreadsheet.js b/public/vendor/codemirror/mode/spreadsheet/spreadsheet.js
index 6fab00fd..222f2976 100644
--- a/public/vendor/codemirror/mode/spreadsheet/spreadsheet.js
+++ b/public/vendor/codemirror/mode/spreadsheet/spreadsheet.js
@@ -70,7 +70,10 @@
return "operator";
case "\\":
if (stream.match(/\\[a-z]+/)) return "string-2";
- else return null;
+ else {
+ stream.next();
+ return "atom";
+ }
case ".":
case ",":
case ";":
diff --git a/public/vendor/codemirror/mode/sql/index.html b/public/vendor/codemirror/mode/sql/index.html
index a0d8d9e1..dba069dc 100644
--- a/public/vendor/codemirror/mode/sql/index.html
+++ b/public/vendor/codemirror/mode/sql/index.html
@@ -56,7 +56,9 @@ SELECT SQL_NO_CACHE DISTINCT
<code><a href="?mime=text/x-cassandra">text/x-cassandra</a></code>,
<code><a href="?mime=text/x-plsql">text/x-plsql</a></code>,
<code><a href="?mime=text/x-mssql">text/x-mssql</a></code>,
- <code><a href="?mime=text/x-hive">text/x-hive</a></code>.
+ <code><a href="?mime=text/x-hive">text/x-hive</a></code>,
+ <code><a href="?mime=text/x-pgsql">text/x-pgsql</a></code>,
+ <code><a href="?mime=text/x-gql">text/x-gql</a></code>.
</p>
<script>
window.onload = function() {
diff --git a/public/vendor/codemirror/mode/sql/sql.js b/public/vendor/codemirror/mode/sql/sql.js
index 86c68f72..daec60ce 100644
--- a/public/vendor/codemirror/mode/sql/sql.js
+++ b/public/vendor/codemirror/mode/sql/sql.js
@@ -65,7 +65,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
// ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html
return "keyword";
} else if (/^[\(\),\;\[\]]/.test(ch)) {
- // no highlightning
+ // no highlighting
return null;
} else if (support.commentSlashSlash && ch == "/" && stream.eat("/")) {
// 1-line comment
@@ -257,7 +257,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
}
// these keywords are used by all SQL dialects (however, a mode can still overwrite it)
- var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit";
+ var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit ";
// turn a space-separated list into an array
function set(str) {
@@ -341,7 +341,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
name: "sql",
client: set("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),
keywords: set("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),
- builtin: set("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),
+ builtin: set("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),
operatorChars: /^[*+\-%<>!=~]/,
dateSQL: set("date time timestamp"),
support: set("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")
@@ -357,6 +357,28 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
dateSQL: set("date timestamp"),
support: set("ODBCdotTable doubleQuote binaryNumber hexNumber")
});
+
+ CodeMirror.defineMIME("text/x-pgsql", {
+ name: "sql",
+ client: set("source"),
+ // http://www.postgresql.org/docs/9.5/static/sql-keywords-appendix.html
+ keywords: set(sqlKeywords + "a abort abs absent absolute access according action ada add admin after aggregate all allocate also always analyse analyze any are array array_agg array_max_cardinality asensitive assertion assignment asymmetric at atomic attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli binary bit_length blob blocked bom both breadth c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain characteristics characters character_length character_set_catalog character_set_name character_set_schema char_length check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column columns column_name command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constraint constraints constraint_catalog constraint_name constraint_schema constructor contains content continue control conversion convert copy corr corresponding cost covar_pop covar_samp cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datetime_interval_code datetime_interval_precision day db deallocate dec declare default defaults deferrable deferred defined definer degree delimiter delimiters dense_rank depth deref derived describe descriptor deterministic diagnostics dictionary disable discard disconnect dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain dynamic dynamic_function dynamic_function_code each element else empty enable encoding encrypted end end-exec end_frame end_partition enforced enum equals escape event every except exception exclude excluding exclusive exec execute exists exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreign fortran forward found frame_row free freeze fs full function functions fusion g general generated get global go goto grant granted greatest grouping groups handler header hex hierarchy hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import including increment indent index indexes indicator inherit inherits initially inline inner inout input insensitive instance instantiable instead integrity intersect intersection invoker isnull isolation k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like_regex link listen ln load local localtime localtimestamp location locator lock locked logged lower m map mapping match matched materialized max maxvalue max_cardinality member merge message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized nothing notify notnull nowait nth_value ntile null nullable nullif nulls number object occurrences_regex octets octet_length of off offset oids old only open operator option options ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password percent percentile_cont percentile_disc percent_rank period permission placing plans pli policy portion position position_regex power precedes preceding prepare prepared preserve primary prior privileges procedural procedure program public quote range rank read reads reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict result return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns revoke right role rollback rollup routine routine_catalog routine_name routine_schema row rows row_count row_number rule savepoint scale schema schema_name scope scope_catalog scope_name scope_schema scroll search second section security selective self sensitive sequence sequences serializable server server_name session session_user setof sets share show similar simple size skip snapshot some source space specific specifictype specific_name sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset substring substring_regex succeeds sum symmetric sysid system system_time system_user t tables tablesample tablespace table_name temp template temporary then ties timezone_hour timezone_minute to token top_level_count trailing transaction transactions_committed transactions_rolled_back transaction_active transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted unique unknown unlink unlisten unlogged unnamed unnest until untyped upper uri usage user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of varbinary variadic var_pop var_samp verbose version versioning view views volatile when whenever whitespace width_bucket window within work wrapper write xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes loop repeat"),
+ // http://www.postgresql.org/docs/9.5/static/datatype.html
+ builtin: set("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),
+ atoms: set("false true null unknown"),
+ operatorChars: /^[*+\-%<>!=&|^]/,
+ dateSQL: set("date time timestamp"),
+ support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast commentHash commentSpaceRequired")
+ });
+
+ // Google's SQL-like query language, GQL
+ CodeMirror.defineMIME("text/x-gql", {
+ name: "sql",
+ keywords: set("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"),
+ atoms: set("false true"),
+ builtin: set("blob datetime first key __key__ string integer double boolean null"),
+ operatorChars: /^[*+\-%<>!=]/
+ });
}());
});
diff --git a/public/vendor/codemirror/mode/swift/swift.js b/public/vendor/codemirror/mode/swift/swift.js
index 7a2339fc..3c28ced3 100644
--- a/public/vendor/codemirror/mode/swift/swift.js
+++ b/public/vendor/codemirror/mode/swift/swift.js
@@ -34,13 +34,13 @@
"private","extension"])
var operators = "+-/*%=|&<>#"
var punc = ";,.(){}[]"
- var delimiters = /^(?:[()\[\]{},:`=;]|\.\.?\.?)/
var number = /^-?(?:(?:[\d_]+\.[_\d]*|\.[_\d]+|0o[0-7_\.]+|0b[01_\.]+)(?:e-?[\d_]+)?|0x[\d_a-f\.]+(?:p-?[\d_]+)?)/i
var identifier = /^[_A-Za-z$][_A-Za-z$0-9]*/
var property = /^[@\.][_A-Za-z$][_A-Za-z$0-9]*/
var regexp = /^\/(?!\s)(?:\/\/)?(?:\\.|[^\/])+\//
function tokenBase(stream, state, prev) {
+ if (stream.sol()) state.indented = stream.indentation()
if (stream.eatSpace()) return null
var ch = stream.peek()
@@ -60,7 +60,8 @@
return "operator"
}
if (punc.indexOf(ch) > -1) {
- stream.match(delimiters)
+ stream.next()
+ stream.match("..")
return "punctuation"
}
if (ch == '"' || ch == "'") {
@@ -136,14 +137,35 @@
return "comment"
}
- CodeMirror.defineMode("swift", function() {
+ function Context(prev, align, indented) {
+ this.prev = prev
+ this.align = align
+ this.indented = indented
+ }
+
+ function pushContext(state, stream) {
+ var align = stream.match(/^\s*($|\/[\/\*])/, false) ? null : stream.column() + 1
+ state.context = new Context(state.context, align, state.indented)
+ }
+
+ function popContext(state) {
+ if (state.context) {
+ state.indented = state.context.indented
+ state.context = state.context.prev
+ }
+ }
+
+ CodeMirror.defineMode("swift", function(config) {
return {
startState: function() {
return {
prev: null,
+ context: null,
+ indented: 0,
tokenize: []
}
},
+
token: function(stream, state) {
var prev = state.prev
state.prev = null
@@ -151,8 +173,25 @@
var style = tokenize(stream, state, prev)
if (!style || style == "comment") state.prev = prev
else if (!state.prev) state.prev = style
+
+ if (style == "punctuation") {
+ var bracket = /[\(\[\{]|([\]\)\}])/.exec(stream.current())
+ if (bracket) (bracket[1] ? popContext : pushContext)(state, stream)
+ }
+
return style
},
+
+ indent: function(state, textAfter) {
+ var cx = state.context
+ if (!cx) return 0
+ var closing = /^[\]\}\)]/.test(textAfter)
+ if (cx.align != null) return cx.align - (closing ? 1 : 0)
+ return cx.indented + (closing ? 0 : config.indentUnit)
+ },
+
+ electricInput: /^\s*[\)\}\]]$/,
+
lineComment: "//",
blockCommentStart: "/*",
blockCommentEnd: "*/"
@@ -160,4 +199,4 @@
})
CodeMirror.defineMIME("text/x-swift","swift")
-})
+});
diff --git a/public/vendor/codemirror/mode/tcl/tcl.js b/public/vendor/codemirror/mode/tcl/tcl.js
index 056accb2..8c76d52c 100644
--- a/public/vendor/codemirror/mode/tcl/tcl.js
+++ b/public/vendor/codemirror/mode/tcl/tcl.js
@@ -42,42 +42,34 @@ CodeMirror.defineMode("tcl", function() {
var beforeParams = state.beforeParams;
state.beforeParams = false;
var ch = stream.next();
- if ((ch == '"' || ch == "'") && state.inParams)
+ if ((ch == '"' || ch == "'") && state.inParams) {
return chain(stream, state, tokenString(ch));
- else if (/[\[\]{}\(\),;\.]/.test(ch)) {
+ } else if (/[\[\]{}\(\),;\.]/.test(ch)) {
if (ch == "(" && beforeParams) state.inParams = true;
else if (ch == ")") state.inParams = false;
return null;
- }
- else if (/\d/.test(ch)) {
+ } else if (/\d/.test(ch)) {
stream.eatWhile(/[\w\.]/);
return "number";
- }
- else if (ch == "#" && stream.eat("*")) {
- return chain(stream, state, tokenComment);
- }
- else if (ch == "#" && stream.match(/ *\[ *\[/)) {
- return chain(stream, state, tokenUnparsed);
- }
- else if (ch == "#" && stream.eat("#")) {
+ } else if (ch == "#") {
+ if (stream.eat("*"))
+ return chain(stream, state, tokenComment);
+ if (ch == "#" && stream.match(/ *\[ *\[/))
+ return chain(stream, state, tokenUnparsed);
stream.skipToEnd();
return "comment";
- }
- else if (ch == '"') {
+ } else if (ch == '"') {
stream.skipTo(/"/);
return "comment";
- }
- else if (ch == "$") {
+ } else if (ch == "$") {
stream.eatWhile(/[$_a-z0-9A-Z\.{:]/);
stream.eatWhile(/}/);
state.beforeParams = true;
return "builtin";
- }
- else if (isOperatorChar.test(ch)) {
+ } else if (isOperatorChar.test(ch)) {
stream.eatWhile(isOperatorChar);
return "comment";
- }
- else {
+ } else {
stream.eatWhile(/[\w\$_{}\xa1-\uffff]/);
var word = stream.current().toLowerCase();
if (keywords && keywords.propertyIsEnumerable(word))
diff --git a/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js b/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js
index 1df01647..1a3b3bc6 100644
--- a/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js
+++ b/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js
@@ -16,7 +16,6 @@
! Info
CoreVersion parameter is needed for TiddlyWiki only!
***/
-//{{{
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
@@ -32,73 +31,60 @@ CodeMirror.defineMode("tiddlywiki", function () {
// Tokenizer
var textwords = {};
- var keywords = function () {
- function kw(type) {
- return { type: type, style: "macro"};
- }
- return {
- "allTags": kw('allTags'), "closeAll": kw('closeAll'), "list": kw('list'),
- "newJournal": kw('newJournal'), "newTiddler": kw('newTiddler'),
- "permaview": kw('permaview'), "saveChanges": kw('saveChanges'),
- "search": kw('search'), "slider": kw('slider'), "tabs": kw('tabs'),
- "tag": kw('tag'), "tagging": kw('tagging'), "tags": kw('tags'),
- "tiddler": kw('tiddler'), "timeline": kw('timeline'),
- "today": kw('today'), "version": kw('version'), "option": kw('option'),
-
- "with": kw('with'),
- "filter": kw('filter')
- };
- }();
+ var keywords = {
+ "allTags": true, "closeAll": true, "list": true,
+ "newJournal": true, "newTiddler": true,
+ "permaview": true, "saveChanges": true,
+ "search": true, "slider": true, "tabs": true,
+ "tag": true, "tagging": true, "tags": true,
+ "tiddler": true, "timeline": true,
+ "today": true, "version": true, "option": true,
+ "with": true, "filter": true
+ };
var isSpaceName = /[\w_\-]/i,
- reHR = /^\-\-\-\-+$/, // <hr>
- reWikiCommentStart = /^\/\*\*\*$/, // /***
- reWikiCommentStop = /^\*\*\*\/$/, // ***/
- reBlockQuote = /^<<<$/,
+ reHR = /^\-\-\-\-+$/, // <hr>
+ reWikiCommentStart = /^\/\*\*\*$/, // /***
+ reWikiCommentStop = /^\*\*\*\/$/, // ***/
+ reBlockQuote = /^<<<$/,
- reJsCodeStart = /^\/\/\{\{\{$/, // //{{{ js block start
- reJsCodeStop = /^\/\/\}\}\}$/, // //}}} js stop
- reXmlCodeStart = /^<!--\{\{\{-->$/, // xml block start
- reXmlCodeStop = /^<!--\}\}\}-->$/, // xml stop
+ reJsCodeStart = /^\/\/\{\{\{$/, // //{{{ js block start
+ reJsCodeStop = /^\/\/\}\}\}$/, // //}}} js stop
+ reXmlCodeStart = /^<!--\{\{\{-->$/, // xml block start
+ reXmlCodeStop = /^<!--\}\}\}-->$/, // xml stop
- reCodeBlockStart = /^\{\{\{$/, // {{{ TW text div block start
- reCodeBlockStop = /^\}\}\}$/, // }}} TW text stop
+ reCodeBlockStart = /^\{\{\{$/, // {{{ TW text div block start
+ reCodeBlockStop = /^\}\}\}$/, // }}} TW text stop
- reUntilCodeStop = /.*?\}\}\}/;
+ reUntilCodeStop = /.*?\}\}\}/;
function chain(stream, state, f) {
state.tokenize = f;
return f(stream, state);
}
- function jsTokenBase(stream, state) {
- var sol = stream.sol(), ch;
+ function tokenBase(stream, state) {
+ var sol = stream.sol(), ch = stream.peek();
state.block = false; // indicates the start of a code block.
- ch = stream.peek(); // don't eat, to make matching simpler
-
// check start of blocks
if (sol && /[<\/\*{}\-]/.test(ch)) {
if (stream.match(reCodeBlockStart)) {
state.block = true;
return chain(stream, state, twTokenCode);
}
- if (stream.match(reBlockQuote)) {
+ if (stream.match(reBlockQuote))
return 'quote';
- }
- if (stream.match(reWikiCommentStart) || stream.match(reWikiCommentStop)) {
+ if (stream.match(reWikiCommentStart) || stream.match(reWikiCommentStop))
return 'comment';
- }
- if (stream.match(reJsCodeStart) || stream.match(reJsCodeStop) || stream.match(reXmlCodeStart) || stream.match(reXmlCodeStop)) {
+ if (stream.match(reJsCodeStart) || stream.match(reJsCodeStop) || stream.match(reXmlCodeStart) || stream.match(reXmlCodeStop))
return 'comment';
- }
- if (stream.match(reHR)) {
+ if (stream.match(reHR))
return 'hr';
- }
- } // sol
- ch = stream.next();
+ }
+ stream.next();
if (sol && /[\/\*!#;:>|]/.test(ch)) {
if (ch == "!") { // tw header
stream.skipToEnd();
@@ -124,95 +110,77 @@ CodeMirror.defineMode("tiddlywiki", function () {
stream.eatWhile(">");
return "quote";
}
- if (ch == '|') {
+ if (ch == '|')
return 'header';
- }
}
- if (ch == '{' && stream.match(/\{\{/)) {
+ if (ch == '{' && stream.match(/\{\{/))
return chain(stream, state, twTokenCode);
- }
// rudimentary html:// file:// link matching. TW knows much more ...
- if (/[hf]/i.test(ch)) {
- if (/[ti]/i.test(stream.peek()) && stream.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i)) {
- return "link";
- }
- }
+ if (/[hf]/i.test(ch) &&
+ /[ti]/i.test(stream.peek()) &&
+ stream.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i))
+ return "link";
+
// just a little string indicator, don't want to have the whole string covered
- if (ch == '"') {
+ if (ch == '"')
return 'string';
- }
- if (ch == '~') { // _no_ CamelCase indicator should be bold
+
+ if (ch == '~') // _no_ CamelCase indicator should be bold
return 'brace';
- }
- if (/[\[\]]/.test(ch)) { // check for [[..]]
- if (stream.peek() == ch) {
- stream.next();
- return 'brace';
- }
- }
+
+ if (/[\[\]]/.test(ch) && stream.match(ch)) // check for [[..]]
+ return 'brace';
+
if (ch == "@") { // check for space link. TODO fix @@...@@ highlighting
stream.eatWhile(isSpaceName);
return "link";
}
+
if (/\d/.test(ch)) { // numbers
stream.eatWhile(/\d/);
return "number";
}
+
if (ch == "/") { // tw invisible comment
if (stream.eat("%")) {
return chain(stream, state, twTokenComment);
- }
- else if (stream.eat("/")) { //
+ } else if (stream.eat("/")) { //
return chain(stream, state, twTokenEm);
}
}
- if (ch == "_") { // tw underline
- if (stream.eat("_")) {
+
+ if (ch == "_" && stream.eat("_")) // tw underline
return chain(stream, state, twTokenUnderline);
- }
- }
+
// strikethrough and mdash handling
- if (ch == "-") {
- if (stream.eat("-")) {
- // if strikethrough looks ugly, change CSS.
- if (stream.peek() != ' ')
- return chain(stream, state, twTokenStrike);
- // mdash
- if (stream.peek() == ' ')
- return 'brace';
- }
- }
- if (ch == "'") { // tw bold
- if (stream.eat("'")) {
- return chain(stream, state, twTokenStrong);
- }
- }
- if (ch == "<") { // tw macro
- if (stream.eat("<")) {
- return chain(stream, state, twTokenMacro);
- }
- }
- else {
- return null;
+ if (ch == "-" && stream.eat("-")) {
+ // if strikethrough looks ugly, change CSS.
+ if (stream.peek() != ' ')
+ return chain(stream, state, twTokenStrike);
+ // mdash
+ if (stream.peek() == ' ')
+ return 'brace';
}
+ if (ch == "'" && stream.eat("'")) // tw bold
+ return chain(stream, state, twTokenStrong);
+
+ if (ch == "<" && stream.eat("<")) // tw macro
+ return chain(stream, state, twTokenMacro);
+
// core macro handling
stream.eatWhile(/[\w\$_]/);
- var word = stream.current(),
- known = textwords.propertyIsEnumerable(word) && textwords[word];
-
- return known ? known.style : null;
- } // jsTokenBase()
+ return textwords.propertyIsEnumerable(stream.current()) ? "keyword" : null
+ }
// tw invisible comment
function twTokenComment(stream, state) {
- var maybeEnd = false,
- ch;
+ var maybeEnd = false, ch;
while (ch = stream.next()) {
if (ch == "/" && maybeEnd) {
- state.tokenize = jsTokenBase;
+ state.tokenize = tokenBase;
break;
}
maybeEnd = (ch == "%");
@@ -226,7 +194,7 @@ CodeMirror.defineMode("tiddlywiki", function () {
ch;
while (ch = stream.next()) {
if (ch == "'" && maybeEnd) {
- state.tokenize = jsTokenBase;
+ state.tokenize = tokenBase;
break;
}
maybeEnd = (ch == "'");
@@ -243,12 +211,12 @@ CodeMirror.defineMode("tiddlywiki", function () {
}
if (!sb && stream.match(reUntilCodeStop)) {
- state.tokenize = jsTokenBase;
+ state.tokenize = tokenBase;
return "comment";
}
if (sb && stream.sol() && stream.match(reCodeBlockStop)) {
- state.tokenize = jsTokenBase;
+ state.tokenize = tokenBase;
return "comment";
}
@@ -262,7 +230,7 @@ CodeMirror.defineMode("tiddlywiki", function () {
ch;
while (ch = stream.next()) {
if (ch == "/" && maybeEnd) {
- state.tokenize = jsTokenBase;
+ state.tokenize = tokenBase;
break;
}
maybeEnd = (ch == "/");
@@ -276,7 +244,7 @@ CodeMirror.defineMode("tiddlywiki", function () {
ch;
while (ch = stream.next()) {
if (ch == "_" && maybeEnd) {
- state.tokenize = jsTokenBase;
+ state.tokenize = tokenBase;
break;
}
maybeEnd = (ch == "_");
@@ -291,7 +259,7 @@ CodeMirror.defineMode("tiddlywiki", function () {
while (ch = stream.next()) {
if (ch == "-" && maybeEnd) {
- state.tokenize = jsTokenBase;
+ state.tokenize = tokenBase;
break;
}
maybeEnd = (ch == "-");
@@ -301,58 +269,40 @@ CodeMirror.defineMode("tiddlywiki", function () {
// macro
function twTokenMacro(stream, state) {
- var ch, word, known;
-
if (stream.current() == '<<') {
return 'macro';
}
- ch = stream.next();
+ var ch = stream.next();
if (!ch) {
- state.tokenize = jsTokenBase;
+ state.tokenize = tokenBase;
return null;
}
if (ch == ">") {
if (stream.peek() == '>') {
stream.next();
- state.tokenize = jsTokenBase;
+ state.tokenize = tokenBase;
return "macro";
}
}
stream.eatWhile(/[\w\$_]/);
- word = stream.current();
- known = keywords.propertyIsEnumerable(word) && keywords[word];
-
- if (known) {
- return known.style, word;
- }
- else {
- return null, word;
- }
+ return keywords.propertyIsEnumerable(stream.current()) ? "keyword" : null
}
// Interface
return {
startState: function () {
- return {
- tokenize: jsTokenBase,
- indented: 0,
- level: 0
- };
+ return {tokenize: tokenBase};
},
token: function (stream, state) {
if (stream.eatSpace()) return null;
var style = state.tokenize(stream, state);
return style;
- },
-
- electricChars: ""
+ }
};
});
CodeMirror.defineMIME("text/x-tiddlywiki", "tiddlywiki");
});
-
-//}}}
diff --git a/public/vendor/codemirror/mode/troff/troff.js b/public/vendor/codemirror/mode/troff/troff.js
index beca778e..86154b6e 100644
--- a/public/vendor/codemirror/mode/troff/troff.js
+++ b/public/vendor/codemirror/mode/troff/troff.js
@@ -77,6 +77,8 @@ CodeMirror.defineMode('troff', function() {
};
});
-CodeMirror.defineMIME('troff', 'troff');
+CodeMirror.defineMIME('text/troff', 'troff');
+CodeMirror.defineMIME('text/x-troff', 'troff');
+CodeMirror.defineMIME('application/x-troff', 'troff');
});
diff --git a/public/vendor/codemirror/mode/twig/twig.js b/public/vendor/codemirror/mode/twig/twig.js
index aa676dc4..1f2854be 100644
--- a/public/vendor/codemirror/mode/twig/twig.js
+++ b/public/vendor/codemirror/mode/twig/twig.js
@@ -3,15 +3,15 @@
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
- mod(require("../../lib/codemirror"));
+ mod(require("../../lib/codemirror"), require("../../addon/mode/multiplex"));
else if (typeof define == "function" && define.amd) // AMD
- define(["../../lib/codemirror"], mod);
+ define(["../../lib/codemirror", "../../addon/mode/multiplex"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
- CodeMirror.defineMode("twig", function() {
+ CodeMirror.defineMode("twig:inner", function() {
var keywords = ["and", "as", "autoescape", "endautoescape", "block", "do", "endblock", "else", "elseif", "extends", "for", "endfor", "embed", "endembed", "filter", "endfilter", "flush", "from", "if", "endif", "in", "is", "include", "import", "not", "or", "set", "spaceless", "endspaceless", "with", "endwith", "trans", "endtrans", "blocktrans", "endblocktrans", "macro", "endmacro", "use", "verbatim", "endverbatim"],
operator = /^[+\-*&%=<>!?|~^]/,
sign = /^[:\[\(\{]/,
@@ -128,5 +128,14 @@
};
});
+ CodeMirror.defineMode("twig", function(config, parserConfig) {
+ var twigInner = CodeMirror.getMode(config, "twig:inner");
+ if (!parserConfig || !parserConfig.base) return twigInner;
+ return CodeMirror.multiplexingMode(
+ CodeMirror.getMode(config, parserConfig.base), {
+ open: /\{[{#%]/, close: /[}#%]\}/, mode: twigInner, parseDelimiters: true
+ }
+ );
+ });
CodeMirror.defineMIME("text/x-twig", "twig");
});
diff --git a/public/vendor/codemirror/mode/velocity/index.html b/public/vendor/codemirror/mode/velocity/index.html
index 27478786..7eba8f41 100644
--- a/public/vendor/codemirror/mode/velocity/index.html
+++ b/public/vendor/codemirror/mode/velocity/index.html
@@ -77,6 +77,8 @@ $someObject.getValues("this is a string split
$someObject("This plus $something in the middle").method(7567).property
+#set($something = "Parseable string with '$quotes'!")
+
#macro( tablerows $color $somelist )
#foreach( $something in $somelist )
<tr><td bgcolor=$color>$something</td></tr>
diff --git a/public/vendor/codemirror/mode/velocity/velocity.js b/public/vendor/codemirror/mode/velocity/velocity.js
index 8fc4f95d..12ee2212 100644
--- a/public/vendor/codemirror/mode/velocity/velocity.js
+++ b/public/vendor/codemirror/mode/velocity/velocity.js
@@ -34,7 +34,7 @@ CodeMirror.defineMode("velocity", function() {
state.beforeParams = false;
var ch = stream.next();
// start of unparsed string?
- if ((ch == "'") && state.inParams) {
+ if ((ch == "'") && !state.inString && state.inParams) {
state.lastTokenWasBuiltin = false;
return chain(stream, state, tokenString(ch));
}
diff --git a/public/vendor/codemirror/mode/verilog/index.html b/public/vendor/codemirror/mode/verilog/index.html
index 96b3d647..9c52722a 100644
--- a/public/vendor/codemirror/mode/verilog/index.html
+++ b/public/vendor/codemirror/mode/verilog/index.html
@@ -112,7 +112,7 @@ endclass
Syntax highlighting and indentation for the Verilog and SystemVerilog languages (IEEE 1800).
<h2>Configuration options:</h2>
<ul>
- <li><strong>noIndentKeywords</strong> - List of keywords which should not cause identation to increase. E.g. ["package", "module"]. Default: None</li>
+ <li><strong>noIndentKeywords</strong> - List of keywords which should not cause indentation to increase. E.g. ["package", "module"]. Default: None</li>
</ul>
</p>
diff --git a/public/vendor/codemirror/mode/verilog/test.js b/public/vendor/codemirror/mode/verilog/test.js
index 9c8c0949..8334fab0 100644
--- a/public/vendor/codemirror/mode/verilog/test.js
+++ b/public/vendor/codemirror/mode/verilog/test.js
@@ -263,7 +263,7 @@
""
);
- MT("covergoup_with_function_indents_properly",
+ MT("covergroup_with_function_indents_properly",
"[keyword covergroup] [variable cg] [keyword with] [keyword function] [variable sample][bracket (][keyword bit] [variable b][bracket )];",
" [variable c] : [keyword coverpoint] [variable c];",
"[keyword endgroup]: [variable cg]",
diff --git a/public/vendor/codemirror/mode/verilog/verilog.js b/public/vendor/codemirror/mode/verilog/verilog.js
index 9d2a4cd5..7513dced 100644
--- a/public/vendor/codemirror/mode/verilog/verilog.js
+++ b/public/vendor/codemirror/mode/verilog/verilog.js
@@ -250,7 +250,7 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) {
if (text == contextClosing) {
return true;
} else {
- // contextClosing may be mulitple keywords separated by ;
+ // contextClosing may be multiple keywords separated by ;
var closingKeywords = contextClosing.split(";");
for (var i in closingKeywords) {
if (text == closingKeywords[i]) {
diff --git a/public/vendor/codemirror/mode/vhdl/vhdl.js b/public/vendor/codemirror/mode/vhdl/vhdl.js
index d3b555aa..97e086e4 100644
--- a/public/vendor/codemirror/mode/vhdl/vhdl.js
+++ b/public/vendor/codemirror/mode/vhdl/vhdl.js
@@ -36,7 +36,7 @@ CodeMirror.defineMode("vhdl", function(config, parserConfig) {
multiLineStrings = parserConfig.multiLineStrings;
var keywords = words("abs,access,after,alias,all,and,architecture,array,assert,attribute,begin,block," +
- "body,buffer,bus,case,component,configuration,constant,disconnent,downto,else,elsif,end,end block,end case," +
+ "body,buffer,bus,case,component,configuration,constant,disconnect,downto,else,elsif,end,end block,end case," +
"end component,end for,end generate,end if,end loop,end process,end record,end units,entity,exit,file,for," +
"function,generate,generic,generic map,group,guarded,if,impure,in,inertial,inout,is,label,library,linkage," +
"literal,loop,map,mod,nand,new,next,nor,null,of,on,open,or,others,out,package,package body,port,port map," +
diff --git a/public/vendor/codemirror/mode/webidl/index.html b/public/vendor/codemirror/mode/webidl/index.html
new file mode 100644
index 00000000..1d4112e1
--- /dev/null
+++ b/public/vendor/codemirror/mode/webidl/index.html
@@ -0,0 +1,71 @@
+<!doctype html>
+
+<title>CodeMirror: Web IDL mode</title>
+<meta charset="utf-8">
+<link rel="stylesheet" href="../../doc/docs.css">
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/edit/matchbrackets.js"></script>
+<script src="webidl.js"></script>
+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
+
+<div id="nav">
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id="logo" src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class="active" href="#">Web IDL</a>
+ </ul>
+</div>
+
+<article>
+ <h2>Web IDL mode</h2>
+
+ <div>
+<textarea id="code" name="code">
+[NamedConstructor=Image(optional unsigned long width, optional unsigned long height)]
+interface HTMLImageElement : HTMLElement {
+ attribute DOMString alt;
+ attribute DOMString src;
+ attribute DOMString srcset;
+ attribute DOMString sizes;
+ attribute DOMString? crossOrigin;
+ attribute DOMString useMap;
+ attribute boolean isMap;
+ attribute unsigned long width;
+ attribute unsigned long height;
+ readonly attribute unsigned long naturalWidth;
+ readonly attribute unsigned long naturalHeight;
+ readonly attribute boolean complete;
+ readonly attribute DOMString currentSrc;
+
+ // also has obsolete members
+};
+
+partial interface HTMLImageElement {
+ attribute DOMString name;
+ attribute DOMString lowsrc;
+ attribute DOMString align;
+ attribute unsigned long hspace;
+ attribute unsigned long vspace;
+ attribute DOMString longDesc;
+
+ [TreatNullAs=EmptyString] attribute DOMString border;
+};
+</textarea>
+ </div>
+
+ <script>
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+ lineNumbers: true,
+ matchBrackets: true
+ });
+ </script>
+
+ <p><strong>MIME type defined:</strong> <code>text/x-webidl</code>.</p>
+</article>
diff --git a/public/vendor/codemirror/mode/webidl/webidl.js b/public/vendor/codemirror/mode/webidl/webidl.js
new file mode 100644
index 00000000..6f024c63
--- /dev/null
+++ b/public/vendor/codemirror/mode/webidl/webidl.js
@@ -0,0 +1,195 @@
+// 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";
+
+function wordRegexp(words) {
+ return new RegExp("^((" + words.join(")|(") + "))\\b");
+};
+
+var builtinArray = [
+ "Clamp",
+ "Constructor",
+ "EnforceRange",
+ "Exposed",
+ "ImplicitThis",
+ "Global", "PrimaryGlobal",
+ "LegacyArrayClass",
+ "LegacyUnenumerableNamedProperties",
+ "LenientThis",
+ "NamedConstructor",
+ "NewObject",
+ "NoInterfaceObject",
+ "OverrideBuiltins",
+ "PutForwards",
+ "Replaceable",
+ "SameObject",
+ "TreatNonObjectAsNull",
+ "TreatNullAs",
+ "EmptyString",
+ "Unforgeable",
+ "Unscopeable"
+];
+var builtins = wordRegexp(builtinArray);
+
+var typeArray = [
+ "unsigned", "short", "long", // UnsignedIntegerType
+ "unrestricted", "float", "double", // UnrestrictedFloatType
+ "boolean", "byte", "octet", // Rest of PrimitiveType
+ "Promise", // PromiseType
+ "ArrayBuffer", "DataView", "Int8Array", "Int16Array", "Int32Array",
+ "Uint8Array", "Uint16Array", "Uint32Array", "Uint8ClampedArray",
+ "Float32Array", "Float64Array", // BufferRelatedType
+ "ByteString", "DOMString", "USVString", "sequence", "object", "RegExp",
+ "Error", "DOMException", "FrozenArray", // Rest of NonAnyType
+ "any", // Rest of SingleType
+ "void" // Rest of ReturnType
+];
+var types = wordRegexp(typeArray);
+
+var keywordArray = [
+ "attribute", "callback", "const", "deleter", "dictionary", "enum", "getter",
+ "implements", "inherit", "interface", "iterable", "legacycaller", "maplike",
+ "partial", "required", "serializer", "setlike", "setter", "static",
+ "stringifier", "typedef", // ArgumentNameKeyword except
+ // "unrestricted"
+ "optional", "readonly", "or"
+];
+var keywords = wordRegexp(keywordArray);
+
+var atomArray = [
+ "true", "false", // BooleanLiteral
+ "Infinity", "NaN", // FloatLiteral
+ "null" // Rest of ConstValue
+];
+var atoms = wordRegexp(atomArray);
+
+CodeMirror.registerHelper("hintWords", "webidl",
+ builtinArray.concat(typeArray).concat(keywordArray).concat(atomArray));
+
+var startDefArray = ["callback", "dictionary", "enum", "interface"];
+var startDefs = wordRegexp(startDefArray);
+
+var endDefArray = ["typedef"];
+var endDefs = wordRegexp(endDefArray);
+
+var singleOperators = /^[:<=>?]/;
+var integers = /^-?([1-9][0-9]*|0[Xx][0-9A-Fa-f]+|0[0-7]*)/;
+var floats = /^-?(([0-9]+\.[0-9]*|[0-9]*\.[0-9]+)([Ee][+-]?[0-9]+)?|[0-9]+[Ee][+-]?[0-9]+)/;
+var identifiers = /^_?[A-Za-z][0-9A-Z_a-z-]*/;
+var strings = /^"[^"]*"/;
+var multilineComments = /^\/\*.*?\*\//;
+var multilineCommentsStart = /^\/\*.*/;
+var multilineCommentsEnd = /^.*?\*\//;
+
+function readToken(stream, state) {
+ // whitespace
+ if (stream.eatSpace()) return null;
+
+ // comment
+ if (state.inComment) {
+ if (stream.match(multilineCommentsEnd)) {
+ state.inComment = false;
+ return "comment";
+ }
+ stream.skipToEnd();
+ return "comment";
+ }
+ if (stream.match("//")) {
+ stream.skipToEnd();
+ return "comment";
+ }
+ if (stream.match(multilineComments)) return "comment";
+ if (stream.match(multilineCommentsStart)) {
+ state.inComment = true;
+ return "comment";
+ }
+
+ // integer and float
+ if (stream.match(/^-?[0-9\.]/, false)) {
+ if (stream.match(integers) || stream.match(floats)) return "number";
+ }
+
+ // string
+ if (stream.match(strings)) return "string";
+
+ // identifier
+ if (stream.match(identifiers)) {
+ if (state.startDef) return "def";
+ if (state.endDef && stream.match(/^\s*;/, false)) {
+ state.endDef = false;
+ return "def";
+ }
+ }
+
+ if (stream.match(keywords)) return "keyword";
+
+ if (stream.match(types)) {
+ var lastToken = state.lastToken;
+ var nextToken = (stream.match(/^\s*(.+?)\b/, false) || [])[1];
+
+ if (lastToken === ":" || lastToken === "implements" ||
+ nextToken === "implements" || nextToken === "=") {
+ // Used as identifier
+ return "builtin";
+ } else {
+ // Used as type
+ return "variable-3";
+ }
+ }
+
+ if (stream.match(builtins)) return "builtin";
+ if (stream.match(atoms)) return "atom";
+ if (stream.match(identifiers)) return "variable";
+
+ // other
+ if (stream.match(singleOperators)) return "operator";
+
+ // unrecognized
+ stream.next();
+ return null;
+};
+
+CodeMirror.defineMode("webidl", function() {
+ return {
+ startState: function() {
+ return {
+ // Is in multiline comment
+ inComment: false,
+ // Last non-whitespace, matched token
+ lastToken: "",
+ // Next token is a definition
+ startDef: false,
+ // Last token of the statement is a definition
+ endDef: false
+ };
+ },
+ token: function(stream, state) {
+ var style = readToken(stream, state);
+
+ if (style) {
+ var cur = stream.current();
+ state.lastToken = cur;
+ if (style === "keyword") {
+ state.startDef = startDefs.test(cur);
+ state.endDef = state.endDef || endDefs.test(cur);
+ } else {
+ state.startDef = false;
+ }
+ }
+
+ return style;
+ }
+ };
+});
+
+CodeMirror.defineMIME("text/x-webidl", "webidl");
+});
diff --git a/public/vendor/codemirror/mode/xml/index.html b/public/vendor/codemirror/mode/xml/index.html
index 7149f06b..c56b8b6e 100644
--- a/public/vendor/codemirror/mode/xml/index.html
+++ b/public/vendor/codemirror/mode/xml/index.html
@@ -42,12 +42,16 @@
lineNumbers: true
});
</script>
- <p>The XML mode supports two configuration parameters:</p>
+ <p>The XML mode supports these configuration parameters:</p>
<dl>
<dt><code>htmlMode (boolean)</code></dt>
<dd>This switches the mode to parse HTML instead of XML. This
means attributes do not have to be quoted, and some elements
(such as <code>br</code>) do not require a closing tag.</dd>
+ <dt><code>matchClosing (boolean)</code></dt>
+ <dd>Controls whether the mode checks that close tags match the
+ corresponding opening tag, and highlights mismatches as errors.
+ Defaults to true.</dd>
<dt><code>alignCDATA (boolean)</code></dt>
<dd>Setting this to true will force the opening tag of CDATA
blocks to not be indented.</dd>
diff --git a/public/vendor/codemirror/mode/xml/xml.js b/public/vendor/codemirror/mode/xml/xml.js
index 014f7d84..f987a3a3 100644
--- a/public/vendor/codemirror/mode/xml/xml.js
+++ b/public/vendor/codemirror/mode/xml/xml.js
@@ -237,7 +237,7 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
if (state.context && state.context.tagName != tagName &&
config.implicitlyClosed.hasOwnProperty(state.context.tagName))
popContext(state);
- if (state.context && state.context.tagName == tagName) {
+ if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {
setStyle = "tag";
return closeState;
} else {
diff --git a/public/vendor/codemirror/mode/xquery/xquery.js b/public/vendor/codemirror/mode/xquery/xquery.js
index c642ee58..75dcbee3 100644
--- a/public/vendor/codemirror/mode/xquery/xquery.js
+++ b/public/vendor/codemirror/mode/xquery/xquery.js
@@ -17,7 +17,7 @@ CodeMirror.defineMode("xquery", function() {
// function. Each keyword is a property of the keywords object whose
// value is {type: atype, style: astyle}
var keywords = function(){
- // conveinence functions used to build keywords object
+ // convenience functions used to build keywords object
function kw(type) {return {type: type, style: "keyword"};}
var A = kw("keyword a")
, B = kw("keyword b")
diff --git a/public/vendor/codemirror/mode/yacas/index.html b/public/vendor/codemirror/mode/yacas/index.html
new file mode 100644
index 00000000..8e52cafb
--- /dev/null
+++ b/public/vendor/codemirror/mode/yacas/index.html
@@ -0,0 +1,87 @@
+<!doctype html>
+
+<title>CodeMirror: yacas mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel=stylesheet href=../../lib/codemirror.css>
+<script src=../../lib/codemirror.js></script>
+<script src=../../addon/edit/matchbrackets.js></script>
+<script src=yacas.js></script>
+<style type=text/css>
+ .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
+</style>
+<div id=nav>
+ <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+ <ul>
+ <li><a href="../../index.html">Home</a>
+ <li><a href="../../doc/manual.html">Manual</a>
+ <li><a href="https://github.com/codemirror/codemirror">Code</a>
+ </ul>
+ <ul>
+ <li><a href="../index.html">Language modes</a>
+ <li><a class=active href="#">yacas</a>
+ </ul>
+</div>
+
+<article>
+<h2>yacas mode</h2>
+
+
+<textarea id="yacasCode">
+// example yacas code
+Graph(edges_IsList) <-- [
+ Local(v, e, f, t);
+
+ vertices := {};
+
+ ForEach (e, edges) [
+ If (IsList(e), e := Head(e));
+ {f, t} := Tail(Listify(e));
+
+ DestructiveAppend(vertices, f);
+ DestructiveAppend(vertices, t);
+ ];
+
+ Graph(RemoveDuplicates(vertices), edges);
+];
+
+10 # IsGraph(Graph(vertices_IsList, edges_IsList)) <-- True;
+20 # IsGraph(_x) <-- False;
+
+Edges(Graph(vertices_IsList, edges_IsList)) <-- edges;
+Vertices(Graph(vertices_IsList, edges_IsList)) <-- vertices;
+
+AdjacencyList(g_IsGraph) <-- [
+ Local(l, vertices, edges, e, op, f, t);
+
+ l := Association'Create();
+
+ vertices := Vertices(g);
+ ForEach (v, vertices)
+ Association'Set(l, v, {});
+
+ edges := Edges(g);
+
+ ForEach(e, edges) [
+ If (IsList(e), e := Head(e));
+ {op, f, t} := Listify(e);
+ DestructiveAppend(Association'Get(l, f), t);
+ If (String(op) = "<->", DestructiveAppend(Association'Get(l, t), f));
+ ];
+
+ l;
+];
+</textarea>
+
+<script>
+ var yacasEditor = CodeMirror.fromTextArea(document.getElementById('yacasCode'), {
+ mode: 'text/x-yacas',
+ lineNumbers: true,
+ matchBrackets: true
+ });
+</script>
+
+<p><strong>MIME types defined:</strong> <code>text/x-yacas</code> (yacas).</p>
+</article>
diff --git a/public/vendor/codemirror/mode/yacas/yacas.js b/public/vendor/codemirror/mode/yacas/yacas.js
new file mode 100644
index 00000000..2967382b
--- /dev/null
+++ b/public/vendor/codemirror/mode/yacas/yacas.js
@@ -0,0 +1,138 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+// Yacas mode copyright (c) 2015 by Grzegorz Mazur
+// Loosely based on mathematica mode by Calin Barbat
+
+(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('yacas', function(_config, _parserConfig) {
+
+ // patterns
+ var pFloatForm = "(?:(?:\\.\\d+|\\d+\\.\\d*|\\d+)(?:[eE][+-]?\\d+)?)";
+ var pIdentifier = "(?:[a-zA-Z\\$'][a-zA-Z0-9\\$']*)";
+
+ // regular expressions
+ var reFloatForm = new RegExp(pFloatForm);
+ var reIdentifier = new RegExp(pIdentifier);
+ var rePattern = new RegExp(pIdentifier + "?_" + pIdentifier);
+ var reFunctionLike = new RegExp(pIdentifier + "\\s*\\(");
+
+ function tokenBase(stream, state) {
+ var ch;
+
+ // get next character
+ ch = stream.next();
+
+ // string
+ if (ch === '"') {
+ state.tokenize = tokenString;
+ return state.tokenize(stream, state);
+ }
+
+ // comment
+ if (ch === '/') {
+ if (stream.eat('*')) {
+ state.tokenize = tokenComment;
+ return state.tokenize(stream, state);
+ }
+ if (stream.eat("/")) {
+ stream.skipToEnd();
+ return "comment";
+ }
+ }
+
+ // go back one character
+ stream.backUp(1);
+
+ // look for ordered rules
+ if (stream.match(/\d+ *#/, true, false)) {
+ return 'qualifier';
+ }
+
+ // look for numbers
+ if (stream.match(reFloatForm, true, false)) {
+ return 'number';
+ }
+
+ // look for placeholders
+ if (stream.match(rePattern, true, false)) {
+ return 'variable-3';
+ }
+
+ // match all braces separately
+ if (stream.match(/(?:\[|\]|{|}|\(|\))/, true, false)) {
+ return 'bracket';
+ }
+
+ // literals looking like function calls
+ if (stream.match(reFunctionLike, true, false)) {
+ stream.backUp(1);
+ return 'variable';
+ }
+
+ // all other identifiers
+ if (stream.match(reIdentifier, true, false)) {
+ return 'variable-2';
+ }
+
+ // operators; note that operators like @@ or /; are matched separately for each symbol.
+ if (stream.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/, true, false)) {
+ return 'operator';
+ }
+
+ // everything else is an error
+ return 'error';
+ }
+
+ function tokenString(stream, state) {
+ var next, end = false, escaped = false;
+ while ((next = stream.next()) != null) {
+ if (next === '"' && !escaped) {
+ end = true;
+ break;
+ }
+ escaped = !escaped && next === '\\';
+ }
+ if (end && !escaped) {
+ state.tokenize = tokenBase;
+ }
+ return 'string';
+ };
+
+ function tokenComment(stream, state) {
+ var prev, next;
+ while((next = stream.next()) != null) {
+ if (prev === '*' && next === '/')
+ break;
+ prev = next;
+ }
+ state.tokenize = tokenBase;
+ return 'comment';
+ }
+
+ return {
+ startState: function() {return {tokenize: tokenBase, commentLevel: 0};},
+ token: function(stream, state) {
+ if (stream.eatSpace()) return null;
+ return state.tokenize(stream, state);
+ },
+ blockCommentStart: "/*",
+ blockCommentEnd: "*/",
+ lineComment: "//"
+ };
+});
+
+CodeMirror.defineMIME('text/x-yacas', {
+ name: 'yacas'
+});
+
+});
diff --git a/public/vendor/codemirror/mode/yaml-frontmatter/index.html b/public/vendor/codemirror/mode/yaml-frontmatter/index.html
index 30bed2f8..30cb294e 100644
--- a/public/vendor/codemirror/mode/yaml-frontmatter/index.html
+++ b/public/vendor/codemirror/mode/yaml-frontmatter/index.html
@@ -78,7 +78,7 @@ Underscores_are_allowed_between_words.
GFM adds syntax to strikethrough text, which is missing from standard Markdown.
~~Mistaken text.~~
-~~**works with other fomatting**~~
+~~**works with other formatting**~~
~~spans across
lines~~
diff --git a/public/vendor/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js b/public/vendor/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js
index 9f081b00..5f497723 100644
--- a/public/vendor/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js
+++ b/public/vendor/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js
@@ -65,4 +65,4 @@
}
}
})
-})
+});