diff --git a/gulliver/js/codemirror/.swp.php.html b/gulliver/js/codemirror/.swp.php.html
new file mode 100755
index 000000000..5d4db0a09
Binary files /dev/null and b/gulliver/js/codemirror/.swp.php.html differ
diff --git a/gulliver/js/codemirror/2/index.html b/gulliver/js/codemirror/2/index.html
new file mode 100755
index 000000000..74a858a1e
--- /dev/null
+++ b/gulliver/js/codemirror/2/index.html
@@ -0,0 +1,74 @@
+
+
+
+ CodeMirror 2
+
+
+
+
+
+
+
CodeMirror 2
+
This is a new project, aiming to create a CodeMirror-style
+ component without using an IFRAME.
+ The ACE editor proved
+ that this is viable, which motivated me to give it a shot. (Though I took a somewhat different
+ approach.)
+
No IE support so far, only tested with recent Chrome, Opera,
+ and Firefox builds. The JavaScript parser is the only one I've
+ ported over.
+
+
+
+
+
diff --git a/gulliver/js/codemirror/contrib/csharp/js/parsecsharp.js b/gulliver/js/codemirror/contrib/csharp/js/parsecsharp.js
new file mode 100755
index 000000000..214571199
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/csharp/js/parsecsharp.js
@@ -0,0 +1,329 @@
+/* Parse function for JavaScript. Makes use of the tokenizer from
+ * tokenizecsharp.js. Note that your parsers do not have to be
+ * this complicated -- if you don't want to recognize local variables,
+ * in many languages it is enough to just look for braces, semicolons,
+ * parentheses, etc, and know when you are inside a string or comment.
+ *
+ * See manual.html for more info about the parser interface.
+ */
+
+var JSParser = Editor.Parser = (function() {
+ // Token types that can be considered to be atoms.
+ var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true};
+ // Setting that can be used to have JSON data indent properly.
+ var json = false;
+ // Constructor for the lexical context objects.
+ function CSharpLexical(indented, column, type, align, prev, info) {
+ // indentation at start of this line
+ this.indented = indented;
+ // column at which this scope was opened
+ this.column = column;
+ // type of scope ('vardef', 'stat' (statement), 'form' (special form), '[', '{', or '(')
+ this.type = type;
+ // '[', '{', or '(' blocks that have any text after their opening
+ // character are said to be 'aligned' -- any lines below are
+ // indented all the way to the opening character.
+ if (align != null)
+ this.align = align;
+ // Parent scope, if any.
+ this.prev = prev;
+ this.info = info;
+ }
+
+ // CSharp indentation rules.
+ function indentCSharp(lexical) {
+ return function(firstChars) {
+ var firstChar = firstChars && firstChars.charAt(0), type = lexical.type;
+ var closing = firstChar == type;
+ if (type == "vardef")
+ return lexical.indented + 4;
+ else if (type == "form" && firstChar == "{")
+ return lexical.indented;
+ else if (type == "stat" || type == "form")
+ return lexical.indented + indentUnit;
+ else if (lexical.info == "switch" && !closing)
+ return lexical.indented + (/^(?:case|default)\b/.test(firstChars) ? indentUnit : 2 * indentUnit);
+ else if (lexical.align)
+ return lexical.column - (closing ? 1 : 0);
+ else
+ return lexical.indented + (closing ? 0 : indentUnit);
+ };
+ }
+
+ // The parser-iterator-producing function itself.
+ function parseCSharp(input, basecolumn) {
+ // Wrap the input in a token stream
+ var tokens = tokenizeCSharp(input);
+ // The parser state. cc is a stack of actions that have to be
+ // performed to finish the current statement. For example we might
+ // know that we still need to find a closing parenthesis and a
+ // semicolon. Actions at the end of the stack go first. It is
+ // initialized with an infinitely looping action that consumes
+ // whole statements.
+ var cc = [statements];
+ // The lexical scope, used mostly for indentation.
+ var lexical = new CSharpLexical((basecolumn || 0) - indentUnit, 0, "block", false);
+ // Current column, and the indentation at the start of the current
+ // line. Used to create lexical scope objects.
+ var column = 0;
+ var indented = 0;
+ // Variables which are used by the mark, cont, and pass functions
+ // below to communicate with the driver loop in the 'next'
+ // function.
+ var consume, marked;
+
+ // The iterator object.
+ var parser = {next: next, copy: copy};
+
+ function next(){
+ // Start by performing any 'lexical' actions (adjusting the
+ // lexical variable), or the operations below will be working
+ // with the wrong lexical state.
+ while(cc[cc.length - 1].lex)
+ cc.pop()();
+
+ // Fetch a token.
+ var token = tokens.next();
+
+ // Adjust column and indented.
+ if (token.type == "whitespace" && column == 0)
+ indented = token.value.length;
+ column += token.value.length;
+ if (token.content == "\n"){
+ indented = column = 0;
+ // If the lexical scope's align property is still undefined at
+ // the end of the line, it is an un-aligned scope.
+ if (!("align" in lexical))
+ lexical.align = false;
+ // Newline tokens get an indentation function associated with
+ // them.
+ token.indentation = indentCSharp(lexical);
+ }
+ // No more processing for meaningless tokens.
+ if (token.type == "whitespace" || token.type == "comment")
+ return token;
+ // When a meaningful token is found and the lexical scope's
+ // align is undefined, it is an aligned scope.
+ if (!("align" in lexical))
+ lexical.align = true;
+
+ // Execute actions until one 'consumes' the token and we can
+ // return it.
+ while(true) {
+ consume = marked = false;
+ // Take and execute the topmost action.
+ cc.pop()(token.type, token.content);
+ if (consume){
+ // Marked is used to change the style of the current token.
+ if (marked)
+ token.style = marked;
+ return token;
+ }
+ }
+ }
+
+ // This makes a copy of the parser state. It stores all the
+ // stateful variables in a closure, and returns a function that
+ // will restore them when called with a new input stream. Note
+ // that the cc array has to be copied, because it is contantly
+ // being modified. Lexical objects are not mutated, and context
+ // objects are not mutated in a harmful way, so they can be shared
+ // between runs of the parser.
+ function copy(){
+ var _lexical = lexical, _cc = cc.concat([]), _tokenState = tokens.state;
+
+ return function copyParser(input){
+ lexical = _lexical;
+ cc = _cc.concat([]); // copies the array
+ column = indented = 0;
+ tokens = tokenizeCSharp(input, _tokenState);
+ return parser;
+ };
+ }
+
+ // Helper function for pushing a number of actions onto the cc
+ // stack in reverse order.
+ function push(fs){
+ for (var i = fs.length - 1; i >= 0; i--)
+ cc.push(fs[i]);
+ }
+ // cont and pass are used by the action functions to add other
+ // actions to the stack. cont will cause the current token to be
+ // consumed, pass will leave it for the next action.
+ function cont(){
+ push(arguments);
+ consume = true;
+ }
+ function pass(){
+ push(arguments);
+ consume = false;
+ }
+ // Used to change the style of the current token.
+ function mark(style){
+ marked = style;
+ }
+
+ // Push a new lexical context of the given type.
+ function pushlex(type, info) {
+ var result = function(){
+ lexical = new CSharpLexical(indented, column, type, null, lexical, info)
+ };
+ result.lex = true;
+ return result;
+ }
+ // Pop off the current lexical context.
+ function poplex(){
+ lexical = lexical.prev;
+ }
+ poplex.lex = true;
+ // The 'lex' flag on these actions is used by the 'next' function
+ // to know they can (and have to) be ran before moving on to the
+ // next token.
+
+ // Creates an action that discards tokens until it finds one of
+ // the given type.
+ function expect(wanted){
+ return function expecting(type){
+ if (type == wanted) cont();
+ else cont(arguments.callee);
+ };
+ }
+
+ // Looks for a statement, and then calls itself.
+ function statements(type){
+ return pass(statement, statements);
+ }
+ // Dispatches various types of statements based on the type of the
+ // current token.
+ function statement(type){
+ if (type == "var") cont(pushlex("vardef"), vardef1, expect(";"), poplex);
+ else if (type == "keyword a") cont(pushlex("form"), expression, statement, poplex);
+ else if (type == "keyword b") cont(pushlex("form"), statement, poplex);
+ else if (type == "{" && json) cont(pushlex("}"), commasep(objprop, "}"), poplex);
+ else if (type == "{") cont(pushlex("}"), block, poplex);
+ else if (type == "function") cont(functiondef);
+ else if (type == "for") cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), poplex, statement, poplex);
+ else if (type == "variable") cont(pushlex("stat"), maybelabel);
+ else if (type == "switch") cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), block, poplex, poplex);
+ else if (type == "case") cont(expression, expect(":"));
+ else if (type == "default") cont(expect(":"));
+ else if (type == "catch") cont(pushlex("form"), expect("("), funarg, expect(")"), statement, poplex);
+
+ else if (type == "class") cont(classdef);
+ else if (type == "keyword d") cont(statement);
+
+ else pass(pushlex("stat"), expression, expect(";"), poplex);
+ }
+ // Dispatch expression types.
+ function expression(type){
+ if (atomicTypes.hasOwnProperty(type)) cont(maybeoperator);
+ else if (type == "function") cont(functiondef);
+ else if (type == "keyword c") cont(expression);
+ else if (type == "(") cont(pushlex(")"), expression, expect(")"), poplex, maybeoperator);
+ else if (type == "operator") cont(expression);
+ else if (type == "[") cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator);
+ else if (type == "{") cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator);
+ }
+ // Called for places where operators, function calls, or
+ // subscripts are valid. Will skip on to the next action if none
+ // is found.
+ function maybeoperator(type){
+ if (type == "operator") cont(expression);
+ else if (type == "(") cont(pushlex(")"), expression, commasep(expression, ")"), poplex, maybeoperator);
+ else if (type == ".") cont(property, maybeoperator);
+ else if (type == "[") cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator);
+ }
+ // When a statement starts with a variable name, it might be a
+ // label. If no colon follows, it's a regular statement.
+ function maybelabel(type){
+ if (type == ":") cont(poplex, statement);
+ else if (type == "(") cont(commasep(funarg, ")"), poplex, statement); // method definition
+ else if (type == "{") cont(poplex, pushlex("}"), block, poplex); // property definition
+ else pass(maybeoperator, expect(";"), poplex);
+ }
+ // Property names need to have their style adjusted -- the
+ // tokenizer thinks they are variables.
+ function property(type){
+ if (type == "variable") {mark("csharp-property"); cont();}
+ }
+ // This parses a property and its value in an object literal.
+ function objprop(type){
+ if (type == "variable") mark("csharp-property");
+ if (atomicTypes.hasOwnProperty(type)) cont(expect(":"), expression);
+ }
+ // Parses a comma-separated list of the things that are recognized
+ // by the 'what' argument.
+ function commasep(what, end){
+ function proceed(type) {
+ if (type == ",") cont(what, proceed);
+ else if (type == end) cont();
+ else cont(expect(end));
+ };
+ return function commaSeparated(type) {
+ if (type == end) cont();
+ else pass(what, proceed);
+ };
+ }
+ // Look for statements until a closing brace is found.
+ function block(type){
+ if (type == "}") cont();
+ else pass(statement, block);
+ }
+ // Variable definitions are split into two actions -- 1 looks for
+ // a name or the end of the definition, 2 looks for an '=' sign or
+ // a comma.
+ function vardef1(type, value){
+ if (type == "variable"){cont(vardef2);}
+ else cont();
+ }
+ function vardef2(type, value){
+ if (value == "=") cont(expression, vardef2);
+ else if (type == ",") cont(vardef1);
+ }
+ // For loops.
+ function forspec1(type){
+ if (type == "var") cont(vardef1, forspec2);
+ else if (type == "keyword d") cont(vardef1, forspec2);
+ else if (type == ";") pass(forspec2);
+ else if (type == "variable") cont(formaybein);
+ else pass(forspec2);
+ }
+ function formaybein(type, value){
+ if (value == "in") cont(expression);
+ else cont(maybeoperator, forspec2);
+ }
+ function forspec2(type, value){
+ if (type == ";") cont(forspec3);
+ else if (value == "in") cont(expression);
+ else cont(expression, expect(";"), forspec3);
+ }
+ function forspec3(type) {
+ if (type == ")") pass();
+ else cont(expression);
+ }
+ // A function definition creates a new context, and the variables
+ // in its argument list have to be added to this context.
+ function functiondef(type, value){
+ if (type == "variable") cont(functiondef);
+ else if (type == "(") cont(commasep(funarg, ")"), statement);
+ }
+ function funarg(type, value){
+ if (type == "variable"){cont();}
+ }
+
+ function classdef(type) {
+ if (type == "variable") cont(classdef, statement);
+ else if (type == ":") cont(classdef, statement);
+ }
+
+ return parser;
+ }
+
+ return {
+ make: parseCSharp,
+ electricChars: "{}:",
+ configure: function(obj) {
+ if (obj.json != null) json = obj.json;
+ }
+ };
+})();
diff --git a/gulliver/js/codemirror/contrib/csharp/js/tokenizecsharp.js b/gulliver/js/codemirror/contrib/csharp/js/tokenizecsharp.js
new file mode 100755
index 000000000..5d89e2615
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/csharp/js/tokenizecsharp.js
@@ -0,0 +1,196 @@
+/* Tokenizer for CSharp code */
+
+var tokenizeCSharp = (function() {
+ // Advance the stream until the given character (not preceded by a
+ // backslash) is encountered, or the end of the line is reached.
+ function nextUntilUnescaped(source, end) {
+ var escaped = false;
+ var next;
+ while (!source.endOfLine()) {
+ var next = source.next();
+ if (next == end && !escaped)
+ return false;
+ escaped = !escaped && next == "\\";
+ }
+ return escaped;
+ }
+
+ // A map of JavaScript's keywords. The a/b/c keyword distinction is
+ // very rough, but it gives the parser enough information to parse
+ // correct code correctly (we don't care that much how we parse
+ // incorrect code). The style information included in these objects
+ // is used by the highlighter to pick the correct CSS style for a
+ // token.
+ var keywords = function(){
+ function result(type, style){
+ return {type: type, style: "csharp-" + style};
+ }
+ // keywords that take a parenthised expression, and then a
+ // statement (if)
+ var keywordA = result("keyword a", "keyword");
+ // keywords that take just a statement (else)
+ var keywordB = result("keyword b", "keyword");
+ // keywords that optionally take an expression, and form a
+ // statement (return)
+ var keywordC = result("keyword c", "keyword");
+ var operator = result("operator", "keyword");
+ var atom = result("atom", "atom");
+ // just a keyword with no indentation implications
+ var keywordD = result("keyword d", "keyword");
+
+ return {
+ "if": keywordA, "while": keywordA, "with": keywordA,
+ "else": keywordB, "do": keywordB, "try": keywordB, "finally": keywordB,
+ "return": keywordC, "break": keywordC, "continue": keywordC, "new": keywordC, "delete": keywordC, "throw": keywordC,
+ "in": operator, "typeof": operator, "instanceof": operator,
+ "var": result("var", "keyword"), "function": result("function", "keyword"), "catch": result("catch", "keyword"),
+ "for": result("for", "keyword"), "switch": result("switch", "keyword"),
+ "case": result("case", "keyword"), "default": result("default", "keyword"),
+ "true": atom, "false": atom, "null": atom,
+
+ "class": result("class", "keyword"), "namespace": result("class", "keyword"),
+
+ "public": keywordD, "private": keywordD, "protected": keywordD, "internal": keywordD,
+ "extern": keywordD, "override": keywordD, "virtual": keywordD, "abstract": keywordD,
+ "static": keywordD, "out": keywordD, "ref": keywordD, "const": keywordD,
+
+ "foreach": result("for", "keyword"), "using": keywordC,
+
+ "int": keywordD, "double": keywordD, "long": keywordD, "bool": keywordD, "char": keywordD,
+ "void": keywordD, "string": keywordD, "byte": keywordD, "sbyte": keywordD, "decimal": keywordD,
+ "float": keywordD, "uint": keywordD, "ulong": keywordD, "object": keywordD,
+ "short": keywordD, "ushort": keywordD,
+
+ "get": keywordD, "set": keywordD, "value": keywordD
+ };
+ }();
+
+ // Some helper regexps
+ var isOperatorChar = /[+\-*&%=<>!?|]/;
+ var isHexDigit = /[0-9A-Fa-f]/;
+ var isWordChar = /[\w\$_]/;
+
+ // Wrapper around jsToken that helps maintain parser state (whether
+ // we are inside of a multi-line comment and whether the next token
+ // could be a regular expression).
+ function jsTokenState(inside, regexp) {
+ return function(source, setState) {
+ var newInside = inside;
+ var type = jsToken(inside, regexp, source, function(c) {newInside = c;});
+ var newRegexp = type.type == "operator" || type.type == "keyword c" || type.type.match(/^[\[{}\(,;:]$/);
+ if (newRegexp != regexp || newInside != inside)
+ setState(jsTokenState(newInside, newRegexp));
+ return type;
+ };
+ }
+
+ // The token reader, inteded to be used by the tokenizer from
+ // tokenize.js (through jsTokenState). Advances the source stream
+ // over a token, and returns an object containing the type and style
+ // of that token.
+ function jsToken(inside, regexp, source, setInside) {
+ function readHexNumber(){
+ source.next(); // skip the 'x'
+ source.nextWhileMatches(isHexDigit);
+ return {type: "number", style: "csharp-atom"};
+ }
+
+ function readNumber() {
+ source.nextWhileMatches(/[0-9]/);
+ if (source.equals(".")){
+ source.next();
+ source.nextWhileMatches(/[0-9]/);
+ }
+ if (source.equals("e") || source.equals("E")){
+ source.next();
+ if (source.equals("-"))
+ source.next();
+ source.nextWhileMatches(/[0-9]/);
+ }
+ return {type: "number", style: "csharp-atom"};
+ }
+ // Read a word, look it up in keywords. If not found, it is a
+ // variable, otherwise it is a keyword of the type found.
+ function readWord() {
+ source.nextWhileMatches(isWordChar);
+ var word = source.get();
+ var known = keywords.hasOwnProperty(word) && keywords.propertyIsEnumerable(word) && keywords[word];
+ return known ? {type: known.type, style: known.style, content: word} :
+ {type: "variable", style: "csharp-variable", content: word};
+ }
+ function readRegexp() {
+ nextUntilUnescaped(source, "/");
+ source.nextWhileMatches(/[gi]/);
+ return {type: "regexp", style: "csharp-string"};
+ }
+ // Mutli-line comments are tricky. We want to return the newlines
+ // embedded in them as regular newline tokens, and then continue
+ // returning a comment token for every line of the comment. So
+ // some state has to be saved (inside) to indicate whether we are
+ // inside a /* */ sequence.
+ function readMultilineComment(start){
+ var newInside = "/*";
+ var maybeEnd = (start == "*");
+ while (true) {
+ if (source.endOfLine())
+ break;
+ var next = source.next();
+ if (next == "/" && maybeEnd){
+ newInside = null;
+ break;
+ }
+ maybeEnd = (next == "*");
+ }
+ setInside(newInside);
+ return {type: "comment", style: "csharp-comment"};
+ }
+ function readOperator() {
+ source.nextWhileMatches(isOperatorChar);
+ return {type: "operator", style: "csharp-operator"};
+ }
+ function readString(quote) {
+ var endBackSlash = nextUntilUnescaped(source, quote);
+ setInside(endBackSlash ? quote : null);
+ return {type: "string", style: "csharp-string"};
+ }
+
+ // Fetch the next token. Dispatches on first character in the
+ // stream, or first two characters when the first is a slash.
+ if (inside == "\"" || inside == "'")
+ return readString(inside);
+ var ch = source.next();
+ if (inside == "/*")
+ return readMultilineComment(ch);
+ else if (ch == "\"" || ch == "'")
+ return readString(ch);
+ // with punctuation, the type of the token is the symbol itself
+ else if (/[\[\]{}\(\),;\:\.]/.test(ch))
+ return {type: ch, style: "csharp-punctuation"};
+ else if (ch == "0" && (source.equals("x") || source.equals("X")))
+ return readHexNumber();
+ else if (/[0-9]/.test(ch))
+ return readNumber();
+ else if (ch == "/"){
+ if (source.equals("*"))
+ { source.next(); return readMultilineComment(ch); }
+ else if (source.equals("/"))
+ { nextUntilUnescaped(source, null); return {type: "comment", style: "csharp-comment"};}
+ else if (regexp)
+ return readRegexp();
+ else
+ return readOperator();
+ }
+ else if (ch == "#") { // treat c# regions like comments
+ nextUntilUnescaped(source, null); return {type: "comment", style: "csharp-comment"};
+ }
+ else if (isOperatorChar.test(ch))
+ return readOperator();
+ else
+ return readWord();
+ }
+
+ // The external interface to the tokenizer.
+ return function(source, startState) {
+ return tokenizer(source, startState || jsTokenState(false, true));
+ };
+})();
diff --git a/gulliver/js/codemirror/contrib/freemarker/LICENSE b/gulliver/js/codemirror/contrib/freemarker/LICENSE
new file mode 100755
index 000000000..fbbb800fd
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/freemarker/LICENSE
@@ -0,0 +1,24 @@
+Copyright (c) 2010, Keybroker AB
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Keybroker AB nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Keybroker AB BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/gulliver/js/codemirror/contrib/freemarker/css/freemarkercolors.css b/gulliver/js/codemirror/contrib/freemarker/css/freemarkercolors.css
new file mode 100755
index 000000000..9e7a8f3d8
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/freemarker/css/freemarkercolors.css
@@ -0,0 +1,63 @@
+html {
+ cursor: text;
+}
+
+.editbox {
+ margin: .4em;
+ padding: 0;
+ font-family: monospace;
+ font-size: 12px;
+ font-size-adjust: none;
+ font-style: normal;
+ font-variant: normal;
+ font-weight: normal;
+ line-height: normal;
+ color: black;
+}
+
+pre.code, .editbox {
+ color: black;
+}
+
+.editbox p {
+ margin: 0;
+}
+
+span.freemarker-comment {
+ color: #BB9977;
+}
+
+span.freemarker-generic {
+}
+
+span.freemarker-boundary {
+ color: darkblue;
+}
+
+span.freemarker-directive {
+ color: darkblue;
+}
+
+span.freemarker-identifier {
+ color: purple;
+}
+
+span.freemarker-builtin {
+ color: gray;
+}
+
+span.freemarker-punctuation {
+ color: blue;
+}
+
+span.freemarker-string {
+ color: darkGreen;
+}
+
+span.freemarker-number {
+ color: blue;
+}
+
+span.freemarker-error {
+ color: #F00 !important;
+}
diff --git a/gulliver/js/codemirror/contrib/freemarker/index.html b/gulliver/js/codemirror/contrib/freemarker/index.html
new file mode 100755
index 000000000..8d31fa873
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/freemarker/index.html
@@ -0,0 +1,75 @@
+
+
+
+
+ CodeMirror: Freemarker demonstration
+
+
+
+
+
+
This page demonstrates CodeMirror's
+Freemarker parser. Written by Magnus Ljung, released under a BSD-style license.
+
+
+
+
+
diff --git a/gulliver/js/codemirror/contrib/java/LICENSE b/gulliver/js/codemirror/contrib/java/LICENSE
new file mode 100755
index 000000000..ba4282470
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/java/LICENSE
@@ -0,0 +1,20 @@
+ Copyright (c) 2010 Patrick Wied
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any
+ damages arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any
+ purpose, including commercial applications, and to alter it and
+ redistribute it freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must
+ not claim that you wrote the original software. If you use this
+ software in a product, an acknowledgment in the product
+ documentation would be appreciated but is not required.
+
+ 2. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+ 3. This notice may not be removed or altered from any source
+ distribution.
diff --git a/gulliver/js/codemirror/contrib/java/css/javacolors.css b/gulliver/js/codemirror/contrib/java/css/javacolors.css
new file mode 100755
index 000000000..64ea0ea74
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/java/css/javacolors.css
@@ -0,0 +1,64 @@
+
+html {
+ cursor: text;
+}
+
+.editbox {
+ margin: .4em;
+ padding: 0;
+ font-family: monospace;
+ font-size: 10pt;
+ color: black;
+}
+
+pre.code, .editbox {
+ color: #666666;
+}
+
+.editbox p {
+ margin: 0;
+}
+
+span.java-punctuation {
+ color: black;
+}
+
+span.java-operator {
+ color: purple;
+}
+
+span.java-keyword {
+ color: #7f0055;
+ font-weight:bold;
+}
+
+span.java-atom {
+ color: brown;
+}
+
+span.java-variable {
+ color: black;
+}
+
+
+span.java-property {
+ color: black;
+}
+
+span.java-comment {
+ color: green;
+}
+
+span.javadoc-comment {
+ color: #3e5797;
+ font-weight:bold;
+}
+
+span.java-string {
+ color: blue;
+}
+
+span.java-annotation{
+ color: gray;
+}
+
diff --git a/gulliver/js/codemirror/contrib/java/index.html b/gulliver/js/codemirror/contrib/java/index.html
new file mode 100755
index 000000000..15df0a9cc
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/java/index.html
@@ -0,0 +1,66 @@
+
+
+
+
+ Demonstration of CodeMirrors Java highlighter written by Patrick Wied
+
+
+
+
+
+
+
+
diff --git a/gulliver/js/codemirror/contrib/java/js/parsejava.js b/gulliver/js/codemirror/contrib/java/js/parsejava.js
new file mode 100755
index 000000000..1b104db4b
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/java/js/parsejava.js
@@ -0,0 +1,285 @@
+/**
+ * Java parser for codemirror
+ *
+ * @author Patrick Wied
+ */
+
+var JavaParser = Editor.Parser = (function() {
+ // Token types that can be considered to be atoms.
+ var atomicTypes = {"atom": true, "number": true, "string": true, "regexp": true};
+ // Setting that can be used to have JSON data indent properly.
+ var json = false;
+ // Constructor for the lexical context objects.
+ function JavaLexical(indented, column, type, align, prev, info) {
+ // indentation at start of this line
+ this.indented = indented;
+ // column at which this scope was opened
+ this.column = column;
+ // type of scope ( 'stat' (statement), 'form' (special form), '[', '{', or '(')
+ this.type = type;
+ // '[', '{', or '(' blocks that have any text after their opening
+ // character are said to be 'aligned' -- any lines below are
+ // indented all the way to the opening character.
+ if (align != null)
+ this.align = align;
+ // Parent scope, if any.
+ this.prev = prev;
+ this.info = info;
+ }
+
+ // java indentation rules.
+ function indentJava(lexical) {
+ return function(firstChars) {
+ var firstChar = firstChars && firstChars.charAt(0), type = lexical.type;
+ var closing = firstChar == type;
+ if (type == "form" && firstChar == "{")
+ return lexical.indented;
+ else if (type == "stat" || type == "form")
+ return lexical.indented + indentUnit;
+ else if (lexical.info == "switch" && !closing)
+ return lexical.indented + (/^(?:case|default)\b/.test(firstChars) ? indentUnit : 2 * indentUnit);
+ else if (lexical.align)
+ return lexical.column - (closing ? 1 : 0);
+ else
+ return lexical.indented + (closing ? 0 : indentUnit);
+ };
+ }
+
+ // The parser-iterator-producing function itself.
+ function parseJava(input, basecolumn) {
+ // Wrap the input in a token stream
+ var tokens = tokenizeJava(input);
+ // The parser state. cc is a stack of actions that have to be
+ // performed to finish the current statement. For example we might
+ // know that we still need to find a closing parenthesis and a
+ // semicolon. Actions at the end of the stack go first. It is
+ // initialized with an infinitely looping action that consumes
+ // whole statements.
+ var cc = [statements];
+ // The lexical scope, used mostly for indentation.
+ var lexical = new JavaLexical(basecolumn || 0, 0, "block", false);
+ // Current column, and the indentation at the start of the current
+ // line. Used to create lexical scope objects.
+ var column = 0;
+ var indented = 0;
+ // Variables which are used by the mark, cont, and pass functions
+ // below to communicate with the driver loop in the 'next'
+ // function.
+ var consume, marked;
+
+ // The iterator object.
+ var parser = {next: next, copy: copy};
+
+ function next(){
+ // Start by performing any 'lexical' actions (adjusting the
+ // lexical variable), or the operations below will be working
+ // with the wrong lexical state.
+ while(cc[cc.length - 1].lex)
+ cc.pop()();
+
+ // Fetch a token.
+ var token = tokens.next();
+
+ // Adjust column and indented.
+ if (token.type == "whitespace" && column == 0)
+ indented = token.value.length;
+ column += token.value.length;
+ if (token.content == "\n"){
+ indented = column = 0;
+ // If the lexical scope's align property is still undefined at
+ // the end of the line, it is an un-aligned scope.
+ if (!("align" in lexical))
+ lexical.align = false;
+ // Newline tokens get an indentation function associated with
+ // them.
+ token.indentation = indentJava(lexical);
+
+ }
+ // No more processing for meaningless tokens.
+ if (token.type == "whitespace" || token.type == "comment" || token.type == "javadoc" || token.type == "annotation")
+ return token;
+
+ // When a meaningful token is found and the lexical scope's
+ // align is undefined, it is an aligned scope.
+ if (!("align" in lexical))
+ lexical.align = true;
+
+ // Execute actions until one 'consumes' the token and we can
+ // return it.
+ while(true) {
+ consume = marked = false;
+ // Take and execute the topmost action.
+ cc.pop()(token.type, token.content);
+ if (consume){
+ // Marked is used to change the style of the current token.
+ if (marked)
+ token.style = marked;
+ return token;
+ }
+ }
+ }
+
+ // This makes a copy of the parser state. It stores all the
+ // stateful variables in a closure, and returns a function that
+ // will restore them when called with a new input stream. Note
+ // that the cc array has to be copied, because it is contantly
+ // being modified. Lexical objects are not mutated, and context
+ // objects are not mutated in a harmful way, so they can be shared
+ // between runs of the parser.
+ function copy(){
+ var _lexical = lexical, _cc = cc.concat([]), _tokenState = tokens.state;
+
+ return function copyParser(input){
+ lexical = _lexical;
+ cc = _cc.concat([]); // copies the array
+ column = indented = 0;
+ tokens = tokenizeJava(input, _tokenState);
+ return parser;
+ };
+ }
+
+ // Helper function for pushing a number of actions onto the cc
+ // stack in reverse order.
+ function push(fs){
+ for (var i = fs.length - 1; i >= 0; i--)
+ cc.push(fs[i]);
+ }
+ // cont and pass are used by the action functions to add other
+ // actions to the stack. cont will cause the current token to be
+ // consumed, pass will leave it for the next action.
+ function cont(){
+ push(arguments);
+ consume = true;
+ }
+ function pass(){
+ push(arguments);
+ consume = false;
+ }
+ // Used to change the style of the current token.
+ function mark(style){
+ marked = style;
+ }
+
+ // Push a new lexical context of the given type.
+ function pushlex(type, info) {
+ var result = function(){
+ lexical = new JavaLexical(indented, column, type, null, lexical, info)
+ };
+ result.lex = true;
+ return result;
+ }
+ // Pop off the current lexical context.
+ function poplex(){
+ lexical = lexical.prev;
+ }
+ poplex.lex = true;
+ // The 'lex' flag on these actions is used by the 'next' function
+ // to know they can (and have to) be ran before moving on to the
+ // next token.
+
+ // Creates an action that discards tokens until it finds one of
+ // the given type.
+ function expect(wanted){
+ return function expecting(type){
+ if (type == wanted) cont();
+ else cont(arguments.callee);
+ };
+ }
+
+ // Looks for a statement, and then calls itself.
+ function statements(type){
+ return pass(statement, statements);
+ }
+ // Dispatches various types of statements based on the type of the
+ // current token.
+ function statement(type){
+ if (type == "keyword a") cont(pushlex("form"), expression, statement, poplex);
+ else if (type == "keyword b") cont(pushlex("form"), statement, poplex);
+ else if (type == "{") cont(pushlex("}"), block, poplex);
+ else if (type == "for") cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), poplex, statement, poplex);
+ else if (type == "variable") cont(pushlex("stat"), maybelabel);
+ else if (type == "switch") cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), block, poplex, poplex);
+ else if (type == "case") cont(expression, expect(":"));
+ else if (type == "default") cont(expect(":"));
+ else if (type == "catch") cont(pushlex("form"), expect("("), function(){}, expect(")"), statement, poplex);
+ else if (type == "class") cont();
+ else if (type == "interface") cont();
+ else if (type == "keyword c") cont(statement);
+ else pass(pushlex("stat"), expression, expect(";"), poplex);
+ }
+ // Dispatch expression types.
+ function expression(type){
+ if (atomicTypes.hasOwnProperty(type)) cont(maybeoperator);
+ //else if (type == "function") cont(functiondef);
+ else if (type == "keyword c") cont(expression);
+ else if (type == "(") cont(pushlex(")"), expression, expect(")"), poplex, maybeoperator);
+ else if (type == "operator") cont(expression);
+ else if (type == "[") cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator);
+ }
+ // Called for places where operators, function calls, or
+ // subscripts are valid. Will skip on to the next action if none
+ // is found.
+ function maybeoperator(type){
+ if (type == "operator") cont(expression);
+ else if (type == "(") cont(pushlex(")"), expression, commasep(expression, ")"), poplex, maybeoperator);
+ else if (type == "[") cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator);
+ }
+ // When a statement starts with a variable name, it might be a
+ // label. If no colon follows, it's a regular statement.
+
+ function maybelabel(type){
+ if (type == "(") cont(commasep(function(){}, ")"), poplex, statement); // method definition
+ else if (type == "{") cont(poplex, pushlex("}"), block, poplex); // property definition
+ else pass(maybeoperator, expect(";"), poplex);
+ }
+
+ // Parses a comma-separated list of the things that are recognized
+ // by the 'what' argument.
+ function commasep(what, end){
+ function proceed(type) {
+ if (type == ",") cont(what, proceed);
+ else if (type == end) cont();
+ else cont(expect(end));
+ };
+ return function commaSeparated(type) {
+ if (type == end) cont();
+ else pass(what, proceed);
+ };
+ }
+ // Look for statements until a closing brace is found.
+ function block(type){
+ if (type == "}") cont();
+ else pass(statement, block);
+ }
+
+ // For loops.
+
+ function forspec1(type){
+ if (type == ";") pass(forspec2);
+ else pass(forspec2);
+ }
+ function formaybein(type, value){
+ if (value == "in") cont(expression);
+ else cont(maybeoperator, forspec2);
+ }
+ function forspec2(type, value){
+ if (type == ";") cont(forspec3);
+ else if (value == "in") cont(expression);
+ else cont(expression, expect(";"), forspec3);
+ }
+ function forspec3(type) {
+ if (type == ")") pass();
+ else cont(expression);
+ }
+
+ return parser;
+ }
+
+ return {
+ make: parseJava,
+ electricChars: "{}:",
+ configure: function(obj) {
+ if (obj.json != null) json = obj.json;
+ }
+ };
+})();
diff --git a/gulliver/js/codemirror/contrib/java/js/tokenizejava.js b/gulliver/js/codemirror/contrib/java/js/tokenizejava.js
new file mode 100755
index 000000000..1b58901ad
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/java/js/tokenizejava.js
@@ -0,0 +1,222 @@
+/**
+ * Java tokenizer for codemirror
+ *
+ * @author Patrick Wied
+ * @version 2010-10-07
+ */
+var tokenizeJava = (function() {
+ // Advance the stream until the given character (not preceded by a
+ // backslash) is encountered, or the end of the line is reached.
+ function nextUntilUnescaped(source, end) {
+ var escaped = false;
+ var next;
+ while (!source.endOfLine()) {
+ var next = source.next();
+ if (next == end && !escaped)
+ return false;
+ escaped = !escaped && next == "\\";
+ }
+ return escaped;
+ }
+
+ // A map of Java's keywords. The a/b/c keyword distinction is
+ // very rough, but it gives the parser enough information to parse
+ // correct code correctly (we don't care that much how we parse
+ // incorrect code). The style information included in these objects
+ // is used by the highlighter to pick the correct CSS style for a
+ // token.
+ var keywords = function(){
+ function result(type, style){
+ return {type: type, style: "java-" + style};
+ }
+ // keywords that take a parenthised expression, and then a
+ // statement (if)
+ var keywordA = result("keyword a", "keyword");
+ // keywords that take just a statement (else)
+ var keywordB = result("keyword b", "keyword");
+ // keywords that optionally take an expression, and form a
+ // statement (return)
+ var keywordC = result("keyword c", "keyword");
+ var operator = result("operator", "keyword");
+ var atom = result("atom", "atom");
+
+ return {
+ "if": keywordA, "while": keywordA, "with": keywordA,
+ "else": keywordB, "do": keywordB, "try": keywordB, "finally": keywordB,
+ "return": keywordC, "break": keywordC, "continue": keywordC, "new": keywordC, "throw": keywordC, "throws": keywordB,
+ "in": operator, "typeof": operator, "instanceof": operator,
+ "catch": result("catch", "keyword"), "for": result("for", "keyword"), "switch": result("switch", "keyword"),
+ "case": result("case", "keyword"), "default": result("default", "keyword"),
+ "true": atom, "false": atom, "null": atom,
+
+ "class": result("class", "keyword"), "interface": result("interface", "keyword"), "package": keywordC, "import": keywordC,
+ "implements": keywordC, "extends": keywordC, "super": keywordC,
+
+ "public": keywordC, "private": keywordC, "protected": keywordC, "transient": keywordC, "this": keywordC,
+ "static": keywordC, "final": keywordC, "const": keywordC, "abstract": keywordC, "static": keywordC,
+
+ "int": keywordC, "double": keywordC, "long": keywordC, "boolean": keywordC, "char": keywordC,
+ "void": keywordC, "byte": keywordC, "float": keywordC, "short": keywordC
+ };
+ }();
+
+ // Some helper regexps
+ var isOperatorChar = /[+\-*&%=<>!?|]/;
+ var isHexDigit = /[0-9A-Fa-f]/;
+ var isWordChar = /[\w\$_]/;
+ // Wrapper around javaToken that helps maintain parser state (whether
+ // we are inside of a multi-line comment and whether the next token
+ // could be a regular expression).
+ function javaTokenState(inside, regexp) {
+ return function(source, setState) {
+ var newInside = inside;
+ var type = javaToken(inside, regexp, source, function(c) {newInside = c;});
+ var newRegexp = type.type == "operator" || type.type == "keyword c" || type.type.match(/^[\[{}\(,;:]$/);
+ if (newRegexp != regexp || newInside != inside)
+ setState(javaTokenState(newInside, newRegexp));
+ return type;
+ };
+ }
+
+ // The token reader, inteded to be used by the tokenizer from
+ // tokenize.js (through jsTokenState). Advances the source stream
+ // over a token, and returns an object containing the type and style
+ // of that token.
+ function javaToken(inside, regexp, source, setInside) {
+ function readHexNumber(){
+ source.next(); // skip the 'x'
+ source.nextWhileMatches(isHexDigit);
+ return {type: "number", style: "java-atom"};
+ }
+
+ function readNumber() {
+ source.nextWhileMatches(/[0-9]/);
+ if (source.equals(".")){
+ source.next();
+ source.nextWhileMatches(/[0-9]/);
+ }
+ if (source.equals("e") || source.equals("E")){
+ source.next();
+ if (source.equals("-"))
+ source.next();
+ source.nextWhileMatches(/[0-9]/);
+ }
+ return {type: "number", style: "java-atom"};
+ }
+ // Read a word, look it up in keywords. If not found, it is a
+ // variable, otherwise it is a keyword of the type found.
+ function readWord() {
+ source.nextWhileMatches(isWordChar);
+ var word = source.get();
+ var known = keywords.hasOwnProperty(word) && keywords.propertyIsEnumerable(word) && keywords[word];
+ return known ? {type: known.type, style: known.style, content: word} :
+ {type: "variable", style: "java-variable", content: word};
+ }
+ function readRegexp() {
+ nextUntilUnescaped(source, "/");
+ source.nextWhileMatches(/[gi]/);
+ return {type: "regexp", style: "java-string"};
+ }
+ // Mutli-line comments are tricky. We want to return the newlines
+ // embedded in them as regular newline tokens, and then continue
+ // returning a comment token for every line of the comment. So
+ // some state has to be saved (inside) to indicate whether we are
+ // inside a /* */ sequence.
+ function readMultilineComment(start){
+ var newInside = "/*";
+ var maybeEnd = (start == "*");
+ while (true) {
+ if (source.endOfLine())
+ break;
+ var next = source.next();
+ if (next == "/" && maybeEnd){
+ newInside = null;
+ break;
+ }
+ maybeEnd = (next == "*");
+ }
+ setInside(newInside);
+ return {type: "comment", style: "java-comment"};
+ }
+
+ // for reading javadoc
+ function readJavaDocComment(start){
+ var newInside = "/**";
+ var maybeEnd = (start == "*");
+ while (true) {
+ if (source.endOfLine())
+ break;
+ var next = source.next();
+ if (next == "/" && maybeEnd){
+ newInside = null;
+ break;
+ }
+ maybeEnd = (next == "*");
+ }
+ setInside(newInside);
+ return {type: "javadoc", style: "javadoc-comment"};
+ }
+ // for reading annotations (word based)
+ function readAnnotation(){
+ source.nextWhileMatches(isWordChar);
+ var word = source.get();
+ return {type: "annotation", style: "java-annotation", content:word};
+ }
+
+ function readOperator() {
+ source.nextWhileMatches(isOperatorChar);
+ return {type: "operator", style: "java-operator"};
+ }
+ function readString(quote) {
+ var endBackSlash = nextUntilUnescaped(source, quote);
+ setInside(endBackSlash ? quote : null);
+ return {type: "string", style: "java-string"};
+ }
+
+ // Fetch the next token. Dispatches on first character in the
+ // stream, or first two characters when the first is a slash.
+ if (inside == "\"" || inside == "'")
+ return readString(inside);
+ var ch = source.next();
+ if (inside == "/*")
+ return readMultilineComment(ch);
+ else if(inside == "/**")
+ return readJavaDocComment(ch);
+ else if (ch == "\"" || ch == "'")
+ return readString(ch);
+ // with punctuation, the type of the token is the symbol itself
+ else if (/[\[\]{}\(\),;\:\.]/.test(ch))
+ return {type: ch, style: "java-punctuation"};
+ else if (ch == "0" && (source.equals("x") || source.equals("X")))
+ return readHexNumber();
+ else if (/[0-9]/.test(ch))
+ return readNumber();
+ else if (ch == "@"){
+ return readAnnotation();
+ }else if (ch == "/"){
+ if (source.equals("*")){
+ source.next();
+
+ if(source.equals("*"))
+ return readJavaDocComment(ch);
+
+ return readMultilineComment(ch);
+ }
+ else if (source.equals("/"))
+ { nextUntilUnescaped(source, null); return {type: "comment", style: "java-comment"};}
+ else if (regexp)
+ return readRegexp();
+ else
+ return readOperator();
+ }
+ else if (isOperatorChar.test(ch))
+ return readOperator();
+ else
+ return readWord();
+ }
+
+ // The external interface to the tokenizer.
+ return function(source, startState) {
+ return tokenizer(source, startState || javaTokenState(false, true));
+ };
+})();
diff --git a/gulliver/js/codemirror/contrib/lua/LICENSE b/gulliver/js/codemirror/contrib/lua/LICENSE
new file mode 100755
index 000000000..5b867cd52
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/lua/LICENSE
@@ -0,0 +1,32 @@
+Copyright (c) 2009, Franciszek Wawrzak
+All rights reserved.
+
+This software is provided for use in connection with the
+CodeMirror suite of modules and utilities, hosted and maintained
+at http://codemirror.net/.
+
+Redistribution and use of this software in source and binary forms,
+with or without modification, are permitted provided that the
+following conditions are met:
+
+* Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the
+ following disclaimer.
+
+* Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the
+ following disclaimer in the documentation and/or other
+ materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
diff --git a/gulliver/js/codemirror/contrib/lua/css/luacolors.css b/gulliver/js/codemirror/contrib/lua/css/luacolors.css
new file mode 100755
index 000000000..e9015296f
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/lua/css/luacolors.css
@@ -0,0 +1,63 @@
+html {
+ cursor: text;
+}
+
+.editbox {
+ margin: .4em;
+ padding: 0;
+ font-family: monospace;
+ font-size: 10pt;
+ color: black;
+}
+
+pre.code, .editbox {
+ color: #666666;
+}
+
+.editbox p {
+ margin: 0;
+}
+
+span.lua-comment {
+ color: #BB9977;
+}
+
+span.lua-keyword {
+ font-weight: bold;
+ color: blue;
+}
+
+span.lua-string {
+ color: #AA2222;
+}
+
+span.lua-stdfunc {
+ font-weight: bold;
+ color: #077;
+}
+span.lua-customfunc {
+ font-weight: bold;
+ color: #0AA;
+}
+
+
+span.lua-identifier {
+ color: black;
+}
+
+span.lua-number {
+ color: #3A3;
+}
+
+span.lua-token {
+ color: #151;
+}
+
+span.lua-error {
+ color: #FFF;
+ background-color: #F00;
+}
+
+
+
+
diff --git a/gulliver/js/codemirror/contrib/lua/index.html b/gulliver/js/codemirror/contrib/lua/index.html
new file mode 100755
index 000000000..03a322998
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/lua/index.html
@@ -0,0 +1,68 @@
+
+
+
+ CodeMirror: Lua demonstration
+
+
+
+
Adapted from the official Javascript parser by Eric KEDJI
+ <eric.kedji@gmail.com>.
+
+
+
+
+
+
+
+
+
diff --git a/gulliver/js/codemirror/contrib/ometa/js/parseometa.js b/gulliver/js/codemirror/contrib/ometa/js/parseometa.js
new file mode 100755
index 000000000..efb715e94
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/ometa/js/parseometa.js
@@ -0,0 +1,364 @@
+/* Parse function for JavaScript. Makes use of the tokenizer from
+ * tokenizejavascript.js. Note that your parsers do not have to be
+ * this complicated -- if you don't want to recognize local variables,
+ * in many languages it is enough to just look for braces, semicolons,
+ * parentheses, etc, and know when you are inside a string or comment.
+ *
+ * See manual.html for more info about the parser interface.
+ */
+
+var JSParser = Editor.Parser = (function() {
+ // Token types that can be considered to be atoms.
+ var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true};
+ // Setting that can be used to have JSON data indent properly.
+ var json = false;
+ // Constructor for the lexical context objects.
+ function JSLexical(indented, column, type, align, prev, info) {
+ // indentation at start of this line
+ this.indented = indented;
+ // column at which this scope was opened
+ this.column = column;
+ // type of scope ('vardef', 'stat' (statement), 'form' (special form), '[', '{', or '(')
+ this.type = type;
+ // '[', '{', or '(' blocks that have any text after their opening
+ // character are said to be 'aligned' -- any lines below are
+ // indented all the way to the opening character.
+ if (align != null)
+ this.align = align;
+ // Parent scope, if any.
+ this.prev = prev;
+ this.info = info;
+ }
+
+ // My favourite JavaScript indentation rules.
+ function indentJS(lexical) {
+ return function(firstChars) {
+ var firstChar = firstChars && firstChars.charAt(0), type = lexical.type;
+ var closing = firstChar == type;
+ if (type == "vardef")
+ return lexical.indented + 4;
+ else if (type == "form" && firstChar == "{")
+ return lexical.indented;
+ else if (type == "stat" || type == "form")
+ return lexical.indented + indentUnit;
+ else if (lexical.info == "switch" && !closing)
+ return lexical.indented + (/^(?:case|default)\b/.test(firstChars) ? indentUnit : 2 * indentUnit);
+ else if (lexical.align)
+ return lexical.column - (closing ? 1 : 0);
+ else
+ return lexical.indented + (closing ? 0 : indentUnit);
+ };
+ }
+
+ // The parser-iterator-producing function itself.
+ function parseJS(input, basecolumn) {
+ // Wrap the input in a token stream
+ var tokens = tokenizeJavaScript(input);
+ // The parser state. cc is a stack of actions that have to be
+ // performed to finish the current statement. For example we might
+ // know that we still need to find a closing parenthesis and a
+ // semicolon. Actions at the end of the stack go first. It is
+ // initialized with an infinitely looping action that consumes
+ // whole statements.
+ var cc = [json ? expressions : statements];
+ // Context contains information about the current local scope, the
+ // variables defined in that, and the scopes above it.
+ var context = null;
+ // The lexical scope, used mostly for indentation.
+ var lexical = new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false);
+ // Current column, and the indentation at the start of the current
+ // line. Used to create lexical scope objects.
+ var column = 0;
+ var indented = 0;
+ // Variables which are used by the mark, cont, and pass functions
+ // below to communicate with the driver loop in the 'next'
+ // function.
+ var consume, marked;
+
+ // The iterator object.
+ var parser = {next: next, copy: copy};
+
+ function next(){
+ // Start by performing any 'lexical' actions (adjusting the
+ // lexical variable), or the operations below will be working
+ // with the wrong lexical state.
+ while(cc[cc.length - 1].lex)
+ cc.pop()();
+
+ // Fetch a token.
+ var token = tokens.next();
+
+ // Adjust column and indented.
+ if (token.type == "whitespace" && column == 0)
+ indented = token.value.length;
+ column += token.value.length;
+ if (token.content == "\n"){
+ indented = column = 0;
+ // If the lexical scope's align property is still undefined at
+ // the end of the line, it is an un-aligned scope.
+ if (!("align" in lexical))
+ lexical.align = false;
+ // Newline tokens get an indentation function associated with
+ // them.
+ token.indentation = indentJS(lexical);
+ // special handling for multiline strings: keep everything in the first
+ // column, as spaces at the start of a multiline string are significant
+ if (lexical.info == "multilineString") {
+ lexical.align = false;
+ token.indentation = function () { return 0; };
+ }
+ }
+ // No more processing for meaningless tokens.
+ if (token.type == "whitespace" || token.type == "comment")
+ return token;
+ // Take note when a multiline string is found, so as to
+ // correctly handle indentation at the end of the line
+ // (see above, line 95)
+ if (token.type == "multilineString")
+ lexical.info = 'multilineString';
+ // When a meaningful token is found and the lexical scope's
+ // align is undefined, it is an aligned scope.
+ if (!("align" in lexical))
+ lexical.align = true;
+
+ // Execute actions until one 'consumes' the token and we can
+ // return it.
+ while(true) {
+ consume = marked = false;
+ // Take and execute the topmost action.
+ cc.pop()(token.type, token.content);
+ if (consume){
+ // Marked is used to change the style of the current token.
+ if (marked)
+ token.style = marked;
+ // Here we differentiate between local and global variables.
+ else if (token.type == "variable" && inScope(token.content))
+ token.style = "js-localvariable";
+ return token;
+ }
+ }
+ }
+
+ // This makes a copy of the parser state. It stores all the
+ // stateful variables in a closure, and returns a function that
+ // will restore them when called with a new input stream. Note
+ // that the cc array has to be copied, because it is contantly
+ // being modified. Lexical objects are not mutated, and context
+ // objects are not mutated in a harmful way, so they can be shared
+ // between runs of the parser.
+ function copy(){
+ var _context = context, _lexical = lexical, _cc = cc.concat([]), _tokenState = tokens.state;
+
+ return function copyParser(input){
+ context = _context;
+ lexical = _lexical;
+ cc = _cc.concat([]); // copies the array
+ column = indented = 0;
+ tokens = tokenizeJavaScript(input, _tokenState);
+ return parser;
+ };
+ }
+
+ // Helper function for pushing a number of actions onto the cc
+ // stack in reverse order.
+ function push(fs){
+ for (var i = fs.length - 1; i >= 0; i--)
+ cc.push(fs[i]);
+ }
+ // cont and pass are used by the action functions to add other
+ // actions to the stack. cont will cause the current token to be
+ // consumed, pass will leave it for the next action.
+ function cont(){
+ push(arguments);
+ consume = true;
+ }
+ function pass(){
+ push(arguments);
+ consume = false;
+ }
+ // Used to change the style of the current token.
+ function mark(style){
+ marked = style;
+ }
+
+ // Push a new scope. Will automatically link the current scope.
+ function pushcontext(){
+ context = {prev: context, vars: {"this": true, "arguments": true}};
+ }
+ // Pop off the current scope.
+ function popcontext(){
+ context = context.prev;
+ }
+ // Register a variable in the current scope.
+ function register(varname){
+ if (context){
+ mark("js-variabledef");
+ context.vars[varname] = true;
+ }
+ }
+ // Check whether a variable is defined in the current scope.
+ function inScope(varname){
+ var cursor = context;
+ while (cursor) {
+ if (cursor.vars[varname])
+ return true;
+ cursor = cursor.prev;
+ }
+ return false;
+ }
+
+ // Push a new lexical context of the given type.
+ function pushlex(type, info) {
+ var result = function(){
+ lexical = new JSLexical(indented, column, type, null, lexical, info)
+ };
+ result.lex = true;
+ return result;
+ }
+ // Pop off the current lexical context.
+ function poplex(){
+ lexical = lexical.prev;
+ }
+ poplex.lex = true;
+ // The 'lex' flag on these actions is used by the 'next' function
+ // to know they can (and have to) be ran before moving on to the
+ // next token.
+
+ // Creates an action that discards tokens until it finds one of
+ // the given type.
+ function expect(wanted){
+ return function expecting(type){
+ if (type == wanted) cont();
+ else cont(arguments.callee);
+ };
+ }
+
+ // Looks for a statement, and then calls itself.
+ function statements(type){
+ return pass(statement, statements);
+ }
+ function expressions(type){
+ return pass(expression, expressions);
+ }
+ // Dispatches various types of statements based on the type of the
+ // current token.
+ function statement(type){
+ if (type == "var") cont(pushlex("vardef"), vardef1, expect(";"), poplex);
+ else if (type == "keyword a") cont(pushlex("form"), expression, statement, poplex);
+ else if (type == "keyword b") cont(pushlex("form"), statement, poplex);
+ else if (type == "{") cont(pushlex("}"), block, poplex);
+ else if (type == "function") cont(functiondef);
+ else if (type == "for") cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), poplex, statement, poplex);
+ else if (type == "variable") cont(pushlex("stat"), maybelabel);
+ else if (type == "switch") cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), block, poplex, poplex);
+ else if (type == "case") cont(expression, expect(":"));
+ else if (type == "default") cont(expect(":"));
+ else if (type == "catch") cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), statement, poplex, popcontext);
+ else pass(pushlex("stat"), expression, expect(";"), poplex);
+ }
+ // Dispatch expression types.
+ function expression(type){
+ if (atomicTypes.hasOwnProperty(type)) cont(maybeoperator);
+ else if (type == "function") cont(functiondef);
+ else if (type == "keyword c") cont(expression);
+ else if (type == "(") cont(pushlex(")"), expression, expect(")"), poplex, maybeoperator);
+ else if (type == "operator") cont(expression);
+ else if (type == "[") cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator);
+ else if (type == "{") cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator);
+ else cont();
+ }
+ // Called for places where operators, function calls, or
+ // subscripts are valid. Will skip on to the next action if none
+ // is found.
+ function maybeoperator(type){
+ if (type == "operator") cont(expression);
+ else if (type == "(") cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator);
+ else if (type == ".") cont(property, maybeoperator);
+ else if (type == "[") cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator);
+ }
+ // When a statement starts with a variable name, it might be a
+ // label. If no colon follows, it's a regular statement.
+ function maybelabel(type){
+ if (type == ":") cont(poplex, statement);
+ else pass(maybeoperator, expect(";"), poplex);
+ }
+ // Property names need to have their style adjusted -- the
+ // tokenizer thinks they are variables.
+ function property(type){
+ if (type == "variable") {mark("js-property"); cont();}
+ }
+ // This parses a property and its value in an object literal.
+ function objprop(type){
+ if (type == "variable") mark("js-property");
+ if (atomicTypes.hasOwnProperty(type)) cont(expect(":"), expression);
+ }
+ // Parses a comma-separated list of the things that are recognized
+ // by the 'what' argument.
+ function commasep(what, end){
+ function proceed(type) {
+ if (type == ",") cont(what, proceed);
+ else if (type == end) cont();
+ else cont(expect(end));
+ }
+ return function commaSeparated(type) {
+ if (type == end) cont();
+ else pass(what, proceed);
+ };
+ }
+ // Look for statements until a closing brace is found.
+ function block(type){
+ if (type == "}") cont();
+ else pass(statement, block);
+ }
+ // Variable definitions are split into two actions -- 1 looks for
+ // a name or the end of the definition, 2 looks for an '=' sign or
+ // a comma.
+ function vardef1(type, value){
+ if (type == "variable"){register(value); cont(vardef2);}
+ else cont();
+ }
+ function vardef2(type, value){
+ if (value == "=") cont(expression, vardef2);
+ else if (type == ",") cont(vardef1);
+ }
+ // For loops.
+ function forspec1(type){
+ if (type == "var") cont(vardef1, forspec2);
+ else if (type == ";") pass(forspec2);
+ else if (type == "variable") cont(formaybein);
+ else pass(forspec2);
+ }
+ function formaybein(type, value){
+ if (value == "in") cont(expression);
+ else cont(maybeoperator, forspec2);
+ }
+ function forspec2(type, value){
+ if (type == ";") cont(forspec3);
+ else if (value == "in") cont(expression);
+ else cont(expression, expect(";"), forspec3);
+ }
+ function forspec3(type) {
+ if (type == ")") pass();
+ else cont(expression);
+ }
+ // A function definition creates a new context, and the variables
+ // in its argument list have to be added to this context.
+ function functiondef(type, value){
+ if (type == "variable"){register(value); cont(functiondef);}
+ else if (type == "(") cont(pushcontext, commasep(funarg, ")"), statement, popcontext);
+ }
+ function funarg(type, value){
+ if (type == "variable"){register(value); cont();}
+ }
+
+ return parser;
+ }
+
+ return {
+ make: parseJS,
+ electricChars: "{}:",
+ configure: function(obj) {
+ if (obj.json != null) json = obj.json;
+ }
+ };
+})();
diff --git a/gulliver/js/codemirror/contrib/ometa/js/tokenizeometa.js b/gulliver/js/codemirror/contrib/ometa/js/tokenizeometa.js
new file mode 100755
index 000000000..430206ca5
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/ometa/js/tokenizeometa.js
@@ -0,0 +1,209 @@
+/* Tokenizer for JavaScript code */
+
+var tokenizeJavaScript = (function() {
+ // Advance the stream until the given character (not preceded by a
+ // backslash) is encountered, or the end of the line is reached.
+ function nextUntilUnescaped(source, end) {
+ var escaped = false;
+ while (!source.endOfLine()) {
+ var next = source.next();
+ if (next == end && !escaped)
+ return false;
+ escaped = !escaped && next == "\\";
+ }
+ return escaped;
+ }
+
+ // A map of JavaScript's keywords. The a/b/c keyword distinction is
+ // very rough, but it gives the parser enough information to parse
+ // correct code correctly (we don't care that much how we parse
+ // incorrect code). The style information included in these objects
+ // is used by the highlighter to pick the correct CSS style for a
+ // token.
+ var keywords = function(){
+ function result(type, style){
+ return {type: type, style: "js-" + style};
+ }
+ // keywords that take a parenthised expression, and then a
+ // statement (if)
+ var keywordA = result("keyword a", "keyword");
+ // keywords that take just a statement (else)
+ var keywordB = result("keyword b", "keyword");
+ // keywords that optionally take an expression, and form a
+ // statement (return)
+ var keywordC = result("keyword c", "keyword");
+ var operator = result("operator", "keyword");
+ var atom = result("atom", "atom");
+ return {
+ "if": keywordA, "while": keywordA, "with": keywordA,
+ "else": keywordB, "do": keywordB, "try": keywordB, "finally": keywordB,
+ "return": keywordC, "break": keywordC, "continue": keywordC, "new": keywordC, "delete": keywordC, "throw": keywordC,
+ "in": operator, "typeof": operator, "instanceof": operator,
+ "var": result("var", "keyword"), "function": result("function", "keyword"), "catch": result("catch", "keyword"),
+ "for": result("for", "keyword"), "switch": result("switch", "keyword"),
+ "case": result("case", "keyword"), "default": result("default", "keyword"),
+ "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
+ "ometa": keywordB
+ };
+ }();
+
+ // Some helper regexps
+ var isOperatorChar = /[+\-*&%=<>!?|~]/;
+ var isHexDigit = /[0-9A-Fa-f]/;
+ var isWordChar = /[\w\$_]/;
+
+ // Wrapper around jsToken that helps maintain parser state (whether
+ // we are inside of a multi-line comment and whether the next token
+ // could be a regular expression).
+ function jsTokenState(inside, regexp) {
+ return function(source, setState) {
+ var newInside = inside;
+ var type = jsToken(inside, regexp, source, function(c) {newInside = c;});
+ var newRegexp = type.type == "operator" || type.type == "keyword c" || type.type.match(/^[\[{}\(,;:]$/);
+ if (newRegexp != regexp || newInside != inside)
+ setState(jsTokenState(newInside, newRegexp));
+ return type;
+ };
+ }
+
+ // The token reader, intended to be used by the tokenizer from
+ // tokenize.js (through jsTokenState). Advances the source stream
+ // over a token, and returns an object containing the type and style
+ // of that token.
+ function jsToken(inside, regexp, source, setInside) {
+ function readHexNumber(){
+ source.next(); // skip the 'x'
+ source.nextWhileMatches(isHexDigit);
+ return {type: "number", style: "js-atom"};
+ }
+
+ function readNumber() {
+ source.nextWhileMatches(/[0-9]/);
+ if (source.equals(".")){
+ source.next();
+ source.nextWhileMatches(/[0-9]/);
+ }
+ if (source.equals("e") || source.equals("E")){
+ source.next();
+ if (source.equals("-"))
+ source.next();
+ source.nextWhileMatches(/[0-9]/);
+ }
+ return {type: "number", style: "js-atom"};
+ }
+ // Read a word, look it up in keywords. If not found, it is a
+ // variable, otherwise it is a keyword of the type found.
+ function readWord() {
+ source.nextWhileMatches(isWordChar);
+ var word = source.get();
+ var known = keywords.hasOwnProperty(word) && keywords.propertyIsEnumerable(word) && keywords[word];
+ return known ? {type: known.type, style: known.style, content: word} :
+ {type: "variable", style: "js-variable", content: word};
+ }
+ function readRegexp() {
+ nextUntilUnescaped(source, "/");
+ source.nextWhileMatches(/[gi]/);
+ return {type: "regexp", style: "js-string"};
+ }
+ // Mutli-line comments are tricky. We want to return the newlines
+ // embedded in them as regular newline tokens, and then continue
+ // returning a comment token for every line of the comment. So
+ // some state has to be saved (inside) to indicate whether we are
+ // inside a /* */ sequence.
+ function readMultilineComment(start){
+ var newInside = "/*";
+ var maybeEnd = (start == "*");
+ while (true) {
+ if (source.endOfLine())
+ break;
+ var next = source.next();
+ if (next == "/" && maybeEnd){
+ newInside = null;
+ break;
+ }
+ maybeEnd = (next == "*");
+ }
+ setInside(newInside);
+ return {type: "comment", style: "js-comment"};
+ }
+ function readMultilineString(start, quotes) {
+ var newInside = quotes;
+ var quote = quotes.charAt(0);
+ var maybeEnd = (start == quote);
+ while (true) {
+ if (source.endOfLine())
+ break;
+ var next = source.next();
+ if (next == quote && source.peek() == quote && maybeEnd) {
+ source.next();
+ newInside = null;
+ break;
+ }
+ maybeEnd = (next == quote);
+ }
+ setInside(newInside);
+ return {type: "multilineString", style: "js-string"};
+ }
+ function readOperator() {
+ source.nextWhileMatches(isOperatorChar);
+ return {type: "operator", style: "js-operator"};
+ }
+ function readString(quote) {
+ var endBackSlash = nextUntilUnescaped(source, quote);
+ setInside(endBackSlash ? quote : null);
+ return {type: "string", style: "js-string"};
+ }
+ function readOmetaIdentifierString() {
+ source.nextWhileMatches(isWordChar);
+ return {type: "string", style: "js-string"};
+ }
+ function readOmetaBinding() {
+ source.nextWhileMatches(isWordChar);
+ return {type: "variable", style: "ometa-binding"};
+ }
+
+ // Fetch the next token. Dispatches on first character in the
+ // stream, or first two characters when the first is a slash.
+ if (inside == "\"" || inside == "'")
+ return readString(inside);
+ var ch = source.next();
+ if (inside == "/*")
+ return readMultilineComment(ch);
+ if (inside == '"""' || inside == "'''")
+ return readMultilineString(ch, inside);
+ if (ch == '"' && source.lookAhead('""', true) || ch == "'" && source.lookAhead("''", true))
+ return readMultilineString('-', ch+ch+ch); // work as far as '-' is not '"' nor "'"
+ else if (ch == "\"" || ch == "'")
+ return readString(ch);
+ else if (ch == "`" || ch == "#" )
+ return readOmetaIdentifierString();
+ else if (ch == ':' && isWordChar.test(source.peek()))
+ return readOmetaBinding();
+ // with punctuation, the type of the token is the symbol itself
+ else if (/[\[\]{}\(\),;\:\.]/.test(ch))
+ return {type: ch, style: "js-punctuation"};
+ else if (ch == "0" && (source.equals("x") || source.equals("X")))
+ return readHexNumber();
+ else if (/[0-9]/.test(ch))
+ return readNumber();
+ else if (ch == "/"){
+ if (source.equals("*"))
+ { source.next(); return readMultilineComment(ch); }
+ else if (source.equals("/"))
+ { nextUntilUnescaped(source, null); return {type: "comment", style: "js-comment"};}
+ else if (regexp)
+ return readRegexp();
+ else
+ return readOperator();
+ }
+ else if (isOperatorChar.test(ch))
+ return readOperator();
+ else
+ return readWord();
+ }
+
+ // The external interface to the tokenizer.
+ return function(source, startState) {
+ return tokenizer(source, startState || jsTokenState(false, true));
+ };
+})();
diff --git a/gulliver/js/codemirror/contrib/php/LICENSE b/gulliver/js/codemirror/contrib/php/LICENSE
new file mode 100755
index 000000000..32f48cad0
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/php/LICENSE
@@ -0,0 +1,37 @@
+Copyright (c) 2008-2009, Yahoo! Inc.
+All rights reserved.
+
+This software is provided for use in connection with the
+CodeMirror suite of modules and utilities, hosted and maintained
+at http://codemirror.net/.
+
+Redistribution and use of this software in source and binary forms,
+with or without modification, are permitted provided that the
+following conditions are met:
+
+* Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the
+ following disclaimer.
+
+* Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the
+ following disclaimer in the documentation and/or other
+ materials provided with the distribution.
+
+* Neither the name of Yahoo! Inc. nor the names of its
+ contributors may be used to endorse or promote products
+ derived from this software without specific prior
+ written permission of Yahoo! Inc.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
diff --git a/gulliver/js/codemirror/contrib/php/css/phpcolors.css b/gulliver/js/codemirror/contrib/php/css/phpcolors.css
new file mode 100755
index 000000000..43d4057b1
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/php/css/phpcolors.css
@@ -0,0 +1,114 @@
+/*
+Copyright (c) 2008-2009 Yahoo! Inc. All rights reserved.
+The copyrights embodied in the content of this file are licensed by
+Yahoo! Inc. under the BSD (revised) open source license
+
+@author Dan Vlad Dascalescu
+*/
+
+html {
+ cursor: text;
+}
+
+.editbox {
+ margin: .4em;
+ padding: 0;
+ font-family: monospace;
+ font-size: 10pt;
+}
+
+/*We should define specific styles for every element of the syntax.
+ the setting below will cause some annoying color to show through if we missed
+ defining a style for a token. This is also the "color" of the whitespace and
+ of the cursor.
+*/
+pre.code, .editbox {
+ color: red;
+}
+
+.editbox p {
+ margin: 0;
+}
+
+span.php-punctuation {
+ color: blue;
+}
+
+span.php-keyword {
+ color: #770088;
+ font-weight: bold;
+}
+
+span.php-operator {
+ color: blue;
+}
+
+/* __FILE__ etc.; http://php.net/manual/en/reserved.php */
+span.php-compile-time-constant {
+ color: #776088;
+ font-weight: bold;
+}
+
+/* output of get_defined_constants(). Differs from http://php.net/manual/en/reserved.constants.php */
+span.php-predefined-constant {
+ color: darkgreen;
+ font-weight: bold;
+}
+
+/* PHP reserved "language constructs"... echo() etc.; http://php.net/manual/en/reserved.php */
+span.php-reserved-language-construct {
+ color: green;
+ font-weight: bold;
+}
+
+/* PHP built-in functions: glob(), chr() etc.; output of get_defined_functions()["internal"] */
+span.php-predefined-function {
+ color: green;
+}
+
+/* PHP predefined classes: PDO, Exception etc.; output of get_declared_classes() and different from http://php.net/manual/en/reserved.classes.php */
+span.php-predefined-class {
+ color: green;
+}
+
+span.php-atom {
+ color: #228811;
+}
+
+/* class, interface, namespace or function names, but not $variables */
+span.php-t_string {
+ color: black;
+}
+
+span.php-variable {
+ color: black;
+ font-weight: bold;
+}
+
+
+span.js-localvariable {
+ color: #004499;
+}
+
+span.php-comment {
+ color: #AA7700;
+ font-stretch: condensed;
+/* font-style: italic; This causes line height to slightly change, getting line numbers out of sync */
+}
+
+span.php-string-single-quoted {
+ color: #AA2222;
+}
+/* double quoted strings allow interpolation */
+span.php-string-double-quoted {
+ color: #AA2222;
+ font-weight: bold;
+}
+
+span.syntax-error {
+ background-color: red;
+}
+
+span.deprecated {
+ font-size: smaller;
+}
diff --git a/gulliver/js/codemirror/contrib/php/index.html b/gulliver/js/codemirror/contrib/php/index.html
new file mode 100755
index 000000000..006cb563e
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/php/index.html
@@ -0,0 +1,310 @@
+
+
+
+
+
+
+ CodeMirror: PHP+HTML+JavaScript+CSS mixed-mode demonstration
+
+
+
+
+
This is a complex demonstration of the PHP+HTML+JavaScript+CSS mixed-mode
+ syntax highlight capabilities of CodeMirror.
+ <?php ... ?> tags use the PHP parser, <script> tags use the JavaScript
+ parser, and <style> tags use the CSS parser. The rest of the content is
+ parsed using the XML parser in HTML mode.
+
+
Features of the PHP parser:
+
+
special "deprecated" style for PHP4 keywords like 'var'
+
support for PHP 5.3 keywords: 'namespace', 'use'
+
911 predefined constants, 1301 predefined functions, 105 predeclared classes
+ from a typical PHP installation in a LAMP environment
+
The Regex parser for CodeMirror allows syntax coloring on regular expressions with some beginning customizability by
+ Regex flavor/language. For integrating styling of regular expression literals into JavaScript syntax highlighting, see this
+ JavaScript+Regex Demo.
+
Styling ability is fine-grained, so any token should be distinctly stylable if so desired. Parenthetical groups can
+ be styled with the same styles for inner content, and the script also enables styling by nesting depth and sequence,
+ including by imposing a limit such that styles will alternate.
+
Information can also be passed on (especially when the parseregex-unicode.js file is included) for use in CodeMirror's
+ activeTokens argument such as demonstrated below by tooltips which show which characters are present in a given
+ range or Unicode class.
+
Note that this editor does not support free-spacing mode, so it is not recommended to use multiple lines for input, but
+ for demonstration purposes, multiple lines are shown.
This demonstrates a parser in the regex folder which wraps the regular CodeMirror JavaScript editor and adds syntax coloring to
+ regular expression literals in JavaScript.
+
+
+
While the above styles by depth or sequence no matter the grouping type, this parser also allows styling distinctly by grouping type (capturing, named, non-capturing), while also still allowing alternating of colors within a type.
+
+
One may also simply turn off the styling of content inside groups, allowing only individual tokens to be styled per the stylesheet (though the parentheses tokens themselves can still indicate depth or sequence):
+
+
+
+
diff --git a/gulliver/js/codemirror/contrib/regex/js/parsejavascript_and_regex.js b/gulliver/js/codemirror/contrib/regex/js/parsejavascript_and_regex.js
new file mode 100755
index 000000000..6a63d0d98
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/regex/js/parsejavascript_and_regex.js
@@ -0,0 +1,91 @@
+// See the dependencies parsejavascript.js and parseregex.js (optionally with parseregex-unicode.js) for options
+
+var JSAndRegexParser = Editor.Parser = (function() {
+ // Parser
+ var run = function () {},
+ regexParser, jsParser, lastRegexSrc,
+ regexPG = {}, jsPG = {};
+
+ function simpleStream (s) {
+ var str = s, pos = 0;
+ return {
+ next : function () {
+ if (pos >= str.length) {
+ throw StopIteration;
+ }
+ return str.charAt(pos++);
+ }
+ };
+ }
+
+ function regex () {
+ var token;
+ try {
+ token = regexParser.next();
+ }
+ catch(e) {
+ _setState(js);
+ return js();
+ }
+ _setState(regex);
+ return token;
+ }
+ function js () {
+ var token = jsParser.next();
+ if (token.type === 'regexp') {
+ lastRegexSrc = stringStream(simpleStream(token.content));
+ regexParser = RegexParser.make(lastRegexSrc);
+ return regex();
+ }
+ return token;
+ }
+
+ function _setState (func) {
+ run = func;
+ }
+
+ function parseJSAndRegex (stream, basecolumn) {
+ JSParser.configure(jsPG);
+ RegexParser.configure(regexPG);
+ jsParser = JSParser.make(stream, basecolumn);
+ _setState(js);
+
+ var iter = {
+ next: function() {
+ return run(stream);
+ },
+ copy: function() {
+ var _run = run, _lastRegexSrc = lastRegexSrc,
+ _jsParser = jsParser.copy(),
+ _regexParser = regexParser && regexParser.copy();
+
+ return function (_stream) {
+ stream = _stream;
+ jsParser = _jsParser(_stream);
+ regexParser = _regexParser && _regexParser(_lastRegexSrc);
+ run = _run;
+ return iter;
+ };
+ }
+ };
+ return iter;
+ }
+
+ // Parser object
+ return {
+ make: parseJSAndRegex,
+ configure: function (parserConfig) {
+ for (var opt in parserConfig) {
+ if ((/^regex_/).test(opt)) {
+ regexPG[opt.replace(/^regex_/, '')] = parserConfig[opt];
+ }
+ else { // Doesn't need a js- prefix, but we'll strip if it does
+ jsPG[opt.replace(/^js_/, '')] = parserConfig[opt];
+ }
+ }
+ regexPG.flavor = regexPG.flavor || 'ecma-262-ed3'; // Allow ed5, etc. if specified
+ regexPG.literal = true; // This is only for literals, since can't easily detect whether will be used for RegExp
+ regexPG.literal_initial = '/'; // Ensure it's always this for JavaScript regex literals
+ }
+ };
+})();
diff --git a/gulliver/js/codemirror/contrib/regex/js/parseregex-unicode.js b/gulliver/js/codemirror/contrib/regex/js/parseregex-unicode.js
new file mode 100755
index 000000000..583a4f195
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/regex/js/parseregex-unicode.js
@@ -0,0 +1,284 @@
+ /*
+ * Note: To include Unicode validation, you must include your CodeMirror parserfile option in this sequence:
+ * parserfile: ["parseregex.js", "parseregex-unicode.js"]
+*/
+(function () {
+
+
+// Fix: Add non-BMP code points
+
+var UnicodeCategories = {
+ C: "0000-001F007F-009F00AD03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-0605061C061D0620065F06DD070E070F074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17B417B517DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF200B-200F202A-202E2060-206F20722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-F8FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFD-FF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFFBFFFEFFFF",
+ Cc: "0000-001F007F-009F",
+ Cf: "00AD0600-060306DD070F17B417B5200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB",
+ Co: "E000-F8FF",
+ Cs: "D800-DFFF",
+ Cn: "03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-05FF06040605061C061D0620065F070E074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF2065-206920722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-D7FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFDFEFEFF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFF8FFFEFFFF",
+ L: "0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05250531-055605590561-058705D0-05EA05F0-05F20621-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280904-0939093D09500958-0961097109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510D0-10FA10FC1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209421022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2D00-2D252D30-2D652D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A65FA662-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78BA78CA7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",
+ Ll: "0061-007A00AA00B500BA00DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02AF037103730377037B-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F0521052305250561-05871D00-1D2B1D62-1D771D79-1D9A1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF7210A210E210F2113212F21342139213C213D2146-2149214E21842C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7C2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2D00-2D25A641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76FA771-A778A77AA77CA77FA781A783A785A787A78CFB00-FB06FB13-FB17FF41-FF5A",
+ Lu: "0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E0520052205240531-055610A0-10C51E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F214521832C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CEDA640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BFF21-FF3A",
+ Lt: "01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC",
+ Lm: "02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D611D781D9B-1DBF2071207F2090-20942C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A9CFAA70AADDFF70FF9EFF9F",
+ Lo: "01BB01C0-01C3029405D0-05EA05F0-05F20621-063F0641-064A066E066F0671-06D306D506EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA0800-08150904-0939093D09500958-096109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E450E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10D0-10FA1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317DC1820-18421844-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C771CE9-1CEC1CEE-1CF12135-21382D30-2D652D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE3006303C3041-3096309F30A1-30FA30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A014A016-A48CA4D0-A4F7A500-A60BA610-A61FA62AA62BA66EA6A0-A6E5A7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2AA00-AA28AA40-AA42AA44-AA4BAA60-AA6FAA71-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADBAADCABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF66-FF6FFF71-FF9DFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",
+ M: "0300-036F0483-04890591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DE-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0903093C093E-094E0951-0955096209630981-098309BC09BE-09C409C709C809CB-09CD09D709E209E30A01-0A030A3C0A3E-0A420A470A480A4B-0A4D0A510A700A710A750A81-0A830ABC0ABE-0AC50AC7-0AC90ACB-0ACD0AE20AE30B01-0B030B3C0B3E-0B440B470B480B4B-0B4D0B560B570B620B630B820BBE-0BC20BC6-0BC80BCA-0BCD0BD70C01-0C030C3E-0C440C46-0C480C4A-0C4D0C550C560C620C630C820C830CBC0CBE-0CC40CC6-0CC80CCA-0CCD0CD50CD60CE20CE30D020D030D3E-0D440D46-0D480D4A-0D4D0D570D620D630D820D830DCA0DCF-0DD40DD60DD8-0DDF0DF20DF30E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F3E0F3F0F71-0F840F860F870F90-0F970F99-0FBC0FC6102B-103E1056-1059105E-10601062-10641067-106D1071-10741082-108D108F109A-109D135F1712-17141732-1734175217531772177317B6-17D317DD180B-180D18A91920-192B1930-193B19B0-19C019C819C91A17-1A1B1A55-1A5E1A60-1A7C1A7F1B00-1B041B34-1B441B6B-1B731B80-1B821BA1-1BAA1C24-1C371CD0-1CD21CD4-1CE81CED1CF21DC0-1DE61DFD-1DFF20D0-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66F-A672A67CA67DA6F0A6F1A802A806A80BA823-A827A880A881A8B4-A8C4A8E0-A8F1A926-A92DA947-A953A980-A983A9B3-A9C0AA29-AA36AA43AA4CAA4DAA7BAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE3-ABEAABECABEDFB1EFE00-FE0FFE20-FE26",
+ Mn: "0300-036F0483-04870591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0902093C0941-0948094D0951-095509620963098109BC09C1-09C409CD09E209E30A010A020A3C0A410A420A470A480A4B-0A4D0A510A700A710A750A810A820ABC0AC1-0AC50AC70AC80ACD0AE20AE30B010B3C0B3F0B41-0B440B4D0B560B620B630B820BC00BCD0C3E-0C400C46-0C480C4A-0C4D0C550C560C620C630CBC0CBF0CC60CCC0CCD0CE20CE30D41-0D440D4D0D620D630DCA0DD2-0DD40DD60E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F71-0F7E0F80-0F840F860F870F90-0F970F99-0FBC0FC6102D-10301032-10371039103A103D103E10581059105E-10601071-1074108210851086108D109D135F1712-17141732-1734175217531772177317B7-17BD17C617C9-17D317DD180B-180D18A91920-19221927192819321939-193B1A171A181A561A58-1A5E1A601A621A65-1A6C1A73-1A7C1A7F1B00-1B031B341B36-1B3A1B3C1B421B6B-1B731B801B811BA2-1BA51BA81BA91C2C-1C331C361C371CD0-1CD21CD4-1CE01CE2-1CE81CED1DC0-1DE61DFD-1DFF20D0-20DC20E120E5-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66FA67CA67DA6F0A6F1A802A806A80BA825A826A8C4A8E0-A8F1A926-A92DA947-A951A980-A982A9B3A9B6-A9B9A9BCAA29-AA2EAA31AA32AA35AA36AA43AA4CAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE5ABE8ABEDFB1EFE00-FE0FFE20-FE26",
+ Mc: "0903093E-09400949-094C094E0982098309BE-09C009C709C809CB09CC09D70A030A3E-0A400A830ABE-0AC00AC90ACB0ACC0B020B030B3E0B400B470B480B4B0B4C0B570BBE0BBF0BC10BC20BC6-0BC80BCA-0BCC0BD70C01-0C030C41-0C440C820C830CBE0CC0-0CC40CC70CC80CCA0CCB0CD50CD60D020D030D3E-0D400D46-0D480D4A-0D4C0D570D820D830DCF-0DD10DD8-0DDF0DF20DF30F3E0F3F0F7F102B102C10311038103B103C105610571062-10641067-106D108310841087-108C108F109A-109C17B617BE-17C517C717C81923-19261929-192B193019311933-193819B0-19C019C819C91A19-1A1B1A551A571A611A631A641A6D-1A721B041B351B3B1B3D-1B411B431B441B821BA11BA61BA71BAA1C24-1C2B1C341C351CE11CF2A823A824A827A880A881A8B4-A8C3A952A953A983A9B4A9B5A9BAA9BBA9BD-A9C0AA2FAA30AA33AA34AA4DAA7BABE3ABE4ABE6ABE7ABE9ABEAABEC",
+ Me: "0488048906DE20DD-20E020E2-20E4A670-A672",
+ N: "0030-003900B200B300B900BC-00BE0660-066906F0-06F907C0-07C90966-096F09E6-09EF09F4-09F90A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BF20C66-0C6F0C78-0C7E0CE6-0CEF0D66-0D750E50-0E590ED0-0ED90F20-0F331040-10491090-10991369-137C16EE-16F017E0-17E917F0-17F91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C5920702074-20792080-20892150-21822185-21892460-249B24EA-24FF2776-27932CFD30073021-30293038-303A3192-31953220-32293251-325F3280-328932B1-32BFA620-A629A6E6-A6EFA830-A835A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",
+ Nd: "0030-00390660-066906F0-06F907C0-07C90966-096F09E6-09EF0A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BEF0C66-0C6F0CE6-0CEF0D66-0D6F0E50-0E590ED0-0ED90F20-0F291040-10491090-109917E0-17E91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C59A620-A629A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",
+ Nl: "16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF",
+ No: "00B200B300B900BC-00BE09F4-09F90BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F920702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293251-325F3280-328932B1-32BFA830-A835",
+ P: "0021-00230025-002A002C-002F003A003B003F0040005B-005D005F007B007D00A100AB00B700BB00BF037E0387055A-055F0589058A05BE05C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F3A-0F3D0F850FD0-0FD4104A-104F10FB1361-13681400166D166E169B169C16EB-16ED1735173617D4-17D617D8-17DA1800-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD32010-20272030-20432045-20512053-205E207D207E208D208E2329232A2768-277527C527C627E6-27EF2983-299829D8-29DB29FC29FD2CF9-2CFC2CFE2CFF2E00-2E2E2E302E313001-30033008-30113014-301F3030303D30A030FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFD3EFD3FFE10-FE19FE30-FE52FE54-FE61FE63FE68FE6AFE6BFF01-FF03FF05-FF0AFF0C-FF0FFF1AFF1BFF1FFF20FF3B-FF3DFF3FFF5BFF5DFF5F-FF65",
+ Pd: "002D058A05BE140018062010-20152E172E1A301C303030A0FE31FE32FE58FE63FF0D",
+ Ps: "0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62",
+ Pe: "0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63",
+ Pi: "00AB2018201B201C201F20392E022E042E092E0C2E1C2E20",
+ Pf: "00BB2019201D203A2E032E052E0A2E0D2E1D2E21",
+ Pc: "005F203F20402054FE33FE34FE4D-FE4FFF3F",
+ Po: "0021-00230025-0027002A002C002E002F003A003B003F0040005C00A100B700BF037E0387055A-055F058905C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F850FD0-0FD4104A-104F10FB1361-1368166D166E16EB-16ED1735173617D4-17D617D8-17DA1800-18051807-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD3201620172020-20272030-2038203B-203E2041-20432047-205120532055-205E2CF9-2CFC2CFE2CFF2E002E012E06-2E082E0B2E0E-2E162E182E192E1B2E1E2E1F2E2A-2E2E2E302E313001-3003303D30FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFE10-FE16FE19FE30FE45FE46FE49-FE4CFE50-FE52FE54-FE57FE5F-FE61FE68FE6AFE6BFF01-FF03FF05-FF07FF0AFF0CFF0EFF0FFF1AFF1BFF1FFF20FF3CFF61FF64FF65",
+ S: "0024002B003C-003E005E0060007C007E00A2-00A900AC00AE-00B100B400B600B800D700F702C2-02C502D2-02DF02E5-02EB02ED02EF-02FF03750384038503F604820606-0608060B060E060F06E906FD06FE07F609F209F309FA09FB0AF10B700BF3-0BFA0C7F0CF10CF20D790E3F0F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-139917DB194019E0-19FF1B61-1B6A1B74-1B7C1FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE20442052207A-207C208A-208C20A0-20B8210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B2140-2144214A-214D214F2190-2328232B-23E82400-24262440-244A249C-24E92500-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE27C0-27C427C7-27CA27CC27D0-27E527F0-29822999-29D729DC-29FB29FE-2B4C2B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F309B309C319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A700-A716A720A721A789A78AA828-A82BA836-A839AA77-AA79FB29FDFCFDFDFE62FE64-FE66FE69FF04FF0BFF1C-FF1EFF3EFF40FF5CFF5EFFE0-FFE6FFE8-FFEEFFFCFFFD",
+ Sm: "002B003C-003E007C007E00AC00B100D700F703F60606-060820442052207A-207C208A-208C2140-2144214B2190-2194219A219B21A021A321A621AE21CE21CF21D221D421F4-22FF2308-230B23202321237C239B-23B323DC-23E125B725C125F8-25FF266F27C0-27C427C7-27CA27CC27D0-27E527F0-27FF2900-29822999-29D729DC-29FB29FE-2AFF2B30-2B442B47-2B4CFB29FE62FE64-FE66FF0BFF1C-FF1EFF5CFF5EFFE2FFE9-FFEC",
+ Sc: "002400A2-00A5060B09F209F309FB0AF10BF90E3F17DB20A0-20B8A838FDFCFE69FF04FFE0FFE1FFE5FFE6",
+ Sk: "005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFF3EFF40FFE3",
+ So: "00A600A700A900AE00B000B60482060E060F06E906FD06FE07F609FA0B700BF3-0BF80BFA0C7F0CF10CF20D790F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-1399194019E0-19FF1B61-1B6A1B74-1B7C210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B214A214C214D214F2195-2199219C-219F21A121A221A421A521A7-21AD21AF-21CD21D021D121D321D5-21F32300-2307230C-231F2322-2328232B-237B237D-239A23B4-23DB23E2-23E82400-24262440-244A249C-24E92500-25B625B8-25C025C2-25F72600-266E2670-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE2800-28FF2B00-2B2F2B452B462B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A828-A82BA836A837A839AA77-AA79FDFDFFE4FFE8FFEDFFEEFFFCFFFD",
+ Z: "002000A01680180E2000-200A20282029202F205F3000",
+ Zs: "002000A01680180E2000-200A202F205F3000",
+ Zl: "2028",
+ Zp: "2029"
+};
+
+var UnicodeBlocks = {
+ InBasic_Latin: "0000-007F",
+ InLatin_1_Supplement: "0080-00FF",
+ InLatin_Extended_A: "0100-017F",
+ InLatin_Extended_B: "0180-024F",
+ InIPA_Extensions: "0250-02AF",
+ InSpacing_Modifier_Letters: "02B0-02FF",
+ InCombining_Diacritical_Marks: "0300-036F",
+ InGreek_and_Coptic: "0370-03FF",
+ InCyrillic: "0400-04FF",
+ InCyrillic_Supplement: "0500-052F",
+ InArmenian: "0530-058F",
+ InHebrew: "0590-05FF",
+ InArabic: "0600-06FF",
+ InSyriac: "0700-074F",
+ InArabic_Supplement: "0750-077F",
+ InThaana: "0780-07BF",
+ InNKo: "07C0-07FF",
+ InSamaritan: "0800-083F",
+ InDevanagari: "0900-097F",
+ InBengali: "0980-09FF",
+ InGurmukhi: "0A00-0A7F",
+ InGujarati: "0A80-0AFF",
+ InOriya: "0B00-0B7F",
+ InTamil: "0B80-0BFF",
+ InTelugu: "0C00-0C7F",
+ InKannada: "0C80-0CFF",
+ InMalayalam: "0D00-0D7F",
+ InSinhala: "0D80-0DFF",
+ InThai: "0E00-0E7F",
+ InLao: "0E80-0EFF",
+ InTibetan: "0F00-0FFF",
+ InMyanmar: "1000-109F",
+ InGeorgian: "10A0-10FF",
+ InHangul_Jamo: "1100-11FF",
+ InEthiopic: "1200-137F",
+ InEthiopic_Supplement: "1380-139F",
+ InCherokee: "13A0-13FF",
+ InUnified_Canadian_Aboriginal_Syllabics: "1400-167F",
+ InOgham: "1680-169F",
+ InRunic: "16A0-16FF",
+ InTagalog: "1700-171F",
+ InHanunoo: "1720-173F",
+ InBuhid: "1740-175F",
+ InTagbanwa: "1760-177F",
+ InKhmer: "1780-17FF",
+ InMongolian: "1800-18AF",
+ InUnified_Canadian_Aboriginal_Syllabics_Extended: "18B0-18FF",
+ InLimbu: "1900-194F",
+ InTai_Le: "1950-197F",
+ InNew_Tai_Lue: "1980-19DF",
+ InKhmer_Symbols: "19E0-19FF",
+ InBuginese: "1A00-1A1F",
+ InTai_Tham: "1A20-1AAF",
+ InBalinese: "1B00-1B7F",
+ InSundanese: "1B80-1BBF",
+ InLepcha: "1C00-1C4F",
+ InOl_Chiki: "1C50-1C7F",
+ InVedic_Extensions: "1CD0-1CFF",
+ InPhonetic_Extensions: "1D00-1D7F",
+ InPhonetic_Extensions_Supplement: "1D80-1DBF",
+ InCombining_Diacritical_Marks_Supplement: "1DC0-1DFF",
+ InLatin_Extended_Additional: "1E00-1EFF",
+ InGreek_Extended: "1F00-1FFF",
+ InGeneral_Punctuation: "2000-206F",
+ InSuperscripts_and_Subscripts: "2070-209F",
+ InCurrency_Symbols: "20A0-20CF",
+ InCombining_Diacritical_Marks_for_Symbols: "20D0-20FF",
+ InLetterlike_Symbols: "2100-214F",
+ InNumber_Forms: "2150-218F",
+ InArrows: "2190-21FF",
+ InMathematical_Operators: "2200-22FF",
+ InMiscellaneous_Technical: "2300-23FF",
+ InControl_Pictures: "2400-243F",
+ InOptical_Character_Recognition: "2440-245F",
+ InEnclosed_Alphanumerics: "2460-24FF",
+ InBox_Drawing: "2500-257F",
+ InBlock_Elements: "2580-259F",
+ InGeometric_Shapes: "25A0-25FF",
+ InMiscellaneous_Symbols: "2600-26FF",
+ InDingbats: "2700-27BF",
+ InMiscellaneous_Mathematical_Symbols_A: "27C0-27EF",
+ InSupplemental_Arrows_A: "27F0-27FF",
+ InBraille_Patterns: "2800-28FF",
+ InSupplemental_Arrows_B: "2900-297F",
+ InMiscellaneous_Mathematical_Symbols_B: "2980-29FF",
+ InSupplemental_Mathematical_Operators: "2A00-2AFF",
+ InMiscellaneous_Symbols_and_Arrows: "2B00-2BFF",
+ InGlagolitic: "2C00-2C5F",
+ InLatin_Extended_C: "2C60-2C7F",
+ InCoptic: "2C80-2CFF",
+ InGeorgian_Supplement: "2D00-2D2F",
+ InTifinagh: "2D30-2D7F",
+ InEthiopic_Extended: "2D80-2DDF",
+ InCyrillic_Extended_A: "2DE0-2DFF",
+ InSupplemental_Punctuation: "2E00-2E7F",
+ InCJK_Radicals_Supplement: "2E80-2EFF",
+ InKangxi_Radicals: "2F00-2FDF",
+ InIdeographic_Description_Characters: "2FF0-2FFF",
+ InCJK_Symbols_and_Punctuation: "3000-303F",
+ InHiragana: "3040-309F",
+ InKatakana: "30A0-30FF",
+ InBopomofo: "3100-312F",
+ InHangul_Compatibility_Jamo: "3130-318F",
+ InKanbun: "3190-319F",
+ InBopomofo_Extended: "31A0-31BF",
+ InCJK_Strokes: "31C0-31EF",
+ InKatakana_Phonetic_Extensions: "31F0-31FF",
+ InEnclosed_CJK_Letters_and_Months: "3200-32FF",
+ InCJK_Compatibility: "3300-33FF",
+ InCJK_Unified_Ideographs_Extension_A: "3400-4DBF",
+ InYijing_Hexagram_Symbols: "4DC0-4DFF",
+ InCJK_Unified_Ideographs: "4E00-9FFF",
+ InYi_Syllables: "A000-A48F",
+ InYi_Radicals: "A490-A4CF",
+ InLisu: "A4D0-A4FF",
+ InVai: "A500-A63F",
+ InCyrillic_Extended_B: "A640-A69F",
+ InBamum: "A6A0-A6FF",
+ InModifier_Tone_Letters: "A700-A71F",
+ InLatin_Extended_D: "A720-A7FF",
+ InSyloti_Nagri: "A800-A82F",
+ InCommon_Indic_Number_Forms: "A830-A83F",
+ InPhags_pa: "A840-A87F",
+ InSaurashtra: "A880-A8DF",
+ InDevanagari_Extended: "A8E0-A8FF",
+ InKayah_Li: "A900-A92F",
+ InRejang: "A930-A95F",
+ InHangul_Jamo_Extended_A: "A960-A97F",
+ InJavanese: "A980-A9DF",
+ InCham: "AA00-AA5F",
+ InMyanmar_Extended_A: "AA60-AA7F",
+ InTai_Viet: "AA80-AADF",
+ InMeetei_Mayek: "ABC0-ABFF",
+ InHangul_Syllables: "AC00-D7AF",
+ InHangul_Jamo_Extended_B: "D7B0-D7FF",
+ InHigh_Surrogates: "D800-DB7F",
+ InHigh_Private_Use_Surrogates: "DB80-DBFF",
+ InLow_Surrogates: "DC00-DFFF",
+ InPrivate_Use_Area: "E000-F8FF",
+ InCJK_Compatibility_Ideographs: "F900-FAFF",
+ InAlphabetic_Presentation_Forms: "FB00-FB4F",
+ InArabic_Presentation_Forms_A: "FB50-FDFF",
+ InVariation_Selectors: "FE00-FE0F",
+ InVertical_Forms: "FE10-FE1F",
+ InCombining_Half_Marks: "FE20-FE2F",
+ InCJK_Compatibility_Forms: "FE30-FE4F",
+ InSmall_Form_Variants: "FE50-FE6F",
+ InArabic_Presentation_Forms_B: "FE70-FEFF",
+ InHalfwidth_and_Fullwidth_Forms: "FF00-FFEF",
+ InSpecials: "FFF0-FFFF"
+};
+
+var UnicodeScripts = {
+ Common: "0000-0040005B-0060007B-00A900AB-00B900BB-00BF00D700F702B9-02DF02E5-02FF0374037E0385038705890600-0603060C061B061F06400660-066906DD0964096509700CF10CF20E3F0FD5-0FD810FB16EB-16ED173517361802180318051CD31CE11CE9-1CEC1CEE-1CF22000-200B200E-2064206A-20702074-207E2080-208E20A0-20B82100-21252127-2129212C-21312133-214D214F-215F21892190-23E82400-24262440-244A2460-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-27942798-27AF27B1-27BE27C0-27CA27CC27D0-27FF2900-2B4C2B50-2B592E00-2E312FF0-2FFB3000-300430063008-30203030-3037303C-303F309B309C30A030FB30FC3190-319F31C0-31E33220-325F327F-32CF3358-33FF4DC0-4DFFA700-A721A788-A78AA830-A839FD3EFD3FFDFDFE10-FE19FE30-FE52FE54-FE66FE68-FE6BFEFFFF01-FF20FF3B-FF40FF5B-FF65FF70FF9EFF9FFFE0-FFE6FFE8-FFEEFFF9-FFFD",
+ Arabic: "0606-060B060D-061A061E0621-063F0641-064A0656-065E066A-066F0671-06DC06DE-06FF0750-077FFB50-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFCFE70-FE74FE76-FEFC",
+ Armenian: "0531-05560559-055F0561-0587058AFB13-FB17",
+ Balinese: "1B00-1B4B1B50-1B7C",
+ Bamum: "A6A0-A6F7",
+ Bengali: "0981-09830985-098C098F09900993-09A809AA-09B009B209B6-09B909BC-09C409C709C809CB-09CE09D709DC09DD09DF-09E309E6-09FB",
+ Bopomofo: "3105-312D31A0-31B7",
+ Braille: "2800-28FF",
+ Buginese: "1A00-1A1B1A1E1A1F",
+ Buhid: "1740-1753",
+ Canadian_Aboriginal: "1400-167F18B0-18F5",
+ Cham: "AA00-AA36AA40-AA4DAA50-AA59AA5C-AA5F",
+ Cherokee: "13A0-13F4",
+ Coptic: "03E2-03EF2C80-2CF12CF9-2CFF",
+ Cyrillic: "0400-04840487-05251D2B1D782DE0-2DFFA640-A65FA662-A673A67C-A697",
+ Devanagari: "0900-0939093C-094E09500953-09550958-09630966-096F097109720979-097FA8E0-A8FB",
+ Ethiopic: "1200-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A135F-137C1380-13992D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE",
+ Georgian: "10A0-10C510D0-10FA10FC2D00-2D25",
+ Glagolitic: "2C00-2C2E2C30-2C5E",
+ Greek: "0370-03730375-0377037A-037D038403860388-038A038C038E-03A103A3-03E103F0-03FF1D26-1D2A1D5D-1D611D66-1D6A1DBF1F00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FC41FC6-1FD31FD6-1FDB1FDD-1FEF1FF2-1FF41FF6-1FFE2126",
+ Gujarati: "0A81-0A830A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABC-0AC50AC7-0AC90ACB-0ACD0AD00AE0-0AE30AE6-0AEF0AF1",
+ Gurmukhi: "0A01-0A030A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A3C0A3E-0A420A470A480A4B-0A4D0A510A59-0A5C0A5E0A66-0A75",
+ Han: "2E80-2E992E9B-2EF32F00-2FD5300530073021-30293038-303B3400-4DB54E00-9FCBF900-FA2DFA30-FA6DFA70-FAD9",
+ Hangul: "1100-11FF3131-318E3200-321E3260-327EA960-A97CAC00-D7A3D7B0-D7C6D7CB-D7FBFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",
+ Hanunoo: "1720-1734",
+ Hebrew: "0591-05C705D0-05EA05F0-05F4FB1D-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FB4F",
+ Hiragana: "3041-3096309D-309F",
+ Inherited: "0300-036F04850486064B-06550670095109521CD0-1CD21CD4-1CE01CE2-1CE81CED1DC0-1DE61DFD-1DFF200C200D20D0-20F0302A-302F3099309AFE00-FE0FFE20-FE26",
+ Javanese: "A980-A9CDA9CF-A9D9A9DEA9DF",
+ Kannada: "0C820C830C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBC-0CC40CC6-0CC80CCA-0CCD0CD50CD60CDE0CE0-0CE30CE6-0CEF",
+ Katakana: "30A1-30FA30FD-30FF31F0-31FF32D0-32FE3300-3357FF66-FF6FFF71-FF9D",
+ Kayah_Li: "A900-A92F",
+ Khmer: "1780-17DD17E0-17E917F0-17F919E0-19FF",
+ Lao: "0E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB90EBB-0EBD0EC0-0EC40EC60EC8-0ECD0ED0-0ED90EDC0EDD",
+ Latin: "0041-005A0061-007A00AA00BA00C0-00D600D8-00F600F8-02B802E0-02E41D00-1D251D2C-1D5C1D62-1D651D6B-1D771D79-1DBE1E00-1EFF2071207F2090-2094212A212B2132214E2160-21882C60-2C7FA722-A787A78BA78CA7FB-A7FFFB00-FB06FF21-FF3AFF41-FF5A",
+ Lepcha: "1C00-1C371C3B-1C491C4D-1C4F",
+ Limbu: "1900-191C1920-192B1930-193B19401944-194F",
+ Lisu: "A4D0-A4FF",
+ Malayalam: "0D020D030D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D-0D440D46-0D480D4A-0D4D0D570D60-0D630D66-0D750D79-0D7F",
+ Meetei_Mayek: "ABC0-ABEDABF0-ABF9",
+ Mongolian: "1800180118041806-180E1810-18191820-18771880-18AA",
+ Myanmar: "1000-109FAA60-AA7B",
+ New_Tai_Lue: "1980-19AB19B0-19C919D0-19DA19DE19DF",
+ NKo: "07C0-07FA",
+ Ogham: "1680-169C",
+ Ol_Chiki: "1C50-1C7F",
+ Oriya: "0B01-0B030B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3C-0B440B470B480B4B-0B4D0B560B570B5C0B5D0B5F-0B630B66-0B71",
+ Phags_Pa: "A840-A877",
+ Rejang: "A930-A953A95F",
+ Runic: "16A0-16EA16EE-16F0",
+ Samaritan: "0800-082D0830-083E",
+ Saurashtra: "A880-A8C4A8CE-A8D9",
+ Sinhala: "0D820D830D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60DCA0DCF-0DD40DD60DD8-0DDF0DF2-0DF4",
+ Sundanese: "1B80-1BAA1BAE-1BB9",
+ Syloti_Nagri: "A800-A82B",
+ Syriac: "0700-070D070F-074A074D-074F",
+ Tagalog: "1700-170C170E-1714",
+ Tagbanwa: "1760-176C176E-177017721773",
+ Tai_Le: "1950-196D1970-1974",
+ Tai_Tham: "1A20-1A5E1A60-1A7C1A7F-1A891A90-1A991AA0-1AAD",
+ Tai_Viet: "AA80-AAC2AADB-AADF",
+ Tamil: "0B820B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BBE-0BC20BC6-0BC80BCA-0BCD0BD00BD70BE6-0BFA",
+ Telugu: "0C01-0C030C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D-0C440C46-0C480C4A-0C4D0C550C560C580C590C60-0C630C66-0C6F0C78-0C7F",
+ Thaana: "0780-07B1",
+ Thai: "0E01-0E3A0E40-0E5B",
+ Tibetan: "0F00-0F470F49-0F6C0F71-0F8B0F90-0F970F99-0FBC0FBE-0FCC0FCE-0FD4",
+ Tifinagh: "2D30-2D652D6F",
+ Vai: "A500-A62B",
+ Yi: "A000-A48CA490-A4C6"
+};
+
+var unicode = {
+ categories: UnicodeCategories,
+ blocks: UnicodeBlocks,
+ scripts: UnicodeScripts
+};
+
+// EXPORTS
+RegexParser.unicode = unicode;
+
+}());
diff --git a/gulliver/js/codemirror/contrib/regex/js/parseregex.js b/gulliver/js/codemirror/contrib/regex/js/parseregex.js
new file mode 100755
index 000000000..8c2f2039d
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/regex/js/parseregex.js
@@ -0,0 +1,847 @@
+/* Simple parser for Regular Expressions */
+/* Thanks to Marijn for patiently addressing some questions and to
+ * Steven Levithan for XRegExp http://xregexp.com/ for pointing the way to the regexps for the regex (I
+ * only discovered his own regex syntax editor RegexPal later on) */
+
+/*
+// Possible future to-dos:
+0) Unicode plugin fix for astral and update for Unicode 6.0.0
+1) Allow parsing of string escaped regular expressions (e.g., \\ as \ and regular \n as an actual newline) and
+ could potentially integrate into parsing for other languages where known (e.g., string inside RegExp constructor)
+2) If configured, allow parsing of replace strings (e.g., $1, \1)
+3) Shared classes
+ a) As with ranges and unicode classes, could also try to supply equivalents which list all
+ characters inside a whole character class
+ b) Add common classes for ranges, inside char. classes, and allow for alternation of colors
+4) Groups
+ a) detect max's (or even inner_group_mode) from CSS if specified as "max-available"
+ _cssPropertyExists('span.regex-max-available') || _cssPropertyExists('.regex-max-available');
+ b) Remove inner_group_mode and just always both uniform and type-based styles? (first improve
+ inner_group_mode performance when on)
+5) Expand configuration for different flavors of regex or language implementations corresponding to config
+ options
+6) Allow free-spacing mode to work with newlines?
+*/
+
+/**
+ * OPTIONS (SETUP):
+ * "possible_flags": {String} All flags to support (as a string of joined characters); default is 'imgxs';
+ * if 'literal' is on, this will check for validity against the literal flags, but
+ * use the literal flags
+ * "flags": {String} List of flags to use on this query; will be added to any literals; default is ''
+ * "literal": {Boolean} Whether inside a literal or not
+ * "literal_initial": {String} The initial character to surround regular expression (optionally followed by flags);
+ * A forward slash ("/"), by default
+ *
+ * OPTIONS (STYLING)
+ * "inner_group_mode": {'type'|'uniform'} Indicates how (if at all) to style content inside groups; if by "type",
+ * the class will be assigned by type; if "uniform", a class named
+ * "regex-group--" where is the nesting level and
+ * is the sequence number; the "uniform" option allows grouped
+ * content to be styled consistently (but potentially differently from
+ * the parentheses themselves) no matter the type of group
+ * "max_levels": {Number|String} Maximum number of nesting levels before class numbers repeat
+ * "max_alternating": {Number|String} Maximum number of alternating sequences at the same level before
+ * class numbers repeat
+ *
+ * OPTIONS (PATTERNS)
+ * "flavor": {'all'|'ecma-262-ed5'|'ecma-262-ed3'} Sets defaults for the following patterns according to the regex flavor
+ *
+ * "unicode_mode": {'simple'|'validate'|'store'} Mode for handling Unicode classes; unless 'simple' is chosen, may
+ * affect performance given initial need to load and subsequent need
+ * to parse and validate (i.e., selectively color), and, if 'store' is chosen,
+ * also makes these (many) additional values on the token object, e.g.,
+ * for use by activeTokens for adding tooltips; Default is 'simple' which
+ * simply checks that the values are plausible;
+ * Note: To include Unicode validation, you must include your
+ * CodeMirror parserfile in this sequence:
+ * parserfile: ["parseregex.js", "parseregex-unicode.js"]
+ * "unicode_classes": {Boolean} Whether to accept all Unicode classes (unless overridden); default is true
+ * "unicode_blocks": {Boolean} Whether to accept Unicode blocks (overrides unicode_classes default); e.g., \p{InArabic}
+ * "unicode_scripts": {Boolean} Whether to accept Unicode scripts (overrides unicode_classes default); e.g., \p{Hebrew}
+ * "unicode_categories": {Boolean} Whether to accept Unicode categories (overrides unicode_classes default); e.g., \p{Ll} (for lower-case letters)
+ * "named_backreferences": {Boolean} Whether to accept named backreferences; default is true
+ * "empty_char_class": {Boolean} Whether to allow [] or [^] as character classes; default is true
+ * "mode_modifier": {Boolean} Whether to allow (?imsx) mode modifiers
+ *
+ * NOTE
+ * You can add the following to your CodeMirror configuration object in order to get simple tooltips showing the
+ * character equivalent of an escape sequence:
+ activeTokens : function (spanNode, tokenObject, editor) {
+ if (tokenObject.equivalent) {
+ spanNode.title = tokenObject.equivalent;
+ }
+ },
+....or this more advanced one which adds ranges (though you may wish to change the character limit, being
+ aware that browsers have a limitation on tooltip size, unless you were to also use a tooltip library which used
+ this information to expand the visible content):
+ activeTokens : (function () {
+ var charLimit = 500;
+ var lastEquivalent, rangeBegan, lastRangeHyphen;
+
+ function _buildTitle (beginChar, endChar) {
+ var beginCode = beginChar.charCodeAt(0), endCode = endChar.charCodeAt(0);
+ var title = '';
+ if (endCode - beginCode <= charLimit) {
+ for (var i = beginCode; i <= endCode; i++) {
+ title += String.fromCharCode(i);
+ }
+ }
+ return title;
+ }
+
+ return function (spanNode, token, editor) {
+ var content = token.content;
+ if (lastEquivalent && token.style === 'regex-class-range-hyphen') {
+ rangeBegan = true;
+ lastRangeHyphen = spanNode;
+ }
+ else if (rangeBegan) {
+ var beginChar = lastEquivalent;
+ var endChar = (token.equivalent || content);
+ lastRangeHyphen.title = _buildTitle(beginChar, endChar);
+ rangeBegan = false;
+ lastEquivalent = null;
+ //editor.reparseBuffer(); // title must be redrawn since already added previously (do below instead as locking up on undo?); too intensive to call this, but keeping here for record
+ }
+ else if (content === ']') {
+ rangeBegan = false;
+ }
+ else {
+ rangeBegan = false;
+ // Fix: 'regex-unicode-class-inside' not supported and should not be since it wouldn't make sense as a starting range?
+ lastEquivalent = token.equivalent || content;
+ }
+
+ if (token.display) {
+ spanNode.title = token.display;
+ }
+ else if (token.equivalent) {
+ if (token.unicode) {
+ var range = /(.)-(.)/g;
+ spanNode.title = token.equivalent.replace(range,
+ function (n0, n1, n2) {
+ return _buildTitle(n1, n2);
+ }
+ );
+ // editor.reparseBuffer(); // too intensive to call this, but keeping here for record
+ }
+ else {
+ spanNode.title = token.equivalent;
+ // editor.reparseBuffer(); // too intensive to call this, but keeping here for record
+ }
+ }
+ };
+ }()),
+ */
+
+
+var RegexParser = Editor.Parser = (function() {
+
+ var regexConfigBooleanOptions = ['unicode_blocks', 'unicode_scripts', 'unicode_categories',
+ 'unicode_classes', 'named_backreferences', 'empty_char_class', 'mode_modifier'],
+ regexConfigStringOptions = ['unicode_mode'], // Just for record-keeping
+ possibleFlags = 'imgxs',
+ config = {}, ucl;
+ // Resettable
+ var initialFound, endFound, charClassRangeBegun, negatedCharClass, mode_modifier_begun, flags = '',
+ groupTypes, groupCounts;
+
+ config.literal_initial = '/';
+
+ // Adapted from tokenize.js (not distinctly treating whitespace except for newlines)
+ function noWSTokenizer (source, state) {
+ var tokenizer = {
+ state: state,
+ take: function(type) {
+ if (typeof(type) == "string")
+ type = {style: type, type: type};
+ type.content = (type.content || "") + source.get();
+ type.value = type.content + source.get();
+ return type;
+ },
+ next: function () {
+ if (!source.more()) throw StopIteration;
+ var type;
+ if (source.equals("\n")) {
+ source.next();
+ return this.take("whitespace");
+ }
+ while (!type)
+ type = this.state(source, function(s) {tokenizer.state = s;});
+ return this.take(type);
+ }
+ };
+ return tokenizer;
+ }
+
+ // Private static utilities
+ function _expandRange (type, name) { // More efficient than unpack in targeting only which we need (though ideally would not need to convert at all)
+ var codePt = /\w{4}/g,
+ unicode = RegexParser.unicode, group = unicode[type];
+ if (group.hasOwnProperty(name)) {
+ // group[name] = group[name].replace(codePt, '\\u$&'); // We shouldn't need this unless we start validating against a matching string
+ return group[name].replace(codePt,
+ function (n0) {
+ if (n0 === '002D') {
+ return 'U+' + n0; // Leave genuine hyphens unresolved so they won't get confused with range hyphens
+ }
+ return String.fromCharCode(parseInt('0x' + n0, 16)); // Fix: Would be more efficient to store as Unicode characters like this from the start
+ });
+ }
+ return false;
+ }
+
+ function _copyObj (obj, deep) {
+ var ret = {};
+ for (var p in obj) {
+ if (obj.hasOwnProperty(p)) {
+ if (deep && typeof obj[p] === 'object' && obj[p] !== null) {
+ ret[p] = _copyObj(obj[p], deep);
+ }
+ else {
+ ret[p] = obj[p];
+ }
+ }
+ }
+ return ret;
+ }
+
+ function _forEach (arr, h) {
+ for (var i = 0, arrl = arr.length; i < arrl; i++) {
+ h(arr[i], i);
+ }
+ }
+ function _setOptions (arr, value) {
+ arr = typeof arr === 'string' ? [arr] : arr;
+ _forEach(arr, function (item) {
+ config[item] = value;
+ });
+ }
+
+ function _cssPropertyExists (selectorText) {
+ var i = 0, j = 0, dsl = 0, crl = 0, ss, d = document,
+ _getPropertyFromStyleSheet =
+ function (ss, selectorText) {
+ var rules = ss.cssRules ? ss.cssRules : ss.rules; /* Mozilla or IE */
+ for (j = 0, crl = rules.length; j < crl; j++) {
+ var rule = rules[j];
+ try {
+ if (rule.type === CSSRule.STYLE_RULE && rule.selectorText === selectorText) {
+ return true;
+ }
+ }
+ catch (err) { /* IE */
+ if (rule.selectorText === selectorText) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+
+ var value;
+ for (i = 0, dsl = d.styleSheets.length; i < dsl; i++) {
+ ss = d.styleSheets[i];
+ value = _getPropertyFromStyleSheet(ss, selectorText);
+ if (value) {
+ break;
+ }
+ }
+ return value;
+ }
+
+ function _addFlags (f) {
+ if ((/[^a-z]/).test(f)) { // Could insist on particular flags
+ throw 'Invalid flag supplied to the regular expression parser';
+ }
+ flags += f;
+ }
+ function _setPossibleFlags (f) {
+ if ((/[^a-z]/).test(f)) { // Could insist on particular flags
+ throw 'Invalid flag supplied to the regular expression parser';
+ }
+ possibleFlags = f;
+ }
+ function _esc (s) {
+ return s.replace(/"[.\\+*?\[\^\]$(){}=!<>|:\-]/g, '\\$&');
+ }
+
+ var tokenizeRegex = (function() {
+ // Private utilities
+ function _hasFlag (f) {
+ return flags.indexOf(f) > -1;
+ }
+ function _lookAheadMatches (source, regex) {
+ var matches = source.lookAheadRegex(regex, true);
+ if (matches && matches.length > 1) { // Allow us to return the position of a match out of alternates
+ for (var i = matches.length - 1; i >= 0; i--) {
+ if (matches[i] != null) {
+ return i;
+ }
+ }
+ }
+ return 0;
+ }
+
+ function validateUnicodeClass (negated, place, source) {
+ var neg = ' regex-' + negated + 'unicode', ret = 'regex-unicode-class-' + place + neg,
+ name, unicode = RegexParser.unicode;
+ if (!unicode) {
+ throw 'Unicode plugin of the regular expression parser not properly loaded';
+ }
+ if (config.unicode_categories) {
+ var categories = source.lookAheadRegex(/^\\[pP]{\^?([A-Z][a-z]?)}/, true);
+ if (categories) {
+ name = categories[1];
+ if (unicode.categories[name]) {
+ return ret + '-category-' + place + neg + '-category-' + name + '-' + place;
+ }
+ return 'regex-bad-sequence';
+ }
+ }
+ if (config.unicode_blocks) {
+ var blocks = source.lookAheadRegex(/^\\[pP]{\^?(In[A-Z][^}]*)}/, true);
+ if (blocks) {
+ name = blocks[1];
+ if (unicode.blocks[name]) {
+ return ret + '-block-' + place + neg + '-block-' + name + '-' + place;
+ }
+ return 'regex-bad-sequence';
+ }
+ }
+ if (config.unicode_scripts) {
+ var scripts = source.lookAheadRegex(/^\\[pP]{\^?([^}]*)}/, true);
+ if (scripts) {
+ name = scripts[1];
+ if (unicode.scripts[name]) {
+ return ret + '-script-' + place + neg + '-script-' + name + '-' + place;
+ }
+ return 'regex-bad-sequence';
+ }
+ }
+ return false;
+ }
+
+ function unicode_class (source, place) {
+ var ret = 'regex-unicode-class-' + place + ' ', negated = '';
+ if (source.lookAheadRegex(/^\\P/) || source.lookAheadRegex(/^\\p{\^/)) {
+ negated = 'negated';
+ }
+ else if (source.lookAheadRegex(/^\\P{\^/)) { // Double-negative
+ return false;
+ }
+ switch (config.unicode_mode) {
+ case 'validate': case 'store':
+ return validateUnicodeClass(negated, place, source);
+ case 'simple': // Fall-through
+ default:
+ // generic: /^\\[pP]{\^?[^}]*}/
+ if (config.unicode_categories && source.lookAheadRegex(/^\\[pP]{\^?[A-Z][a-z]?}/, true)) {
+ return ret + 'regex-' + negated + 'unicode-category';
+ }
+ if (config.unicode_blocks && source.lookAheadRegex(/^\\[pP]{\^?In[A-Z][^}]*}/, true)) {
+ return ret + 'regex-' + negated + 'unicode-block';
+ }
+ if (config.unicode_scripts && source.lookAheadRegex(/^\\[pP]{\^?[^}]*}/, true)) {
+ return ret + 'regex-' + negated + 'unicode-script';
+ }
+ break;
+ }
+ return false;
+ }
+
+ // State functions
+ // Changed [\s\S] to [^\n] to avoid accidentally grabbing a terminating (auto-inserted place-holder?) newline
+ var inside_class_meta = /^\\(?:([0-3][0-7]{0,2}|[4-7][0-7]?)|(x[\dA-Fa-f]{2})|(u[\dA-Fa-f]{4})|(c[A-Za-z])|(-\\]^)|([bBdDfnrsStvwW0])|([^\n]))/;
+ function inside_class (source, setState) {
+ var ret;
+ if (source.lookAhead(']', true)) {
+ // charClassRangeBegun = false; // Shouldn't be needed
+ setState(customOutsideClass);
+ return 'regex-class-end';
+ }
+ if (negatedCharClass && source.lookAhead('^', true)) {
+ negatedCharClass = false;
+ return 'regex-class-negator';
+ }
+ if (source.lookAhead('-', true)) {
+ if (!charClassRangeBegun) {
+ ret = 'regex-class-initial-hyphen';
+ }
+ else if (source.equals(']')) {
+ ret = 'regex-class-final-hyphen';
+ }
+ else {
+ return 'regex-class-range-hyphen';
+ }
+ }
+ else if (!source.equals('\\')) {
+ var ch = source.next();
+ if (config.literal && ch === config.literal_initial) {
+ return 'regex-bad-character';
+ }
+ ret = 'regex-class-character';
+ }
+ else if ((ucl = unicode_class(source, 'inside'))) {
+ ret = ucl;
+ }
+ else if (source.lookAheadRegex(/^\\(\n|$)/)) { // Treat an ending backslash like a bad
+ // character to avoid auto-adding of extra text
+ source.next();
+ ret = 'regex-bad-character';
+ }
+ else {
+ switch (_lookAheadMatches(source, inside_class_meta)) {
+ case 1:
+ ret = 'regex-class-octal';
+ break;
+ case 2:
+ ret = 'regex-class-hex';
+ break;
+ case 3:
+ ret = 'regex-class-unicode-escape';
+ break;
+ case 4:
+ ret = 'regex-class-ascii-control';
+ break;
+ case 5:
+ ret = 'regex-class-escaped-special';
+ break;
+ case 6:
+ ret = 'regex-class-special-escape';
+ break;
+ case 7:
+ ret = 'regex-class-extra-escaped';
+ break;
+ default:
+ throw 'Unexpected character inside class, beginning ' +
+ source.lookAheadRegex(/^[\s\S]+$/)[0] + ' and of length '+
+ source.lookAheadRegex(/^[\s\S]+$/)[0].length; // Shouldn't reach here
+ }
+ }
+ // Fix: Add this as a token property in the parser instead?
+ if (charClassRangeBegun) {
+ charClassRangeBegun = false;
+ ret += '-end-range';
+ }
+ else if (source.equals('-')) {
+ charClassRangeBegun = true;
+ ret += '-begin-range';
+ }
+ return ret;
+ }
+
+ // Changed [\s\S] to [^\n] to avoid accidentally grabbing a terminating (auto-inserted place-holder?) newline
+ var outside_class_meta = /^(?:\\(?:(0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?)|([1-9]\d*)|(x[\dA-Fa-f]{2})|(u[\dA-Fa-f]{4})|(c[A-Za-z])|([bBdDfnrsStvwW0])|([?*+])|([.\\[$|{])|([^\n]))|([?*+]\??)|({\d+(?:,\d*)?}\??))/;
+ function outside_class (source, setState) {
+ if ((ucl = unicode_class(source, 'outside'))) {
+ return ucl;
+ }
+ switch (_lookAheadMatches(source, outside_class_meta)) {
+ case 1:
+ return 'regex-octal';
+ case 2:
+ return 'regex-ascii';
+ case 3:
+ return 'regex-hex';
+ case 4:
+ return 'regex-unicode-escape';
+ case 5:
+ return 'regex-ascii-control';
+ case 6:
+ return 'regex-special-escape';
+ case 7:
+ return 'regex-quantifier-escape'; // Fix: could probably just merge with escaped-special
+ case 8:
+ return 'regex-escaped-special';
+ case 9:
+ return 'regex-extra-escaped';
+ case 10:
+ return 'regex-quantifiers';
+ case 11:
+ return 'regex-repetition';
+ default:
+ if (config.literal && source.lookAhead(config.literal_initial, true)) {
+ if (!initialFound) {
+ initialFound = true;
+ return 'regex-literal-begin';
+ }
+ endFound = true;
+ setState(beginFlags);
+ return 'regex-literal-end';
+ }
+ if (source.lookAhead('|', true)) {
+ return 'regex-alternator';
+ }
+ if (source.lookAheadRegex(/^\\$/, true)) {
+ return 'regex-bad-character';
+ }
+ source.next();
+ return 'regex-character';
+ }
+ }
+ function beginFlags (source, setState) {
+ var endFlags = source.lookAheadRegex(new RegExp('^[' + possibleFlags + ']*', ''), true);
+ if (endFlags == null) {
+ // Unrecognized flag used in regular expression literal
+ return 'regex-bad-character';
+ }
+ // Already confirmed validity earlier
+ setState(finished);
+ return 'regex-flags';
+ }
+ function finished () {
+ throw StopIteration;
+ }
+
+ function customOutsideClass (source, setState) {
+ if (config.named_backreferences && source.lookAheadRegex(/^\\k<([\w$]+)>/, true)) {
+ return 'regex-named-backreference';
+ }
+ if (_hasFlag('x') && source.lookAheadRegex(/^(?:#.*)+?/, true)) { // Fix: lookAheadRegex will avoid new lines; added extra '?' at end
+ // Regex should be /^(?:\s+|#.*)+?/ but this was problematic
+ return 'regex-free-spacing-mode';
+ }
+
+ if (source.lookAhead('[', true)) {
+ if (source.lookAheadRegex(/^\^?]/, true)) {
+ return config.empty_char_class ? 'regex-empty-class' : 'regex-bad-character';
+ }
+ if (source.equals('^')) {
+ negatedCharClass = true;
+ }
+ setState(inside_class);
+ return 'regex-class-begin';
+ }
+
+ // Unmatched ending parentheses
+ if (source.lookAhead(')', true)) {
+ return 'regex-ending-group';
+ }
+ if (source.lookAhead('(', true)) {
+ if (config.mode_modifier && mode_modifier_begun) {
+ var mode_modifier = source.lookAheadRegex(/^\?([imsx]+)\)/, true);
+ if (mode_modifier) { // We know it should exist if we're here
+ // addFlags(mode_modifier[1]); // Handle flags earlier
+ mode_modifier_begun = false;
+ return 'regex-mode-modifier';
+ }
+ }
+ if (source.lookAheadRegex(/^\?#[^)]*\)/, true)) { // No apparent nesting of comments?
+ return 'regex-comment-pattern';
+ }
+
+ var ret;
+ if (source.lookAheadRegex(/^(?!\?)/, true)) {
+ ret = 'regex-capturing-group';
+ }
+ if (source.lookAheadRegex(/^\?<([$\w]+)>/, true)) {
+ ret = 'regex-named-capturing-group';
+ }
+ if (source.lookAheadRegex(/^\?[:=!]/, true)) {
+ ret = 'regex-grouping';
+ }
+ if (!ret) {
+ return 'regex-bad-character'; // 'Uncaught parenthetical in tokenizing regular expression';
+ }
+ return ret;
+ }
+ return outside_class(source, setState);
+ }
+
+ return function(source, startState) {
+ return noWSTokenizer(source, startState || customOutsideClass);
+ };
+ })();
+
+
+ function resetStateVariables () {
+ initialFound = false, endFound = false, charClassRangeBegun = false, negatedCharClass = false,
+ mode_modifier_begun = false;
+ flags = '';
+ if (config.flags) { // Reset to configuration value
+ _addFlags(config.flags);
+ }
+ groupTypes = [],
+ groupCounts = {
+ 'capturing-group': {currentCount: 0},
+ 'named-capturing-group': {currentCount: 0},
+ 'grouping': {currentCount: 0}
+ };
+ }
+
+ // Parser
+ function parseRegex (source) {
+ resetStateVariables();
+
+ var tokens = tokenizeRegex(source);
+
+ if (config.literal && !source.equals(config.literal_initial)) {
+ throw 'Regular expression literals must include a beginning "'+config.literal_initial+'"';
+ }
+
+ if (config.literal) {
+ var regex = new RegExp('^[\\s\\S]*' + _esc(config.literal_initial) + '([' + possibleFlags + ']*)$', '');
+ var endFlags = source.lookAheadRegex(regex);
+ if (endFlags == null) {
+ // Unrecognized flag used in regular expression literal
+ }
+ else {
+ _addFlags(endFlags[1]);
+ }
+ }
+ else if (config.mode_modifier) { // Fix: We are not allowing both a mode modifier and
+ // literal syntax (presumably redundant)
+ var mode_modifier = source.lookAheadRegex(/^\(\?([imsx]+)\)/, true);
+ if (mode_modifier) {
+ mode_modifier_begun = true;
+ _addFlags(mode_modifier[1]);
+ }
+ }
+ var iter = {
+ next: function() {
+ try {
+ var level_num,
+ token = tokens.next(),
+ style = token.style,
+ content = token.content,
+ lastChildren, currentChildren, currentCount, currentGroupStyle,
+ type = style.replace(/^regex-/, '');
+
+ switch (type) {
+ case 'ending-group':
+ if (!groupTypes.length) {
+ // Closing parenthesis without an opening one
+ token.style = 'regex-bad-character';
+ }
+ else {
+ level_num = config.max_levels ?
+ ((groupTypes.length % config.max_levels) || config.max_levels) : groupTypes.length;
+ var popped = groupTypes.pop();
+ // Allow numbered classes
+ currentChildren = groupCounts[popped];
+ while (currentChildren && currentChildren.currentChildren &&
+ currentChildren.currentChildren.currentChildren) { // Find lowest level parent
+ currentChildren = currentChildren.currentChildren;
+ }
+ delete currentChildren.currentChildren; // Use parent to delete children
+ currentCount = currentChildren.currentCount; // Use parent as new child to get current count
+ currentCount = config.max_alternating ?
+ ((currentCount % config.max_alternating) || config.max_alternating) : currentCount;
+
+ currentGroupStyle = level_num + '-' + currentCount;
+ token.style = 'regex-ending-' + popped + ' regex-ending-' + popped + currentGroupStyle;
+ if (config.inner_group_mode === 'uniform') { // 'type' is automatically processed for ending
+ token.style += ' regex-group-' + currentGroupStyle;
+ }
+ }
+ break;
+ case 'capturing-group':
+ case 'named-capturing-group':
+ case 'grouping':
+ lastChildren = groupCounts[type],
+ currentChildren = groupCounts[type].currentChildren;
+ while (currentChildren) {
+ lastChildren = currentChildren;
+ currentChildren = currentChildren.currentChildren;
+ }
+ currentCount = ++lastChildren.currentCount;
+ if (!lastChildren.currentChildren) {
+ lastChildren.currentChildren = {currentCount: 0};
+ }
+
+ groupTypes.push(type);
+ level_num = config.max_levels ?
+ ((groupTypes.length % config.max_levels) || config.max_levels) : groupTypes.length;
+ // Allow numbered classes
+ currentCount = config.max_alternating ?
+ ((currentCount % config.max_alternating) || config.max_alternating) : currentCount;
+ currentGroupStyle = level_num + '-' + currentCount;
+ var currentStyle = ' ' + token.style;
+
+
+ if (config.inner_group_mode) {
+ token.style += config.inner_group_mode === 'type' ?
+ currentStyle + currentGroupStyle :
+ ' regex-group-' + currentGroupStyle;
+ token.style += ' ' + style + currentGroupStyle;
+ }
+ else {
+ token.style += currentStyle + currentGroupStyle;
+ }
+ lastChildren.currentGroupStyle = currentGroupStyle;
+ lastChildren.currentStyle = currentStyle;
+ break;
+ // Allow ability to extract information on character equivalence, e.g., for use on tooltips
+ case 'class-octal': case 'octal': // Fall-through
+ case 'class-octal-begin-range': case 'class-octal-end-range': // Fall-through
+ case 'class-ascii-begin-range': case 'class-ascii-end-range': // Fall-through
+ case 'class-ascii': case 'ascii': // Firefox apparently treats ascii here as octals
+ token.equivalent = String.fromCharCode(parseInt(content.replace(/^\\/, ''), 8));
+ break;
+ case 'class-hex': case 'hex': // Fall-through
+ case 'class-hex-begin-range': case 'class-hex-end-range': // Fall-through
+ case 'class-unicode-escape': case 'class-unicode-escape-begin-range': // Fall-through
+ case 'class-unicode-escape-end-range': case 'unicode-escape':
+ token.equivalent = String.fromCharCode(parseInt('0x'+content.replace(/^\\(x|u)/, ''), 16));
+ break;
+ case 'class-ascii-control-begin-range': case 'class-ascii-control-end-range': // Fall-through
+ case 'class-ascii-control': case 'ascii-control':
+ token.equivalent = String.fromCharCode(content.replace(/^\\c/, '').charCodeAt(0) - 64);
+ break;
+ case 'class-special-escape': case 'class-special-escape-begin-range': // Fall-through
+ case 'class-special-escape-end-range': case 'special-escape':
+ // Others to ignore (though some (\d, \s, \w) could have theirs listed): bBdDsSwW
+ var chr = content.replace(/^\\/, ''),
+ pos = 'fnrtv'.indexOf(chr),
+ specialEquivs = '\f\n\r\t\v';
+ if (pos !== -1) { // May not be visible without conversion to codepoints
+ var c = specialEquivs.charAt(pos);
+ var hex = c.charCodeAt(0).toString(16).toUpperCase();
+ token.display = 'U+' + Array(5 - hex.length).join('0') + hex;
+ token.equivalent = c;
+ }
+ break;
+ case 'regex-class-escaped-special': case 'regex-class-escaped-special-begin-range':
+ case 'regex-class-escaped-special-end-range':
+ case 'class-extra-escaped-begin-range': case 'class-extra-escaped-end-range':
+ case 'class-extra-escaped': case 'extra-escaped':
+ token.equivalent = content.replace(/^\\/, '');
+ break;
+ default:
+ if (config.unicode_mode === 'store') {
+ if (config.unicode_categories) {
+ var cat = type.match(/regex-unicode-category-(\w+?)-(?:outside|inside)/);
+ if (cat) {
+ token.equivalent = _expandRange('categories', cat[1]) || '';
+ token.unicode = true;
+ break;
+ }
+ }
+ if (config.unicode_blocks) {
+ var block = type.match(/regex-unicode-block-(\w+)-(?:outside|inside)/);
+ if (block) {
+ token.equivalent = _expandRange('blocks', block[1]) || '';
+ token.unicode = true;
+ break;
+ }
+ }
+ if (config.unicode_scripts) {
+ var script = type.match(/regex-unicode-script-(\w+)-(?:outside|inside)/);
+ if (script) {
+ token.equivalent = _expandRange('scripts', script[1]) || '';
+ token.unicode = true;
+ break;
+ }
+ }
+ }
+ break;
+ }
+ if (config.inner_group_mode && type !== 'ending-group' && type !== 'capturing-group' && type !== 'named-capturing-group' &&
+ type !== 'grouping') {
+ level_num = config.max_levels ?
+ ((groupTypes.length % config.max_levels) || config.max_levels) : groupTypes.length;
+ // Allow numbered classes
+ var last = groupTypes[groupTypes.length - 1];
+ if (last) {
+ currentChildren = groupCounts[last];
+ while (currentChildren && currentChildren.currentChildren &&
+ currentChildren.currentChildren.currentChildren) { // Find lowest level parent
+ currentChildren = currentChildren.currentChildren;
+ }
+ token.style += config.inner_group_mode === 'type' ?
+ currentChildren.currentStyle + currentChildren.currentGroupStyle :
+ ' regex-group-' + currentChildren.currentGroupStyle;
+ }
+ }
+ if (!source.more()) {
+ if (groupTypes.length) { // Opening group without a closing parenthesis
+ token.style = 'regex-bad-character';
+ }
+ else if (config.literal && !endFound) {
+ //throw 'Regular expression literals must include a (non-escaped) ending "' +
+ // config.literal_initial + '" (with optional flags).';
+ token.style = 'regex-bad-character';
+ }
+ }
+ }
+ catch (e) {
+if (e != StopIteration) {
+ alert(e + '::'+e.lineNumber);
+}
+ throw e;
+ }
+ return token;
+ },
+ copy: function() {
+ var _initialFound = initialFound, _charClassRangeBegun = charClassRangeBegun,
+ _negatedCharClass = negatedCharClass, _flags = flags,
+ _endFound = endFound, _groupTypes = groupTypes,
+ _mode_modifier_begun = mode_modifier_begun,
+ _tokenState = tokens.state,
+ _groupCounts = _copyObj(groupCounts, true);
+ return function(source) {
+ initialFound = _initialFound;
+ charClassRangeBegun = _charClassRangeBegun;
+ negatedCharClass = _negatedCharClass;
+ flags = _flags;
+ endFound = _endFound;
+ groupTypes = _groupTypes;
+ mode_modifier_begun = _mode_modifier_begun;
+ tokens = tokenizeRegex(source, _tokenState);
+ groupCounts = _groupCounts;
+ return iter;
+ };
+ }
+ };
+ return iter;
+ }
+
+ // Parser object
+ return {
+ make: parseRegex,
+ configure: function (parserConfig) {
+ var unicode = this.unicode;
+
+ // Overridable
+ _setOptions('unicode_mode', 'simple');
+ _setOptions(regexConfigBooleanOptions, false);
+ if (parserConfig.unicode_classes) {
+ _setOptions(['unicode_blocks', 'unicode_scripts', 'unicode_categories'], true);
+ }
+ switch (parserConfig.flavor) {
+ case 'ecma-262-ed5':
+ _setOptions(['empty_char_class'], true);
+ // Fall-through
+ case 'ecma-262-ed3':
+ config.possible_flags = 'gim'; // If wish for Firefox 'y', add it on parserConfig
+ break;
+ case 'all':
+ default:
+ _setOptions(regexConfigBooleanOptions, true);
+ break;
+ }
+
+ // Setting with possible overrides
+ for (var opt in parserConfig) {
+ if ((/^regex_/).test(opt)) { // Use for compatibility with JS+Regex
+ config[opt.replace(/^regex_/, '')] = parserConfig[opt];
+ continue;
+ }
+ config[opt] = parserConfig[opt];
+ }
+
+ // Post-processing
+ if (config.possible_flags) {
+ _setPossibleFlags(config.possible_flags);
+ }
+
+ if (config.unicode_mode !== 'simple') {
+ if (!unicode) {
+ throw 'You must include the parseregex-unicode.js file in order to use validate or storage mode Unicode';
+ }
+ }
+ }
+ };
+})();
diff --git a/gulliver/js/codemirror/contrib/scheme/LICENSE b/gulliver/js/codemirror/contrib/scheme/LICENSE
new file mode 100755
index 000000000..9f8a9f340
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/scheme/LICENSE
@@ -0,0 +1,23 @@
+ Copyright (c) 2010 Danny Yoo
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any
+ damages arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any
+ purpose, including commercial applications, and to alter it and
+ redistribute it freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must
+ not claim that you wrote the original software. If you use this
+ software in a product, an acknowledgment in the product
+ documentation would be appreciated but is not required.
+
+ 2. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+ 3. This notice may not be removed or altered from any source
+ distribution.
+
+ Danny Yoo
+ dyoo@cs.wpi.edu
diff --git a/gulliver/js/codemirror/contrib/scheme/css/schemecolors.css b/gulliver/js/codemirror/contrib/scheme/css/schemecolors.css
new file mode 100755
index 000000000..7283510bc
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/scheme/css/schemecolors.css
@@ -0,0 +1,45 @@
+html {
+ cursor: text;
+ width: 100%;
+ height: 100%;
+ background-color: white;
+}
+
+.editbox {
+ width: 100%;
+ height: 100%;
+ margin: 0pt;
+ padding: 0;
+ font-family: monospace;
+ font-size: 10pt;
+ color: black;
+}
+
+
+
+pre.code, .editbox {
+ color: #666666;
+}
+
+.editbox p {
+ margin: 0;
+}
+
+span.scheme-string {color: green;}
+span.scheme-number {color: blue;}
+span.scheme-boolean {color: darkred;}
+span.scheme-character {color: orange;}
+span.scheme-symbol {color: steelblue;}
+span.scheme-punctuation {color: black;}
+span.scheme-lparen {color: black;}
+span.scheme-rparen {color: black;}
+span.scheme-comment { color: orange; }
+
+span.good-matching-paren {
+ font-weight: bold;
+ color: #3399FF;
+}
+span.bad-matching-paren {
+ font-weight: bold;
+ color: red;
+}
diff --git a/gulliver/js/codemirror/contrib/scheme/index.html b/gulliver/js/codemirror/contrib/scheme/index.html
new file mode 100755
index 000000000..e48837696
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/scheme/index.html
@@ -0,0 +1,82 @@
+
+
+
+
+ CodeMirror: Scheme demonstration
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/gulliver/js/codemirror/contrib/sql/js/parsesql.js b/gulliver/js/codemirror/contrib/sql/js/parsesql.js
new file mode 100755
index 000000000..9b05d6066
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/sql/js/parsesql.js
@@ -0,0 +1,267 @@
+var SqlParser = Editor.Parser = (function() {
+
+ function wordRegexp(words) {
+ return new RegExp("^(?:" + words.join("|") + ")$", "i");
+ }
+
+ var functions = wordRegexp([
+ "abs", "acos", "adddate", "aes_encrypt", "aes_decrypt", "ascii",
+ "asin", "atan", "atan2", "avg", "benchmark", "bin", "bit_and",
+ "bit_count", "bit_length", "bit_or", "cast", "ceil", "ceiling",
+ "char_length", "character_length", "coalesce", "concat", "concat_ws",
+ "connection_id", "conv", "convert", "cos", "cot", "count", "curdate",
+ "current_date", "current_time", "current_timestamp", "current_user",
+ "curtime", "database", "date_add", "date_format", "date_sub",
+ "dayname", "dayofmonth", "dayofweek", "dayofyear", "decode", "degrees",
+ "des_encrypt", "des_decrypt", "elt", "encode", "encrypt", "exp",
+ "export_set", "extract", "field", "find_in_set", "floor", "format",
+ "found_rows", "from_days", "from_unixtime", "get_lock", "greatest",
+ "group_unique_users", "hex", "ifnull", "inet_aton", "inet_ntoa", "instr",
+ "interval", "is_free_lock", "isnull", "last_insert_id", "lcase", "least",
+ "left", "length", "ln", "load_file", "locate", "log", "log2", "log10",
+ "lower", "lpad", "ltrim", "make_set", "master_pos_wait", "max", "md5",
+ "mid", "min", "mod", "monthname", "now", "nullif", "oct", "octet_length",
+ "ord", "password", "period_add", "period_diff", "pi", "position",
+ "pow", "power", "quarter", "quote", "radians", "rand", "release_lock",
+ "repeat", "reverse", "right", "round", "rpad", "rtrim", "sec_to_time",
+ "session_user", "sha", "sha1", "sign", "sin", "soundex", "space", "sqrt",
+ "std", "stddev", "strcmp", "subdate", "substring", "substring_index",
+ "sum", "sysdate", "system_user", "tan", "time_format", "time_to_sec",
+ "to_days", "trim", "ucase", "unique_users", "unix_timestamp", "upper",
+ "user", "version", "week", "weekday", "yearweek"
+ ]);
+
+ var keywords = wordRegexp([
+ "alter", "grant", "revoke", "primary", "key", "table", "start", "top",
+ "transaction", "select", "update", "insert", "delete", "create", "describe",
+ "from", "into", "values", "where", "join", "inner", "left", "natural", "and",
+ "or", "in", "not", "xor", "like", "using", "on", "order", "group", "by",
+ "asc", "desc", "limit", "offset", "union", "all", "as", "distinct", "set",
+ "commit", "rollback", "replace", "view", "database", "separator", "if",
+ "exists", "null", "truncate", "status", "show", "lock", "unique", "having",
+ "drop", "procedure", "begin", "end", "delimiter", "call", "else", "leave",
+ "declare", "temporary", "then"
+ ]);
+
+ var types = wordRegexp([
+ "bigint", "binary", "bit", "blob", "bool", "char", "character", "date",
+ "datetime", "dec", "decimal", "double", "enum", "float", "float4", "float8",
+ "int", "int1", "int2", "int3", "int4", "int8", "integer", "long", "longblob",
+ "longtext", "mediumblob", "mediumint", "mediumtext", "middleint", "nchar",
+ "numeric", "real", "set", "smallint", "text", "time", "timestamp", "tinyblob",
+ "tinyint", "tinytext", "varbinary", "varchar", "year"
+ ]);
+
+ var operators = wordRegexp([
+ ":=", "<", "<=", "==", "<>", ">", ">=", "like", "rlike", "in", "xor", "between"
+ ]);
+
+ var operatorChars = /[*+\-<>=&|:\/]/;
+
+ var CFG = {};
+
+ var tokenizeSql = (function() {
+ function normal(source, setState) {
+ var ch = source.next();
+ if (ch == "@" || ch == "$") {
+ source.nextWhileMatches(/[\w\d]/);
+ return "sql-var";
+ }
+ else if (ch == "["){
+ setState(inAlias(ch))
+ return null;
+ }
+ else if (ch == "\"" || ch == "'" || ch == "`") {
+ setState(inLiteral(ch));
+ return null;
+ }
+ else if (ch == "," || ch == ";") {
+ return "sql-separator"
+ }
+ else if (ch == '#') {
+ while (!source.endOfLine()) source.next();
+ return "sql-comment";
+ }
+ else if (ch == '-') {
+ if (source.peek() == "-") {
+ while (!source.endOfLine()) source.next();
+ return "sql-comment";
+ }
+ else if (/\d/.test(source.peek())) {
+ source.nextWhileMatches(/\d/);
+ if (source.peek() == '.') {
+ source.next();
+ source.nextWhileMatches(/\d/);
+ }
+ return "sql-number";
+ }
+ else
+ return "sql-operator";
+ }
+ else if (operatorChars.test(ch)) {
+
+ if(ch == "/" && source.peek() == "*"){
+ setState(inBlock("sql-comment", "*/"));
+ return null;
+ }
+ else{
+ source.nextWhileMatches(operatorChars);
+ return "sql-operator";
+ }
+
+ }
+ else if (/\d/.test(ch)) {
+ source.nextWhileMatches(/\d/);
+ if (source.peek() == '.') {
+ source.next();
+ source.nextWhileMatches(/\d/);
+ }
+ return "sql-number";
+ }
+ else if (/[()]/.test(ch)) {
+ return "sql-punctuation";
+ }
+ else {
+ source.nextWhileMatches(/[_\w\d]/);
+ var word = source.get(), type;
+ if (operators.test(word))
+ type = "sql-operator";
+ else if (keywords.test(word))
+ type = "sql-keyword";
+ else if (functions.test(word))
+ type = "sql-function";
+ else if (types.test(word))
+ type = "sql-type";
+ else
+ type = "sql-word";
+ return {style: type, content: word};
+ }
+ }
+
+ function inAlias(quote) {
+ return function(source, setState) {
+ while (!source.endOfLine()) {
+ var ch = source.next();
+ if (ch == ']') {
+ setState(normal);
+ break;
+ }
+ }
+ return "sql-word";
+ }
+ }
+
+ function inLiteral(quote) {
+ return function(source, setState) {
+ var escaped = false;
+ while (!source.endOfLine()) {
+ var ch = source.next();
+ if (ch == quote && !escaped) {
+ setState(normal);
+ break;
+ }
+ escaped = CFG.extension == 'T-SQL' ?
+ !escaped && quote == ch && source.equals(quote) :
+ !escaped && ch == "\\";
+ }
+ return quote == "`" ? "sql-quoted-word" : "sql-literal";
+ };
+ }
+
+ function inBlock(style, terminator) {
+ return function(source, setState) {
+ while (!source.endOfLine()) {
+ if (source.lookAhead(terminator, true)) {
+ setState(normal);
+ break;
+ }
+ source.next();
+ }
+ return style;
+ };
+ }
+
+ return function(source, startState) {
+ return tokenizer(source, startState || normal);
+ };
+ })();
+
+ function indentSql(context) {
+ return function(nextChars) {
+ var firstChar = nextChars && nextChars.charAt(0);
+ var closing = context && firstChar == context.type;
+ if (!context)
+ return 0;
+ else if (context.align)
+ return context.col - (closing ? context.width : 0);
+ else
+ return context.indent + (closing ? 0 : indentUnit);
+ }
+ }
+
+ function parseSql(source) {
+ var tokens = tokenizeSql(source);
+ var context = null, indent = 0, col = 0;
+ function pushContext(type, width, align) {
+ context = {prev: context, indent: indent, col: col, type: type, width: width, align: align};
+ }
+ function popContext() {
+ context = context.prev;
+ }
+
+ var iter = {
+ next: function() {
+ var token = tokens.next();
+ var type = token.style, content = token.content, width = token.value.length;
+
+ if (content == "\n") {
+ token.indentation = indentSql(context);
+ indent = col = 0;
+ if (context && context.align == null) context.align = false;
+ }
+ else if (type == "whitespace" && col == 0) {
+ indent = width;
+ }
+ else if (!context && type != "sql-comment") {
+ pushContext(";", 0, false);
+ }
+
+ if (content != "\n") col += width;
+
+ if (type == "sql-punctuation") {
+ if (content == "(")
+ pushContext(")", width);
+ else if (content == ")")
+ popContext();
+ }
+ else if (type == "sql-separator" && content == ";" && context && !context.prev) {
+ popContext();
+ }
+
+ return token;
+ },
+
+ copy: function() {
+ var _context = context, _indent = indent, _col = col, _tokenState = tokens.state;
+ return function(source) {
+ tokens = tokenizeSql(source, _tokenState);
+ context = _context;
+ indent = _indent;
+ col = _col;
+ return iter;
+ };
+ }
+ };
+ return iter;
+ }
+
+ function configure (parserConfig) {
+ for (var p in parserConfig) {
+ if (parserConfig.hasOwnProperty(p)) {
+ CFG[p] = parserConfig[p];
+ }
+ }
+ }
+
+ return {make: parseSql, electricChars: ")", configure: configure};
+})();
diff --git a/gulliver/js/codemirror/contrib/xquery/LICENSE b/gulliver/js/codemirror/contrib/xquery/LICENSE
new file mode 100755
index 000000000..dd8e3e824
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/xquery/LICENSE
@@ -0,0 +1,13 @@
+Copyright 2010 Mike Brevoort
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/gulliver/js/codemirror/contrib/xquery/css/xqcolors-dark.css b/gulliver/js/codemirror/contrib/xquery/css/xqcolors-dark.css
new file mode 100755
index 000000000..97e538307
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/xquery/css/xqcolors-dark.css
@@ -0,0 +1,93 @@
+
+.editbox {
+ margin: .4em;
+ padding: 0;
+ font-family: monospace;
+ font-size: 10pt;
+ color: white;
+ background-color: black;
+ line-height: 16px;
+}
+
+span.word {
+ color:white;
+}
+
+span.xqueryKeyword {
+ color: #ffbd40;
+ /* font-weight: bold; */
+}
+
+span.xqueryComment {
+ color: #CDCDCD;
+ font-style:italic;
+}
+
+span.xqueryModifier {
+color:#6c8cd5;
+ font-weight: bold;
+}
+
+span.xqueryType {
+ color:#6c8cd5;
+ font-weight: bold;
+}
+
+span.xqueryAtom {
+ color:#6c8cd5;
+ font-weight: bold;
+}
+
+span.xqueryString {
+ color: #9fee00;
+}
+
+span.xqueryRegexp {
+ color: rgb(128,0,64);
+}
+
+span.xqueryNumber {
+ color: rgb(255,0,0);
+}
+
+span.xqueryVariable {
+
+}
+
+span.xqueryFunction {
+ color:#FFF700;
+}
+
+span.xqueryLocalvariable {
+ color: white;
+}
+
+span.xqueryProperty
+{
+ color: white;
+}
+
+span.xqueryOperator {
+ color: orange;
+}
+
+span.xqueryPunctuation {
+ color: white;
+}
+
+span.xquery-doc-directive {
+ color: white;
+}
+
+span.xml-tagname {
+ color: #ffbd40; ;
+}
+
+span.xml-attribute {
+ color: #FFF700;
+}
+
+span.xml-attribute-value {
+ color: #FFF700;
+ font-style:italic;
+}
\ No newline at end of file
diff --git a/gulliver/js/codemirror/contrib/xquery/css/xqcolors.css b/gulliver/js/codemirror/contrib/xquery/css/xqcolors.css
new file mode 100755
index 000000000..058c1815f
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/xquery/css/xqcolors.css
@@ -0,0 +1,99 @@
+/*
+Copyright 2010 Mike Brevoort http://mike.brevoort.com (twitter:@mbrevoort)
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+This is an indirect collective derivative of the other parses in this package
+
+*/
+.editbox {
+ margin: .4em;
+ padding: 0;
+ font-family: monospace;
+ font-size: 10pt;
+ color: black;
+ background-color: white;
+ line-height: 16px;
+}
+
+span.word {
+}
+
+span.xqueryKeyword {
+ color: red; /* #1240AB; */
+ /* font-weight: bold; */
+}
+
+span.xqueryComment {
+ color: gray;
+ font-style: italic;
+}
+
+span.xqueryModifier {
+ color: rgb(0,102,153);
+ font-weight: bold;
+}
+
+span.xqueryType {
+ color: purple;
+ font-weight: bold;
+}
+
+span.xqueryAtom {
+ color: rgb(0,102,153);
+ font-weight: bold;
+}
+
+span.xqueryString {
+ color: green;
+}
+
+span.xqueryRegexp {
+ color: rgb(128,0,64);
+}
+
+span.xqueryNumber {
+ color: #1240AB;
+}
+
+span.xqueryVariable {
+ /* color: red; */
+}
+
+span.xqueryFunction {
+ color: #1240AB;
+ /* font-weight:bold; */
+}
+
+
+span.xqueryOperator {
+ color: red;
+}
+
+span.xqueryPunctuation {
+ color: DIMGray;
+}
+
+span.xml-tagname {
+ color: purple;
+}
+
+span.xml-attribute {
+ color: purple;
+ font-style:italic;
+}
+
+span.xml-attribute-value {
+ color: purple;
+ font-style:italic;
+}
\ No newline at end of file
diff --git a/gulliver/js/codemirror/contrib/xquery/css/xqcolors2.css b/gulliver/js/codemirror/contrib/xquery/css/xqcolors2.css
new file mode 100755
index 000000000..accb7f734
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/xquery/css/xqcolors2.css
@@ -0,0 +1,96 @@
+/*
+Copyright 2010 Mike Brevoort http://mike.brevoort.com (twitter:@mbrevoort)
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+This is an indirect collective derivative of the other parses in this package
+
+*/
+.editbox {
+ margin: .4em;
+ padding: 0;
+ font-family: monospace;
+ font-size: 10pt;
+ color: black;
+ background-color: white;
+ line-height: 16px;
+}
+
+span.word {
+}
+
+span.xqueryKeyword {
+ color: blue;
+ /* font-weight: bold; */
+}
+
+span.xqueryComment {
+ color: gray;
+}
+
+span.xqueryModifier {
+ color: rgb(0,102,153);
+ font-weight: bold;
+}
+
+span.xqueryType {
+ color: rgb(0,135,255);
+ font-weight: bold;
+}
+
+span.xqueryAtom {
+ color: rgb(0,102,153);
+ font-weight: bold;
+}
+
+span.xqueryString {
+ color: green;
+}
+
+span.xqueryRegexp {
+ color: rgb(128,0,64);
+}
+
+span.xqueryNumber {
+ color: rgb(255,0,0);
+}
+
+span.xqueryVariable {
+ color: red;
+}
+
+span.xqueryFunction {
+ text-decoration:underline
+}
+
+
+span.xqueryOperator {
+ color: DimGray;
+}
+
+span.xqueryPunctuation {
+}
+
+span.xml-tagname {
+ color: purple;
+}
+
+span.xml-attribute {
+ color: purple;
+ font-style:italic;
+}
+
+span.xml-attribute-value {
+ color: purple;
+ font-style:italic;
+}
\ No newline at end of file
diff --git a/gulliver/js/codemirror/contrib/xquery/index.html b/gulliver/js/codemirror/contrib/xquery/index.html
new file mode 100755
index 000000000..eb1150f5b
--- /dev/null
+++ b/gulliver/js/codemirror/contrib/xquery/index.html
@@ -0,0 +1,552 @@
+
+
+
+
+ CodeMirror: XQuery highlighting demonstration
+
+
+
+
+
+
XQuery Syntax Support for CodeMirror
+
This is a demonstration of the XQuery highlighting module
+for CodeMirror. The formatting is CSS driven and very easy to customize to your liking.
+There are three sample styles sets below.
+You can edit or paste in any code below to give it a test run.
+