From 01685c255fda6e13f1cd2980130d2e388d52125c Mon Sep 17 00:00:00 2001
From: Wu Cheng-Han
Date: Sat, 4 Jul 2015 11:31:01 +0800
Subject: Updated codemirror to 5.4.0
---
public/vendor/codemirror/mode/apl/apl.js | 3 +-
public/vendor/codemirror/mode/asn.1/asn.1.js | 204 +++++++++++++++
public/vendor/codemirror/mode/asn.1/index.html | 78 ++++++
public/vendor/codemirror/mode/asterisk/asterisk.js | 6 +-
public/vendor/codemirror/mode/clike/clike.js | 183 +++++++++----
public/vendor/codemirror/mode/clike/test.js | 33 +++
public/vendor/codemirror/mode/css/css.js | 17 +-
public/vendor/codemirror/mode/css/test.js | 7 -
public/vendor/codemirror/mode/cypher/cypher.js | 2 +-
public/vendor/codemirror/mode/dylan/dylan.js | 44 ++--
public/vendor/codemirror/mode/ecl/ecl.js | 3 +-
public/vendor/codemirror/mode/eiffel/eiffel.js | 2 -
public/vendor/codemirror/mode/elm/elm.js | 205 +++++++++++++++
public/vendor/codemirror/mode/elm/index.html | 61 +++++
public/vendor/codemirror/mode/factor/factor.js | 83 ++++++
public/vendor/codemirror/mode/factor/index.html | 77 ++++++
public/vendor/codemirror/mode/groovy/groovy.js | 13 +-
.../vendor/codemirror/mode/htmlmixed/htmlmixed.js | 4 +-
public/vendor/codemirror/mode/index.html | 9 +
.../codemirror/mode/javascript/javascript.js | 7 +-
public/vendor/codemirror/mode/javascript/test.js | 5 +
public/vendor/codemirror/mode/julia/julia.js | 2 -
public/vendor/codemirror/mode/kotlin/kotlin.js | 7 +-
.../codemirror/mode/livescript/livescript.js | 4 +-
public/vendor/codemirror/mode/markdown/markdown.js | 60 +++--
public/vendor/codemirror/mode/markdown/test.js | 122 ++++++---
.../vendor/codemirror/mode/mathematica/index.html | 72 ++++++
.../codemirror/mode/mathematica/mathematica.js | 175 +++++++++++++
public/vendor/codemirror/mode/meta.js | 8 +
public/vendor/codemirror/mode/php/php.js | 38 +--
public/vendor/codemirror/mode/pig/pig.js | 40 ++-
public/vendor/codemirror/mode/python/python.js | 2 +-
public/vendor/codemirror/mode/sql/sql.js | 4 +-
public/vendor/codemirror/mode/swift/index.html | 88 +++++++
public/vendor/codemirror/mode/swift/swift.js | 203 +++++++++++++++
.../codemirror/mode/tiddlywiki/tiddlywiki.js | 83 +++---
public/vendor/codemirror/mode/tiki/tiki.js | 27 +-
public/vendor/codemirror/mode/ttcn-cfg/index.html | 115 +++++++++
public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js | 214 ++++++++++++++++
public/vendor/codemirror/mode/ttcn/index.html | 118 +++++++++
public/vendor/codemirror/mode/ttcn/ttcn.js | 283 +++++++++++++++++++++
public/vendor/codemirror/mode/twig/index.html | 45 ++++
public/vendor/codemirror/mode/twig/twig.js | 132 ++++++++++
public/vendor/codemirror/mode/vb/vb.js | 3 +-
public/vendor/codemirror/mode/xquery/xquery.js | 70 +++--
45 files changed, 2626 insertions(+), 335 deletions(-)
create mode 100755 public/vendor/codemirror/mode/asn.1/asn.1.js
create mode 100755 public/vendor/codemirror/mode/asn.1/index.html
create mode 100755 public/vendor/codemirror/mode/clike/test.js
create mode 100755 public/vendor/codemirror/mode/elm/elm.js
create mode 100755 public/vendor/codemirror/mode/elm/index.html
create mode 100755 public/vendor/codemirror/mode/factor/factor.js
create mode 100755 public/vendor/codemirror/mode/factor/index.html
create mode 100755 public/vendor/codemirror/mode/mathematica/index.html
create mode 100755 public/vendor/codemirror/mode/mathematica/mathematica.js
create mode 100755 public/vendor/codemirror/mode/swift/index.html
create mode 100755 public/vendor/codemirror/mode/swift/swift.js
create mode 100755 public/vendor/codemirror/mode/ttcn-cfg/index.html
create mode 100755 public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js
create mode 100755 public/vendor/codemirror/mode/ttcn/index.html
create mode 100755 public/vendor/codemirror/mode/ttcn/ttcn.js
create mode 100755 public/vendor/codemirror/mode/twig/index.html
create mode 100755 public/vendor/codemirror/mode/twig/twig.js
(limited to 'public/vendor/codemirror/mode')
diff --git a/public/vendor/codemirror/mode/apl/apl.js b/public/vendor/codemirror/mode/apl/apl.js
index 4357bed4..caafe4e9 100755
--- a/public/vendor/codemirror/mode/apl/apl.js
+++ b/public/vendor/codemirror/mode/apl/apl.js
@@ -102,7 +102,7 @@ CodeMirror.defineMode("apl", function() {
};
},
token: function(stream, state) {
- var ch, funcName, word;
+ var ch, funcName;
if (stream.eatSpace()) {
return null;
}
@@ -163,7 +163,6 @@ CodeMirror.defineMode("apl", function() {
return "function jot-dot";
}
stream.eatWhile(/[\w\$_]/);
- word = stream.current();
state.prev = true;
return "keyword";
}
diff --git a/public/vendor/codemirror/mode/asn.1/asn.1.js b/public/vendor/codemirror/mode/asn.1/asn.1.js
new file mode 100755
index 00000000..9600247e
--- /dev/null
+++ b/public/vendor/codemirror/mode/asn.1/asn.1.js
@@ -0,0 +1,204 @@
+// 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("asn.1", function(config, parserConfig) {
+ var indentUnit = config.indentUnit,
+ keywords = parserConfig.keywords || {},
+ cmipVerbs = parserConfig.cmipVerbs || {},
+ compareTypes = parserConfig.compareTypes || {},
+ status = parserConfig.status || {},
+ tags = parserConfig.tags || {},
+ storage = parserConfig.storage || {},
+ modifier = parserConfig.modifier || {},
+ accessTypes = parserConfig.accessTypes|| {},
+ multiLineStrings = parserConfig.multiLineStrings,
+ indentStatements = parserConfig.indentStatements !== false;
+ var isOperatorChar = /[\|\^]/;
+ var curPunc;
+
+ function tokenBase(stream, state) {
+ var ch = stream.next();
+ if (ch == '"' || ch == "'") {
+ state.tokenize = tokenString(ch);
+ return state.tokenize(stream, state);
+ }
+ if (/[\[\]\(\){}:=,;]/.test(ch)) {
+ curPunc = ch;
+ return "punctuation";
+ }
+ if (ch == "-"){
+ if (stream.eat("-")) {
+ stream.skipToEnd();
+ return "comment";
+ }
+ }
+ if (/\d/.test(ch)) {
+ stream.eatWhile(/[\w\.]/);
+ return "number";
+ }
+ if (isOperatorChar.test(ch)) {
+ stream.eatWhile(isOperatorChar);
+ return "operator";
+ }
+
+ stream.eatWhile(/[\w\-]/);
+ var cur = stream.current();
+ if (keywords.propertyIsEnumerable(cur)) return "keyword";
+ if (cmipVerbs.propertyIsEnumerable(cur)) return "variable cmipVerbs";
+ if (compareTypes.propertyIsEnumerable(cur)) return "atom compareTypes";
+ if (status.propertyIsEnumerable(cur)) return "comment status";
+ if (tags.propertyIsEnumerable(cur)) return "variable-3 tags";
+ if (storage.propertyIsEnumerable(cur)) return "builtin storage";
+ if (modifier.propertyIsEnumerable(cur)) return "string-2 modifier";
+ if (accessTypes.propertyIsEnumerable(cur)) return "atom accessTypes";
+
+ return "variable";
+ }
+
+ function tokenString(quote) {
+ return function(stream, state) {
+ var escaped = false, next, end = false;
+ while ((next = stream.next()) != null) {
+ if (next == quote && !escaped){
+ var afterNext = stream.peek();
+ //look if the character if the quote is like the B in '10100010'B
+ if (afterNext){
+ afterNext = afterNext.toLowerCase();
+ if(afterNext == "b" || afterNext == "h" || afterNext == "o")
+ stream.next();
+ }
+ end = true; break;
+ }
+ escaped = !escaped && next == "\\";
+ }
+ if (end || !(escaped || multiLineStrings))
+ state.tokenize = null;
+ return "string";
+ };
+ }
+
+ 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) {
+ var indent = state.indented;
+ if (state.context && state.context.type == "statement")
+ 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;
+ }
+
+ //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;
+ curPunc = null;
+ var style = (state.tokenize || tokenBase)(stream, state);
+ if (style == "comment") return style;
+ if (ctx.align == null) ctx.align = true;
+
+ if ((curPunc == ";" || curPunc == ":" || curPunc == ",")
+ && ctx.type == "statement"){
+ popContext(state);
+ }
+ else if (curPunc == "{") pushContext(state, stream.column(), "}");
+ else if (curPunc == "[") pushContext(state, stream.column(), "]");
+ else if (curPunc == "(") pushContext(state, stream.column(), ")");
+ else if (curPunc == "}") {
+ while (ctx.type == "statement") ctx = popContext(state);
+ if (ctx.type == "}") ctx = popContext(state);
+ while (ctx.type == "statement") ctx = popContext(state);
+ }
+ else if (curPunc == ctx.type) popContext(state);
+ else if (indentStatements && (((ctx.type == "}" || ctx.type == "top")
+ && curPunc != ';') || (ctx.type == "statement"
+ && curPunc == "newstatement")))
+ pushContext(state, stream.column(), "statement");
+
+ state.startOfLine = false;
+ return style;
+ },
+
+ electricChars: "{}",
+ lineComment: "--",
+ fold: "brace"
+ };
+ });
+
+ function words(str) {
+ var obj = {}, words = str.split(" ");
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
+ return obj;
+ }
+
+ CodeMirror.defineMIME("text/x-ttcn-asn", {
+ name: "asn.1",
+ keywords: words("DEFINITIONS OBJECTS IF DERIVED INFORMATION ACTION" +
+ " REPLY ANY NAMED CHARACTERIZED BEHAVIOUR REGISTERED" +
+ " WITH AS IDENTIFIED CONSTRAINED BY PRESENT BEGIN" +
+ " IMPORTS FROM UNITS SYNTAX MIN-ACCESS MAX-ACCESS" +
+ " MINACCESS MAXACCESS REVISION STATUS DESCRIPTION" +
+ " SEQUENCE SET COMPONENTS OF CHOICE DistinguishedName" +
+ " ENUMERATED SIZE MODULE END INDEX AUGMENTS EXTENSIBILITY" +
+ " IMPLIED EXPORTS"),
+ cmipVerbs: words("ACTIONS ADD GET NOTIFICATIONS REPLACE REMOVE"),
+ compareTypes: words("OPTIONAL DEFAULT MANAGED MODULE-TYPE MODULE_IDENTITY" +
+ " MODULE-COMPLIANCE OBJECT-TYPE OBJECT-IDENTITY" +
+ " OBJECT-COMPLIANCE MODE CONFIRMED CONDITIONAL" +
+ " SUBORDINATE SUPERIOR CLASS TRUE FALSE NULL" +
+ " TEXTUAL-CONVENTION"),
+ status: words("current deprecated mandatory obsolete"),
+ tags: words("APPLICATION AUTOMATIC EXPLICIT IMPLICIT PRIVATE TAGS" +
+ " UNIVERSAL"),
+ storage: words("BOOLEAN INTEGER OBJECT IDENTIFIER BIT OCTET STRING" +
+ " UTCTime InterfaceIndex IANAifType CMIP-Attribute" +
+ " REAL PACKAGE PACKAGES IpAddress PhysAddress" +
+ " NetworkAddress BITS BMPString TimeStamp TimeTicks" +
+ " TruthValue RowStatus DisplayString GeneralString" +
+ " GraphicString IA5String NumericString" +
+ " PrintableString SnmpAdminAtring TeletexString" +
+ " UTF8String VideotexString VisibleString StringStore" +
+ " ISO646String T61String UniversalString Unsigned32" +
+ " Integer32 Gauge Gauge32 Counter Counter32 Counter64"),
+ modifier: words("ATTRIBUTE ATTRIBUTES MANDATORY-GROUP MANDATORY-GROUPS" +
+ " GROUP GROUPS ELEMENTS EQUALITY ORDERING SUBSTRINGS" +
+ " DEFINED"),
+ accessTypes: words("not-accessible accessible-for-notify read-only" +
+ " read-create read-write"),
+ multiLineStrings: true
+ });
+});
diff --git a/public/vendor/codemirror/mode/asn.1/index.html b/public/vendor/codemirror/mode/asn.1/index.html
new file mode 100755
index 00000000..8346f8e5
--- /dev/null
+++ b/public/vendor/codemirror/mode/asn.1/index.html
@@ -0,0 +1,78 @@
+
+
+
CodeMirror: ASN.1 mode
+
+
+
+
+
+
+
+
+
+ ASN.1 example
+
+
+
+
+
+
+ Language: Abstract Syntax Notation One
+ (ASN.1)
+
+ MIME types defined: text/x-ttcn-asn
+
+
+ The development of this mode has been sponsored by Ericsson
+ .
+ Coded by Asmelash Tsegay Gebretsadkan
+
+
+
diff --git a/public/vendor/codemirror/mode/asterisk/asterisk.js b/public/vendor/codemirror/mode/asterisk/asterisk.js
index a1ead115..b7ebfc5a 100755
--- a/public/vendor/codemirror/mode/asterisk/asterisk.js
+++ b/public/vendor/codemirror/mode/asterisk/asterisk.js
@@ -65,8 +65,7 @@ CodeMirror.defineMode("asterisk", function() {
function basicToken(stream,state){
var cur = '';
- var ch = '';
- ch = stream.next();
+ var ch = stream.next();
// comment
if(ch == ";") {
stream.skipToEnd();
@@ -136,7 +135,6 @@ CodeMirror.defineMode("asterisk", function() {
token: function(stream, state) {
var cur = '';
- var ch = '';
if(stream.eatSpace()) return null;
// extension started
if(state.extenStart){
@@ -170,7 +168,7 @@ CodeMirror.defineMode("asterisk", function() {
} else if(state.extenPriority) {
state.extenPriority = false;
state.extenApplication = true;
- ch = stream.next(); // get comma
+ stream.next(); // get comma
if(state.extenSame) return null;
stream.eatWhile(/[^,]/);
return "number";
diff --git a/public/vendor/codemirror/mode/clike/clike.js b/public/vendor/codemirror/mode/clike/clike.js
index b209910b..f1a7e7a9 100755
--- a/public/vendor/codemirror/mode/clike/clike.js
+++ b/public/vendor/codemirror/mode/clike/clike.js
@@ -16,15 +16,19 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
dontAlignCalls = parserConfig.dontAlignCalls,
keywords = parserConfig.keywords || {},
+ types = parserConfig.types || {},
builtin = parserConfig.builtin || {},
blockKeywords = parserConfig.blockKeywords || {},
+ defKeywords = parserConfig.defKeywords || {},
atoms = parserConfig.atoms || {},
hooks = parserConfig.hooks || {},
multiLineStrings = parserConfig.multiLineStrings,
- indentStatements = parserConfig.indentStatements !== false;
+ indentStatements = parserConfig.indentStatements !== false,
+ indentSwitch = parserConfig.indentSwitch !== false,
+ namespaceSeparator = parserConfig.namespaceSeparator;
var isOperatorChar = /[+\-*&%=<>!?|\/]/;
- var curPunc;
+ var curPunc, isDefKeyword;
function tokenBase(stream, state) {
var ch = stream.next();
@@ -59,11 +63,16 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
return "operator";
}
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
+ if (namespaceSeparator) while (stream.match(namespaceSeparator))
+ stream.eatWhile(/[\w\$_\xa1-\uffff]/);
+
var cur = stream.current();
if (keywords.propertyIsEnumerable(cur)) {
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
+ if (defKeywords.propertyIsEnumerable(cur)) isDefKeyword = true;
return "keyword";
}
+ if (types.propertyIsEnumerable(cur)) return "variable-3";
if (builtin.propertyIsEnumerable(cur)) {
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
return "builtin";
@@ -104,9 +113,12 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
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 && state.context.type == "statement")
+ if (state.context && isStatement(state.context.type) && !isStatement(type))
indent = state.context.indented;
return state.context = new Context(indent, col, type, null, state.context);
}
@@ -117,6 +129,19 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
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 {
@@ -125,7 +150,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
tokenize: null,
context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
indented: 0,
- startOfLine: true
+ startOfLine: true,
+ prevToken: null
};
},
@@ -137,41 +163,69 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
state.startOfLine = true;
}
if (stream.eatSpace()) return null;
- curPunc = null;
+ curPunc = isDefKeyword = null;
var style = (state.tokenize || tokenBase)(stream, state);
if (style == "comment" || style == "meta") return style;
if (ctx.align == null) ctx.align = true;
- if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && ctx.type == "statement") popContext(state);
+ if ((curPunc == ";" || curPunc == ":" || curPunc == ","))
+ while (isStatement(state.context.type)) popContext(state);
else if (curPunc == "{") pushContext(state, stream.column(), "}");
else if (curPunc == "[") pushContext(state, stream.column(), "]");
else if (curPunc == "(") pushContext(state, stream.column(), ")");
else if (curPunc == "}") {
- while (ctx.type == "statement") ctx = popContext(state);
+ while (isStatement(ctx.type)) ctx = popContext(state);
if (ctx.type == "}") ctx = popContext(state);
- while (ctx.type == "statement") ctx = popContext(state);
+ while (isStatement(ctx.type)) ctx = popContext(state);
}
else if (curPunc == ctx.type) popContext(state);
else if (indentStatements &&
- (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') ||
- (ctx.type == "statement" && curPunc == "newstatement")))
- pushContext(state, stream.column(), "statement");
+ (((ctx.type == "}" || ctx.type == "top") && curPunc != ";") ||
+ (isStatement(ctx.type) && curPunc == "newstatement"))) {
+ var type = "statement";
+ if (curPunc == "newstatement" && indentSwitch && stream.current() == "switch")
+ type = "switchstatement";
+ else if (style == "keyword" && stream.current() == "namespace")
+ type = "namespace";
+ pushContext(state, stream.column(), type);
+ }
+
+ if (style == "variable" &&
+ ((state.prevToken == "def" ||
+ (parserConfig.typeFirstDefinitions && typeBefore(stream, state) &&
+ isTopScope(state.context) && stream.match(/^\s*\(/, false)))))
+ style = "def";
+
+ if (hooks.token) {
+ var result = hooks.token(stream, state, style);
+ if (result !== undefined) style = result;
+ }
+
+ if (style == "def" && parserConfig.styleDefs === false) style = "variable";
+
state.startOfLine = false;
+ state.prevToken = isDefKeyword ? "def" : style || curPunc;
return style;
},
indent: function(state, textAfter) {
if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass;
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
- if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
+ if (isStatement(ctx.type) && firstChar == "}") ctx = ctx.prev;
var closing = firstChar == ctx.type;
- if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
- else if (ctx.align && (!dontAlignCalls || ctx.type != ")")) return ctx.column + (closing ? 0 : 1);
- else if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit;
- else return ctx.indented + (closing ? 0 : indentUnit);
+ var switchBlock = ctx.prev && ctx.prev.type == "switchstatement";
+ if (isStatement(ctx.type))
+ return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
+ if (ctx.align && (!dontAlignCalls || ctx.type != ")"))
+ return ctx.column + (closing ? 0 : 1);
+ if (ctx.type == ")" && !closing)
+ return ctx.indented + statementIndentUnit;
+
+ return ctx.indented + (closing ? 0 : indentUnit) +
+ (!closing && switchBlock && !/^(?:case|default)\b/.test(textAfter) ? indentUnit : 0);
},
- electricChars: "{}",
+ electricInput: indentSwitch ? /^\s*(?:case .*?:|default:|\{\}?|\})$/ : /^\s*[{}]$/,
blockCommentStart: "/*",
blockCommentEnd: "*/",
lineComment: "//",
@@ -184,9 +238,10 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
return obj;
}
- var cKeywords = "auto if break int case long char register continue return default short do sizeof " +
- "double static else struct switch extern typedef float union for unsigned " +
- "goto while enum void const signed volatile";
+ var cKeywords = "auto if break case register continue return default do sizeof " +
+ "static else struct switch extern typedef float union for " +
+ "goto while enum const volatile";
+ var cTypes = "int long char short double float unsigned signed void size_t ptrdiff_t";
function cppHook(stream, state) {
if (!state.startOfLine) return false;
@@ -206,6 +261,11 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
return "meta";
}
+ function pointerHook(_stream, state) {
+ if (state.prevToken == "variable-3") return "variable-3";
+ return false;
+ }
+
function cpp11StringHook(stream, state) {
stream.backUp(1);
// Raw strings.
@@ -230,6 +290,11 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
return false;
}
+ function cppLooksLikeConstructor(word) {
+ var lastTwo = /(\w+)::(\w+)$/.exec(word);
+ return lastTwo && lastTwo[1] == lastTwo[2];
+ }
+
// C#-style strings where "" escapes a quote.
function tokenAtString(stream, state) {
var next;
@@ -263,6 +328,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
words.push(prop);
}
add(mode.keywords);
+ add(mode.types);
add(mode.builtin);
add(mode.atoms);
if (words.length) {
@@ -277,39 +343,60 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
def(["text/x-csrc", "text/x-c", "text/x-chdr"], {
name: "clike",
keywords: words(cKeywords),
+ types: words(cTypes + " bool _Complex _Bool float_t double_t intptr_t intmax_t " +
+ "int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t " +
+ "uint32_t uint64_t"),
blockKeywords: words("case do else for if switch while struct"),
- atoms: words("null"),
- hooks: {"#": cppHook},
+ defKeywords: words("struct"),
+ typeFirstDefinitions: true,
+ atoms: words("null true false"),
+ hooks: {"#": cppHook, "*": pointerHook},
modeProps: {fold: ["brace", "include"]}
});
def(["text/x-c++src", "text/x-c++hdr"], {
name: "clike",
- keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try bool explicit new " +
+ keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try explicit new " +
"static_cast typeid catch operator template typename class friend private " +
"this using const_cast inline public throw virtual delete mutable protected " +
- "wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final " +
+ "alignas alignof constexpr decltype nullptr noexcept thread_local final " +
"static_assert override"),
+ types: words(cTypes + " bool wchar_t"),
blockKeywords: words("catch class do else finally for if struct switch try while"),
+ defKeywords: words("class namespace struct enum union"),
+ typeFirstDefinitions: true,
atoms: words("true false null"),
hooks: {
"#": cppHook,
+ "*": pointerHook,
"u": cpp11StringHook,
"U": cpp11StringHook,
"L": cpp11StringHook,
- "R": cpp11StringHook
+ "R": cpp11StringHook,
+ token: function(stream, state, style) {
+ if (style == "variable" && stream.peek() == "(" &&
+ (state.prevToken == ";" || state.prevToken == null ||
+ state.prevToken == "}") &&
+ cppLooksLikeConstructor(stream.current()))
+ return "def";
+ }
},
+ namespaceSeparator: "::",
modeProps: {fold: ["brace", "include"]}
});
def("text/x-java", {
name: "clike",
- keywords: words("abstract assert boolean break byte case catch char class const continue default " +
- "do double else enum extends final finally float for goto if implements import " +
- "instanceof int interface long native new package private protected public " +
- "return short static strictfp super switch synchronized this throw throws transient " +
- "try void volatile while"),
+ keywords: words("abstract assert break case catch class const continue default " +
+ "do else enum extends final finally float for goto if implements import " +
+ "instanceof interface native new package private protected public " +
+ "return static strictfp super switch synchronized this throw throws transient " +
+ "try volatile while"),
+ types: words("byte short int long float double boolean char void Boolean Byte Character Double Float " +
+ "Integer Long Number Object Short String StringBuffer StringBuilder Void"),
blockKeywords: words("catch class do else finally for if switch try while"),
+ defKeywords: words("class interface package enum"),
+ typeFirstDefinitions: true,
atoms: words("true false null"),
hooks: {
"@": function(stream) {
@@ -322,18 +409,20 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
def("text/x-csharp", {
name: "clike",
- keywords: words("abstract as base break case catch checked class const continue" +
+ keywords: words("abstract as async await base break case catch checked class const continue" +
" default delegate do else enum event explicit extern finally fixed for" +
" foreach goto if implicit in interface internal is lock namespace new" +
" operator out override params private protected public readonly ref return sealed" +
" sizeof stackalloc static struct switch this throw try typeof unchecked" +
" unsafe using virtual void volatile while add alias ascending descending dynamic from get" +
" global group into join let orderby partial remove select set value var yield"),
+ types: words("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func" +
+ " Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32" +
+ " UInt64 bool byte char decimal double short int long object" +
+ " sbyte float string ushort uint ulong"),
blockKeywords: words("catch class do else finally for foreach if struct switch try while"),
- builtin: words("Boolean Byte Char DateTime DateTimeOffset Decimal Double" +
- " Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32" +
- " UInt64 bool byte char decimal double short int long object" +
- " sbyte float string ushort uint ulong"),
+ defKeywords: words("class interface namespace struct var"),
+ typeFirstDefinitions: true,
atoms: words("true false null"),
hooks: {
"@": function(stream, state) {
@@ -366,18 +455,21 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
/* scala */
"abstract case catch class def do else extends false final finally for forSome if " +
"implicit import lazy match new null object override package private protected return " +
- "sealed super this throw trait try trye type val var while with yield _ : = => <- <: " +
+ "sealed super this throw trait try type val var while with yield _ : = => <- <: " +
"<% >: # @ " +
/* package scala */
"assert assume require print println printf readLine readBoolean readByte readShort " +
"readChar readInt readLong readFloat readDouble " +
+ ":: #:: "
+ ),
+ types: words(
"AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " +
"Enumeration Equiv Error Exception Fractional Function IndexedSeq 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 :: #:: " +
+ "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector " +
/* package java.lang */
"Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
@@ -387,8 +479,10 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
),
multiLineStrings: true,
blockKeywords: words("catch class do else finally for forSome if match switch try while"),
+ defKeywords: words("class def object package trait type val var"),
atoms: words("true false null"),
indentStatements: false,
+ indentSwitch: false,
hooks: {
"@": function(stream) {
stream.eatWhile(/[\w\$_]/);
@@ -409,15 +503,15 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
def(["x-shader/x-vertex", "x-shader/x-fragment"], {
name: "clike",
- keywords: words("float int bool void " +
- "vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " +
- "mat2 mat3 mat4 " +
- "sampler1D sampler2D sampler3D samplerCube " +
+ keywords: words("sampler1D sampler2D sampler3D samplerCube " +
"sampler1DShadow sampler2DShadow " +
"const attribute uniform varying " +
"break continue discard return " +
"for while do if else struct " +
"in out inout"),
+ types: words("float int bool void " +
+ "vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " +
+ "mat2 mat3 mat4"),
blockKeywords: words("for while do if else struct"),
builtin: words("radians degrees sin cos tan asin acos atan " +
"pow exp log exp2 sqrt inversesqrt " +
@@ -461,6 +555,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
"gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " +
"gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " +
"gl_MaxDrawBuffers"),
+ indentSwitch: false,
hooks: {"#": cppHook},
modeProps: {fold: ["brace", "include"]}
});
@@ -470,8 +565,9 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
keywords: words(cKeywords + "as atomic async call command component components configuration event generic " +
"implementation includes interface module new norace nx_struct nx_union post provides " +
"signal task uses abstract extends"),
+ types: words(cTypes),
blockKeywords: words("case do else for if switch while struct"),
- atoms: words("null"),
+ atoms: words("null true false"),
hooks: {"#": cppHook},
modeProps: {fold: ["brace", "include"]}
});
@@ -480,7 +576,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
name: "clike",
keywords: words(cKeywords + "inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in " +
"inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),
- atoms: words("YES NO NULL NILL ON OFF"),
+ types: words(cTypes),
+ atoms: words("YES NO NULL NILL ON OFF true false"),
hooks: {
"@": function(stream) {
stream.eatWhile(/[\w\$]/);
diff --git a/public/vendor/codemirror/mode/clike/test.js b/public/vendor/codemirror/mode/clike/test.js
new file mode 100755
index 00000000..79b006de
--- /dev/null
+++ b/public/vendor/codemirror/mode/clike/test.js
@@ -0,0 +1,33 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function() {
+ var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-c");
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
+
+ MT("indent",
+ "[variable-3 void] [def foo]([variable-3 void*] [variable a], [variable-3 int] [variable b]) {",
+ " [variable-3 int] [variable c] [operator =] [variable b] [operator +]",
+ " [number 1];",
+ " [keyword return] [operator *][variable a];",
+ "}");
+
+ MT("indent_switch",
+ "[keyword switch] ([variable x]) {",
+ " [keyword case] [number 10]:",
+ " [keyword return] [number 20];",
+ " [keyword default]:",
+ " [variable printf]([string \"foo %c\"], [variable x]);",
+ "}");
+
+ MT("def",
+ "[variable-3 void] [def foo]() {}",
+ "[keyword struct] [def bar]{}",
+ "[variable-3 int] [variable-3 *][def baz]() {}");
+
+ MT("double_block",
+ "[keyword for] (;;)",
+ " [keyword for] (;;)",
+ " [variable x][operator ++];",
+ "[keyword return];");
+})();
diff --git a/public/vendor/codemirror/mode/css/css.js b/public/vendor/codemirror/mode/css/css.js
index 7fc9098f..1e6d2ddb 100755
--- a/public/vendor/codemirror/mode/css/css.js
+++ b/public/vendor/codemirror/mode/css/css.js
@@ -329,7 +329,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
if (type == "}") return popContext(state);
if (type == "{" || type == ";") return popAndPass(type, stream, state);
if (type == "word") override = "variable";
- else if (type != "variable") override = "error";
+ else if (type != "variable" && type != "(" && type != ")") override = "error";
return "interpolation";
};
@@ -653,16 +653,6 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
return ["comment", "comment"];
}
- function tokenSGMLComment(stream, state) {
- if (stream.skipTo("-->")) {
- stream.match("-->");
- state.tokenize = null;
- } else {
- stream.skipToEnd();
- }
- return ["comment", "comment"];
- }
-
CodeMirror.defineMIME("text/css", {
documentTypes: documentTypes,
mediaTypes: mediaTypes,
@@ -674,11 +664,6 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
colorKeywords: colorKeywords,
valueKeywords: valueKeywords,
tokenHooks: {
- "<": function(stream, state) {
- if (!stream.match("!--")) return false;
- state.tokenize = tokenSGMLComment;
- return tokenSGMLComment(stream, state);
- },
"/": function(stream, state) {
if (!stream.eat("*")) return false;
state.tokenize = tokenCComment;
diff --git a/public/vendor/codemirror/mode/css/test.js b/public/vendor/codemirror/mode/css/test.js
index bef71561..55ae676e 100755
--- a/public/vendor/codemirror/mode/css/test.js
+++ b/public/vendor/codemirror/mode/css/test.js
@@ -76,13 +76,6 @@
MT("tagTwoPropertiesURL",
"[tag foo] { [property background]: [atom url]([string //example.com/foo.png]); [property padding]: [number 0]; }");
- MT("commentSGML",
- "[comment ]");
-
- MT("commentSGML2",
- "[comment ] [tag div] {}");
-
MT("indent_tagSelector",
"[tag strong], [tag em] {",
" [property background]: [atom rgba](",
diff --git a/public/vendor/codemirror/mode/cypher/cypher.js b/public/vendor/codemirror/mode/cypher/cypher.js
index 9decf307..e218d473 100755
--- a/public/vendor/codemirror/mode/cypher/cypher.js
+++ b/public/vendor/codemirror/mode/cypher/cypher.js
@@ -19,7 +19,7 @@
CodeMirror.defineMode("cypher", function(config) {
var tokenBase = function(stream/*, state*/) {
- var ch = stream.next(), curPunc = null;
+ var ch = stream.next();
if (ch === "\"" || ch === "'") {
stream.match(/.+?["']/);
return "string";
diff --git a/public/vendor/codemirror/mode/dylan/dylan.js b/public/vendor/codemirror/mode/dylan/dylan.js
index be2986ad..85f0166c 100755
--- a/public/vendor/codemirror/mode/dylan/dylan.js
+++ b/public/vendor/codemirror/mode/dylan/dylan.js
@@ -154,20 +154,12 @@ CodeMirror.defineMode("dylan", function(_config) {
return f(stream, state);
}
- var type, content;
-
- function ret(_type, style, _content) {
- type = _type;
- content = _content;
- return style;
- }
-
function tokenBase(stream, state) {
// String
var ch = stream.peek();
if (ch == "'" || ch == '"') {
stream.next();
- return chain(stream, state, tokenString(ch, "string", "string"));
+ return chain(stream, state, tokenString(ch, "string"));
}
// Comment
else if (ch == "/") {
@@ -176,16 +168,16 @@ CodeMirror.defineMode("dylan", function(_config) {
return chain(stream, state, tokenComment);
} else if (stream.eat("/")) {
stream.skipToEnd();
- return ret("comment", "comment");
+ return "comment";
} else {
stream.skipTo(" ");
- return ret("operator", "operator");
+ return "operator";
}
}
// Decimal
else if (/\d/.test(ch)) {
stream.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/);
- return ret("number", "number");
+ return "number";
}
// Hash
else if (ch == "#") {
@@ -194,33 +186,33 @@ CodeMirror.defineMode("dylan", function(_config) {
ch = stream.peek();
if (ch == '"') {
stream.next();
- return chain(stream, state, tokenString('"', "symbol", "string-2"));
+ return chain(stream, state, tokenString('"', "string-2"));
}
// Binary number
else if (ch == "b") {
stream.next();
stream.eatWhile(/[01]/);
- return ret("number", "number");
+ return "number";
}
// Hex number
else if (ch == "x") {
stream.next();
stream.eatWhile(/[\da-f]/i);
- return ret("number", "number");
+ return "number";
}
// Octal number
else if (ch == "o") {
stream.next();
stream.eatWhile(/[0-7]/);
- return ret("number", "number");
+ return "number";
}
// Hash symbol
else {
stream.eatWhile(/[-a-zA-Z]/);
- return ret("hash", "keyword");
+ return "keyword";
}
} else if (stream.match("end")) {
- return ret("end", "keyword");
+ return "keyword";
}
for (var name in patterns) {
if (patterns.hasOwnProperty(name)) {
@@ -228,21 +220,21 @@ CodeMirror.defineMode("dylan", function(_config) {
if ((pattern instanceof Array && pattern.some(function(p) {
return stream.match(p);
})) || stream.match(pattern))
- return ret(name, patternStyles[name], stream.current());
+ return patternStyles[name];
}
}
if (stream.match("define")) {
- return ret("definition", "def");
+ return "def";
} else {
stream.eatWhile(/[\w\-]/);
// Keyword
if (wordLookup[stream.current()]) {
- return ret(wordLookup[stream.current()], styleLookup[stream.current()], stream.current());
+ return styleLookup[stream.current()];
} else if (stream.current().match(symbol)) {
- return ret("variable", "variable");
+ return "variable";
} else {
stream.next();
- return ret("other", "variable-2");
+ return "variable-2";
}
}
}
@@ -257,10 +249,10 @@ CodeMirror.defineMode("dylan", function(_config) {
}
maybeEnd = (ch == "*");
}
- return ret("comment", "comment");
+ return "comment";
}
- function tokenString(quote, type, style) {
+ function tokenString(quote, style) {
return function(stream, state) {
var next, end = false;
while ((next = stream.next()) != null) {
@@ -271,7 +263,7 @@ CodeMirror.defineMode("dylan", function(_config) {
}
if (end)
state.tokenize = tokenBase;
- return ret(type, style);
+ return style;
};
}
diff --git a/public/vendor/codemirror/mode/ecl/ecl.js b/public/vendor/codemirror/mode/ecl/ecl.js
index 18778f16..8df7ebe4 100755
--- a/public/vendor/codemirror/mode/ecl/ecl.js
+++ b/public/vendor/codemirror/mode/ecl/ecl.js
@@ -34,7 +34,6 @@ CodeMirror.defineMode("ecl", function(config) {
var blockKeywords = words("catch class do else finally for if switch try while");
var atoms = words("true false null");
var hooks = {"#": metaHook};
- var multiLineStrings;
var isOperatorChar = /[+\-*&%=<>!?|\/]/;
var curPunc;
@@ -112,7 +111,7 @@ CodeMirror.defineMode("ecl", function(config) {
if (next == quote && !escaped) {end = true; break;}
escaped = !escaped && next == "\\";
}
- if (end || !(escaped || multiLineStrings))
+ if (end || !escaped)
state.tokenize = tokenBase;
return "string";
};
diff --git a/public/vendor/codemirror/mode/eiffel/eiffel.js b/public/vendor/codemirror/mode/eiffel/eiffel.js
index fcdf295c..b8b70e36 100755
--- a/public/vendor/codemirror/mode/eiffel/eiffel.js
+++ b/public/vendor/codemirror/mode/eiffel/eiffel.js
@@ -84,7 +84,6 @@ CodeMirror.defineMode("eiffel", function() {
'or'
]);
var operators = wordObj([":=", "and then","and", "or","<<",">>"]);
- var curPunc;
function chain(newtok, stream, state) {
state.tokenize.push(newtok);
@@ -92,7 +91,6 @@ CodeMirror.defineMode("eiffel", function() {
}
function tokenBase(stream, state) {
- curPunc = null;
if (stream.eatSpace()) return null;
var ch = stream.next();
if (ch == '"'||ch == "'") {
diff --git a/public/vendor/codemirror/mode/elm/elm.js b/public/vendor/codemirror/mode/elm/elm.js
new file mode 100755
index 00000000..7124c50a
--- /dev/null
+++ b/public/vendor/codemirror/mode/elm/elm.js
@@ -0,0 +1,205 @@
+// 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("elm", function() {
+
+ function switchState(source, setState, f) {
+ setState(f);
+ return f(source, setState);
+ }
+
+ // These should all be Unicode extended, as per the Haskell 2010 report
+ var smallRE = /[a-z_]/;
+ var largeRE = /[A-Z]/;
+ var digitRE = /[0-9]/;
+ var hexitRE = /[0-9A-Fa-f]/;
+ var octitRE = /[0-7]/;
+ var idRE = /[a-z_A-Z0-9\']/;
+ var symbolRE = /[-!#$%&*+.\/<=>?@\\^|~:\u03BB\u2192]/;
+ var specialRE = /[(),;[\]`{}]/;
+ var whiteCharRE = /[ \t\v\f]/; // newlines are handled in tokenizer
+
+ function normal() {
+ return function (source, setState) {
+ if (source.eatWhile(whiteCharRE)) {
+ return null;
+ }
+
+ var ch = source.next();
+ if (specialRE.test(ch)) {
+ if (ch == '{' && source.eat('-')) {
+ var t = "comment";
+ if (source.eat('#')) t = "meta";
+ return switchState(source, setState, ncomment(t, 1));
+ }
+ return null;
+ }
+
+ if (ch == '\'') {
+ if (source.eat('\\'))
+ source.next(); // should handle other escapes here
+ else
+ source.next();
+
+ if (source.eat('\''))
+ return "string";
+ return "error";
+ }
+
+ if (ch == '"') {
+ return switchState(source, setState, stringLiteral);
+ }
+
+ if (largeRE.test(ch)) {
+ source.eatWhile(idRE);
+ if (source.eat('.'))
+ return "qualifier";
+ return "variable-2";
+ }
+
+ if (smallRE.test(ch)) {
+ var isDef = source.pos === 1;
+ source.eatWhile(idRE);
+ return isDef ? "variable-3" : "variable";
+ }
+
+ if (digitRE.test(ch)) {
+ if (ch == '0') {
+ if (source.eat(/[xX]/)) {
+ source.eatWhile(hexitRE); // should require at least 1
+ return "integer";
+ }
+ if (source.eat(/[oO]/)) {
+ source.eatWhile(octitRE); // should require at least 1
+ return "number";
+ }
+ }
+ source.eatWhile(digitRE);
+ var t = "number";
+ if (source.eat('.')) {
+ t = "number";
+ source.eatWhile(digitRE); // should require at least 1
+ }
+ if (source.eat(/[eE]/)) {
+ t = "number";
+ source.eat(/[-+]/);
+ source.eatWhile(digitRE); // should require at least 1
+ }
+ return t;
+ }
+
+ if (symbolRE.test(ch)) {
+ if (ch == '-' && source.eat(/-/)) {
+ source.eatWhile(/-/);
+ if (!source.eat(symbolRE)) {
+ source.skipToEnd();
+ return "comment";
+ }
+ }
+ source.eatWhile(symbolRE);
+ return "builtin";
+ }
+
+ return "error";
+ }
+ }
+
+ function ncomment(type, nest) {
+ if (nest == 0) {
+ return normal();
+ }
+ return function(source, setState) {
+ var currNest = nest;
+ while (!source.eol()) {
+ var ch = source.next();
+ if (ch == '{' && source.eat('-')) {
+ ++currNest;
+ } else if (ch == '-' && source.eat('}')) {
+ --currNest;
+ if (currNest == 0) {
+ setState(normal());
+ return type;
+ }
+ }
+ }
+ setState(ncomment(type, currNest));
+ return type;
+ }
+ }
+
+ function stringLiteral(source, setState) {
+ while (!source.eol()) {
+ var ch = source.next();
+ if (ch == '"') {
+ setState(normal());
+ return "string";
+ }
+ if (ch == '\\') {
+ if (source.eol() || source.eat(whiteCharRE)) {
+ setState(stringGap);
+ return "string";
+ }
+ if (!source.eat('&')) source.next(); // should handle other escapes here
+ }
+ }
+ setState(normal());
+ return "error";
+ }
+
+ function stringGap(source, setState) {
+ if (source.eat('\\')) {
+ return switchState(source, setState, stringLiteral);
+ }
+ source.next();
+ setState(normal());
+ return "error";
+ }
+
+
+ var wellKnownWords = (function() {
+ var wkw = {};
+
+ var keywords = [
+ "case", "of", "as",
+ "if", "then", "else",
+ "let", "in",
+ "infix", "infixl", "infixr",
+ "type", "alias",
+ "input", "output", "foreign", "loopback",
+ "module", "where", "import", "exposing",
+ "_", "..", "|", ":", "=", "\\", "\"", "->", "<-"
+ ];
+
+ for (var i = keywords.length; i--;)
+ wkw[keywords[i]] = "keyword";
+
+ return wkw;
+ })();
+
+
+
+ return {
+ startState: function () { return { f: normal() }; },
+ copyState: function (s) { return { f: s.f }; },
+
+ token: function(stream, state) {
+ var t = state.f(stream, function(s) { state.f = s; });
+ var w = stream.current();
+ return (wellKnownWords.hasOwnProperty(w)) ? wellKnownWords[w] : t;
+ }
+ };
+
+ });
+
+ CodeMirror.defineMIME("text/x-elm", "elm");
+})();
diff --git a/public/vendor/codemirror/mode/elm/index.html b/public/vendor/codemirror/mode/elm/index.html
new file mode 100755
index 00000000..d5cb16ab
--- /dev/null
+++ b/public/vendor/codemirror/mode/elm/index.html
@@ -0,0 +1,61 @@
+
+
+CodeMirror: Elm mode
+
+
+
+
+
+
+
+
+
+
+Elm mode
+
+
+
+
+
+ MIME types defined: text/x-elm
.
+
diff --git a/public/vendor/codemirror/mode/factor/factor.js b/public/vendor/codemirror/mode/factor/factor.js
new file mode 100755
index 00000000..86d7adf6
--- /dev/null
+++ b/public/vendor/codemirror/mode/factor/factor.js
@@ -0,0 +1,83 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+// Factor syntax highlight - simple mode
+//
+// by Dimage Sapelkin (https://github.com/kerabromsmu)
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"), require("../../addon/mode/simple"));
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror", "../../addon/mode/simple"], mod);
+ else // Plain browser env
+ mod(CodeMirror);
+})(function(CodeMirror) {
+ "use strict";
+
+ CodeMirror.defineSimpleMode("factor", {
+ // The start state contains the rules that are intially used
+ start: [
+ // comments
+ {regex: /#?!.*/, token: "comment"},
+ // strings """, multiline --> state
+ {regex: /"""/, token: "string", next: "string3"},
+ {regex: /"/, token: "string", next: "string"},
+ // numbers: dec, hex, unicode, bin, fractional, complex
+ {regex: /(?:[+-]?)(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\d+.?\d*)/, token: "number"},
+ //{regex: /[+-]?/} //fractional
+ // definition: defining word, defined word, etc
+ {regex: /(\:)(\s+)(\S+)(\s+)(\()/, token: ["keyword", null, "def", null, "keyword"], next: "stack"},
+ // vocabulary using --> state
+ {regex: /USING\:/, token: "keyword", next: "vocabulary"},
+ // vocabulary definition/use
+ {regex: /(USE\:|IN\:)(\s+)(\S+)/, token: ["keyword", null, "variable-2"]},
+ //
+ {regex: /<\S+>/, token: "builtin"},
+ // "keywords", incl. ; t f . [ ] { } defining words
+ {regex: /;|t|f|if|\.|\[|\]|\{|\}|MAIN:/, token: "keyword"},
+ // any id (?)
+ {regex: /\S+/, token: "variable"},
+
+ {
+ regex: /./,
+ token: null
+ }
+ ],
+ vocabulary: [
+ {regex: /;/, token: "keyword", next: "start"},
+ {regex: /\S+/, token: "variable-2"},
+ {
+ regex: /./,
+ token: null
+ }
+ ],
+ string: [
+ {regex: /(?:[^\\]|\\.)*?"/, token: "string", next: "start"},
+ {regex: /.*/, token: "string"}
+ ],
+ string3: [
+ {regex: /(?:[^\\]|\\.)*?"""/, token: "string", next: "start"},
+ {regex: /.*/, token: "string"}
+ ],
+ stack: [
+ {regex: /\)/, token: "meta", next: "start"},
+ {regex: /--/, token: "meta"},
+ {regex: /\S+/, token: "variable-3"},
+ {
+ regex: /./,
+ token: null
+ }
+ ],
+ // The meta property contains global information about the mode. It
+ // can contain properties like lineComment, which are supported by
+ // all modes, and also directives like dontIndentStates, which are
+ // specific to simple modes.
+ meta: {
+ dontIndentStates: ["start", "vocabulary", "string", "string3", "stack"],
+ lineComment: [ "!", "#!" ]
+ }
+ });
+
+ CodeMirror.defineMIME("text/x-factor", "factor");
+});
diff --git a/public/vendor/codemirror/mode/factor/index.html b/public/vendor/codemirror/mode/factor/index.html
new file mode 100755
index 00000000..9f154891
--- /dev/null
+++ b/public/vendor/codemirror/mode/factor/index.html
@@ -0,0 +1,77 @@
+
+
+CodeMirror: Factor mode
+
+
+
+
+
+
+
+
+
+
+
+
+
+Factor mode
+
+
+
+
+
+Simple mode that handles Factor Syntax (Factor on WikiPedia).
+
+MIME types defined: text/x-factor
.
+
+
diff --git a/public/vendor/codemirror/mode/groovy/groovy.js b/public/vendor/codemirror/mode/groovy/groovy.js
index e3a1db86..721933b0 100755
--- a/public/vendor/codemirror/mode/groovy/groovy.js
+++ b/public/vendor/codemirror/mode/groovy/groovy.js
@@ -24,6 +24,7 @@ CodeMirror.defineMode("groovy", function(config) {
"short static strictfp super switch synchronized threadsafe throw throws transient " +
"try void volatile while");
var blockKeywords = words("catch class do else finally for if switch try while enum interface def");
+ var standaloneKeywords = words("return break continue");
var atoms = words("null true false this");
var curPunc;
@@ -50,7 +51,7 @@ CodeMirror.defineMode("groovy", function(config) {
stream.skipToEnd();
return "comment";
}
- if (expectExpression(state.lastToken)) {
+ if (expectExpression(state.lastToken, false)) {
return startString(ch, stream, state);
}
}
@@ -70,6 +71,7 @@ CodeMirror.defineMode("groovy", function(config) {
if (atoms.propertyIsEnumerable(cur)) { return "atom"; }
if (keywords.propertyIsEnumerable(cur)) {
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
+ else if (standaloneKeywords.propertyIsEnumerable(cur)) curPunc = "standalone";
return "keyword";
}
return "variable";
@@ -132,9 +134,10 @@ CodeMirror.defineMode("groovy", function(config) {
return "comment";
}
- function expectExpression(last) {
+ function expectExpression(last, newline) {
return !last || last == "operator" || last == "->" || /[\.\[\{\(,;:]/.test(last) ||
- last == "newstatement" || last == "keyword" || last == "proplabel";
+ last == "newstatement" || last == "keyword" || last == "proplabel" ||
+ (last == "standalone" && !newline);
}
function Context(indented, column, type, align, prev) {
@@ -174,7 +177,7 @@ CodeMirror.defineMode("groovy", function(config) {
state.indented = stream.indentation();
state.startOfLine = true;
// Automatic semicolon insertion
- if (ctx.type == "statement" && !expectExpression(state.lastToken)) {
+ if (ctx.type == "statement" && !expectExpression(state.lastToken, true)) {
popContext(state); ctx = state.context;
}
}
@@ -209,7 +212,7 @@ CodeMirror.defineMode("groovy", function(config) {
indent: function(state, textAfter) {
if (!state.tokenize[state.tokenize.length-1].isBase) return 0;
var firstChar = textAfter && textAfter.charAt(0), ctx = state.context;
- if (ctx.type == "statement" && !expectExpression(state.lastToken)) ctx = ctx.prev;
+ if (ctx.type == "statement" && !expectExpression(state.lastToken, true)) ctx = ctx.prev;
var closing = firstChar == ctx.type;
if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : config.indentUnit);
else if (ctx.align) return ctx.column + (closing ? 0 : 1);
diff --git a/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js b/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js
index 1cc438f0..24552e2d 100755
--- a/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js
+++ b/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js
@@ -57,9 +57,9 @@ CodeMirror.defineMode("htmlmixed", function(config, parserConfig) {
}
function maybeBackup(stream, pat, style) {
var cur = stream.current();
- var close = cur.search(pat), m;
+ var close = cur.search(pat);
if (close > -1) stream.backUp(cur.length - close);
- else if (m = cur.match(/<\/?$/)) {
+ else if (cur.match(/<\/?$/)) {
stream.backUp(cur.length);
if (!stream.match(pat, false)) stream.match(cur);
}
diff --git a/public/vendor/codemirror/mode/index.html b/public/vendor/codemirror/mode/index.html
index 245595de..8c6d0a43 100755
--- a/public/vendor/codemirror/mode/index.html
+++ b/public/vendor/codemirror/mode/index.html
@@ -31,6 +31,7 @@ option.
- APL
+ - ASN.1
- Asterisk dialplan
- C, C++, C#
- Clojure
@@ -51,7 +52,9 @@ option.
- EBNF
- ECL
- Eiffel
+ - Elm
- Erlang
+ - Factor
- Forth
- Fortran
- F#
@@ -63,6 +66,7 @@ option.
- Handlebars
- Haskell
- Haxe
+ - HTML embedded (JSP, ASP.NET)
- HTML mixed-mode
- HTTP
- IDL
@@ -76,6 +80,7 @@ option.
- LiveScript
- Lua
- Markdown (GitHub-flavour)
+ - Mathematica
- mIRC
- Modelica
- MUMPS
@@ -114,6 +119,7 @@ option.
- Stylus
- SQL (several dialects)
- SPARQL
+ - Swift
- sTeX, LaTeX
- Tcl
- Textile
@@ -122,7 +128,10 @@ option.
- TOML
- Tornado (templating language)
- troff (for manpages)
+ - TTCN
+ - TTCN Configuration
- Turtle
+ - Twig
- VB.NET
- VBScript
- Velocity
diff --git a/public/vendor/codemirror/mode/javascript/javascript.js b/public/vendor/codemirror/mode/javascript/javascript.js
index ef018478..c86f49e1 100755
--- a/public/vendor/codemirror/mode/javascript/javascript.js
+++ b/public/vendor/codemirror/mode/javascript/javascript.js
@@ -482,8 +482,11 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
function maybetype(type) {
if (isTS && type == ":") return cont(typedef);
}
+ function maybedefault(_, value) {
+ if (value == "=") return cont(expressionNoComma);
+ }
function typedef(type) {
- if (type == "variable"){cx.marked = "variable-3"; return cont();}
+ if (type == "variable") {cx.marked = "variable-3"; return cont();}
}
function vardef() {
return pass(pattern, maybetype, maybeAssign, vardefCont);
@@ -538,7 +541,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
}
function funarg(type) {
if (type == "spread") return cont(funarg);
- return pass(pattern, maybetype);
+ return pass(pattern, maybetype, maybedefault);
}
function className(type, value) {
if (type == "variable") {register(value); return cont(classNameAfter);}
diff --git a/public/vendor/codemirror/mode/javascript/test.js b/public/vendor/codemirror/mode/javascript/test.js
index 91b0e89a..092d25dc 100755
--- a/public/vendor/codemirror/mode/javascript/test.js
+++ b/public/vendor/codemirror/mode/javascript/test.js
@@ -160,6 +160,11 @@
"]];",
"[number 10];");
+ MT("param_default",
+ "[keyword function] [variable foo]([def x] [operator =] [string-2 `foo${][number 10][string-2 }bar`]) {",
+ " [keyword return] [variable-2 x];",
+ "}");
+
var jsonld_mode = CodeMirror.getMode(
{indentUnit: 2},
{name: "javascript", jsonld: true}
diff --git a/public/vendor/codemirror/mode/julia/julia.js b/public/vendor/codemirror/mode/julia/julia.js
index e854988a..d0a74cef 100755
--- a/public/vendor/codemirror/mode/julia/julia.js
+++ b/public/vendor/codemirror/mode/julia/julia.js
@@ -34,7 +34,6 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
var closers = wordRegexp(blockClosers);
var macro = /^@[_A-Za-z][_A-Za-z0-9]*/;
var symbol = /^:[_A-Za-z][_A-Za-z0-9]*/;
- var indentInfo = null;
function in_array(state) {
var ch = cur_scope(state);
@@ -247,7 +246,6 @@ CodeMirror.defineMode("julia", function(_conf, parserConf) {
}
function tokenLexer(stream, state) {
- indentInfo = null;
var style = state.tokenize(stream, state);
var current = stream.current();
diff --git a/public/vendor/codemirror/mode/kotlin/kotlin.js b/public/vendor/codemirror/mode/kotlin/kotlin.js
index 1efec85d..e9a6a94e 100755
--- a/public/vendor/codemirror/mode/kotlin/kotlin.js
+++ b/public/vendor/codemirror/mode/kotlin/kotlin.js
@@ -21,7 +21,7 @@ CodeMirror.defineMode("kotlin", function (config, parserConfig) {
var multiLineStrings = parserConfig.multiLineStrings;
var keywords = words(
- "package continue return object while break class data trait throw super" +
+ "package continue return object while break class data trait interface throw super" +
" when type this else This try val var fun for is in if do as true false null get set");
var softKeywords = words("import" +
" where by get set abstract enum open annotation override private public internal" +
@@ -272,7 +272,10 @@ CodeMirror.defineMode("kotlin", function (config, parserConfig) {
},
closeBrackets: {triples: "'\""},
- electricChars: "{}"
+ electricChars: "{}",
+ blockCommentStart: "/*",
+ blockCommentEnd: "*/",
+ lineComment: "//"
};
});
diff --git a/public/vendor/codemirror/mode/livescript/livescript.js b/public/vendor/codemirror/mode/livescript/livescript.js
index 55882efc..4b26e046 100755
--- a/public/vendor/codemirror/mode/livescript/livescript.js
+++ b/public/vendor/codemirror/mode/livescript/livescript.js
@@ -24,8 +24,8 @@
var nr = Rules[next_rule];
if (nr.splice) {
for (var i$ = 0; i$ < nr.length; ++i$) {
- var r = nr[i$], m;
- if (r.regex && (m = stream.match(r.regex))) {
+ var r = nr[i$];
+ if (r.regex && stream.match(r.regex)) {
state.next = r.next || state.next;
return r.token;
}
diff --git a/public/vendor/codemirror/mode/markdown/markdown.js b/public/vendor/codemirror/mode/markdown/markdown.js
index bc5314fc..bef37b8a 100755
--- a/public/vendor/codemirror/mode/markdown/markdown.js
+++ b/public/vendor/codemirror/mode/markdown/markdown.js
@@ -68,12 +68,12 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
, strong = 'strong'
, strikethrough = 'strikethrough';
- var hrRE = /^([*\-=_])(?:\s*\1){2,}\s*$/
+ var hrRE = /^([*\-_])(?:\s*\1){2,}\s*$/
, ulRE = /^[*\-+]\s+/
- , olRE = /^[0-9]+\.\s+/
+ , olRE = /^[0-9]+([.)])\s+/
, taskListRE = /^\[(x| )\](?=\s)/ // Must follow ulRE or olRE
- , atxHeaderRE = /^#+ ?/
- , setextHeaderRE = /^(?:\={1,}|-{1,})$/
+ , atxHeaderRE = /^(#+)(?: |$)/
+ , setextHeaderRE = /^ *(?:\={1,}|-{1,})\s*$/
, textRE = /^[^#!\[\]*_\\<>` "'(~]+/;
function switchInline(stream, state, f) {
@@ -100,6 +100,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
state.strikethrough = false;
// Reset state.quote
state.quote = 0;
+ // Reset state.indentedCode
+ state.indentedCode = false;
if (!htmlFound && state.f == htmlBlock) {
state.f = inlineNormal;
state.block = blockNormal;
@@ -116,7 +118,11 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
var sol = stream.sol();
- var prevLineIsList = state.list !== false;
+ var prevLineIsList = state.list !== false,
+ prevLineIsIndentedCode = state.indentedCode;
+
+ state.indentedCode = false;
+
if (prevLineIsList) {
if (state.indentationDiff >= 0) { // Continued list
if (state.indentationDiff < 4) { // Only adjust indentation if *not* a code block
@@ -134,23 +140,27 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
var match = null;
if (state.indentationDiff >= 4) {
- state.indentation -= 4;
stream.skipToEnd();
- return code;
+ if (prevLineIsIndentedCode || !state.prevLineHasContent) {
+ state.indentation -= 4;
+ state.indentedCode = true;
+ return code;
+ } else {
+ return null;
+ }
} else if (stream.eatSpace()) {
return null;
- } else if (match = stream.match(atxHeaderRE)) {
- state.header = Math.min(6, match[0].indexOf(" ") !== -1 ? match[0].length - 1 : match[0].length);
+ } else if ((match = stream.match(atxHeaderRE)) && match[1].length <= 6) {
+ state.header = match[1].length;
if (modeCfg.highlightFormatting) state.formatting = "header";
state.f = state.inline;
return getType(state);
- } else if (state.prevLineHasContent && (match = stream.match(setextHeaderRE))) {
+ } else if (state.prevLineHasContent && !state.quote && !prevLineIsList && !prevLineIsIndentedCode && (match = stream.match(setextHeaderRE))) {
state.header = match[0].charAt(0) == '=' ? 1 : 2;
if (modeCfg.highlightFormatting) state.formatting = "header";
state.f = state.inline;
return getType(state);
} else if (stream.eat('>')) {
- state.indentation++;
state.quote = sol ? 1 : state.quote + 1;
if (modeCfg.highlightFormatting) state.formatting = "quote";
stream.eatSpace();
@@ -158,6 +168,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
} else if (stream.peek() === '[') {
return switchInline(stream, state, footnoteLink);
} else if (stream.match(hrRE, true)) {
+ state.hr = true;
return hr;
} else if ((!state.prevLineHasContent || prevLineIsList) && (stream.match(ulRE, false) || stream.match(olRE, false))) {
var listType = null;
@@ -262,17 +273,16 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
}
if (state.linkHref) {
- styles.push(linkhref);
- return styles.length ? styles.join(' ') : null;
- }
+ styles.push(linkhref, "url");
+ } else { // Only apply inline styles to non-url text
+ if (state.strong) { styles.push(strong); }
+ if (state.em) { styles.push(em); }
+ if (state.strikethrough) { styles.push(strikethrough); }
- if (state.strong) { styles.push(strong); }
- if (state.em) { styles.push(em); }
- if (state.strikethrough) { styles.push(strikethrough); }
+ if (state.linkText) { styles.push(linktext); }
- if (state.linkText) { styles.push(linktext); }
-
- if (state.code) { styles.push(code); }
+ if (state.code) { styles.push(code); }
+ }
if (state.header) { styles.push(header); styles.push(header + "-" + state.header); }
@@ -626,7 +636,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true);
}
state.f = state.inline = inlineNormal;
- return linkhref;
+ return linkhref + " url";
}
var savedInlineRE = [];
@@ -663,6 +673,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
em: false,
strong: false,
header: 0,
+ hr: false,
taskList: false,
list: false,
listDepth: 0,
@@ -695,10 +706,12 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
strong: s.strong,
strikethrough: s.strikethrough,
header: s.header,
+ hr: s.hr,
taskList: s.taskList,
list: s.list,
listDepth: s.listDepth,
quote: s.quote,
+ indentedCode: s.indentedCode,
trailingSpace: s.trailingSpace,
trailingSpaceNewLine: s.trailingSpaceNewLine,
md_inside: s.md_inside
@@ -711,10 +724,11 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
state.formatting = false;
if (stream.sol()) {
- var forceBlankLine = !!state.header;
+ var forceBlankLine = !!state.header || state.hr;
- // Reset state.header
+ // Reset state.header and state.hr
state.header = 0;
+ state.hr = false;
if (stream.match(/^\s*$/, true) || forceBlankLine) {
state.prevLineHasContent = false;
diff --git a/public/vendor/codemirror/mode/markdown/test.js b/public/vendor/codemirror/mode/markdown/test.js
index 7bc687f0..7cd0bf4b 100755
--- a/public/vendor/codemirror/mode/markdown/test.js
+++ b/public/vendor/codemirror/mode/markdown/test.js
@@ -41,11 +41,11 @@
"[variable-2&formatting&formatting-list&formatting-list-ol 1. ][variable-2 foo]");
FT("formatting_link",
- "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string (][string http://example.com/][string&formatting&formatting-link-string )]");
+ "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string&url (][string&url http://example.com/][string&formatting&formatting-link-string&url )]");
FT("formatting_linkReference",
- "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string [][string bar][string&formatting&formatting-link-string ]]]",
- "[link&formatting&formatting-link [][link bar][link&formatting&formatting-link ]]:] [string http://example.com/]");
+ "[link&formatting&formatting-link [][link foo][link&formatting&formatting-link ]]][string&formatting&formatting-link-string&url [][string&url bar][string&formatting&formatting-link-string&url ]]]",
+ "[link&formatting&formatting-link [][link bar][link&formatting&formatting-link ]]:] [string&url http://example.com/]");
FT("formatting_linkWeb",
"[link&formatting&formatting-link <][link http://example.com/][link&formatting&formatting-link >]");
@@ -85,13 +85,6 @@
" [comment foo]",
"bar");
- // Code blocks using 4 spaces with internal indentation
- MT("codeBlocksUsing4SpacesIndentation",
- " foo",
- " [comment bar]",
- " [comment hello]",
- " [comment world]");
-
// Code blocks should end even after extra indented lines
MT("codeBlocksWithTrailingIndentedLine",
" [comment foo]",
@@ -104,6 +97,12 @@
MT("codeBlocksUsing1Tab",
"\t[comment foo]");
+ // No code blocks directly after paragraph
+ // http://spec.commonmark.org/0.19/#example-65
+ MT("noCodeBlocksAfterParagraph",
+ "Foo",
+ " Bar");
+
// Inline code using backticks
MT("inlineCodeUsingBackticks",
"foo [comment `bar`]");
@@ -166,10 +165,13 @@
MT("atxH6",
"[header&header-6 ###### foo]");
- // H6 - 7x '#' should still be H6, per Dingus
- // http://daringfireball.net/projects/markdown/dingus
- MT("atxH6NotH7",
- "[header&header-6 ####### foo]");
+ // http://spec.commonmark.org/0.19/#example-24
+ MT("noAtxH7",
+ "####### foo");
+
+ // http://spec.commonmark.org/0.19/#example-25
+ MT("noAtxH1WithoutSpace",
+ "#5 bolt");
// Inline styles should be parsed inside headers
MT("atxH1inline",
@@ -202,6 +204,25 @@
"foo",
"[header&header-2 ---]");
+ // http://spec.commonmark.org/0.19/#example-45
+ MT("setextH2AllowSpaces",
+ "foo",
+ " [header&header-2 ---- ]");
+
+ // http://spec.commonmark.org/0.19/#example-44
+ MT("noSetextAfterIndentedCodeBlock",
+ " [comment foo]",
+ "[hr ---]");
+
+ // http://spec.commonmark.org/0.19/#example-51
+ MT("noSetextAfterQuote",
+ "[quote"e-1 > foo]",
+ "[hr ---]");
+
+ MT("noSetextAfterList",
+ "[variable-2 - foo]",
+ "[hr ---]");
+
// Single-line blockquote with trailing space
MT("blockquoteSpace",
"[quote"e-1 > foo]");
@@ -251,6 +272,13 @@
"",
"hello");
+ // Header with leading space after continued blockquote (#3287, negative indentation)
+ MT("headerAfterContinuedBlockquote",
+ "[quote"e-1 > foo]",
+ "[quote"e-1 bar]",
+ "",
+ " [header&header-1 # hello]");
+
// Check list types
MT("listAsterisk",
@@ -287,11 +315,21 @@
"1. bar",
"2. hello");
+ // List after hr
+ MT("listAfterHr",
+ "[hr ---]",
+ "[variable-2 - bar]");
+
// List after header
MT("listAfterHeader",
"[header&header-1 # foo]",
"[variable-2 - bar]");
+ // hr after list
+ MT("hrAfterList",
+ "[variable-2 - foo]",
+ "[hr -----]");
+
// Formatting in lists (*)
MT("listAsteriskFormatting",
"[variable-2 * ][variable-2&em *foo*][variable-2 bar]",
@@ -498,39 +536,39 @@
// Inline link with title
MT("linkTitle",
- "[link [[foo]]][string (http://example.com/ \"bar\")] hello");
+ "[link [[foo]]][string&url (http://example.com/ \"bar\")] hello");
// Inline link without title
MT("linkNoTitle",
- "[link [[foo]]][string (http://example.com/)] bar");
+ "[link [[foo]]][string&url (http://example.com/)] bar");
// Inline link with image
MT("linkImage",
- "[link [[][tag ![[foo]]][string (http://example.com/)][link ]]][string (http://example.com/)] bar");
+ "[link [[][tag ![[foo]]][string&url (http://example.com/)][link ]]][string&url (http://example.com/)] bar");
// Inline link with Em
MT("linkEm",
- "[link [[][link&em *foo*][link ]]][string (http://example.com/)] bar");
+ "[link [[][link&em *foo*][link ]]][string&url (http://example.com/)] bar");
// Inline link with Strong
MT("linkStrong",
- "[link [[][link&strong **foo**][link ]]][string (http://example.com/)] bar");
+ "[link [[][link&strong **foo**][link ]]][string&url (http://example.com/)] bar");
// Inline link with EmStrong
MT("linkEmStrong",
- "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string (http://example.com/)] bar");
+ "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string&url (http://example.com/)] bar");
// Image with title
MT("imageTitle",
- "[tag ![[foo]]][string (http://example.com/ \"bar\")] hello");
+ "[tag ![[foo]]][string&url (http://example.com/ \"bar\")] hello");
// Image without title
MT("imageNoTitle",
- "[tag ![[foo]]][string (http://example.com/)] bar");
+ "[tag ![[foo]]][string&url (http://example.com/)] bar");
// Image with asterisks
MT("imageAsterisks",
- "[tag ![[*foo*]]][string (http://example.com/)] bar");
+ "[tag ![[*foo*]]][string&url (http://example.com/)] bar");
// Not a link. Should be normal text due to square brackets being used
// regularly in text, especially in quoted material, and no space is allowed
@@ -540,24 +578,24 @@
// Reference-style links
MT("linkReference",
- "[link [[foo]]][string [[bar]]] hello");
+ "[link [[foo]]][string&url [[bar]]] hello");
// Reference-style links with Em
MT("linkReferenceEm",
- "[link [[][link&em *foo*][link ]]][string [[bar]]] hello");
+ "[link [[][link&em *foo*][link ]]][string&url [[bar]]] hello");
// Reference-style links with Strong
MT("linkReferenceStrong",
- "[link [[][link&strong **foo**][link ]]][string [[bar]]] hello");
+ "[link [[][link&strong **foo**][link ]]][string&url [[bar]]] hello");
// Reference-style links with EmStrong
MT("linkReferenceEmStrong",
- "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string [[bar]]] hello");
+ "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string&url [[bar]]] hello");
// Reference-style links with optional space separator (per docuentation)
// "You can optionally use a space to separate the sets of brackets"
MT("linkReferenceSpace",
- "[link [[foo]]] [string [[bar]]] hello");
+ "[link [[foo]]] [string&url [[bar]]] hello");
// Should only allow a single space ("...use *a* space...")
MT("linkReferenceDoubleSpace",
@@ -565,7 +603,7 @@
// Reference-style links with implicit link name
MT("linkImplicit",
- "[link [[foo]]][string [[]]] hello");
+ "[link [[foo]]][string&url [[]]] hello");
// @todo It would be nice if, at some point, the document was actually
// checked to see if the referenced link exists
@@ -573,46 +611,46 @@
// Link label, for reference-style links (taken from documentation)
MT("labelNoTitle",
- "[link [[foo]]:] [string http://example.com/]");
+ "[link [[foo]]:] [string&url http://example.com/]");
MT("labelIndented",
- " [link [[foo]]:] [string http://example.com/]");
+ " [link [[foo]]:] [string&url http://example.com/]");
MT("labelSpaceTitle",
- "[link [[foo bar]]:] [string http://example.com/ \"hello\"]");
+ "[link [[foo bar]]:] [string&url http://example.com/ \"hello\"]");
MT("labelDoubleTitle",
- "[link [[foo bar]]:] [string http://example.com/ \"hello\"] \"world\"");
+ "[link [[foo bar]]:] [string&url http://example.com/ \"hello\"] \"world\"");
MT("labelTitleDoubleQuotes",
- "[link [[foo]]:] [string http://example.com/ \"bar\"]");
+ "[link [[foo]]:] [string&url http://example.com/ \"bar\"]");
MT("labelTitleSingleQuotes",
- "[link [[foo]]:] [string http://example.com/ 'bar']");
+ "[link [[foo]]:] [string&url http://example.com/ 'bar']");
MT("labelTitleParenthese",
- "[link [[foo]]:] [string http://example.com/ (bar)]");
+ "[link [[foo]]:] [string&url http://example.com/ (bar)]");
MT("labelTitleInvalid",
- "[link [[foo]]:] [string http://example.com/] bar");
+ "[link [[foo]]:] [string&url http://example.com/] bar");
MT("labelLinkAngleBrackets",
- "[link [[foo]]:] [string \"bar\"]");
+ "[link [[foo]]:] [string&url \"bar\"]");
MT("labelTitleNextDoubleQuotes",
- "[link [[foo]]:] [string http://example.com/]",
+ "[link [[foo]]:] [string&url http://example.com/]",
"[string \"bar\"] hello");
MT("labelTitleNextSingleQuotes",
- "[link [[foo]]:] [string http://example.com/]",
+ "[link [[foo]]:] [string&url http://example.com/]",
"[string 'bar'] hello");
MT("labelTitleNextParenthese",
- "[link [[foo]]:] [string http://example.com/]",
+ "[link [[foo]]:] [string&url http://example.com/]",
"[string (bar)] hello");
MT("labelTitleNextMixed",
- "[link [[foo]]:] [string http://example.com/]",
+ "[link [[foo]]:] [string&url http://example.com/]",
"(bar\" hello");
MT("linkWeb",
diff --git a/public/vendor/codemirror/mode/mathematica/index.html b/public/vendor/codemirror/mode/mathematica/index.html
new file mode 100755
index 00000000..57c42985
--- /dev/null
+++ b/public/vendor/codemirror/mode/mathematica/index.html
@@ -0,0 +1,72 @@
+
+
+CodeMirror: Mathematica mode
+
+
+
+
+
+
+
+
+
+
+
+Mathematica mode
+
+
+
+
+
+
+MIME types defined: text/x-mathematica
(Mathematica).
+
diff --git a/public/vendor/codemirror/mode/mathematica/mathematica.js b/public/vendor/codemirror/mode/mathematica/mathematica.js
new file mode 100755
index 00000000..5ae6f55c
--- /dev/null
+++ b/public/vendor/codemirror/mode/mathematica/mathematica.js
@@ -0,0 +1,175 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+// Mathematica mode copyright (c) 2015 by Calin Barbat
+// Based on code by Patrick Scheibe (halirutan)
+// See: https://github.com/halirutan/Mathematica-Source-Highlighting/tree/master/src/lang-mma.js
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
+ mod(require("../../lib/codemirror"));
+ else if (typeof define == "function" && define.amd) // AMD
+ define(["../../lib/codemirror"], mod);
+ else // Plain browser env
+ mod(CodeMirror);
+})(function(CodeMirror) {
+"use strict";
+
+CodeMirror.defineMode('mathematica', function(_config, _parserConfig) {
+
+ // used pattern building blocks
+ var Identifier = '[a-zA-Z\\$][a-zA-Z0-9\\$]*';
+ var pBase = "(?:\\d+)";
+ var pFloat = "(?:\\.\\d+|\\d+\\.\\d*|\\d+)";
+ var pFloatBase = "(?:\\.\\w+|\\w+\\.\\w*|\\w+)";
+ var pPrecision = "(?:`(?:`?"+pFloat+")?)";
+
+ // regular expressions
+ var reBaseForm = new RegExp('(?:'+pBase+'(?:\\^\\^'+pFloatBase+pPrecision+'?(?:\\*\\^[+-]?\\d+)?))');
+ var reFloatForm = new RegExp('(?:' + pFloat + pPrecision + '?(?:\\*\\^[+-]?\\d+)?)');
+ var reIdInContext = new RegExp('(?:`?)(?:' + Identifier + ')(?:`(?:' + Identifier + '))*(?:`?)');
+
+ 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.commentLevel++;
+ state.tokenize = tokenComment;
+ return state.tokenize(stream, state);
+ }
+ }
+
+ // go back one character
+ stream.backUp(1);
+
+ // look for numbers
+ // Numbers in a baseform
+ if (stream.match(reBaseForm, true, false)) {
+ return 'number';
+ }
+
+ // Mathematica numbers. Floats (1.2, .2, 1.) can have optionally a precision (`float) or an accuracy definition
+ // (``float). Note: while 1.2` is possible 1.2`` is not. At the end an exponent (float*^+12) can follow.
+ if (stream.match(reFloatForm, true, false)) {
+ return 'number';
+ }
+
+ /* In[23] and Out[34] */
+ if (stream.match(/(?:In|Out)\[[0-9]*\]/, true, false)) {
+ return 'atom';
+ }
+
+ // usage
+ if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::usage)/, true, false)) {
+ return 'meta';
+ }
+
+ // message
+ if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/, true, false)) {
+ return 'string-2';
+ }
+
+ // this makes a look-ahead match for something like variable:{_Integer}
+ // the match is then forwarded to the mma-patterns tokenizer.
+ if (stream.match(/([a-zA-Z\$][a-zA-Z0-9\$]*\s*:)(?:(?:[a-zA-Z\$][a-zA-Z0-9\$]*)|(?:[^:=>~@\^\&\*\)\[\]'\?,\|])).*/, true, false)) {
+ return 'variable-2';
+ }
+
+ // catch variables which are used together with Blank (_), BlankSequence (__) or BlankNullSequence (___)
+ // Cannot start with a number, but can have numbers at any other position. Examples
+ // blub__Integer, a1_, b34_Integer32
+ if (stream.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+[a-zA-Z\$][a-zA-Z0-9\$]*/, true, false)) {
+ return 'variable-2';
+ }
+ if (stream.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+/, true, false)) {
+ return 'variable-2';
+ }
+ if (stream.match(/_+[a-zA-Z\$][a-zA-Z0-9\$]*/, true, false)) {
+ return 'variable-2';
+ }
+
+ // Named characters in Mathematica, like \[Gamma].
+ if (stream.match(/\\\[[a-zA-Z\$][a-zA-Z0-9\$]*\]/, true, false)) {
+ return 'variable-3';
+ }
+
+ // Match all braces separately
+ if (stream.match(/(?:\[|\]|{|}|\(|\))/, true, false)) {
+ return 'bracket';
+ }
+
+ // Catch Slots (#, ##, #3, ##9 and the V10 named slots #name). I have never seen someone using more than one digit after #, so we match
+ // only one.
+ if (stream.match(/(?:#[a-zA-Z\$][a-zA-Z0-9\$]*|#+[0-9]?)/, true, false)) {
+ return 'variable-2';
+ }
+
+ // Literals like variables, keywords, functions
+ if (stream.match(reIdInContext, true, false)) {
+ return 'keyword';
+ }
+
+ // 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(state.commentLevel > 0 && (next = stream.next()) != null) {
+ if (prev === '(' && next === '*') state.commentLevel++;
+ if (prev === '*' && next === ')') state.commentLevel--;
+ prev = next;
+ }
+ if (state.commentLevel <= 0) {
+ 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: "*)"
+ };
+});
+
+CodeMirror.defineMIME('text/x-mathematica', {
+ name: 'mathematica'
+});
+
+});
diff --git a/public/vendor/codemirror/mode/meta.js b/public/vendor/codemirror/mode/meta.js
index 6c988e22..bb30c80f 100755
--- a/public/vendor/codemirror/mode/meta.js
+++ b/public/vendor/codemirror/mode/meta.js
@@ -14,6 +14,7 @@
CodeMirror.modeInfo = [
{name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]},
{name: "PGP", mimes: ["application/pgp", "application/pgp-keys", "application/pgp-signature"], mode: "asciiarmor", ext: ["pgp"]},
+ {name: "ASN.1", mime: "text/x-ttcn-asn", mode: "asn.1", ext: ["asn, asn1"]},
{name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i},
{name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h"]},
{name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]},
@@ -37,9 +38,11 @@
{name: "EBNF", mime: "text/x-ebnf", mode: "ebnf"},
{name: "ECL", mime: "text/x-ecl", mode: "ecl", ext: ["ecl"]},
{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: "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"]},
@@ -72,6 +75,7 @@
{name: "Markdown", mime: "text/x-markdown", mode: "markdown", ext: ["markdown", "md", "mkd"]},
{name: "mIRC", mime: "text/mirc", mode: "mirc"},
{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: "MS SQL", mime: "text/x-mssql", mode: "sql"},
@@ -112,6 +116,7 @@
{name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]},
{name: "Spreadsheet", mime: "text/x-spreadsheet", mode: "spreadsheet", alias: ["excel", "formula"]},
{name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]},
+ {name: "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"]},
@@ -123,8 +128,11 @@
{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: "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: "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"]},
diff --git a/public/vendor/codemirror/mode/php/php.js b/public/vendor/codemirror/mode/php/php.js
index e112d911..0c3f21e5 100755
--- a/public/vendor/codemirror/mode/php/php.js
+++ b/public/vendor/codemirror/mode/php/php.js
@@ -17,31 +17,31 @@
return obj;
}
- // Helper for stringWithEscapes
- function matchSequence(list, end) {
- if (list.length == 0) return stringWithEscapes(end);
+ // Helper for phpString
+ function matchSequence(list, end, escapes) {
+ if (list.length == 0) return phpString(end);
return function (stream, state) {
var patterns = list[0];
for (var i = 0; i < patterns.length; i++) if (stream.match(patterns[i][0])) {
state.tokenize = matchSequence(list.slice(1), end);
return patterns[i][1];
}
- state.tokenize = stringWithEscapes(end);
+ state.tokenize = phpString(end, escapes);
return "string";
};
}
- function stringWithEscapes(closing) {
- return function(stream, state) { return stringWithEscapes_(stream, state, closing); };
+ function phpString(closing, escapes) {
+ return function(stream, state) { return phpString_(stream, state, closing, escapes); };
}
- function stringWithEscapes_(stream, state, closing) {
+ function phpString_(stream, state, closing, escapes) {
// "Complex" syntax
- if (stream.match("${", false) || stream.match("{$", false)) {
+ if (escapes !== false && stream.match("${", false) || stream.match("{$", false)) {
state.tokenize = null;
return "string";
}
// Simple syntax
- if (stream.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/)) {
+ if (escapes !== false && stream.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/)) {
// After the variable name there may appear array or object operator.
if (stream.match("[", false)) {
// Match array operator
@@ -51,14 +51,14 @@
[/\$[a-zA-Z_][a-zA-Z0-9_]*/, "variable-2"],
[/[\w\$]+/, "variable"]],
[["]", null]]
- ], closing);
+ ], closing, escapes);
}
if (stream.match(/\-\>\w/, false)) {
// Match object operator
state.tokenize = matchSequence([
[["->", null]],
[[/[\w]+/, "variable"]]
- ], closing);
+ ], closing, escapes);
}
return "variable-2";
}
@@ -66,8 +66,9 @@
var escaped = false;
// Normal string
while (!stream.eol() &&
- (escaped || (!stream.match("{$", false) &&
- !stream.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/, false)))) {
+ (escaped || escapes === false ||
+ (!stream.match("{$", false) &&
+ !stream.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/, false)))) {
if (!escaped && stream.match(closing)) {
state.tokenize = null;
state.tokStack.pop(); state.tokStack.pop();
@@ -94,6 +95,7 @@
helperType: "php",
keywords: keywords(phpKeywords),
blockKeywords: keywords("catch do else elseif for foreach if switch try while finally"),
+ defKeywords: keywords("class function interface namespace trait"),
atoms: keywords(phpAtoms),
builtin: keywords(phpBuiltin),
multiLineStrings: true,
@@ -104,11 +106,13 @@
},
"<": function(stream, state) {
if (stream.match(/<)) {
+ var nowDoc = stream.eat("'");
stream.eatWhile(/[\w\.]/);
- var delim = stream.current().slice(3);
+ var delim = stream.current().slice(3 + (nowDoc ? 1 : 0));
+ if (nowDoc) stream.eat("'");
if (delim) {
(state.tokStack || (state.tokStack = [])).push(delim, 0);
- state.tokenize = stringWithEscapes(delim);
+ state.tokenize = phpString(delim, nowDoc ? false : true);
return "string";
}
}
@@ -127,7 +131,7 @@
},
'"': function(_stream, state) {
(state.tokStack || (state.tokStack = [])).push('"', 0);
- state.tokenize = stringWithEscapes('"');
+ state.tokenize = phpString('"');
return "string";
},
"{": function(_stream, state) {
@@ -138,7 +142,7 @@
"}": function(_stream, state) {
if (state.tokStack && state.tokStack.length > 0 &&
!--state.tokStack[state.tokStack.length - 1]) {
- state.tokenize = stringWithEscapes(state.tokStack[state.tokStack.length - 2]);
+ state.tokenize = phpString(state.tokStack[state.tokStack.length - 2]);
}
return false;
}
diff --git a/public/vendor/codemirror/mode/pig/pig.js b/public/vendor/codemirror/mode/pig/pig.js
index c74b2cc8..5b567272 100755
--- a/public/vendor/codemirror/mode/pig/pig.js
+++ b/public/vendor/codemirror/mode/pig/pig.js
@@ -30,12 +30,6 @@ CodeMirror.defineMode("pig", function(_config, parserConfig) {
return f(stream, state);
}
- var type;
- function ret(tp, style) {
- type = tp;
- return style;
- }
-
function tokenComment(stream, state) {
var isEnd = false;
var ch;
@@ -46,7 +40,7 @@ CodeMirror.defineMode("pig", function(_config, parserConfig) {
}
isEnd = (ch == "*");
}
- return ret("comment", "comment");
+ return "comment";
}
function tokenString(quote) {
@@ -60,10 +54,11 @@ CodeMirror.defineMode("pig", function(_config, parserConfig) {
}
if (end || !(escaped || multiLineStrings))
state.tokenize = tokenBase;
- return ret("string", "error");
+ return "error";
};
}
+
function tokenBase(stream, state) {
var ch = stream.next();
@@ -72,11 +67,11 @@ CodeMirror.defineMode("pig", function(_config, parserConfig) {
return chain(stream, state, tokenString(ch));
// is it one of the special chars
else if(/[\[\]{}\(\),;\.]/.test(ch))
- return ret(ch);
+ return null;
// is it a number?
else if(/\d/.test(ch)) {
stream.eatWhile(/[\w\.]/);
- return ret("number", "number");
+ return "number";
}
// multi line comment or operator
else if (ch == "/") {
@@ -85,47 +80,42 @@ CodeMirror.defineMode("pig", function(_config, parserConfig) {
}
else {
stream.eatWhile(isOperatorChar);
- return ret("operator", "operator");
+ return "operator";
}
}
// single line comment or operator
else if (ch=="-") {
if(stream.eat("-")){
stream.skipToEnd();
- return ret("comment", "comment");
+ return "comment";
}
else {
stream.eatWhile(isOperatorChar);
- return ret("operator", "operator");
+ return "operator";
}
}
// is it an operator
else if (isOperatorChar.test(ch)) {
stream.eatWhile(isOperatorChar);
- return ret("operator", "operator");
+ return "operator";
}
else {
// get the while word
stream.eatWhile(/[\w\$_]/);
// is it one of the listed keywords?
if (keywords && keywords.propertyIsEnumerable(stream.current().toUpperCase())) {
- if (stream.eat(")") || stream.eat(".")) {
- //keywords can be used as variables like flatten(group), group.$0 etc..
- }
- else {
- return ("keyword", "keyword");
- }
+ //keywords can be used as variables like flatten(group), group.$0 etc..
+ if (!stream.eat(")") && !stream.eat("."))
+ return "keyword";
}
// is it one of the builtin functions?
if (builtins && builtins.propertyIsEnumerable(stream.current().toUpperCase()))
- {
- return ("keyword", "variable-2");
- }
+ return "variable-2";
// is it one of the listed types?
if (types && types.propertyIsEnumerable(stream.current().toUpperCase()))
- return ("keyword", "variable-3");
+ return "variable-3";
// default is a 'variable'
- return ret("variable", "pig-word");
+ return "variable";
}
}
diff --git a/public/vendor/codemirror/mode/python/python.js b/public/vendor/codemirror/mode/python/python.js
index cdb58bbb..e5a09719 100755
--- a/public/vendor/codemirror/mode/python/python.js
+++ b/public/vendor/codemirror/mode/python/python.js
@@ -37,7 +37,7 @@
"unichr", "unicode", "xrange", "False", "True", "None"],
keywords: ["exec", "print"]};
var py3 = {builtins: ["ascii", "bytes", "exec", "print"],
- keywords: ["nonlocal", "False", "True", "None"]};
+ keywords: ["nonlocal", "False", "True", "None", "async", "await"]};
CodeMirror.registerHelper("hintWords", "python", commonKeywords.concat(commonBuiltins));
diff --git a/public/vendor/codemirror/mode/sql/sql.js b/public/vendor/codemirror/mode/sql/sql.js
index fb1c6cb5..a9082771 100755
--- a/public/vendor/codemirror/mode/sql/sql.js
+++ b/public/vendor/codemirror/mode/sql/sql.js
@@ -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 having in insert into is join like not on or order select set table union update values where ";
+ 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 ";
// turn a space-separated list into an array
function set(str) {
@@ -293,7 +293,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
CodeMirror.defineMIME("text/x-mysql", {
name: "sql",
client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),
- keywords: set(sqlKeywords + "accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group groupby_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),
+ keywords: set(sqlKeywords + "accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),
builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),
atoms: set("false true null unknown"),
operatorChars: /^[*+\-%<>!=&|^]/,
diff --git a/public/vendor/codemirror/mode/swift/index.html b/public/vendor/codemirror/mode/swift/index.html
new file mode 100755
index 00000000..2649dc37
--- /dev/null
+++ b/public/vendor/codemirror/mode/swift/index.html
@@ -0,0 +1,88 @@
+
+
+CodeMirror: Swift mode
+
+
+
+
+
+
+
+
+
+
+
+Swift mode
+
+
+
+
+ A simple mode for Swift
+
+ MIME types defined: text/x-swift
(Swift code)
+
diff --git a/public/vendor/codemirror/mode/swift/swift.js b/public/vendor/codemirror/mode/swift/swift.js
new file mode 100755
index 00000000..cf784fef
--- /dev/null
+++ b/public/vendor/codemirror/mode/swift/swift.js
@@ -0,0 +1,203 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+// Swift mode created by Michael Kaminsky https://github.com/mkaminsky11
+
+(function(mod) {
+ if (typeof exports == "object" && typeof module == "object")
+ mod(require("../../lib/codemirror"))
+ else if (typeof define == "function" && define.amd)
+ define(["../../lib/codemirror"], mod)
+ else
+ mod(CodeMirror)
+})(function(CodeMirror) {
+ "use strict"
+
+ function trim(str) { return /^\s*(.*?)\s*$/.exec(str)[1] }
+
+ var separators = [" ","\\\+","\\\-","\\\(","\\\)","\\\*","/",":","\\\?","\\\<","\\\>"," ","\\\."]
+ var tokens = new RegExp(separators.join("|"),"g")
+
+ function getWord(string, pos) {
+ var index = -1, count = 1
+ var words = string.split(tokens)
+ for (var i = 0; i < words.length; i++) {
+ for(var j = 1; j <= words[i].length; j++) {
+ if (count==pos) index = i
+ count++
+ }
+ count++
+ }
+ var ret = ["", ""]
+ if (pos == 0) {
+ ret[1] = words[0]
+ ret[0] = null
+ } else {
+ ret[1] = words[index]
+ ret[0] = words[index-1]
+ }
+ return ret
+ }
+
+ CodeMirror.defineMode("swift", function() {
+ var keywords=["var","let","class","deinit","enum","extension","func","import","init","let","protocol","static","struct","subscript","typealias","var","as","dynamicType","is","new","super","self","Self","Type","__COLUMN__","__FILE__","__FUNCTION__","__LINE__","break","case","continue","default","do","else","fallthrough","if","in","for","return","switch","where","while","associativity","didSet","get","infix","inout","left","mutating","none","nonmutating","operator","override","postfix","precedence","prefix","right","set","unowned","unowned(safe)","unowned(unsafe)","weak","willSet"]
+ var commonConstants=["Infinity","NaN","undefined","null","true","false","on","off","yes","no","nil","null","this","super"]
+ var types=["String","bool","int","string","double","Double","Int","Float","float","public","private","extension"]
+ var numbers=["0","1","2","3","4","5","6","7","8","9"]
+ var operators=["+","-","/","*","%","=","|","&","<",">"]
+ var punc=[";",",",".","(",")","{","}","[","]"]
+ var delimiters=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/
+ var identifiers=/^[_A-Za-z$][_A-Za-z$0-9]*/
+ var properties=/^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/
+ var regexPrefixes=/^(\/{3}|\/)/
+
+ return {
+ startState: function() {
+ return {
+ prev: false,
+ string: false,
+ escape: false,
+ inner: false,
+ comment: false,
+ num_left: 0,
+ num_right: 0,
+ doubleString: false,
+ singleString: false
+ }
+ },
+ token: function(stream, state) {
+ if (stream.eatSpace()) return null
+
+ var ch = stream.next()
+ if (state.string) {
+ if (state.escape) {
+ state.escape = false
+ return "string"
+ } else {
+ if ((ch == "\"" && (state.doubleString && !state.singleString) ||
+ (ch == "'" && (!state.doubleString && state.singleString))) &&
+ !state.escape) {
+ state.string = false
+ state.doubleString = false
+ state.singleString = false
+ return "string"
+ } else if (ch == "\\" && stream.peek() == "(") {
+ state.inner = true
+ state.string = false
+ return "keyword"
+ } else if (ch == "\\" && stream.peek() != "(") {
+ state.escape = true
+ state.string = true
+ return "string"
+ } else {
+ return "string"
+ }
+ }
+ } else if (state.comment) {
+ if (ch == "*" && stream.peek() == "/") {
+ state.prev = "*"
+ return "comment"
+ } else if (ch == "/" && state.prev == "*") {
+ state.prev = false
+ state.comment = false
+ return "comment"
+ }
+ return "comment"
+ } else {
+ if (ch == "/") {
+ if (stream.peek() == "/") {
+ stream.skipToEnd()
+ return "comment"
+ }
+ if (stream.peek() == "*") {
+ state.comment = true
+ return "comment"
+ }
+ }
+ if (ch == "(" && state.inner) {
+ state.num_left++
+ return null
+ }
+ if (ch == ")" && state.inner) {
+ state.num_right++
+ if (state.num_left == state.num_right) {
+ state.inner=false
+ state.string=true
+ }
+ return null
+ }
+
+ var ret = getWord(stream.string, stream.pos)
+ var the_word = ret[1]
+ var prev_word = ret[0]
+
+ if (operators.indexOf(ch + "") > -1) return "operator"
+ if (punc.indexOf(ch) > -1) return "punctuation"
+
+ if (typeof the_word != "undefined") {
+ the_word = trim(the_word)
+ if (typeof prev_word != "undefined") prev_word = trim(prev_word)
+ if (the_word.charAt(0) == "#") return null
+
+ if (types.indexOf(the_word) > -1) return "def"
+ if (commonConstants.indexOf(the_word) > -1) return "atom"
+ if (numbers.indexOf(the_word) > -1) return "number"
+
+ if ((numbers.indexOf(the_word.charAt(0) + "") > -1 ||
+ operators.indexOf(the_word.charAt(0) + "") > -1) &&
+ numbers.indexOf(ch) > -1) {
+ return "number"
+ }
+
+ if (keywords.indexOf(the_word) > -1 ||
+ keywords.indexOf(the_word.split(tokens)[0]) > -1)
+ return "keyword"
+ if (keywords.indexOf(prev_word) > -1) return "def"
+ }
+ if (ch == '"' && !state.doubleString) {
+ state.string = true
+ state.doubleString = true
+ return "string"
+ }
+ if (ch == "'" && !state.singleString) {
+ state.string = true
+ state.singleString = true
+ return "string"
+ }
+ if (ch == "(" && state.inner)
+ state.num_left++
+ if (ch == ")" && state.inner) {
+ state.num_right++
+ if (state.num_left == state.num_right) {
+ state.inner = false
+ state.string = true
+ }
+ return null
+ }
+ if (stream.match(/^-?[0-9\.]/, false)) {
+ if (stream.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i) ||
+ stream.match(/^-?\d+\.\d*/) ||
+ stream.match(/^-?\.\d+/)) {
+ if (stream.peek() == ".") stream.backUp(1)
+ return "number"
+ }
+ if (stream.match(/^-?0x[0-9a-f]+/i) ||
+ stream.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/) ||
+ stream.match(/^-?0(?![\dx])/i))
+ return "number"
+ }
+ if (stream.match(regexPrefixes)) {
+ if (stream.current()!="/" || stream.match(/^.*\//,false)) return "string"
+ else stream.backUp(1)
+ }
+ if (stream.match(delimiters)) return "punctuation"
+ if (stream.match(identifiers)) return "variable"
+ if (stream.match(properties)) return "property"
+ return "variable"
+ }
+ }
+ }
+ })
+
+ CodeMirror.defineMIME("text/x-swift","swift")
+})
diff --git a/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js b/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js
index 88c9768a..1df01647 100755
--- a/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js
+++ b/public/vendor/codemirror/mode/tiddlywiki/tiddlywiki.js
@@ -71,16 +71,6 @@ CodeMirror.defineMode("tiddlywiki", function () {
return f(stream, state);
}
- // Used as scratch variables to communicate multiple values without
- // consing up tons of objects.
- var type, content;
-
- function ret(tp, style, cont) {
- type = tp;
- content = cont;
- return style;
- }
-
function jsTokenBase(stream, state) {
var sol = stream.sol(), ch;
@@ -95,16 +85,16 @@ CodeMirror.defineMode("tiddlywiki", function () {
return chain(stream, state, twTokenCode);
}
if (stream.match(reBlockQuote)) {
- return ret('quote', 'quote');
+ return 'quote';
}
if (stream.match(reWikiCommentStart) || stream.match(reWikiCommentStop)) {
- return ret('code', 'comment');
+ return 'comment';
}
if (stream.match(reJsCodeStart) || stream.match(reJsCodeStop) || stream.match(reXmlCodeStart) || stream.match(reXmlCodeStop)) {
- return ret('code', 'comment');
+ return 'comment';
}
if (stream.match(reHR)) {
- return ret('hr', 'hr');
+ return 'hr';
}
} // sol
ch = stream.next();
@@ -112,30 +102,30 @@ CodeMirror.defineMode("tiddlywiki", function () {
if (sol && /[\/\*!#;:>|]/.test(ch)) {
if (ch == "!") { // tw header
stream.skipToEnd();
- return ret("header", "header");
+ return "header";
}
if (ch == "*") { // tw list
stream.eatWhile('*');
- return ret("list", "comment");
+ return "comment";
}
if (ch == "#") { // tw numbered list
stream.eatWhile('#');
- return ret("list", "comment");
+ return "comment";
}
if (ch == ";") { // definition list, term
stream.eatWhile(';');
- return ret("list", "comment");
+ return "comment";
}
if (ch == ":") { // definition list, description
stream.eatWhile(':');
- return ret("list", "comment");
+ return "comment";
}
if (ch == ">") { // single line quote
stream.eatWhile(">");
- return ret("quote", "quote");
+ return "quote";
}
if (ch == '|') {
- return ret('table', 'header');
+ return 'header';
}
}
@@ -146,29 +136,29 @@ CodeMirror.defineMode("tiddlywiki", function () {
// 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 ret("link", "link");
+ return "link";
}
}
// just a little string indicator, don't want to have the whole string covered
if (ch == '"') {
- return ret('string', 'string');
+ return 'string';
}
if (ch == '~') { // _no_ CamelCase indicator should be bold
- return ret('text', 'brace');
+ return 'brace';
}
if (/[\[\]]/.test(ch)) { // check for [[..]]
if (stream.peek() == ch) {
stream.next();
- return ret('brace', 'brace');
+ return 'brace';
}
}
if (ch == "@") { // check for space link. TODO fix @@...@@ highlighting
stream.eatWhile(isSpaceName);
- return ret("link", "link");
+ return "link";
}
if (/\d/.test(ch)) { // numbers
stream.eatWhile(/\d/);
- return ret("number", "number");
+ return "number";
}
if (ch == "/") { // tw invisible comment
if (stream.eat("%")) {
@@ -191,7 +181,7 @@ CodeMirror.defineMode("tiddlywiki", function () {
return chain(stream, state, twTokenStrike);
// mdash
if (stream.peek() == ' ')
- return ret('text', 'brace');
+ return 'brace';
}
}
if (ch == "'") { // tw bold
@@ -205,7 +195,7 @@ CodeMirror.defineMode("tiddlywiki", function () {
}
}
else {
- return ret(ch);
+ return null;
}
// core macro handling
@@ -213,8 +203,7 @@ CodeMirror.defineMode("tiddlywiki", function () {
var word = stream.current(),
known = textwords.propertyIsEnumerable(word) && textwords[word];
- return known ? ret(known.type, known.style, word) : ret("text", null, word);
-
+ return known ? known.style : null;
} // jsTokenBase()
// tw invisible comment
@@ -228,7 +217,7 @@ CodeMirror.defineMode("tiddlywiki", function () {
}
maybeEnd = (ch == "%");
}
- return ret("comment", "comment");
+ return "comment";
}
// tw strong / bold
@@ -242,29 +231,29 @@ CodeMirror.defineMode("tiddlywiki", function () {
}
maybeEnd = (ch == "'");
}
- return ret("text", "strong");
+ return "strong";
}
// tw code
function twTokenCode(stream, state) {
- var ch, sb = state.block;
+ var sb = state.block;
if (sb && stream.current()) {
- return ret("code", "comment");
+ return "comment";
}
if (!sb && stream.match(reUntilCodeStop)) {
state.tokenize = jsTokenBase;
- return ret("code", "comment");
+ return "comment";
}
if (sb && stream.sol() && stream.match(reCodeBlockStop)) {
state.tokenize = jsTokenBase;
- return ret("code", "comment");
+ return "comment";
}
- ch = stream.next();
- return (sb) ? ret("code", "comment") : ret("code", "comment");
+ stream.next();
+ return "comment";
}
// tw em / italic
@@ -278,7 +267,7 @@ CodeMirror.defineMode("tiddlywiki", function () {
}
maybeEnd = (ch == "/");
}
- return ret("text", "em");
+ return "em";
}
// tw underlined text
@@ -292,7 +281,7 @@ CodeMirror.defineMode("tiddlywiki", function () {
}
maybeEnd = (ch == "_");
}
- return ret("text", "underlined");
+ return "underlined";
}
// tw strike through text looks ugly
@@ -307,7 +296,7 @@ CodeMirror.defineMode("tiddlywiki", function () {
}
maybeEnd = (ch == "-");
}
- return ret("text", "strikethrough");
+ return "strikethrough";
}
// macro
@@ -315,19 +304,19 @@ CodeMirror.defineMode("tiddlywiki", function () {
var ch, word, known;
if (stream.current() == '<<') {
- return ret('brace', 'macro');
+ return 'macro';
}
ch = stream.next();
if (!ch) {
state.tokenize = jsTokenBase;
- return ret(ch);
+ return null;
}
if (ch == ">") {
if (stream.peek() == '>') {
stream.next();
state.tokenize = jsTokenBase;
- return ret("brace", "macro");
+ return "macro";
}
}
@@ -336,10 +325,10 @@ CodeMirror.defineMode("tiddlywiki", function () {
known = keywords.propertyIsEnumerable(word) && keywords[word];
if (known) {
- return ret(known.type, known.style, word);
+ return known.style, word;
}
else {
- return ret("macro", null, word);
+ return null, word;
}
}
diff --git a/public/vendor/codemirror/mode/tiki/tiki.js b/public/vendor/codemirror/mode/tiki/tiki.js
index c90aac9e..5e05b1ff 100755
--- a/public/vendor/codemirror/mode/tiki/tiki.js
+++ b/public/vendor/codemirror/mode/tiki/tiki.js
@@ -52,35 +52,27 @@ CodeMirror.defineMode('tiki', function(config) {
case "{": //plugin
stream.eat("/");
stream.eatSpace();
- var tagName = "";
- var c;
- while ((c = stream.eat(/[^\s\u00a0=\"\'\/?(}]/))) tagName += c;
+ stream.eatWhile(/[^\s\u00a0=\"\'\/?(}]/);
state.tokenize = inPlugin;
return "tag";
- break;
case "_": //bold
- if (stream.eat("_")) {
+ if (stream.eat("_"))
return chain(inBlock("strong", "__", inText));
- }
break;
case "'": //italics
- if (stream.eat("'")) {
- // Italic text
+ if (stream.eat("'"))
return chain(inBlock("em", "''", inText));
- }
break;
case "(":// Wiki Link
- if (stream.eat("(")) {
+ if (stream.eat("("))
return chain(inBlock("variable-2", "))", inText));
- }
break;
case "[":// Weblink
return chain(inBlock("variable-3", "]", inText));
break;
case "|": //table
- if (stream.eat("|")) {
+ if (stream.eat("|"))
return chain(inBlock("comment", "||"));
- }
break;
case "-":
if (stream.eat("=")) {//titleBar
@@ -90,22 +82,19 @@ CodeMirror.defineMode('tiki', function(config) {
}
break;
case "=": //underline
- if (stream.match("==")) {
+ if (stream.match("=="))
return chain(inBlock("tw-underline", "===", inText));
- }
break;
case ":":
- if (stream.eat(":")) {
+ if (stream.eat(":"))
return chain(inBlock("comment", "::"));
- }
break;
case "^": //box
return chain(inBlock("tw-box", "^"));
break;
case "~": //np
- if (stream.match("np~")) {
+ if (stream.match("np~"))
return chain(inBlock("meta", "~/np~"));
- }
break;
}
diff --git a/public/vendor/codemirror/mode/ttcn-cfg/index.html b/public/vendor/codemirror/mode/ttcn-cfg/index.html
new file mode 100755
index 00000000..4a4cd457
--- /dev/null
+++ b/public/vendor/codemirror/mode/ttcn-cfg/index.html
@@ -0,0 +1,115 @@
+
+
+CodeMirror: TTCN-CFG mode
+
+
+
+
+
+
+
+
+
+ TTCN-CFG example
+
+
+
+
+
+
+ Language: Testing and Test Control Notation -
+ Configuration files
+ (TTCN-CFG)
+
+ MIME types defined: text/x-ttcn-cfg
.
+
+
+ The development of this mode has been sponsored by Ericsson
+ .
+ Coded by Asmelash Tsegay Gebretsadkan
+
+
diff --git a/public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js b/public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js
new file mode 100755
index 00000000..e1080511
--- /dev/null
+++ b/public/vendor/codemirror/mode/ttcn-cfg/ttcn-cfg.js
@@ -0,0 +1,214 @@
+// 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("ttcn-cfg", function(config, parserConfig) {
+ var indentUnit = config.indentUnit,
+ keywords = parserConfig.keywords || {},
+ fileNCtrlMaskOptions = parserConfig.fileNCtrlMaskOptions || {},
+ externalCommands = parserConfig.externalCommands || {},
+ multiLineStrings = parserConfig.multiLineStrings,
+ indentStatements = parserConfig.indentStatements !== false;
+ var isOperatorChar = /[\|]/;
+ var curPunc;
+
+ function tokenBase(stream, state) {
+ var ch = stream.next();
+ if (ch == '"' || ch == "'") {
+ state.tokenize = tokenString(ch);
+ return state.tokenize(stream, state);
+ }
+ if (/[:=]/.test(ch)) {
+ curPunc = ch;
+ return "punctuation";
+ }
+ if (ch == "#"){
+ stream.skipToEnd();
+ return "comment";
+ }
+ if (/\d/.test(ch)) {
+ stream.eatWhile(/[\w\.]/);
+ return "number";
+ }
+ if (isOperatorChar.test(ch)) {
+ stream.eatWhile(isOperatorChar);
+ return "operator";
+ }
+ if (ch == "["){
+ stream.eatWhile(/[\w_\]]/);
+ return "number sectionTitle";
+ }
+
+ stream.eatWhile(/[\w\$_]/);
+ var cur = stream.current();
+ if (keywords.propertyIsEnumerable(cur)) return "keyword";
+ if (fileNCtrlMaskOptions.propertyIsEnumerable(cur))
+ return "negative fileNCtrlMaskOptions";
+ if (externalCommands.propertyIsEnumerable(cur)) return "negative externalCommands";
+
+ return "variable";
+ }
+
+ function tokenString(quote) {
+ return function(stream, state) {
+ var escaped = false, next, end = false;
+ while ((next = stream.next()) != null) {
+ if (next == quote && !escaped){
+ var afterNext = stream.peek();
+ //look if the character if the quote is like the B in '10100010'B
+ if (afterNext){
+ afterNext = afterNext.toLowerCase();
+ if(afterNext == "b" || afterNext == "h" || afterNext == "o")
+ stream.next();
+ }
+ end = true; break;
+ }
+ escaped = !escaped && next == "\\";
+ }
+ if (end || !(escaped || multiLineStrings))
+ state.tokenize = null;
+ return "string";
+ };
+ }
+
+ 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) {
+ var indent = state.indented;
+ if (state.context && state.context.type == "statement")
+ 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;
+ }
+
+ //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;
+ curPunc = null;
+ var style = (state.tokenize || tokenBase)(stream, state);
+ if (style == "comment") return style;
+ if (ctx.align == null) ctx.align = true;
+
+ if ((curPunc == ";" || curPunc == ":" || curPunc == ",")
+ && ctx.type == "statement"){
+ popContext(state);
+ }
+ else if (curPunc == "{") pushContext(state, stream.column(), "}");
+ else if (curPunc == "[") pushContext(state, stream.column(), "]");
+ else if (curPunc == "(") pushContext(state, stream.column(), ")");
+ else if (curPunc == "}") {
+ while (ctx.type == "statement") ctx = popContext(state);
+ if (ctx.type == "}") ctx = popContext(state);
+ while (ctx.type == "statement") ctx = popContext(state);
+ }
+ else if (curPunc == ctx.type) popContext(state);
+ else if (indentStatements && (((ctx.type == "}" || ctx.type == "top")
+ && curPunc != ';') || (ctx.type == "statement"
+ && curPunc == "newstatement")))
+ pushContext(state, stream.column(), "statement");
+ state.startOfLine = false;
+ return style;
+ },
+
+ electricChars: "{}",
+ lineComment: "#",
+ fold: "brace"
+ };
+ });
+
+ function words(str) {
+ var obj = {}, words = str.split(" ");
+ for (var i = 0; i < words.length; ++i)
+ obj[words[i]] = true;
+ return obj;
+ }
+
+ CodeMirror.defineMIME("text/x-ttcn-cfg", {
+ name: "ttcn-cfg",
+ keywords: words("Yes No LogFile FileMask ConsoleMask AppendFile" +
+ " TimeStampFormat LogEventTypes SourceInfoFormat" +
+ " LogEntityName LogSourceInfo DiskFullAction" +
+ " LogFileNumber LogFileSize MatchingHints Detailed" +
+ " Compact SubCategories Stack Single None Seconds" +
+ " DateTime Time Stop Error Retry Delete TCPPort KillTimer" +
+ " NumHCs UnixSocketsEnabled LocalAddress"),
+ fileNCtrlMaskOptions: words("TTCN_EXECUTOR TTCN_ERROR TTCN_WARNING" +
+ " TTCN_PORTEVENT TTCN_TIMEROP TTCN_VERDICTOP" +
+ " TTCN_DEFAULTOP TTCN_TESTCASE TTCN_ACTION" +
+ " TTCN_USER TTCN_FUNCTION TTCN_STATISTICS" +
+ " TTCN_PARALLEL TTCN_MATCHING TTCN_DEBUG" +
+ " EXECUTOR ERROR WARNING PORTEVENT TIMEROP" +
+ " VERDICTOP DEFAULTOP TESTCASE ACTION USER" +
+ " FUNCTION STATISTICS PARALLEL MATCHING DEBUG" +
+ " LOG_ALL LOG_NOTHING ACTION_UNQUALIFIED" +
+ " DEBUG_ENCDEC DEBUG_TESTPORT" +
+ " DEBUG_UNQUALIFIED DEFAULTOP_ACTIVATE" +
+ " DEFAULTOP_DEACTIVATE DEFAULTOP_EXIT" +
+ " DEFAULTOP_UNQUALIFIED ERROR_UNQUALIFIED" +
+ " EXECUTOR_COMPONENT EXECUTOR_CONFIGDATA" +
+ " EXECUTOR_EXTCOMMAND EXECUTOR_LOGOPTIONS" +
+ " EXECUTOR_RUNTIME EXECUTOR_UNQUALIFIED" +
+ " FUNCTION_RND FUNCTION_UNQUALIFIED" +
+ " MATCHING_DONE MATCHING_MCSUCCESS" +
+ " MATCHING_MCUNSUCC MATCHING_MMSUCCESS" +
+ " MATCHING_MMUNSUCC MATCHING_PCSUCCESS" +
+ " MATCHING_PCUNSUCC MATCHING_PMSUCCESS" +
+ " MATCHING_PMUNSUCC MATCHING_PROBLEM" +
+ " MATCHING_TIMEOUT MATCHING_UNQUALIFIED" +
+ " PARALLEL_PORTCONN PARALLEL_PORTMAP" +
+ " PARALLEL_PTC PARALLEL_UNQUALIFIED" +
+ " PORTEVENT_DUALRECV PORTEVENT_DUALSEND" +
+ " PORTEVENT_MCRECV PORTEVENT_MCSEND" +
+ " PORTEVENT_MMRECV PORTEVENT_MMSEND" +
+ " PORTEVENT_MQUEUE PORTEVENT_PCIN" +
+ " PORTEVENT_PCOUT PORTEVENT_PMIN" +
+ " PORTEVENT_PMOUT PORTEVENT_PQUEUE" +
+ " PORTEVENT_STATE PORTEVENT_UNQUALIFIED" +
+ " STATISTICS_UNQUALIFIED STATISTICS_VERDICT" +
+ " TESTCASE_FINISH TESTCASE_START" +
+ " TESTCASE_UNQUALIFIED TIMEROP_GUARD" +
+ " TIMEROP_READ TIMEROP_START TIMEROP_STOP" +
+ " TIMEROP_TIMEOUT TIMEROP_UNQUALIFIED" +
+ " USER_UNQUALIFIED VERDICTOP_FINAL" +
+ " VERDICTOP_GETVERDICT VERDICTOP_SETVERDICT" +
+ " VERDICTOP_UNQUALIFIED WARNING_UNQUALIFIED"),
+ externalCommands: words("BeginControlPart EndControlPart BeginTestCase" +
+ " EndTestCase"),
+ multiLineStrings: true
+ });
+});
\ No newline at end of file
diff --git a/public/vendor/codemirror/mode/ttcn/index.html b/public/vendor/codemirror/mode/ttcn/index.html
new file mode 100755
index 00000000..f1ef8113
--- /dev/null
+++ b/public/vendor/codemirror/mode/ttcn/index.html
@@ -0,0 +1,118 @@
+
+
+CodeMirror: TTCN mode
+
+
+
+
+
+
+
+
+
+ TTCN example
+
+
+
+
+
+
+ Language: Testing and Test Control Notation
+ (TTCN)
+
+ MIME types defined: text/x-ttcn,
+ text/x-ttcn3, text/x-ttcnpp
.
+
+ The development of this mode has been sponsored by Ericsson
+ .
+ Coded by Asmelash Tsegay Gebretsadkan
+
+
diff --git a/public/vendor/codemirror/mode/ttcn/ttcn.js b/public/vendor/codemirror/mode/ttcn/ttcn.js
new file mode 100755
index 00000000..30518517
--- /dev/null
+++ b/public/vendor/codemirror/mode/ttcn/ttcn.js
@@ -0,0 +1,283 @@
+// 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("ttcn", function(config, parserConfig) {
+ var indentUnit = config.indentUnit,
+ keywords = parserConfig.keywords || {},
+ builtin = parserConfig.builtin || {},
+ timerOps = parserConfig.timerOps || {},
+ portOps = parserConfig.portOps || {},
+ configOps = parserConfig.configOps || {},
+ verdictOps = parserConfig.verdictOps || {},
+ sutOps = parserConfig.sutOps || {},
+ functionOps = parserConfig.functionOps || {},
+
+ verdictConsts = parserConfig.verdictConsts || {},
+ booleanConsts = parserConfig.booleanConsts || {},
+ otherConsts = parserConfig.otherConsts || {},
+
+ types = parserConfig.types || {},
+ visibilityModifiers = parserConfig.visibilityModifiers || {},
+ templateMatch = parserConfig.templateMatch || {},
+ multiLineStrings = parserConfig.multiLineStrings,
+ indentStatements = parserConfig.indentStatements !== false;
+ var isOperatorChar = /[+\-*&@=<>!\/]/;
+ var curPunc;
+
+ function tokenBase(stream, state) {
+ var ch = stream.next();
+
+ if (ch == '"' || ch == "'") {
+ state.tokenize = tokenString(ch);
+ return state.tokenize(stream, state);
+ }
+ if (/[\[\]{}\(\),;\\:\?\.]/.test(ch)) {
+ curPunc = ch;
+ return "punctuation";
+ }
+ if (ch == "#"){
+ stream.skipToEnd();
+ return "atom preprocessor";
+ }
+ if (ch == "%"){
+ stream.eatWhile(/\b/);
+ return "atom ttcn3Macros";
+ }
+ if (/\d/.test(ch)) {
+ stream.eatWhile(/[\w\.]/);
+ return "number";
+ }
+ if (ch == "/") {
+ if (stream.eat("*")) {
+ state.tokenize = tokenComment;
+ return tokenComment(stream, state);
+ }
+ if (stream.eat("/")) {
+ stream.skipToEnd();
+ return "comment";
+ }
+ }
+ if (isOperatorChar.test(ch)) {
+ if(ch == "@"){
+ if(stream.match("try") || stream.match("catch")
+ || stream.match("lazy")){
+ return "keyword";
+ }
+ }
+ stream.eatWhile(isOperatorChar);
+ return "operator";
+ }
+ stream.eatWhile(/[\w\$_\xa1-\uffff]/);
+ var cur = stream.current();
+
+ if (keywords.propertyIsEnumerable(cur)) return "keyword";
+ if (builtin.propertyIsEnumerable(cur)) return "builtin";
+
+ if (timerOps.propertyIsEnumerable(cur)) return "def timerOps";
+ if (configOps.propertyIsEnumerable(cur)) return "def configOps";
+ if (verdictOps.propertyIsEnumerable(cur)) return "def verdictOps";
+ if (portOps.propertyIsEnumerable(cur)) return "def portOps";
+ if (sutOps.propertyIsEnumerable(cur)) return "def sutOps";
+ if (functionOps.propertyIsEnumerable(cur)) return "def functionOps";
+
+ if (verdictConsts.propertyIsEnumerable(cur)) return "string verdictConsts";
+ if (booleanConsts.propertyIsEnumerable(cur)) return "string booleanConsts";
+ if (otherConsts.propertyIsEnumerable(cur)) return "string otherConsts";
+
+ if (types.propertyIsEnumerable(cur)) return "builtin types";
+ if (visibilityModifiers.propertyIsEnumerable(cur))
+ return "builtin visibilityModifiers";
+ if (templateMatch.propertyIsEnumerable(cur)) return "atom templateMatch";
+
+ return "variable";
+ }
+
+ function tokenString(quote) {
+ return function(stream, state) {
+ var escaped = false, next, end = false;
+ while ((next = stream.next()) != null) {
+ if (next == quote && !escaped){
+ var afterQuote = stream.peek();
+ //look if the character after the quote is like the B in '10100010'B
+ if (afterQuote){
+ afterQuote = afterQuote.toLowerCase();
+ if(afterQuote == "b" || afterQuote == "h" || afterQuote == "o")
+ stream.next();
+ }
+ end = true; break;
+ }
+ escaped = !escaped && next == "\\";
+ }
+ if (end || !(escaped || multiLineStrings))
+ state.tokenize = null;
+ return "string";
+ };
+ }
+
+ function tokenComment(stream, state) {
+ var maybeEnd = false, ch;
+ while (ch = stream.next()) {
+ if (ch == "/" && maybeEnd) {
+ state.tokenize = null;
+ 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) {
+ var indent = state.indented;
+ if (state.context && state.context.type == "statement")
+ 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;
+ }
+
+ //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;
+ curPunc = null;
+ var style = (state.tokenize || tokenBase)(stream, state);
+ if (style == "comment") return style;
+ if (ctx.align == null) ctx.align = true;
+
+ if ((curPunc == ";" || curPunc == ":" || curPunc == ",")
+ && ctx.type == "statement"){
+ popContext(state);
+ }
+ else if (curPunc == "{") pushContext(state, stream.column(), "}");
+ else if (curPunc == "[") pushContext(state, stream.column(), "]");
+ else if (curPunc == "(") pushContext(state, stream.column(), ")");
+ else if (curPunc == "}") {
+ while (ctx.type == "statement") ctx = popContext(state);
+ if (ctx.type == "}") ctx = popContext(state);
+ while (ctx.type == "statement") ctx = popContext(state);
+ }
+ else if (curPunc == ctx.type) popContext(state);
+ else if (indentStatements &&
+ (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') ||
+ (ctx.type == "statement" && curPunc == "newstatement")))
+ pushContext(state, stream.column(), "statement");
+
+ state.startOfLine = false;
+
+ return style;
+ },
+
+ electricChars: "{}",
+ blockCommentStart: "/*",
+ blockCommentEnd: "*/",
+ lineComment: "//",
+ fold: "brace"
+ };
+ });
+
+ function words(str) {
+ var obj = {}, words = str.split(" ");
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
+ return obj;
+ }
+
+ function def(mimes, mode) {
+ if (typeof mimes == "string") mimes = [mimes];
+ var words = [];
+ function add(obj) {
+ if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop))
+ words.push(prop);
+ }
+
+ add(mode.keywords);
+ add(mode.builtin);
+ add(mode.timerOps);
+ add(mode.portOps);
+
+ if (words.length) {
+ mode.helperType = mimes[0];
+ CodeMirror.registerHelper("hintWords", mimes[0], words);
+ }
+
+ for (var i = 0; i < mimes.length; ++i)
+ CodeMirror.defineMIME(mimes[i], mode);
+ }
+
+ def(["text/x-ttcn", "text/x-ttcn3", "text/x-ttcnpp"], {
+ name: "ttcn",
+ keywords: words("activate address alive all alt altstep and and4b any" +
+ " break case component const continue control deactivate" +
+ " display do else encode enumerated except exception" +
+ " execute extends extension external for from function" +
+ " goto group if import in infinity inout interleave" +
+ " label language length log match message mixed mod" +
+ " modifies module modulepar mtc noblock not not4b nowait" +
+ " of on optional or or4b out override param pattern port" +
+ " procedure record recursive rem repeat return runs select" +
+ " self sender set signature system template testcase to" +
+ " type union value valueof var variant while with xor xor4b"),
+ builtin: words("bit2hex bit2int bit2oct bit2str char2int char2oct encvalue" +
+ " decomp decvalue float2int float2str hex2bit hex2int" +
+ " hex2oct hex2str int2bit int2char int2float int2hex" +
+ " int2oct int2str int2unichar isbound ischosen ispresent" +
+ " isvalue lengthof log2str oct2bit oct2char oct2hex oct2int" +
+ " oct2str regexp replace rnd sizeof str2bit str2float" +
+ " str2hex str2int str2oct substr unichar2int unichar2char" +
+ " enum2int"),
+ types: words("anytype bitstring boolean char charstring default float" +
+ " hexstring integer objid octetstring universal verdicttype timer"),
+ timerOps: words("read running start stop timeout"),
+ portOps: words("call catch check clear getcall getreply halt raise receive" +
+ " reply send trigger"),
+ configOps: words("create connect disconnect done kill killed map unmap"),
+ verdictOps: words("getverdict setverdict"),
+ sutOps: words("action"),
+ functionOps: words("apply derefers refers"),
+
+ verdictConsts: words("error fail inconc none pass"),
+ booleanConsts: words("true false"),
+ otherConsts: words("null NULL omit"),
+
+ visibilityModifiers: words("private public friend"),
+ templateMatch: words("complement ifpresent subset superset permutation"),
+ multiLineStrings: true
+ });
+});
diff --git a/public/vendor/codemirror/mode/twig/index.html b/public/vendor/codemirror/mode/twig/index.html
new file mode 100755
index 00000000..02493a5c
--- /dev/null
+++ b/public/vendor/codemirror/mode/twig/index.html
@@ -0,0 +1,45 @@
+
+
+CodeMirror: Twig mode
+
+
+
+
+
+
+
+
+
+
+Twig mode
+
+
+
diff --git a/public/vendor/codemirror/mode/twig/twig.js b/public/vendor/codemirror/mode/twig/twig.js
new file mode 100755
index 00000000..aa676dc4
--- /dev/null
+++ b/public/vendor/codemirror/mode/twig/twig.js
@@ -0,0 +1,132 @@
+// 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("twig", 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 = /^[:\[\(\{]/,
+ atom = ["true", "false", "null", "empty", "defined", "divisibleby", "divisible by", "even", "odd", "iterable", "sameas", "same as"],
+ number = /^(\d[+\-\*\/])?\d+(\.\d+)?/;
+
+ keywords = new RegExp("((" + keywords.join(")|(") + "))\\b");
+ atom = new RegExp("((" + atom.join(")|(") + "))\\b");
+
+ function tokenBase (stream, state) {
+ var ch = stream.peek();
+
+ //Comment
+ if (state.incomment) {
+ if (!stream.skipTo("#}")) {
+ stream.skipToEnd();
+ } else {
+ stream.eatWhile(/\#|}/);
+ state.incomment = false;
+ }
+ return "comment";
+ //Tag
+ } else if (state.intag) {
+ //After operator
+ if (state.operator) {
+ state.operator = false;
+ if (stream.match(atom)) {
+ return "atom";
+ }
+ if (stream.match(number)) {
+ return "number";
+ }
+ }
+ //After sign
+ if (state.sign) {
+ state.sign = false;
+ if (stream.match(atom)) {
+ return "atom";
+ }
+ if (stream.match(number)) {
+ return "number";
+ }
+ }
+
+ if (state.instring) {
+ if (ch == state.instring) {
+ state.instring = false;
+ }
+ stream.next();
+ return "string";
+ } else if (ch == "'" || ch == '"') {
+ state.instring = ch;
+ stream.next();
+ return "string";
+ } else if (stream.match(state.intag + "}") || stream.eat("-") && stream.match(state.intag + "}")) {
+ state.intag = false;
+ return "tag";
+ } else if (stream.match(operator)) {
+ state.operator = true;
+ return "operator";
+ } else if (stream.match(sign)) {
+ state.sign = true;
+ } else {
+ if (stream.eat(" ") || stream.sol()) {
+ if (stream.match(keywords)) {
+ return "keyword";
+ }
+ if (stream.match(atom)) {
+ return "atom";
+ }
+ if (stream.match(number)) {
+ return "number";
+ }
+ if (stream.sol()) {
+ stream.next();
+ }
+ } else {
+ stream.next();
+ }
+
+ }
+ return "variable";
+ } else if (stream.eat("{")) {
+ if (ch = stream.eat("#")) {
+ state.incomment = true;
+ if (!stream.skipTo("#}")) {
+ stream.skipToEnd();
+ } else {
+ stream.eatWhile(/\#|}/);
+ state.incomment = false;
+ }
+ return "comment";
+ //Open tag
+ } else if (ch = stream.eat(/\{|%/)) {
+ //Cache close tag
+ state.intag = ch;
+ if (ch == "{") {
+ state.intag = "}";
+ }
+ stream.eat("-");
+ return "tag";
+ }
+ }
+ stream.next();
+ };
+
+ return {
+ startState: function () {
+ return {};
+ },
+ token: function (stream, state) {
+ return tokenBase(stream, state);
+ }
+ };
+ });
+
+ CodeMirror.defineMIME("text/x-twig", "twig");
+});
diff --git a/public/vendor/codemirror/mode/vb/vb.js b/public/vendor/codemirror/mode/vb/vb.js
index 665248f4..d78f91f7 100755
--- a/public/vendor/codemirror/mode/vb/vb.js
+++ b/public/vendor/codemirror/mode/vb/vb.js
@@ -264,8 +264,9 @@ CodeMirror.defineMode("vb", function(conf, parserConf) {
if (trueText.match(closing) || trueText.match(doubleClosing) || trueText.match(middle)) return conf.indentUnit*(state.currentIndent-1);
if(state.currentIndent < 0) return 0;
return state.currentIndent * conf.indentUnit;
- }
+ },
+ lineComment: "'"
};
return external;
});
diff --git a/public/vendor/codemirror/mode/xquery/xquery.js b/public/vendor/codemirror/mode/xquery/xquery.js
index c8f3d90a..c642ee58 100755
--- a/public/vendor/codemirror/mode/xquery/xquery.js
+++ b/public/vendor/codemirror/mode/xquery/xquery.js
@@ -68,15 +68,6 @@ CodeMirror.defineMode("xquery", function() {
return kwObj;
}();
- // Used as scratch variables to communicate multiple values without
- // consing up tons of objects.
- var type, content;
-
- function ret(tp, style, cont) {
- type = tp; content = cont;
- return style;
- }
-
function chain(stream, state, f) {
state.tokenize = f;
return f(stream, state);
@@ -95,7 +86,7 @@ CodeMirror.defineMode("xquery", function() {
if(stream.match("![CDATA", false)) {
state.tokenize = tokenCDATA;
- return ret("tag", "tag");
+ return "tag";
}
if(stream.match("?", false)) {
@@ -112,28 +103,28 @@ CodeMirror.defineMode("xquery", function() {
// start code block
else if(ch == "{") {
pushStateStack(state,{ type: "codeblock"});
- return ret("", null);
+ return null;
}
// end code block
else if(ch == "}") {
popStateStack(state);
- return ret("", null);
+ return null;
}
// if we're in an XML block
else if(isInXmlBlock(state)) {
if(ch == ">")
- return ret("tag", "tag");
+ return "tag";
else if(ch == "/" && stream.eat(">")) {
popStateStack(state);
- return ret("tag", "tag");
+ return "tag";
}
else
- return ret("word", "variable");
+ return "variable";
}
// if a number
else if (/\d/.test(ch)) {
stream.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/);
- return ret("number", "atom");
+ return "atom";
}
// comment start
else if (ch === "(" && stream.eat(":")) {
@@ -149,27 +140,27 @@ CodeMirror.defineMode("xquery", function() {
}
// assignment
else if(ch ===":" && stream.eat("=")) {
- return ret("operator", "keyword");
+ return "keyword";
}
// open paren
else if(ch === "(") {
pushStateStack(state, { type: "paren"});
- return ret("", null);
+ return null;
}
// close paren
else if(ch === ")") {
popStateStack(state);
- return ret("", null);
+ return null;
}
// open paren
else if(ch === "[") {
pushStateStack(state, { type: "bracket"});
- return ret("", null);
+ return null;
}
// close paren
else if(ch === "]") {
popStateStack(state);
- return ret("", null);
+ return null;
}
else {
var known = keywords.propertyIsEnumerable(ch) && keywords[ch];
@@ -204,15 +195,14 @@ CodeMirror.defineMode("xquery", function() {
// if the previous word was element, attribute, axis specifier, this word should be the name of that
if(isInXmlConstructor(state)) {
popStateStack(state);
- return ret("word", "variable", word);
+ return "variable";
}
// as previously checked, if the word is element,attribute, axis specifier, call it an "xmlconstructor" and
// push the stack so we know to look for it on the next word
if(word == "element" || word == "attribute" || known.type == "axis_specifier") pushStateStack(state, {type: "xmlconstructor"});
// if the word is known, return the details of that else just call this a generic 'word'
- return known ? ret(known.type, known.style, word) :
- ret("word", "variable", word);
+ return known ? known.style : "variable";
}
}
@@ -235,7 +225,7 @@ CodeMirror.defineMode("xquery", function() {
maybeNested = (ch == "(");
}
- return ret("comment", "comment");
+ return "comment";
}
// tokenizer for string literals
@@ -247,7 +237,7 @@ CodeMirror.defineMode("xquery", function() {
if(isInString(state) && stream.current() == quote) {
popStateStack(state);
if(f) state.tokenize = f;
- return ret("string", "string");
+ return "string";
}
pushStateStack(state, { type: "string", name: quote, tokenize: tokenString(quote, f) });
@@ -255,7 +245,7 @@ CodeMirror.defineMode("xquery", function() {
// if we're in a string and in an XML block, allow an embedded code block
if(stream.match("{", false) && isInXmlAttributeBlock(state)) {
state.tokenize = tokenBase;
- return ret("string", "string");
+ return "string";
}
@@ -269,13 +259,13 @@ CodeMirror.defineMode("xquery", function() {
// if we're in a string and in an XML block, allow an embedded code block in an attribute
if(stream.match("{", false) && isInXmlAttributeBlock(state)) {
state.tokenize = tokenBase;
- return ret("string", "string");
+ return "string";
}
}
}
- return ret("string", "string");
+ return "string";
};
}
@@ -293,7 +283,7 @@ CodeMirror.defineMode("xquery", function() {
}
stream.eatWhile(isVariableChar);
state.tokenize = tokenBase;
- return ret("variable", "variable");
+ return "variable";
}
// tokenizer for XML tags
@@ -303,19 +293,19 @@ CodeMirror.defineMode("xquery", function() {
if(isclose && stream.eat(">")) {
popStateStack(state);
state.tokenize = tokenBase;
- return ret("tag", "tag");
+ return "tag";
}
// self closing tag without attributes?
if(!stream.eat("/"))
pushStateStack(state, { type: "tag", name: name, tokenize: tokenBase});
if(!stream.eat(">")) {
state.tokenize = tokenAttribute;
- return ret("tag", "tag");
+ return "tag";
}
else {
state.tokenize = tokenBase;
}
- return ret("tag", "tag");
+ return "tag";
};
}
@@ -326,14 +316,14 @@ CodeMirror.defineMode("xquery", function() {
if(ch == "/" && stream.eat(">")) {
if(isInXmlAttributeBlock(state)) popStateStack(state);
if(isInXmlBlock(state)) popStateStack(state);
- return ret("tag", "tag");
+ return "tag";
}
if(ch == ">") {
if(isInXmlAttributeBlock(state)) popStateStack(state);
- return ret("tag", "tag");
+ return "tag";
}
if(ch == "=")
- return ret("", null);
+ return null;
// quoted string
if (ch == '"' || ch == "'")
return chain(stream, state, tokenString(ch, tokenAttribute));
@@ -351,7 +341,7 @@ CodeMirror.defineMode("xquery", function() {
state.tokenize = tokenBase;
}
- return ret("attribute", "attribute");
+ return "attribute";
}
// handle comments, including nested
@@ -360,7 +350,7 @@ CodeMirror.defineMode("xquery", function() {
while (ch = stream.next()) {
if (ch == "-" && stream.match("->", true)) {
state.tokenize = tokenBase;
- return ret("comment", "comment");
+ return "comment";
}
}
}
@@ -372,7 +362,7 @@ CodeMirror.defineMode("xquery", function() {
while (ch = stream.next()) {
if (ch == "]" && stream.match("]", true)) {
state.tokenize = tokenBase;
- return ret("comment", "comment");
+ return "comment";
}
}
}
@@ -383,7 +373,7 @@ CodeMirror.defineMode("xquery", function() {
while (ch = stream.next()) {
if (ch == "?" && stream.match(">", true)) {
state.tokenize = tokenBase;
- return ret("comment", "comment meta");
+ return "comment meta";
}
}
}
--
cgit v1.2.3