diff --git a/lib/ace/mode/_test/package.json b/lib/ace/mode/_test/package.json new file mode 100644 index 00000000..3fdc706d --- /dev/null +++ b/lib/ace/mode/_test/package.json @@ -0,0 +1,8 @@ +{ + "name": "ace-mode-creator", + "version": "0.1.0", + "dependencies": { + "connect": "", + "socket.io": "" + } +} \ No newline at end of file diff --git a/lib/ace/mode/_test/test_highlight_rules.js b/lib/ace/mode/_test/test_highlight_rules.js new file mode 100644 index 00000000..544438e6 --- /dev/null +++ b/lib/ace/mode/_test/test_highlight_rules.js @@ -0,0 +1,102 @@ +var fs = require("fs"); +var path = require("path"); +if (!fs.existsSync) + fs.existsSync = path.existsSync; + +require("amd-loader"); + +function generateTestData() { + var root = Array(5).join("../") + "/demo/kitchen-sink/docs" + var docs = fs.readdirSync(root) + var specialDocs = fs.readdirSync(".") + var modes = fs.readdirSync("../").filter(function(x){ + return /(\w+)_highlight_rules.js$/.test(x) + }).map(function(x) { + return x.replace(/_highlight_rules.js$/, "") + }); + + console.log(docs) + console.log(modes) + + docs.forEach(function(docName){ + var p = docName.toLowerCase().split("."), modeName + if (modes.indexOf(p[0]) != -1) { + modeName = p[0] + } else if (modes.indexOf(p[1]) != -1) { + modeName = p[1] + } else { + modeName = {"txt": "text", cpp: "c_cpp"}[p[1]] + } + + if (!modeName) { + return console.error(p) + } + + var filePath = "text_" + modeName + ".txt" + if (specialDocs.indexOf(filePath) == -1) { + filePath = root + "/" + docName + } + + var text = fs.readFileSync(filePath, "utf8") + var Mode = require("../" + modeName).Mode; + var tokenizer = new Mode().getTokenizer(); + + var state = "start" + var data = text.split(/\n|\r|\r\n]/).map(function(line) { + var tokens = tokenizer.getLineTokens(line, state) + state = tokens.state + tokens = tokens.tokens + return { + state: state, + values: tokens.map(function(x) {return x.value}), + types: tokens.map(function(x) {return x.type}) + } + }) + + fs.writeFileSync("tokens_" + modeName + ".json", JSON.stringify(data, null, 1), "utf8") + }) +} + +function test() { + var docs = fs.readdirSync(".").filter(function(x){ + return /^tokens_\w+.json/.test(x) + }); + docs.forEach(function(x, i){ + var modeName = x.match(/tokens_(.*).json/)[1] + + console.log((" " + (i+1)).slice(-3) + ") testing: \u001b[33m" + modeName + "\u001b[0m") + + var text = fs.readFileSync("./" + x, "utf8") + var data = JSON.parse(text) + var Mode = require("../" + modeName).Mode; + var tokenizer = new Mode().getTokenizer(); + + var state = "start" + data.forEach(function(lineData) { + var line = lineData.values.join("") + + var tokens = tokenizer.getLineTokens(line, state) + var values = tokens.tokens.map(function(x) {return x.value}) + var types = tokens.tokens.map(function(x) {return x.type}) + + testEqual(lineData.state, tokens.state) + testEqual(lineData.types, types) + testEqual(lineData.values, values) + + state = lineData.state + }) + }) + + console.log("\u001b[32m" + "all ok" + "\u001b[0m") + + function testEqual(a, b) { + if (a + "" !== b + "") + throw a + "!=" + b + } +} + +if (process.argv[2] == "gen") { + generateTestData(process.argv.splice(3)) +} else { + test() +} diff --git a/lib/ace/mode/_test/text_javascript.txt b/lib/ace/mode/_test/text_javascript.txt new file mode 100644 index 00000000..1e8d3676 --- /dev/null +++ b/lib/ace/mode/_test/text_javascript.txt @@ -0,0 +1,47 @@ +function foo(items, nada) { + for (var i=0; i" + ], + "types": [ + "keyword", + "text", + "constant" + ] + }, + { + "state": "start", + "values": [ + "using", + " ", + "namespace", + " ", + "std", + ";" + ], + "types": [ + "keyword", + "text", + "keyword", + "text", + "identifier", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "int", + " ", + "main", + " ", + "(", + ")" + ], + "types": [ + "keyword", + "text", + "identifier", + "text", + "paren.lparen", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "{" + ], + "types": [ + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "int", + " ", + "a", + ",", + " ", + "b", + "=", + "3", + ";", + " ", + "/*", + " foobar */" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "punctuation.operator", + "text", + "identifier", + "keyword.operator", + "constant.numeric", + "punctuation.operator", + "text", + "comment", + "comment" + ] + }, + { + "state": "start", + "values": [ + " ", + "a", + " ", + "=", + " ", + "b", + ";" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "a", + "+", + "=", + "2", + ";", + " ", + "// equivalent to a=a+2" + ], + "types": [ + "text", + "identifier", + "keyword.operator", + "keyword.operator", + "constant.numeric", + "punctuation.operator", + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + " ", + "cout", + " ", + "<", + "<", + " ", + "a", + ";" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator", + "text", + "identifier", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "return", + " ", + "0", + ";" + ], + "types": [ + "text", + "keyword", + "text", + "constant.numeric", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_clojure.json b/lib/ace/mode/_test/tokens_clojure.json new file mode 100644 index 00000000..20831bf5 --- /dev/null +++ b/lib/ace/mode/_test/tokens_clojure.json @@ -0,0 +1,437 @@ +[ + { + "state": "start", + "values": [ + "(", + "defn", + " ", + "parting" + ], + "types": [ + "keyword", + "support.function", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"returns a String parting in a given language", + "\"" + ], + "types": [ + "text", + "string", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "(", + "[", + "]", + " ", + "(", + "parting", + " ", + "\"World", + "\"", + ")", + ")" + ], + "types": [ + "text", + "keyword", + "keyword", + "keyword", + "text", + "keyword", + "identifier", + "text", + "string", + "string", + "keyword", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "(", + "[", + "name", + "]", + " ", + "(", + "parting", + " ", + "name", + " ", + "\"en", + "\"", + ")", + ")" + ], + "types": [ + "text", + "keyword", + "keyword", + "support.function", + "keyword", + "text", + "keyword", + "identifier", + "text", + "support.function", + "text", + "string", + "string", + "keyword", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "(", + "[", + "name", + " ", + "language", + "]" + ], + "types": [ + "text", + "keyword", + "keyword", + "support.function", + "text", + "identifier", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "; condp is similar to a case statement in other languages." + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + " ", + "; It is described in more detail later." + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + " ", + "; It is used here to take different actions based on whether the" + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + " ", + "; parameter \"language\" is set to \"en\", \"es\" or something else." + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + " ", + "(", + "condp", + " ", + "=", + " ", + "language" + ], + "types": [ + "text", + "keyword", + "support.function", + "text", + "constant.language", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"en", + "\"", + " ", + "(", + "str", + " ", + "\"Goodbye, ", + "\"", + " ", + "name", + ")" + ], + "types": [ + "text", + "string", + "string", + "text", + "keyword", + "support.function", + "text", + "string", + "string", + "text", + "support.function", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"es", + "\"", + " ", + "(", + "str", + " ", + "\"Adios, ", + "\"", + " ", + "name", + ")" + ], + "types": [ + "text", + "string", + "string", + "text", + "keyword", + "support.function", + "text", + "string", + "string", + "text", + "support.function", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "(", + "throw", + " ", + "(", + "IllegalArgumentException", + "." + ], + "types": [ + "text", + "keyword", + "keyword", + "text", + "keyword", + "identifier", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "(", + "str", + " ", + "\"unsupported language ", + "\"", + " ", + "language", + ")", + ")", + ")", + ")", + ")", + ")" + ], + "types": [ + "text", + "keyword", + "support.function", + "text", + "string", + "string", + "text", + "identifier", + "keyword", + "keyword", + "keyword", + "keyword", + "keyword", + "keyword" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "(", + "println", + " ", + "(", + "parting", + ")", + ")", + " ", + "; -> Goodbye, World" + ], + "types": [ + "keyword", + "support.function", + "text", + "keyword", + "identifier", + "keyword", + "keyword", + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + "(", + "println", + " ", + "(", + "parting", + " ", + "\"Mark", + "\"", + ")", + ")", + " ", + "; -> Goodbye, Mark" + ], + "types": [ + "keyword", + "support.function", + "text", + "keyword", + "identifier", + "text", + "string", + "string", + "keyword", + "keyword", + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + "(", + "println", + " ", + "(", + "parting", + " ", + "\"Mark", + "\"", + " ", + "\"es", + "\"", + ")", + ")", + " ", + "; -> Adios, Mark" + ], + "types": [ + "keyword", + "support.function", + "text", + "keyword", + "identifier", + "text", + "string", + "string", + "text", + "string", + "string", + "keyword", + "keyword", + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + "(", + "println", + " ", + "(", + "parting", + " ", + "\"Mark", + "\"", + ", ", + "\"xy", + "\"", + ")", + ")", + " ", + "; -> java.lang.IllegalArgumentException: unsupported language xy" + ], + "types": [ + "keyword", + "support.function", + "text", + "keyword", + "identifier", + "text", + "string", + "string", + "text", + "string", + "string", + "keyword", + "keyword", + "text", + "comment" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_coffee.json b/lib/ace/mode/_test/tokens_coffee.json new file mode 100644 index 00000000..6d3aa160 --- /dev/null +++ b/lib/ace/mode/_test/tokens_coffee.json @@ -0,0 +1,308 @@ +[ + { + "state": "start", + "values": [ + "#!/usr/bin/env coffee" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "try" + ], + "types": [ + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "throw", + " ", + "URIError", + " ", + "decodeURI", + "(", + "0xC0ffee", + " ", + "*", + " ", + "123456.7e-8", + " ", + "/", + " ", + ".9", + ")" + ], + "types": [ + "text", + "keyword", + "text", + "language.support.class", + "text", + "language.support.function", + "paren.lparen", + "constant.numeric", + "text", + "keyword.operator", + "text", + "constant.numeric", + "text", + "keyword.operator", + "text", + "constant.numeric", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "catch", + " ", + "e" + ], + "types": [ + "keyword", + "text", + "identifier" + ] + }, + { + "state": "qdoc", + "values": [ + " ", + "console", + ".log", + " ", + "'qstring'", + " ", + "+", + " ", + "\"qqstring\"", + " ", + "+", + " ", + "'''" + ], + "types": [ + "text", + "identifier", + "identifier", + "text", + "string", + "text", + "keyword.operator", + "text", + "string", + "text", + "keyword.operator", + "text", + "string" + ] + }, + { + "state": "qdoc", + "values": [ + " qdoc" + ], + "types": [ + "string" + ] + }, + { + "state": "qqdoc", + "values": [ + " '''", + " ", + "+", + " ", + "\"\"\"" + ], + "types": [ + "string", + "text", + "keyword.operator", + "text", + "string" + ] + }, + { + "state": "qqdoc", + "values": [ + " qqdoc" + ], + "types": [ + "string" + ] + }, + { + "state": "start", + "values": [ + " \"\"\"" + ], + "types": [ + "string" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "do", + " ", + "->" + ], + "types": [ + "keyword", + "text", + "keyword.operator" + ] + }, + { + "state": "comment", + "values": [ + " ", + "###" + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "comment", + "values": [ + " herecomment" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + " ###" + ], + "types": [ + "comment" + ] + }, + { + "state": "heregex", + "values": [ + " ", + "re", + " ", + "=", + " ", + "/regex/imgy", + ".test", + " ", + "///" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "string.regex", + "identifier", + "text", + "string.regex" + ] + }, + { + "state": "heregex", + "values": [ + " ", + "heregex", + " # comment" + ], + "types": [ + "comment.regex", + "string.regex", + "comment.regex" + ] + }, + { + "state": "start", + "values": [ + " ///imgy" + ], + "types": [ + "string.regex" + ] + }, + { + "state": "start", + "values": [ + " ", + "this", + " ", + "isnt", + ":", + " ", + "`just JavaScript`" + ], + "types": [ + "text", + "keyword", + "text", + "keyword", + "punctuation.operator", + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "undefined" + ], + "types": [ + "text", + "constant.language" + ] + }, + { + "state": "start", + "values": [ + " " + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "sentence", + " ", + "=", + " ", + "\"#{ 22 / 7 } is a decent approximation of π\"" + ], + "types": [ + "identifier", + "text", + "keyword.operator", + "text", + "string" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_coldfusion.json b/lib/ace/mode/_test/tokens_coldfusion.json new file mode 100644 index 00000000..7e443910 --- /dev/null +++ b/lib/ace/mode/_test/tokens_coldfusion.json @@ -0,0 +1,65 @@ +[ + { + "state": "start", + "values": [ + "" + ], + "types": [ + "comment", + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "<", + "cfset", + " ", + "welcome", + "=", + "\"Hello World!\"", + ">" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "<", + "cfoutput", + ">", + "#welcome#", + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_csharp.json b/lib/ace/mode/_test/tokens_csharp.json new file mode 100644 index 00000000..6c23838d --- /dev/null +++ b/lib/ace/mode/_test/tokens_csharp.json @@ -0,0 +1,70 @@ +[ + { + "state": "start", + "values": [ + "public", + " ", + "void", + " ", + "HelloWorld", + "(", + ")", + " ", + "{" + ], + "types": [ + "keyword", + "text", + "keyword", + "text", + "identifier", + "paren.lparen", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "//Say Hello!" + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + " ", + "Console", + ".", + "WriteLine", + "(", + "\"Hello World\"", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "punctuation.operator", + "identifier", + "paren.lparen", + "string", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_css.json b/lib/ace/mode/_test/tokens_css.json new file mode 100644 index 00000000..c872bad4 --- /dev/null +++ b/lib/ace/mode/_test/tokens_css.json @@ -0,0 +1,376 @@ +[ + { + "state": "ruleset", + "values": [ + ".text-layer", + " ", + "{" + ], + "types": [ + "variable", + "text", + "paren.lparen" + ] + }, + { + "state": "ruleset", + "values": [ + " ", + "font-family", + ": Monaco, ", + "\"Courier New\"", + ", ", + "monospace", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "string", + "text", + "support.constant.fonts", + "text" + ] + }, + { + "state": "ruleset", + "values": [ + " ", + "font-size", + ": ", + "12", + "px", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "constant.numeric", + "keyword", + "text" + ] + }, + { + "state": "ruleset", + "values": [ + " ", + "cursor", + ": ", + "text", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "support.constant", + "text" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "ruleset", + "values": [ + ".blinker", + " ", + "{" + ], + "types": [ + "variable", + "text", + "paren.lparen" + ] + }, + { + "state": "ruleset", + "values": [ + " ", + "animation-duration", + ": ", + "1", + "s", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "constant.numeric", + "keyword", + "text" + ] + }, + { + "state": "ruleset", + "values": [ + " ", + "animation-name", + ": blink;" + ], + "types": [ + "text", + "support.type", + "text" + ] + }, + { + "state": "ruleset", + "values": [ + " ", + "animation-iteration-count", + ": infinite;" + ], + "types": [ + "text", + "support.type", + "text" + ] + }, + { + "state": "ruleset", + "values": [ + " ", + "animation-direction", + ": alternate;" + ], + "types": [ + "text", + "support.type", + "text" + ] + }, + { + "state": "ruleset", + "values": [ + " ", + "animation-timing-function", + ": ", + "linear", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "support.constant", + "text" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "media", + "values": [ + "@keyframes blink {" + ], + "types": [ + "string" + ] + }, + { + "state": "media_ruleset", + "values": [ + " ", + "0", + "% ", + "{" + ], + "types": [ + "text", + "constant", + "text", + "paren.lparen" + ] + }, + { + "state": "media_ruleset", + "values": [ + " ", + "opacity", + ": ", + "0", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "constant.numeric", + "text" + ] + }, + { + "state": "media", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "media_ruleset", + "values": [ + " ", + "40", + "% ", + "{" + ], + "types": [ + "text", + "constant", + "text", + "paren.lparen" + ] + }, + { + "state": "media_ruleset", + "values": [ + " ", + "opacity", + ": ", + "0", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "constant.numeric", + "text" + ] + }, + { + "state": "media", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "media_ruleset", + "values": [ + " ", + "40", + ".5", + "% ", + "{" + ], + "types": [ + "text", + "constant", + "variable", + "text", + "paren.lparen" + ] + }, + { + "state": "media_ruleset", + "values": [ + " ", + "opacity", + ": ", + "1" + ], + "types": [ + "text", + "support.type", + "text", + "constant.numeric" + ] + }, + { + "state": "media", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "media_ruleset", + "values": [ + " ", + "100", + "% ", + "{" + ], + "types": [ + "text", + "constant", + "text", + "paren.lparen" + ] + }, + { + "state": "media_ruleset", + "values": [ + " ", + "opacity", + ": ", + "1" + ], + "types": [ + "text", + "support.type", + "text", + "constant.numeric" + ] + }, + { + "state": "media", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "string" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_diff.json b/lib/ace/mode/_test/tokens_diff.json new file mode 100644 index 00000000..5ec5f694 --- /dev/null +++ b/lib/ace/mode/_test/tokens_diff.json @@ -0,0 +1,1051 @@ +[ + { + "state": "start", + "values": [ + "diff", + " --git", + " a/lib/ace/edit_session.js", + " b/lib/ace/edit_session.js" + ], + "types": [ + "variable", + "variable", + "keyword", + "variable" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "index 23fc3fc..ed3b273 100644" + ], + "types": [ + "variable" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "---", + " a/lib/ace/edit_session.js" + ], + "types": [ + "constant.numeric", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "+++", + " b/lib/ace/edit_session.js" + ], + "types": [ + "constant.numeric", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "@@", + " -51,6 +51,7 ", + "@@", + " var TextMode = require(\"./mode/text\").Mode;" + ], + "types": [ + "constant", + "constant.numeric", + "constant", + "comment.doc.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " var Range = require(\"./range\").Range;" + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " var Document = require(\"./document\").Document;" + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " var BackgroundTokenizer = require(\"./background_tokenizer\").BackgroundTokenizer;" + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "+", + "var SearchHighlight = require(\"./search_highlight\").SearchHighlight;" + ], + "types": [ + "support.constant", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " /**" + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " * class EditSession" + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "@@", + " -307,6 +308,13 ", + "@@", + " var EditSession = function(text, mode) {" + ], + "types": [ + "constant", + "constant.numeric", + "constant", + "comment.doc.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " return token;" + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " };" + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "+", + " this.highlight = function(re) {" + ], + "types": [ + "support.constant", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "+", + " if (!this.$searchHighlight) {" + ], + "types": [ + "support.constant", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "+", + " var highlight = new SearchHighlight(null, \"ace_selected_word\", \"text\");" + ], + "types": [ + "support.constant", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "+", + " this.$searchHighlight = this.addDynamicMarker(highlight);" + ], + "types": [ + "support.constant", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "+", + " }" + ], + "types": [ + "support.constant", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "+", + " this.$searchHighlight.setRegexp(re);" + ], + "types": [ + "support.constant", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "+", + " }" + ], + "types": [ + "support.constant", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " /**" + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " * EditSession.setUndoManager(undoManager)" + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " * - undoManager (UndoManager): The new undo manager" + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "@@", + " -556,7 +564,8 ", + "@@", + " var EditSession = function(text, mode) {" + ], + "types": [ + "constant", + "constant.numeric", + "constant", + "comment.doc.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " type : type || \"line\"," + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " renderer: typeof type == \"function\" ? type : null," + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " clazz : clazz," + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "-", + " inFront: !!inFront" + ], + "types": [ + "support.function", + "string" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "+", + " inFront: !!inFront," + ], + "types": [ + "support.constant", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "+", + " id: id" + ], + "types": [ + "support.constant", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " }" + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " if (inFront) {" + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "diff", + " --git", + " a/lib/ace/editor.js", + " b/lib/ace/editor.js" + ], + "types": [ + "variable", + "variable", + "keyword", + "variable" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "index 834e603..b27ec73 100644" + ], + "types": [ + "variable" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "---", + " a/lib/ace/editor.js" + ], + "types": [ + "constant.numeric", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "+++", + " b/lib/ace/editor.js" + ], + "types": [ + "constant.numeric", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "@@", + " -494,7 +494,7 ", + "@@", + " var Editor = function(renderer, session) {" + ], + "types": [ + "constant", + "constant.numeric", + "constant", + "comment.doc.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " * Emitted when a selection has changed." + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " **/" + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " this.onSelectionChange = function(e) {" + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "-", + " var session = this.getSession();" + ], + "types": [ + "support.function", + "string" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "+", + " var session = this.session;" + ], + "types": [ + "support.constant", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " if (session.$selectionMarker) {" + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " session.removeMarker(session.$selectionMarker);" + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "@@", + " -509,12 +509,40 ", + "@@", + " var Editor = function(renderer, session) {" + ], + "types": [ + "constant", + "constant.numeric", + "constant", + "comment.doc.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " this.$updateHighlightActiveLine();" + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " }" + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "-", + " var self = this;" + ], + "types": [ + "support.function", + "string" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "-", + " if (this.$highlightSelectedWord && !this.$wordHighlightTimer)" + ], + "types": [ + "support.function", + "string" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "-", + " this.$wordHighlightTimer = setTimeout(function() {" + ], + "types": [ + "support.function", + "string" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "-", + " self.session.$mode.highlightSelection(self);" + ], + "types": [ + "support.function", + "string" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "-", + " self.$wordHighlightTimer = null;" + ], + "types": [ + "support.function", + "string" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "-", + " }, 30, this);" + ], + "types": [ + "support.function", + "string" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "+", + " var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp()" + ], + "types": [ + "support.constant", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " };" + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "diff", + " --git", + " a/lib/ace/search_highlight.js", + " b/lib/ace/search_highlight.js" + ], + "types": [ + "variable", + "variable", + "keyword", + "variable" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "new file mode 100644" + ], + "types": [ + "invisible" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "index 0000000..b2df779" + ], + "types": [ + "variable" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "---", + " /dev/null" + ], + "types": [ + "constant.numeric", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "+++", + " b/lib/ace/search_highlight.js" + ], + "types": [ + "constant.numeric", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "@@", + " -0,0 +1,3 ", + "@@" + ], + "types": [ + "constant", + "constant.numeric", + "constant" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "+", + "new" + ], + "types": [ + "support.constant", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "+", + "empty file" + ], + "types": [ + "support.constant", + "text" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_glsl.json b/lib/ace/mode/_test/tokens_glsl.json new file mode 100644 index 00000000..d0f06dea --- /dev/null +++ b/lib/ace/mode/_test/tokens_glsl.json @@ -0,0 +1,308 @@ +[ + { + "state": "start", + "values": [ + "uniform", + " ", + "float", + " ", + "amplitude", + ";" + ], + "types": [ + "keyword", + "text", + "keyword", + "text", + "identifier", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [ + "attribute", + " ", + "float", + " ", + "displacement", + ";" + ], + "types": [ + "keyword", + "text", + "keyword", + "text", + "identifier", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [ + "varying", + " ", + "vec3", + " ", + "vNormal", + ";" + ], + "types": [ + "keyword", + "text", + "keyword", + "text", + "identifier", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "void", + " ", + "main", + "(", + ")", + " ", + "{" + ], + "types": [ + "keyword", + "text", + "identifier", + "paren.lparen", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " ", + "vNormal", + " ", + "=", + " ", + "normal", + ";" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [ + " " + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "// multiply our displacement by the" + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + " ", + "// amplitude. The amp will get animated" + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + " ", + "// so we'll have animated displacement" + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + " ", + "vec3", + " ", + "newPosition", + " ", + "=", + " ", + "position", + " ", + "+", + " " + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "text", + "keyword.operator", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "normal", + " ", + "*", + " " + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "vec3", + "(", + "displacement", + " ", + "*" + ], + "types": [ + "text", + "keyword", + "paren.lparen", + "identifier", + "text", + "keyword.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "amplitude", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " ", + "gl_Position", + " ", + "=", + " ", + "projectionMatrix", + " ", + "*" + ], + "types": [ + "text", + "constant.language", + "text", + "keyword.operator", + "text", + "identifier", + "text", + "keyword.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "modelViewMatrix", + " ", + "*" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "vec4", + "(", + "newPosition", + ",", + "1.0", + ")", + ";" + ], + "types": [ + "text", + "keyword", + "paren.lparen", + "identifier", + "punctuation.operator", + "constant.numeric", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_golang.json b/lib/ace/mode/_test/tokens_golang.json new file mode 100644 index 00000000..4ac7fc96 --- /dev/null +++ b/lib/ace/mode/_test/tokens_golang.json @@ -0,0 +1,617 @@ +[ + { + "state": "start", + "values": [ + "// Concurrent computation of pi." + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "// See http://goo.gl/ZuTZM." + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "//" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "// This demonstrates Go's ability to handle" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "// large numbers of concurrent processes." + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "// It is an unreasonable way to calculate pi." + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "package", + " ", + "main" + ], + "types": [ + "keyword", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "import", + " ", + "(" + ], + "types": [ + "keyword", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"fmt\"" + ], + "types": [ + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"math\"" + ], + "types": [ + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + ")" + ], + "types": [ + "paren.rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "func", + " ", + "main", + "(", + ")", + " ", + "{" + ], + "types": [ + "keyword", + "text", + "identifier", + "paren.lparen", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "fmt", + ".", + "Println", + "(", + "pi", + "(", + "5000", + ")", + ")" + ], + "types": [ + "text", + "identifier", + "punctuation.operator", + "identifier", + "paren.lparen", + "identifier", + "paren.lparen", + "constant.numeric", + "paren.rparen", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "// pi launches n goroutines to compute an" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "// approximation of pi." + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "func", + " ", + "pi", + "(", + "n", + " ", + "int", + ")", + " ", + "float64", + " ", + "{" + ], + "types": [ + "keyword", + "text", + "identifier", + "paren.lparen", + "identifier", + "text", + "identifier", + "paren.rparen", + "text", + "identifier", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "ch", + " ", + ":", + "=", + " ", + "make", + "(", + "chan", + " ", + "float64", + ")" + ], + "types": [ + "text", + "identifier", + "text", + "punctuation.operator", + "keyword.operator", + "text", + "identifier", + "paren.lparen", + "keyword", + "text", + "identifier", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "for", + " ", + "k", + " ", + ":", + "=", + " ", + "0", + ";", + " ", + "k", + " ", + "<=", + " ", + "n", + ";", + " ", + "k", + "++", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "punctuation.operator", + "keyword.operator", + "text", + "constant.numeric", + "punctuation.operator", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "punctuation.operator", + "text", + "identifier", + "keyword.operator", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "go", + " ", + "term", + "(", + "ch", + ",", + " ", + "float64", + "(", + "k", + ")", + ")" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "paren.lparen", + "identifier", + "punctuation.operator", + "text", + "identifier", + "paren.lparen", + "identifier", + "paren.rparen", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "f", + " ", + ":", + "=", + " ", + "0.0" + ], + "types": [ + "text", + "identifier", + "text", + "punctuation.operator", + "keyword.operator", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + " ", + "for", + " ", + "k", + " ", + ":", + "=", + " ", + "0", + ";", + " ", + "k", + " ", + "<=", + " ", + "n", + ";", + " ", + "k", + "++", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "punctuation.operator", + "keyword.operator", + "text", + "constant.numeric", + "punctuation.operator", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "punctuation.operator", + "text", + "identifier", + "keyword.operator", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "f", + " ", + "+", + "=", + " ", + "<", + "-", + "ch" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator", + "text", + "keyword.operator", + "keyword.operator", + "identifier" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "return", + " ", + "f" + ], + "types": [ + "text", + "keyword", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "func", + " ", + "term", + "(", + "ch", + " ", + "chan", + " ", + "float64", + ",", + " ", + "k", + " ", + "float64", + ")", + " ", + "{" + ], + "types": [ + "keyword", + "text", + "identifier", + "paren.lparen", + "identifier", + "text", + "keyword", + "text", + "identifier", + "punctuation.operator", + "text", + "identifier", + "text", + "identifier", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "ch", + " ", + "<", + "-", + " ", + "4", + " ", + "*", + " ", + "math", + ".", + "Pow", + "(", + "-1", + ",", + " ", + "k", + ")", + " / ", + "(", + "2", + "*", + "k", + " ", + "+", + " ", + "1", + ")" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator", + "text", + "constant.numeric", + "text", + "keyword.operator", + "text", + "identifier", + "punctuation.operator", + "identifier", + "paren.lparen", + "constant.numeric", + "punctuation.operator", + "text", + "identifier", + "paren.rparen", + "text", + "paren.lparen", + "constant.numeric", + "keyword.operator", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_groovy.json b/lib/ace/mode/_test/tokens_groovy.json new file mode 100644 index 00000000..8df0b304 --- /dev/null +++ b/lib/ace/mode/_test/tokens_groovy.json @@ -0,0 +1,933 @@ +[ + { + "state": "start", + "values": [ + "//http://groovy.codehaus.org/Martin+Fowler%27s+closure+examples+in+Groovy" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "class", + " ", + "Employee", + " ", + "{" + ], + "types": [ + "keyword", + "text", + "identifier", + "text", + "lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "def", + " ", + "name", + ", ", + "salary" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + " ", + "boolean", + " ", + "manager" + ], + "types": [ + "text", + "keyword", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + " ", + "String", + " ", + "toString", + "(", + ")", + " ", + "{", + " ", + "return", + " ", + "name", + " ", + "}" + ], + "types": [ + "text", + "support.function", + "text", + "identifier", + "lparen", + "rparen", + "text", + "lparen", + "text", + "keyword", + "text", + "identifier", + "text", + "rparen" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "def", + " ", + "emps", + " ", + "=", + " ", + "[", + "new", + " ", + "Employee", + "(", + "name", + ":", + "'Guillaume'", + ", ", + "manager", + ":", + "true", + ", ", + "salary", + ":", + "200", + ")", + "," + ], + "types": [ + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "lparen", + "keyword", + "text", + "identifier", + "lparen", + "identifier", + "text", + "string", + "text", + "identifier", + "text", + "constant.language.boolean", + "text", + "identifier", + "text", + "constant.numeric", + "rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "new", + " ", + "Employee", + "(", + "name", + ":", + "'Graeme'", + ", ", + "manager", + ":", + "true", + ", ", + "salary", + ":", + "200", + ")", + "," + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "lparen", + "identifier", + "text", + "string", + "text", + "identifier", + "text", + "constant.language.boolean", + "text", + "identifier", + "text", + "constant.numeric", + "rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "new", + " ", + "Employee", + "(", + "name", + ":", + "'Dierk'", + ", ", + "manager", + ":", + "false", + ", ", + "salary", + ":", + "151", + ")", + "," + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "lparen", + "identifier", + "text", + "string", + "text", + "identifier", + "text", + "constant.language.boolean", + "text", + "identifier", + "text", + "constant.numeric", + "rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "new", + " ", + "Employee", + "(", + "name", + ":", + "'Bernd'", + ", ", + "manager", + ":", + "false", + ", ", + "salary", + ":", + "50", + ")", + "]" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "lparen", + "identifier", + "text", + "string", + "text", + "identifier", + "text", + "constant.language.boolean", + "text", + "identifier", + "text", + "constant.numeric", + "rparen", + "rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "def", + " ", + "managers", + "(", + "emps", + ")", + " ", + "{" + ], + "types": [ + "keyword", + "text", + "identifier", + "lparen", + "identifier", + "rparen", + "text", + "lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "emps", + ".", + "findAll", + " ", + "{", + " ", + "e", + " ", + "-", + ">", + " ", + "e", + ".", + "isManager", + "(", + ")", + " ", + "}" + ], + "types": [ + "text", + "identifier", + "text", + "identifier", + "text", + "lparen", + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator", + "text", + "identifier", + "text", + "identifier", + "lparen", + "rparen", + "text", + "rparen" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "assert", + " ", + "emps", + "[", + "0", + "..", + "1", + "]", + " ", + "==", + " ", + "managers", + "(", + "emps", + ")", + " ", + "// [Guillaume, Graeme]" + ], + "types": [ + "keyword", + "text", + "identifier", + "lparen", + "constant.numeric", + "text", + "constant.numeric", + "rparen", + "text", + "keyword.operator", + "text", + "identifier", + "lparen", + "identifier", + "rparen", + "text", + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "def", + " ", + "highPaid", + "(", + "emps", + ")", + " ", + "{" + ], + "types": [ + "keyword", + "text", + "identifier", + "lparen", + "identifier", + "rparen", + "text", + "lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "threshold", + " ", + "=", + " ", + "150" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + " ", + "emps", + ".", + "findAll", + " ", + "{", + " ", + "e", + " ", + "-", + ">", + " ", + "e", + ".", + "salary", + " ", + ">", + " ", + "threshold", + " ", + "}" + ], + "types": [ + "text", + "identifier", + "text", + "identifier", + "text", + "lparen", + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator", + "text", + "identifier", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "text", + "rparen" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "assert", + " ", + "emps", + "[", + "0", + "..", + "2", + "]", + " ", + "==", + " ", + "highPaid", + "(", + "emps", + ")", + " ", + "// [Guillaume, Graeme, Dierk]" + ], + "types": [ + "keyword", + "text", + "identifier", + "lparen", + "constant.numeric", + "text", + "constant.numeric", + "rparen", + "text", + "keyword.operator", + "text", + "identifier", + "lparen", + "identifier", + "rparen", + "text", + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "def", + " ", + "paidMore", + "(", + "amount", + ")", + " ", + "{" + ], + "types": [ + "keyword", + "text", + "identifier", + "lparen", + "identifier", + "rparen", + "text", + "lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "{", + " ", + "e", + " ", + "-", + ">", + " ", + "e", + ".", + "salary", + " ", + ">", + " ", + "amount", + "}" + ], + "types": [ + "text", + "lparen", + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator", + "text", + "identifier", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "rparen" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "rparen" + ] + }, + { + "state": "start", + "values": [ + "def", + " ", + "highPaid", + " ", + "=", + " ", + "paidMore", + "(", + "150", + ")" + ], + "types": [ + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "lparen", + "constant.numeric", + "rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "assert", + " ", + "highPaid", + "(", + "emps", + "[", + "0", + "]", + ")", + " ", + "// true" + ], + "types": [ + "keyword", + "text", + "identifier", + "lparen", + "identifier", + "lparen", + "constant.numeric", + "rparen", + "rparen", + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + "assert", + " ", + "emps", + "[", + "0", + "..", + "2", + "]", + " ", + "==", + " ", + "emps", + ".", + "findAll", + "(", + "highPaid", + ")" + ], + "types": [ + "keyword", + "text", + "identifier", + "lparen", + "constant.numeric", + "text", + "constant.numeric", + "rparen", + "text", + "keyword.operator", + "text", + "identifier", + "text", + "identifier", + "lparen", + "identifier", + "rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "def", + " ", + "filename", + " ", + "=", + " ", + "'test.txt'" + ], + "types": [ + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + "new", + " ", + "File", + "(", + "filename", + ")", + ".", + "withReader", + "{", + " ", + "reader", + " ", + "-", + ">", + " ", + "doSomethingWith", + "(", + "reader", + ")", + " ", + "}" + ], + "types": [ + "keyword", + "text", + "identifier", + "lparen", + "identifier", + "rparen", + "text", + "identifier", + "lparen", + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator", + "text", + "identifier", + "lparen", + "identifier", + "rparen", + "text", + "rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "def", + " ", + "readersText" + ], + "types": [ + "keyword", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + "def", + " ", + "doSomethingWith", + "(", + "reader", + ")", + " ", + "{", + " ", + "readersText", + " ", + "=", + " ", + "reader", + ".", + "text", + " ", + "}" + ], + "types": [ + "keyword", + "text", + "identifier", + "lparen", + "identifier", + "rparen", + "text", + "lparen", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "text", + "identifier", + "text", + "rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "assert", + " ", + "new", + " ", + "File", + "(", + "filename", + ")", + ".", + "text", + " ", + "==", + " ", + "readersText" + ], + "types": [ + "keyword", + "text", + "keyword", + "text", + "identifier", + "lparen", + "identifier", + "rparen", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_haxe.json b/lib/ace/mode/_test/tokens_haxe.json new file mode 100644 index 00000000..0b5b0b69 --- /dev/null +++ b/lib/ace/mode/_test/tokens_haxe.json @@ -0,0 +1,337 @@ +[ + { + "state": "start", + "values": [ + "class", + " ", + "Haxe", + " " + ], + "types": [ + "keyword", + "text", + "identifier", + "text" + ] + }, + { + "state": "start", + "values": [ + "{" + ], + "types": [ + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "public", + " ", + "static", + " ", + "function", + " ", + "main", + "(", + ")", + " " + ], + "types": [ + "text", + "keyword", + "text", + "keyword", + "text", + "keyword", + "text", + "identifier", + "paren.lparen", + "paren.rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "{" + ], + "types": [ + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "// Say Hello!" + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + " ", + "var", + " ", + "greeting", + ":", + "String", + " ", + "=", + " ", + "\"Hello World\"", + ";" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "punctuation.operator", + "keyword", + "text", + "keyword.operator", + "text", + "string", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "trace", + "(", + "greeting", + ")", + ";" + ], + "types": [ + "text", + "keyword", + "paren.lparen", + "identifier", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [ + " " + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "var", + " ", + "targets", + ":", + "Array", + "<", + "String", + ">", + " ", + "=", + " ", + "[", + "\"Flash\"", + ",", + "\"Javascript\"", + ",", + "\"PHP\"", + ",", + "\"Neko\"", + ",", + "\"C++\"", + ",", + "\"iOS\"", + ",", + "\"Android\"", + ",", + "\"webOS\"", + "]", + ";" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "punctuation.operator", + "keyword", + "keyword.operator", + "keyword", + "keyword.operator", + "text", + "keyword.operator", + "text", + "paren.lparen", + "string", + "punctuation.operator", + "string", + "punctuation.operator", + "string", + "punctuation.operator", + "string", + "punctuation.operator", + "string", + "punctuation.operator", + "string", + "punctuation.operator", + "string", + "punctuation.operator", + "string", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "trace", + "(", + "\"Haxe is a great language that can target:\"", + ")", + ";" + ], + "types": [ + "text", + "keyword", + "paren.lparen", + "string", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "for", + " ", + "(", + "target", + " ", + "in", + " ", + "targets", + ")" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "identifier", + "text", + "keyword", + "text", + "identifier", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "{" + ], + "types": [ + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "trace", + " ", + "(", + "\" - \"", + " ", + "+", + " ", + "target", + ")", + ";" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "string", + "text", + "keyword.operator", + "text", + "identifier", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "trace", + "(", + "\"And many more!\"", + ")", + ";" + ], + "types": [ + "text", + "keyword", + "paren.lparen", + "string", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_html.json b/lib/ace/mode/_test/tokens_html.json new file mode 100644 index 00000000..3acbb7f2 --- /dev/null +++ b/lib/ace/mode/_test/tokens_html.json @@ -0,0 +1,250 @@ +[ + { + "state": "start", + "values": [ + "<", + "html", + ">" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "head", + ">" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "css-start", + "values": [ + " ", + "<", + "style", + " ", + "type", + "=", + "\"text/css\"", + ">" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name.style", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "css-ruleset", + "values": [ + " ", + ".text-layer", + " ", + "{" + ], + "types": [ + "text", + "variable", + "text", + "paren.lparen" + ] + }, + { + "state": "css-ruleset", + "values": [ + " ", + "font-family", + ": Monaco, ", + "\"Courier New\"", + ", ", + "monospace", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "string", + "text", + "support.constant.fonts", + "text" + ] + }, + { + "state": "css-ruleset", + "values": [ + " ", + "font-size", + ": ", + "12", + "px", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "constant.numeric", + "keyword", + "text" + ] + }, + { + "state": "css-ruleset", + "values": [ + " ", + "cursor", + ": ", + "text", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "support.constant", + "text" + ] + }, + { + "state": "css-start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name.style", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " ", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "body", + ">" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "h1", + " ", + "style", + "=", + "\"color:red\"", + ">", + "Juhu Kinners", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_java.json b/lib/ace/mode/_test/tokens_java.json new file mode 100644 index 00000000..56ad4fc1 --- /dev/null +++ b/lib/ace/mode/_test/tokens_java.json @@ -0,0 +1,231 @@ +[ + { + "state": "start", + "values": [ + "public", + " ", + "class", + " ", + "InfiniteLoop", + " ", + "{" + ], + "types": [ + "keyword", + "text", + "keyword", + "text", + "identifier", + "text", + "lparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "comment", + "values": [ + " ", + "/*" + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "comment", + "values": [ + " * This will cause the program to hang..." + ], + "types": [ + "comment" + ] + }, + { + "state": "comment", + "values": [ + " *" + ], + "types": [ + "comment" + ] + }, + { + "state": "comment", + "values": [ + " * Taken from:" + ], + "types": [ + "comment" + ] + }, + { + "state": "comment", + "values": [ + " * http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + " */" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + " ", + "public", + " ", + "static", + " ", + "void", + " ", + "main", + "(", + "String", + "[", + "]", + " ", + "args", + ")", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "keyword", + "text", + "keyword", + "text", + "identifier", + "lparen", + "support.function", + "lparen", + "rparen", + "text", + "identifier", + "rparen", + "text", + "lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "double", + " ", + "d", + " ", + "=", + " ", + "Double", + ".", + "parseDouble", + "(", + "\"2.2250738585072012e-308\"", + ")", + ";" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "support.function", + "text", + "identifier", + "lparen", + "string", + "rparen", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " ", + "// unreachable code" + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + " ", + "System", + ".", + "out", + ".", + "println", + "(", + "\"Value: \"", + " ", + "+", + " ", + "d", + ")", + ";" + ], + "types": [ + "text", + "support.function", + "text", + "identifier", + "text", + "identifier", + "lparen", + "string", + "text", + "keyword.operator", + "text", + "identifier", + "rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "rparen" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "rparen" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_javascript.json b/lib/ace/mode/_test/tokens_javascript.json new file mode 100644 index 00000000..fc012829 --- /dev/null +++ b/lib/ace/mode/_test/tokens_javascript.json @@ -0,0 +1,766 @@ +[ + { + "state": "regex_allowed", + "values": [ + "function", + " ", + "foo", + "(", + "items", + ", ", + "nada", + ")", + " ", + "{" + ], + "types": [ + "storage.type", + "text", + "entity.name.function", + "paren.lparen", + "variable.parameter", + "punctuation.operator", + "variable.parameter", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "regex_allowed", + "values": [ + " ", + "for", + " ", + "(", + "var", + " ", + "i", + "=", + "0", + ";", + " ", + "i", + "<", + "items", + ".", + "length", + ";", + " ", + "i", + "++", + ")", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "storage.type", + "text", + "identifier", + "keyword.operator", + "constant.numeric", + "punctuation.operator", + "text", + "identifier", + "keyword.operator", + "identifier", + "punctuation.operator", + "support.constant", + "punctuation.operator", + "text", + "identifier", + "keyword.operator", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "regex_allowed", + "values": [ + " ", + "alert", + "(", + "items", + "[", + "i", + "]", + " ", + "+", + " ", + "\"juhu", + "\\n", + "\"", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "paren.lparen", + "identifier", + "paren.lparen", + "identifier", + "paren.rparen", + "text", + "keyword.operator", + "text", + "string", + "constant.language.escape", + "string", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "}", + "\t", + "// Real Tab." + ], + "types": [ + "text", + "paren.rparen", + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "/************************************/" + ], + "types": [ + "text", + "comment.doc" + ] + }, + { + "state": "start", + "values": [ + "/** total mess, tricky to highlight**/" + ], + "types": [ + "comment.doc" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "regex_allowed", + "values": [ + "function", + " ", + "(", + ")", + " ", + "{" + ], + "types": [ + "storage.type", + "text", + "paren.lparen", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "doc-start", + "values": [ + "\t", + "/**" + ], + "types": [ + "text", + "comment.doc" + ] + }, + { + "state": "doc-start", + "values": [ + "\t * docComment" + ], + "types": [ + "comment.doc" + ] + }, + { + "state": "start", + "values": [ + "\t **/" + ], + "types": [ + "comment.doc" + ] + }, + { + "state": "start", + "values": [ + "\t", + "r", + " ", + "=", + " ", + "/u", + "\\t", + "*/" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "string.regexp", + "regexp.keyword.operator", + "string.regexp" + ] + }, + { + "state": "start", + "values": [ + "\t", + "g", + " ", + "=", + " ", + "1.", + "00", + "E", + "^", + "1", + ",", + " ", + "y", + " ", + "=", + " ", + "1.2", + " ", + "+", + " ", + ".", + "2", + " ", + "+", + " ", + "052", + " ", + "+", + " ", + "0x25" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric", + "text", + "identifier", + "text", + "constant.numeric", + "punctuation.operator", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric", + "text", + "keyword.operator", + "text", + "punctuation.operator", + "constant.numeric", + "text", + "keyword.operator", + "text", + "constant.numeric", + "text", + "keyword.operator", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + "\t", + "t", + " ", + "=", + " ", + "[", + "'d'", + ",", + " ", + "''", + "]" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "paren.lparen", + "string", + "punctuation.operator", + "text", + "string", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + }, + { + "state": "regex_allowed", + "values": [ + "function", + " ", + "(", + ")", + " ", + "{" + ], + "types": [ + "storage.type", + "text", + "paren.lparen", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "regex_allowed", + "values": [ + "\t", + "/* eee */" + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "qqstring", + "values": [ + "\"s\\" + ], + "types": [ + "string" + ] + }, + { + "state": "start", + "values": [ + "s", + "\\u7824", + "sss", + "\\u", + "1\"" + ], + "types": [ + "string", + "constant.language.escape", + "string", + "constant.language.escape", + "string" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "qstring", + "values": [ + "'\\" + ], + "types": [ + "string" + ] + }, + { + "state": "start", + "values": [ + "string'" + ], + "types": [ + "string" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "'" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "string", + "'" + ], + "types": [ + "identifier", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "\"trailing space", + "\\ ", + " " + ], + "types": [ + "string", + "constant.language.escape", + "string" + ] + }, + { + "state": "start", + "values": [ + "\" \"", + " ", + "/", + "not", + " ", + "a", + " ", + "regexp", + "/", + "g" + ], + "types": [ + "string", + "text", + "keyword.operator", + "identifier", + "text", + "identifier", + "text", + "identifier", + "keyword.operator", + "identifier" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "doc-start", + "values": [ + "/**" + ], + "types": [ + "comment.doc" + ] + }, + { + "state": "doc-start", + "values": [ + " *doc" + ], + "types": [ + "comment.doc" + ] + }, + { + "state": "start", + "values": [ + " */" + ], + "types": [ + "comment.doc" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "regex_allowed", + "values": [ + "a", + " ", + "=", + " ", + "{" + ], + "types": [ + "identifier", + "text", + "keyword.operator", + "text", + "paren.lparen" + ] + }, + { + "state": "regex_allowed", + "values": [ + "\t", + "'a'", + ":", + " ", + "b", + "," + ], + "types": [ + "text", + "string", + "punctuation.operator", + "text", + "identifier", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [ + "\t", + "'g'", + ": ", + "function", + "(", + "t", + ")" + ], + "types": [ + "text", + "string", + "text", + "storage.type", + "paren.lparen", + "variable.parameter", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "\t", + "gta", + ":", + "function", + "(", + "a", + ",", + "b", + ")" + ], + "types": [ + "text", + "entity.name.function", + "punctuation.operator", + "storage.type", + "paren.lparen", + "variable.parameter", + "punctuation.operator", + "variable.parameter", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "function_arguments", + "values": [ + "foo", + ".", + "protoype", + ".", + "d", + " ", + "=", + " ", + "function", + "(", + "a", + ", ", + "b", + "," + ], + "types": [ + "identifier", + "punctuation.operator", + "storage.type", + "punctuation.operator", + "entity.name.function", + "text", + "keyword.operator", + "text", + "storage.type", + "paren.lparen", + "variable.parameter", + "punctuation.operator", + "variable.parameter", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "c", + ", ", + "d", + ")" + ], + "types": [ + "punctuation.operator", + "variable.parameter", + "punctuation.operator", + "variable.parameter", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "foo", + ".", + "d", + " ", + "=", + "function", + "(", + "a", + ", ", + "b", + ")" + ], + "types": [ + "storage.type", + "punctuation.operator", + "entity.name.function", + "text", + "keyword.operator", + "storage.type", + "paren.lparen", + "variable.parameter", + "punctuation.operator", + "variable.parameter", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "foo", + ".", + "d", + " ", + "=", + "function", + "(", + "a", + ", ", + "/*****/", + " ", + "d", + "\"string\"", + " " + ], + "types": [ + "storage.type", + "punctuation.operator", + "entity.name.function", + "text", + "keyword.operator", + "storage.type", + "paren.lparen", + "variable.parameter", + "punctuation.operator", + "comment.doc", + "text", + "identifier", + "string", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_json.json b/lib/ace/mode/_test/tokens_json.json new file mode 100644 index 00000000..f90f0870 --- /dev/null +++ b/lib/ace/mode/_test/tokens_json.json @@ -0,0 +1,1022 @@ +[ + { + "state": "start", + "values": [ + "{" + ], + "types": [ + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"query\"", + ": ", + "{" + ], + "types": [ + "text", + "variable", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"count\"", + ": ", + "10", + "," + ], + "types": [ + "text", + "variable", + "text", + "constant.numeric", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"created\"", + ": ", + "\"2011-06-21T08:10:46Z\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"lang\"", + ": ", + "\"en-US\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"results\"", + ": ", + "{" + ], + "types": [ + "text", + "variable", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"photo\"", + ": ", + "[" + ], + "types": [ + "text", + "variable", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "{" + ], + "types": [ + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"farm\"", + ": ", + "\"6\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"id\"", + ": ", + "\"5855620975\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"isfamily\"", + ": ", + "\"0\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"isfriend\"", + ": ", + "\"0\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"ispublic\"", + ": ", + "\"1\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"owner\"", + ": ", + "\"32021554@N04\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"secret\"", + ": ", + "\"f1f5e8515d\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"server\"", + ": ", + "\"5110\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"title\"", + ": ", + "\"7087 bandit cat\"" + ], + "types": [ + "text", + "variable", + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "}", + "," + ], + "types": [ + "text", + "paren.rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "{" + ], + "types": [ + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"farm\"", + ": ", + "\"4\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"id\"", + ": ", + "\"5856170534\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"isfamily\"", + ": ", + "\"0\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"isfriend\"", + ": ", + "\"0\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"ispublic\"", + ": ", + "\"1\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"owner\"", + ": ", + "\"32021554@N04\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"secret\"", + ": ", + "\"ff1efb2a6f\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"server\"", + ": ", + "\"3217\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"title\"", + ": ", + "\"6975 rusty cat\"" + ], + "types": [ + "text", + "variable", + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "}", + "," + ], + "types": [ + "text", + "paren.rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "{" + ], + "types": [ + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"farm\"", + ": ", + "\"6\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"id\"", + ": ", + "\"5856172972\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"isfamily\"", + ": ", + "\"0\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"isfriend\"", + ": ", + "\"0\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"ispublic\"", + ": ", + "\"1\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"owner\"", + ": ", + "\"51249875@N03\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"secret\"", + ": ", + "\"6c6887347c\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"server\"", + ": ", + "\"5192\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"title\"", + ": ", + "\"watermarked-cats\"" + ], + "types": [ + "text", + "variable", + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "}", + "," + ], + "types": [ + "text", + "paren.rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "{" + ], + "types": [ + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"farm\"", + ": ", + "\"6\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"id\"", + ": ", + "\"5856168328\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"isfamily\"", + ": ", + "\"0\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"isfriend\"", + ": ", + "\"0\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"ispublic\"", + ": ", + "\"1\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"owner\"", + ": ", + "\"32021554@N04\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"secret\"", + ": ", + "\"0c1cfdf64c\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"server\"", + ": ", + "\"5078\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"title\"", + ": ", + "\"7020 mandy cat\"" + ], + "types": [ + "text", + "variable", + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "}", + "," + ], + "types": [ + "text", + "paren.rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "{" + ], + "types": [ + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"farm\"", + ": ", + "\"3\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"id\"", + ": ", + "\"5856171774\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"isfamily\"", + ": ", + "\"0\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"isfriend\"", + ": ", + "\"0\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"ispublic\"", + ": ", + "\"1\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"owner\"", + ": ", + "\"32021554@N04\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"secret\"", + ": ", + "\"7f5a3180ab\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"server\"", + ": ", + "\"2696\"", + "," + ], + "types": [ + "text", + "variable", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"title\"", + ": ", + "\"7448 bobby cat\"" + ], + "types": [ + "text", + "variable", + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "]" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_jsx.json b/lib/ace/mode/_test/tokens_jsx.json new file mode 100644 index 00000000..30d5945a --- /dev/null +++ b/lib/ace/mode/_test/tokens_jsx.json @@ -0,0 +1,129 @@ +[ + { + "state": "comment", + "values": [ + "/*EXPECTED" + ], + "types": [ + "comment" + ] + }, + { + "state": "comment", + "values": [ + "hello world!" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "*/" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "class", + " ", + "Test", + " ", + "{" + ], + "types": [ + "keyword", + "text", + "language.support.class", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "static", + " ", + "function", + " ", + "run", + "(", + ")", + " ", + ":", + " ", + "void", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "storage.type", + "text", + "entity.name.function", + "paren.lparen", + "paren.rparen", + "text", + "punctuation.operator", + "text", + "keyword", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "// console.log(\"hello world!\");" + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + " ", + "log", + " ", + "\"hello world!\"", + ";" + ], + "types": [ + "text", + "keyword", + "text", + "string", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_latex.json b/lib/ace/mode/_test/tokens_latex.json new file mode 100644 index 00000000..5ee56b23 --- /dev/null +++ b/lib/ace/mode/_test/tokens_latex.json @@ -0,0 +1,324 @@ +[ + { + "state": "start", + "values": [ + "\\usepackage", + "{", + "amsmath", + "}" + ], + "types": [ + "keyword", + "lparen", + "text", + "rparen" + ] + }, + { + "state": "start", + "values": [ + "\\title", + "{", + "\\LaTeX", + "}" + ], + "types": [ + "keyword", + "lparen", + "keyword", + "rparen" + ] + }, + { + "state": "start", + "values": [ + "\\date", + "{", + "}" + ], + "types": [ + "keyword", + "lparen", + "rparen" + ] + }, + { + "state": "start", + "values": [ + "\\begin", + "{", + "document", + "}" + ], + "types": [ + "keyword", + "lparen", + "text", + "rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "\\maketitle" + ], + "types": [ + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "\\LaTeX", + "{", + "}", + " is a document preparation system for the ", + "\\TeX", + "{", + "}" + ], + "types": [ + "text", + "keyword", + "lparen", + "rparen", + "text", + "keyword", + "lparen", + "rparen" + ] + }, + { + "state": "start", + "values": [ + " typesetting program. It offers programmable desktop publishing" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + " features and extensive facilities for automating most aspects of" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + " typesetting and desktop publishing, including numbering and" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + " cross-referencing, tables and figures, page layout, bibliographies," + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + " and much more. ", + "\\LaTeX", + "{", + "}", + " was originally written in 1984 by Leslie" + ], + "types": [ + "text", + "keyword", + "lparen", + "rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + " Lamport and has become the dominant method for using ", + "\\TeX", + "; few" + ], + "types": [ + "text", + "keyword", + "text" + ] + }, + { + "state": "start", + "values": [ + " people write in plain ", + "\\TeX", + "{", + "}", + " anymore. The current version is" + ], + "types": [ + "text", + "keyword", + "lparen", + "rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "\\LaTeXe", + "." + ], + "types": [ + "text", + "keyword", + "text" + ] + }, + { + "state": "start", + "values": [ + " " + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "% This is a comment; it will not be shown in the final output." + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + " ", + "% The following shows a little of the typesetting power of LaTeX:" + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + " ", + "\\begin", + "{", + "align", + "}" + ], + "types": [ + "text", + "keyword", + "lparen", + "text", + "rparen" + ] + }, + { + "state": "start", + "values": [ + " E &= mc^2 ", + "\\\\" + ], + "types": [ + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " m &= ", + "\\frac", + "{", + "m_0", + "}", + "{", + "\\sqrt", + "{", + "1-", + "\\frac", + "{", + "v^2", + "}", + "{", + "c^2", + "}", + "}", + "}" + ], + "types": [ + "text", + "keyword", + "lparen", + "text", + "rparen", + "lparen", + "keyword", + "lparen", + "text", + "keyword", + "lparen", + "text", + "rparen", + "lparen", + "text", + "rparen", + "rparen", + "rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "\\end", + "{", + "align", + "}" + ], + "types": [ + "text", + "keyword", + "lparen", + "text", + "rparen" + ] + }, + { + "state": "start", + "values": [ + "\\end", + "{", + "document", + "}" + ], + "types": [ + "keyword", + "lparen", + "text", + "rparen" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_less.json b/lib/ace/mode/_test/tokens_less.json new file mode 100644 index 00000000..9bfae5a5 --- /dev/null +++ b/lib/ace/mode/_test/tokens_less.json @@ -0,0 +1,495 @@ +[ + { + "state": "start", + "values": [ + "/*", + " styles.less */" + ], + "types": [ + "comment", + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "@base", + ": ", + "#f938ab", + ";" + ], + "types": [ + "variable", + "text", + "constant.numeric", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + ".box-shadow", + "(", + "@style", + ", ", + "@c", + ")", + " ", + "when", + " ", + "(", + "iscolor", + "(", + "@c", + ")", + ")", + " ", + "{" + ], + "types": [ + "variable.language", + "paren.lparen", + "variable", + "text", + "variable", + "paren.rparen", + "text", + "keyword", + "text", + "paren.lparen", + "support.function", + "paren.lparen", + "variable", + "paren.rparen", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " box-shadow: ", + "@style", + " ", + "@c", + ";" + ], + "types": [ + "text", + "variable", + "text", + "variable", + "text" + ] + }, + { + "state": "start", + "values": [ + " -webkit-box-shadow: ", + "@style", + " ", + "@c", + ";" + ], + "types": [ + "text", + "variable", + "text", + "variable", + "text" + ] + }, + { + "state": "start", + "values": [ + " -moz-box-shadow: ", + "@style", + " ", + "@c", + ";" + ], + "types": [ + "text", + "variable", + "text", + "variable", + "text" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + ".box-shadow", + "(", + "@style", + ", ", + "@alpha", + ": ", + "50%", + ")", + " ", + "when", + " ", + "(", + "isnumber", + "(", + "@alpha", + ")", + ")", + " ", + "{" + ], + "types": [ + "variable.language", + "paren.lparen", + "variable", + "text", + "variable", + "text", + "constant.numeric", + "paren.rparen", + "text", + "keyword", + "text", + "paren.lparen", + "support.function", + "paren.lparen", + "variable", + "paren.rparen", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + ".box-shadow", + "(", + "@style", + ", ", + "rgba", + "(", + "0", + ", ", + "0", + ", ", + "0", + ", ", + "@alpha", + ")", + ")", + ";" + ], + "types": [ + "text", + "variable.language", + "paren.lparen", + "variable", + "text", + "support.function", + "paren.lparen", + "constant.numeric", + "text", + "constant.numeric", + "text", + "constant.numeric", + "text", + "variable", + "paren.rparen", + "paren.rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "// Box styles" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + ".box", + " ", + "{", + " " + ], + "types": [ + "variable.language", + "text", + "paren.lparen", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "color", + ": ", + "saturate", + "(", + "@base", + ", ", + "5%", + ")", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "support.function", + "paren.lparen", + "variable", + "text", + "constant.numeric", + "paren.rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "border-color", + ": ", + "lighten", + "(", + "@base", + ", ", + "30%", + ")", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "support.function", + "paren.lparen", + "variable", + "text", + "constant.numeric", + "paren.rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + " " + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "div", + " ", + "{", + " ", + ".box-shadow", + "(", + "0", + " ", + "0", + " ", + "5px", + ", ", + "30%", + ")", + " ", + "}" + ], + "types": [ + "text", + "variable.language", + "text", + "paren.lparen", + "text", + "variable.language", + "paren.lparen", + "constant.numeric", + "text", + "constant.numeric", + "text", + "constant.numeric", + "text", + "constant.numeric", + "paren.rparen", + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " " + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "a", + " ", + "{" + ], + "types": [ + "text", + "variable.language", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "color", + ": ", + "@base", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "variable", + "text" + ] + }, + { + "state": "start", + "values": [ + " " + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + " &", + ":hover", + " ", + "{" + ], + "types": [ + "text", + "variable.language", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "color", + ": ", + "lighten", + "(", + "@base", + ", ", + "50%", + ")", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "support.function", + "paren.lparen", + "variable", + "text", + "constant.numeric", + "paren.rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_liquid.json b/lib/ace/mode/_test/tokens_liquid.json new file mode 100644 index 00000000..36a09bc2 --- /dev/null +++ b/lib/ace/mode/_test/tokens_liquid.json @@ -0,0 +1,1163 @@ +[ + { + "state": "start", + "values": [ + "The following examples can be found in full at http://liquidmarkup.org/" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Liquid is an extraction from the e-commerce system Shopify." + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "Shopify powers many thousands of e-commerce stores which all call for unique designs." + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "For this we developed Liquid which allows our customers complete design freedom while" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "maintaining the integrity of our servers." + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Liquid has been in production use since June 2006 and is now used by many other" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "hosted web applications." + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "It was developed for usage in Ruby on Rails web applications and integrates seamlessly" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "as a plugin but it also works excellently as a stand alone library." + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Here's what it looks like:" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " ", + "<", + "ul", + " ", + "id", + "=", + "\"products\"", + ">" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "{%", + " ", + "for", + " ", + "product", + " ", + "in", + " ", + "products", + " ", + "%}" + ], + "types": [ + "text", + "variable", + "text", + "keyword", + "text", + "identifier", + "text", + "keyword", + "text", + "identifier", + "text", + "variable" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "li", + ">" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "h2", + ">", + "{{", + " ", + "product", + ".", + "title", + " ", + "}}", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "variable", + "text", + "identifier", + "text", + "identifier", + "text", + "variable", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " Only {{ product.price | format_as_money }}" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " ", + "<", + "p", + ">", + "{{", + " ", + "product", + ".", + "description", + " | ", + "prettyprint", + " | ", + "truncate", + ": ", + "200", + " ", + "}}", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "variable", + "text", + "identifier", + "text", + "identifier", + "text", + "identifier", + "text", + "support.function", + "text", + "constant.numeric", + "text", + "variable", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " ", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "{%", + " ", + "endfor", + " ", + "%}" + ], + "types": [ + "text", + "variable", + "text", + "keyword", + "text", + "variable" + ] + }, + { + "state": "start", + "values": [ + " ", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Some more features include:" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "<", + "h2", + ">", + "Filters", + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "<", + "p", + ">", + " The word \"tobi\" in uppercase: {{ 'tobi' | upcase }} ", + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "<", + "p", + ">", + "The word \"tobi\" has {{ 'tobi' | size }} letters! ", + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "<", + "p", + ">", + "Change \"Hello world\" to \"Hi world\": {{ 'Hello world' | replace: 'Hello', 'Hi' }} ", + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "<", + "p", + ">", + "The date today is {{ 'now' | date: \"%Y %b %d\" }} ", + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "<", + "h2", + ">", + "If", + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "<", + "p", + ">" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "{%", + " ", + "if", + " ", + "user", + ".", + "name", + " ", + "=", + "=", + " ", + "'tobi'", + " ", + "or", + " ", + "user", + ".", + "name", + " ", + "=", + "=", + " ", + "'marc'", + " ", + "%}", + " " + ], + "types": [ + "text", + "variable", + "text", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator", + "text", + "string", + "text", + "identifier", + "text", + "identifier", + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator", + "text", + "string", + "text", + "variable", + "text" + ] + }, + { + "state": "start", + "values": [ + " hi marc or tobi" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "{%", + " ", + "endif", + " ", + "%}" + ], + "types": [ + "text", + "variable", + "text", + "keyword", + "text", + "variable" + ] + }, + { + "state": "start", + "values": [ + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "<", + "h2", + ">", + "Case", + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "<", + "p", + ">" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "{%", + " ", + "case", + " ", + "template", + " ", + "%}" + ], + "types": [ + "text", + "variable", + "text", + "keyword", + "text", + "identifier", + "text", + "variable" + ] + }, + { + "state": "start", + "values": [ + " ", + "{%", + " ", + "when", + " ", + "'index'", + " ", + "%}" + ], + "types": [ + "text", + "variable", + "text", + "keyword", + "text", + "string", + "text", + "variable" + ] + }, + { + "state": "start", + "values": [ + " Welcome" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "{%", + " ", + "when", + " ", + "'product'", + " ", + "%}" + ], + "types": [ + "text", + "variable", + "text", + "keyword", + "text", + "string", + "text", + "variable" + ] + }, + { + "state": "start", + "values": [ + " ", + "{{", + " ", + "product", + ".", + "vendor", + " | ", + "link_to_vendor", + " ", + "}}", + " / {{ product.title }}" + ], + "types": [ + "text", + "variable", + "text", + "identifier", + "text", + "identifier", + "text", + "identifier", + "text", + "variable", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "{%", + " ", + "else", + " ", + "%}" + ], + "types": [ + "text", + "variable", + "text", + "keyword", + "text", + "variable" + ] + }, + { + "state": "start", + "values": [ + " ", + "{{", + " ", + "page_title", + " ", + "}}" + ], + "types": [ + "text", + "variable", + "text", + "identifier", + "text", + "variable" + ] + }, + { + "state": "start", + "values": [ + " ", + "{%", + " ", + "endcase", + " ", + "%}" + ], + "types": [ + "text", + "variable", + "text", + "keyword", + "text", + "variable" + ] + }, + { + "state": "start", + "values": [ + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "<", + "h2", + ">", + "For Loops", + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "<", + "p", + ">" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "{%", + " ", + "for", + " ", + "item", + " ", + "in", + " ", + "array", + " ", + "%}", + " " + ], + "types": [ + "text", + "variable", + "text", + "keyword", + "text", + "identifier", + "text", + "keyword", + "text", + "identifier", + "text", + "variable", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "{{", + " ", + "item", + " ", + "}}" + ], + "types": [ + "text", + "variable", + "text", + "identifier", + "text", + "variable" + ] + }, + { + "state": "start", + "values": [ + " ", + "{%", + " ", + "endfor", + " ", + "%}" + ], + "types": [ + "text", + "variable", + "text", + "keyword", + "text", + "variable" + ] + }, + { + "state": "start", + "values": [ + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "<", + "h2", + ">", + "Tables", + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "<", + "p", + ">" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "{%", + " ", + "tablerow", + " ", + "item", + " ", + "in", + " ", + "items", + " ", + "cols", + ": ", + "3", + " ", + "%}" + ], + "types": [ + "text", + "variable", + "text", + "keyword", + "text", + "identifier", + "text", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "constant.numeric", + "text", + "variable" + ] + }, + { + "state": "start", + "values": [ + " ", + "{%", + " ", + "if", + " ", + "tablerowloop", + ".", + "col_first", + " ", + "%}" + ], + "types": [ + "text", + "variable", + "text", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "variable" + ] + }, + { + "state": "start", + "values": [ + " First column: {{ item.variable }}" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "{%", + " ", + "else", + " ", + "%}" + ], + "types": [ + "text", + "variable", + "text", + "keyword", + "text", + "variable" + ] + }, + { + "state": "start", + "values": [ + " Different column: {{ item.variable }}" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "{%", + " ", + "endif", + " ", + "%}" + ], + "types": [ + "text", + "variable", + "text", + "keyword", + "text", + "variable" + ] + }, + { + "state": "start", + "values": [ + " ", + "{%", + " ", + "endtablerow", + " ", + "%}" + ], + "types": [ + "text", + "variable", + "text", + "keyword", + "text", + "variable" + ] + }, + { + "state": "start", + "values": [ + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_lua.json b/lib/ace/mode/_test/tokens_lua.json new file mode 100644 index 00000000..5a832a0f --- /dev/null +++ b/lib/ace/mode/_test/tokens_lua.json @@ -0,0 +1,789 @@ +[ + { + "state": "qcomment", + "values": [ + "--[[--" + ], + "types": [ + "comment" + ] + }, + { + "state": "qcomment", + "values": [ + "num_args takes in 5.1 byte code and extracts the number of arguments" + ], + "types": [ + "comment" + ] + }, + { + "state": "qcomment", + "values": [ + "from its function header." + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "--]]", + "--" + ], + "types": [ + "comment", + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "function", + " ", + "int", + "(", + "t", + ")" + ], + "types": [ + "keyword", + "text", + "identifier", + "paren.lparen", + "identifier", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "\t", + "return", + " ", + "t", + ":", + "byte", + "(", + "1", + ")", + "+", + "t", + ":", + "byte", + "(", + "2", + ")", + "*", + "0x100", + "+", + "t", + ":", + "byte", + "(", + "3", + ")", + "*", + "0x10000", + "+", + "t", + ":", + "byte", + "(", + "4", + ")", + "*", + "0x1000000" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "keyword.operator", + "support.function", + "paren.lparen", + "constant.numeric", + "paren.rparen", + "keyword.operator", + "identifier", + "keyword.operator", + "support.function", + "paren.lparen", + "constant.numeric", + "paren.rparen", + "keyword.operator", + "constant.numeric", + "keyword.operator", + "identifier", + "keyword.operator", + "support.function", + "paren.lparen", + "constant.numeric", + "paren.rparen", + "keyword.operator", + "constant.numeric", + "keyword.operator", + "identifier", + "keyword.operator", + "support.function", + "paren.lparen", + "constant.numeric", + "paren.rparen", + "keyword.operator", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + "end" + ], + "types": [ + "keyword" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "function", + " ", + "num_args", + "(", + "func", + ")" + ], + "types": [ + "keyword", + "text", + "identifier", + "paren.lparen", + "identifier", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "\t", + "local", + " ", + "dump", + " ", + "=", + " ", + "string", + ".", + "dump", + "(", + "func", + ")" + ], + "types": [ + "text", + "keyword", + "text", + "support.function", + "text", + "keyword.operator", + "text", + "constant.library", + "text", + "support.function", + "paren.lparen", + "identifier", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "\t", + "local", + " ", + "offset", + ", ", + "cursor", + " ", + "=", + " ", + "int", + "(", + "dump", + ":", + "sub", + "(", + "13", + ")", + ")", + ", ", + "offset", + " ", + "+", + " ", + "26" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "paren.lparen", + "support.function", + "keyword.operator", + "support.function", + "paren.lparen", + "constant.numeric", + "paren.rparen", + "paren.rparen", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + "\t", + "--Get the params and var flag (whether there's a ... in the param)" + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + "\t", + "return", + " ", + "dump", + ":", + "sub", + "(", + "cursor", + ")", + ":", + "byte", + "(", + ")", + ", ", + "dump", + ":", + "sub", + "(", + "cursor", + "+", + "1", + ")", + ":", + "byte", + "(", + ")" + ], + "types": [ + "text", + "keyword", + "text", + "support.function", + "keyword.operator", + "support.function", + "paren.lparen", + "identifier", + "paren.rparen", + "keyword.operator", + "support.function", + "paren.lparen", + "paren.rparen", + "text", + "support.function", + "keyword.operator", + "support.function", + "paren.lparen", + "identifier", + "keyword.operator", + "constant.numeric", + "paren.rparen", + "keyword.operator", + "support.function", + "paren.lparen", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "end" + ], + "types": [ + "keyword" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "-- Usage:" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "num_args", + "(", + "function", + "(", + "a", + ",", + "b", + ",", + "c", + ",", + "d", + ", ", + "...", + ")", + " ", + "end", + ")", + " ", + "-- return 4, 7" + ], + "types": [ + "identifier", + "paren.lparen", + "keyword", + "paren.lparen", + "identifier", + "text", + "identifier", + "text", + "identifier", + "text", + "identifier", + "text", + "keyword.operator", + "paren.rparen", + "text", + "keyword", + "paren.rparen", + "text", + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "-- Python styled string format operator" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "local", + " ", + "gm", + " ", + "=", + " ", + "debug", + ".", + "getmetatable", + "(", + "\"\"", + ")" + ], + "types": [ + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "constant.library", + "text", + "support.function", + "paren.lparen", + "string", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "gm", + ".", + "__mod", + "=", + "function", + "(", + "self", + ", ", + "other", + ")" + ], + "types": [ + "identifier", + "text", + "support.function", + "keyword.operator", + "keyword", + "paren.lparen", + "identifier", + "text", + "identifier", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "if", + " ", + "type", + "(", + "other", + ")", + " ", + "~", + "=", + " ", + "\"table\"", + " ", + "then", + " ", + "other", + " ", + "=", + " ", + "{", + "other", + "}", + " ", + "end" + ], + "types": [ + "text", + "keyword", + "text", + "support.function", + "paren.lparen", + "identifier", + "paren.rparen", + "text", + "keyword.operator", + "keyword.operator", + "text", + "string", + "text", + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "paren.lparen", + "identifier", + "paren.rparen", + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "for", + " ", + "i", + ",", + "v", + " ", + "in", + " ", + "ipairs", + "(", + "other", + ")", + " ", + "do", + " ", + "other", + "[", + "i", + "]", + " ", + "=", + " ", + "tostring", + "(", + "v", + ")", + " ", + "end" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "keyword", + "text", + "support.function", + "paren.lparen", + "identifier", + "paren.rparen", + "text", + "keyword", + "text", + "identifier", + "paren.lparen", + "identifier", + "paren.rparen", + "text", + "keyword.operator", + "text", + "support.function", + "paren.lparen", + "identifier", + "paren.rparen", + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "return", + " ", + "self", + ":", + "format", + "(", + "unpack", + "(", + "other", + ")", + ")" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "keyword.operator", + "support.function", + "paren.lparen", + "support.function", + "paren.lparen", + "identifier", + "paren.rparen", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "end" + ], + "types": [ + "keyword" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "qstring3", + "values": [ + "print", + "(", + "[===[" + ], + "types": [ + "support.function", + "paren.lparen", + "string" + ] + }, + { + "state": "qstring3", + "values": [ + " blah blah %s, (%d %d)" + ], + "types": [ + "string" + ] + }, + { + "state": "start", + "values": [ + "]===]", + "%", + "{", + "\"blah\"", + ", ", + "num_args", + "(", + "int", + ")", + "}", + ")" + ], + "types": [ + "string", + "keyword.operator", + "paren.lparen", + "string", + "text", + "identifier", + "paren.lparen", + "identifier", + "paren.rparen", + "paren.rparen", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "qcomment1", + "values": [ + "--[=[--" + ], + "types": [ + "comment" + ] + }, + { + "state": "qcomment1", + "values": [ + "table.maxn is deprecated, use # instead." + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "--]=]", + "--" + ], + "types": [ + "comment", + "comment" + ] + }, + { + "state": "start", + "values": [ + "print", + "(", + "table", + ".", + "maxn", + "{", + "1", + ",", + "2", + ",", + "[", + "4", + "]", + "=", + "4", + ",", + "[", + "8", + "]", + "=", + "8", + ")", + " ", + "-- outputs 8 instead of 2" + ], + "types": [ + "support.function", + "paren.lparen", + "constant.library", + "text", + "invalid.deprecated", + "paren.lparen", + "constant.numeric", + "text", + "constant.numeric", + "text", + "paren.lparen", + "constant.numeric", + "paren.rparen", + "keyword.operator", + "constant.numeric", + "text", + "paren.lparen", + "constant.numeric", + "paren.rparen", + "keyword.operator", + "constant.numeric", + "paren.rparen", + "text", + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_luapage.json b/lib/ace/mode/_test/tokens_luapage.json new file mode 100644 index 00000000..f36e728f --- /dev/null +++ b/lib/ace/mode/_test/tokens_luapage.json @@ -0,0 +1,1430 @@ +[ + { + "state": "tag_embed_attribute_list", + "values": [ + "", + "<", + "!", + "DOCTYPE", + " ", + "html", + " ", + "PUBLIC", + " ", + "\"-//W3C//DTD XHTML 1.0 Strict//EN\"" + ], + "types": [ + "text", + "meta.tag", + "text", + "entity.other.attribute-name", + "text", + "entity.other.attribute-name", + "text", + "entity.other.attribute-name", + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"", + ">" + ], + "types": [ + "text", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "<", + "html", + ">" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "lua-qcomment", + "values": [ + "<%", + " ", + "--[[--" + ], + "types": [ + "keyword", + "text", + "comment" + ] + }, + { + "state": "lua-qcomment", + "values": [ + " index.lp from the Kepler Project's LuaDoc HTML doclet." + ], + "types": [ + "comment" + ] + }, + { + "state": "lua-qcomment", + "values": [ + " http://keplerproject.github.com/luadoc/" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "--]]", + " ", + "%>" + ], + "types": [ + "comment", + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + "<", + "head", + ">" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "title", + ">", + "Reference", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "link", + " ", + "rel", + "=", + "\"stylesheet\"", + " ", + "href", + "=", + "\"<%=luadoc.doclet.html.link(\"", + "luadoc", + ".", + "css", + "\")%>\"", + " ", + "type", + "=", + "\"text/css\"", + " ", + "/>" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "entity.other.attribute-name", + "text", + "entity.other.attribute-name", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "\t", + "" + ], + "types": [ + "text", + "comment", + "comment" + ] + }, + { + "state": "start", + "values": [ + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "<", + "body", + ">" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "<", + "div", + " ", + "id", + "=", + "\"container\"", + ">" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "<", + "div", + " ", + "id", + "=", + "\"product\"", + ">" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "\t", + "<", + "div", + " ", + "id", + "=", + "\"product_logo\"", + ">", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "\t", + "<", + "div", + " ", + "id", + "=", + "\"product_name\"", + ">", + "<", + "big", + ">", + "<", + "b", + ">", + "", + "", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "\t", + "<", + "div", + " ", + "id", + "=", + "\"product_description\"", + ">", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "", + " ", + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "comment", + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "<", + "div", + " ", + "id", + "=", + "\"main\"", + ">" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "<", + "div", + " ", + "id", + "=", + "\"navigation\"", + ">" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "<%=", + "luadoc", + ".", + "doclet", + ".", + "html", + ".", + "include", + "(", + "\"menu.lp\"", + ", ", + "{", + " ", + "doc", + "=", + "doc", + " ", + "}", + ")", + "%>" + ], + "types": [ + "keyword", + "identifier", + "text", + "identifier", + "text", + "identifier", + "text", + "identifier", + "paren.lparen", + "string", + "text", + "paren.lparen", + "text", + "identifier", + "keyword.operator", + "identifier", + "text", + "paren.rparen", + "paren.rparen", + "keyword" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "", + " ", + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "comment", + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "<", + "div", + " ", + "id", + "=", + "\"content\"", + ">" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "<%", + "if", + " ", + "not", + " ", + "options", + ".", + "nomodules", + " ", + "and", + " ", + "#", + "doc", + ".", + "modules", + " ", + ">", + " ", + "0", + " ", + "then", + "%>" + ], + "types": [ + "keyword", + "keyword", + "text", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "keyword", + "text", + "keyword.operator", + "identifier", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric", + "text", + "keyword", + "keyword" + ] + }, + { + "state": "start", + "values": [ + "<", + "h2", + ">", + "Modules", + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "<", + "table", + " ", + "class", + "=", + "\"module_list\"", + ">" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name.table", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "" + ], + "types": [ + "comment", + "comment" + ] + }, + { + "state": "start", + "values": [ + "<%", + "for", + " ", + "_", + ", ", + "modulename", + " ", + "in", + " ", + "ipairs", + "(", + "doc", + ".", + "modules", + ")", + " ", + "do", + "%>" + ], + "types": [ + "keyword", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "keyword", + "text", + "support.function", + "paren.lparen", + "identifier", + "text", + "identifier", + "paren.rparen", + "text", + "keyword", + "keyword" + ] + }, + { + "state": "start", + "values": [ + "\t", + "<", + "tr", + ">" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name.table", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "\t\t", + "<", + "td", + " ", + "class", + "=", + "\"name\"", + ">", + "<", + "a", + " ", + "href", + "=", + "\"<%=luadoc.doclet.html.module_link(modulename, doc)%>\"", + ">", + "<%=", + "modulename", + "%>", + "", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name.table", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "meta.tag", + "meta.tag.tag-name.anchor", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "keyword", + "identifier", + "keyword", + "meta.tag", + "meta.tag.tag-name.anchor", + "meta.tag", + "meta.tag", + "meta.tag.tag-name.table", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "\t\t", + "<", + "td", + " ", + "class", + "=", + "\"summary\"", + ">", + "<%=", + "doc", + ".", + "modules", + "[", + "modulename", + "]", + ".", + "summary", + "%>", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name.table", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "keyword", + "identifier", + "text", + "identifier", + "paren.lparen", + "identifier", + "paren.rparen", + "text", + "identifier", + "keyword", + "meta.tag", + "meta.tag.tag-name.table", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "\t", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name.table", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "<%", + "end", + "%>" + ], + "types": [ + "keyword", + "keyword", + "keyword" + ] + }, + { + "state": "start", + "values": [ + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name.table", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "<%", + "end", + "%>" + ], + "types": [ + "keyword", + "keyword", + "keyword" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "<%", + "if", + " ", + "not", + " ", + "options", + ".", + "nofiles", + " ", + "and", + " ", + "#", + "doc", + ".", + "files", + " ", + ">", + " ", + "0", + " ", + "then", + "%>" + ], + "types": [ + "keyword", + "keyword", + "text", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "keyword", + "text", + "keyword.operator", + "identifier", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric", + "text", + "keyword", + "keyword" + ] + }, + { + "state": "start", + "values": [ + "<", + "h2", + ">", + "Files", + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "<", + "table", + " ", + "class", + "=", + "\"file_list\"", + ">" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name.table", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "" + ], + "types": [ + "comment", + "comment" + ] + }, + { + "state": "start", + "values": [ + "<%", + "for", + " ", + "_", + ", ", + "filepath", + " ", + "in", + " ", + "ipairs", + "(", + "doc", + ".", + "files", + ")", + " ", + "do", + "%>" + ], + "types": [ + "keyword", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "keyword", + "text", + "support.function", + "paren.lparen", + "identifier", + "text", + "identifier", + "paren.rparen", + "text", + "keyword", + "keyword" + ] + }, + { + "state": "start", + "values": [ + "\t", + "<", + "tr", + ">" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name.table", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "\t\t", + "<", + "td", + " ", + "class", + "=", + "\"name\"", + ">", + "<", + "a", + " ", + "href", + "=", + "\"<%=luadoc.doclet.html.file_link(filepath)%>\"", + ">", + "<%=", + "filepath", + "%>", + "", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name.table", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "meta.tag", + "meta.tag.tag-name.anchor", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "keyword", + "identifier", + "keyword", + "meta.tag", + "meta.tag.tag-name.anchor", + "meta.tag", + "meta.tag", + "meta.tag.tag-name.table", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "\t\t", + "<", + "td", + " ", + "class", + "=", + "\"summary\"", + ">", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name.table", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "meta.tag", + "meta.tag.tag-name.table", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "\t", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name.table", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "<%", + "end", + "%>" + ], + "types": [ + "keyword", + "keyword", + "keyword" + ] + }, + { + "state": "start", + "values": [ + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name.table", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "<%", + "end", + "%>" + ], + "types": [ + "keyword", + "keyword", + "keyword" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "", + " ", + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "comment", + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "", + " ", + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "comment", + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "<", + "div", + " ", + "id", + "=", + "\"about\"", + ">" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "\t", + "<", + "p", + ">", + "<", + "a", + " ", + "href", + "=", + "\"http://validator.w3.org/check?uri=referer\"", + ">", + "<", + "img", + " ", + "src", + "=", + "\"http://www.w3.org/Icons/valid-xhtml10\"", + " ", + "alt", + "=", + "\"Valid XHTML 1.0!\"", + " ", + "height", + "=", + "\"31\"", + " ", + "width", + "=", + "\"88\"", + " ", + "/>", + "", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "meta.tag", + "meta.tag.tag-name.anchor", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "meta.tag", + "meta.tag.tag-name.image", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "meta.tag", + "meta.tag", + "meta.tag.tag-name.anchor", + "meta.tag", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "", + " ", + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "comment", + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "", + " ", + "", + "\t" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "comment", + "comment", + "text" + ] + }, + { + "state": "start", + "values": [ + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_markdown.json b/lib/ace/mode/_test/tokens_markdown.json new file mode 100644 index 00000000..4c306d12 --- /dev/null +++ b/lib/ace/mode/_test/tokens_markdown.json @@ -0,0 +1,1844 @@ +[ + { + "state": "start", + "values": [ + "Ace (Ajax.org Cloud9 Editor)" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "============================" + ], + "types": [ + "markup.heading.1" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Ace is a standalone code editor written in JavaScript. Our goal is to create a browser based editor that matches and extends the features, usability and performance of existing native editors such as TextMate, Vim or Eclipse. It can be easily embedded in any web page or JavaScript application. Ace is developed as the primary editor for [", + "Cloud9 IDE", + "](", + "http://www.cloud9ide.com/", + ") and the successor of the Mozilla Skywriter (Bespin) Project." + ], + "types": [ + "text", + "string", + "text", + "markup.underline", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Features" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "--------" + ], + "types": [ + "markup.heading.1" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "listblock", + "values": [ + "* ", + "Syntax highlighting" + ], + "types": [ + "markup.list", + "markup.list" + ] + }, + { + "state": "listblock", + "values": [ + "* Automatic indent and outdent" + ], + "types": [ + "markup.list" + ] + }, + { + "state": "listblock", + "values": [ + "* An optional command line" + ], + "types": [ + "markup.list" + ] + }, + { + "state": "listblock", + "values": [ + "* Handles huge documents (100,000 lines and more are no problem)" + ], + "types": [ + "markup.list" + ] + }, + { + "state": "listblock", + "values": [ + "* Fully customizable key bindings including VI and Emacs modes" + ], + "types": [ + "markup.list" + ] + }, + { + "state": "listblock", + "values": [ + "* Themes (TextMate themes can be imported)" + ], + "types": [ + "markup.list" + ] + }, + { + "state": "listblock", + "values": [ + "* Search and replace with regular expressions" + ], + "types": [ + "markup.list" + ] + }, + { + "state": "listblock", + "values": [ + "* Highlight matching parentheses" + ], + "types": [ + "markup.list" + ] + }, + { + "state": "listblock", + "values": [ + "* Toggle between soft tabs and real tabs" + ], + "types": [ + "markup.list" + ] + }, + { + "state": "listblock", + "values": [ + "* Displays hidden characters" + ], + "types": [ + "markup.list" + ] + }, + { + "state": "listblock", + "values": [ + "* Drag and drop text using the mouse" + ], + "types": [ + "markup.list" + ] + }, + { + "state": "listblock", + "values": [ + "* Line wrapping" + ], + "types": [ + "markup.list" + ] + }, + { + "state": "listblock", + "values": [ + "* Unstructured / user code folding" + ], + "types": [ + "markup.list" + ] + }, + { + "state": "listblock", + "values": [ + "* Live syntax checker (currently JavaScript/CoffeeScript)" + ], + "types": [ + "markup.list" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Take Ace for a spin!" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "--------------------" + ], + "types": [ + "markup.heading.1" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Check out the Ace live [", + "demo", + "](", + "http://ajaxorg.github.com/ace/", + ") or get a [", + "Cloud9 IDE account", + "](", + "http://run.cloud9ide.com", + ") to experience Ace while editing one of your own GitHub projects." + ], + "types": [ + "text", + "string", + "text", + "markup.underline", + "text", + "string", + "text", + "markup.underline", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "If you want, you can use Ace as a textarea replacement thanks to the [", + "Ace Bookmarklet", + "](", + "http://ajaxorg.github.com/ace/build/textarea/editor.html", + ")." + ], + "types": [ + "text", + "string", + "text", + "markup.underline", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "History" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "-------" + ], + "types": [ + "markup.heading.1" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Previously known as “Bespin” and “Skywriter” it’s now known as Ace (Ajax.org Cloud9 Editor)! Bespin and Ace started as two independent projects, both aiming to build a no-compromise code editor component for the web. Bespin started as part of Mozilla Labs and was based on the canvas tag, while Ace is the Editor component of the Cloud9 IDE and is using the DOM for rendering. After the release of Ace at JSConf.eu 2010 in Berlin the Skywriter team decided to merge Ace with a simplified version of Skywriter's plugin system and some of Skywriter's extensibility points. All these changes have been merged back to Ace. Both Ajax.org and Mozilla are actively developing and maintaining Ace." + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Getting the code" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "----------------" + ], + "types": [ + "markup.heading.1" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Ace is a community project. We actively encourage and support contributions. The Ace source code is hosted on GitHub. It is released under the Mozilla tri-license (MPL/GPL/LGPL), the same license used by Firefox. This license is friendly to all kinds of projects, whether open source or not. Take charge of your editor and add your favorite language highlighting and keybindings!" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "githubblock", + "values": [ + "```bash" + ], + "types": [ + "support.function" + ] + }, + { + "state": "githubblock", + "values": [ + " git clone git://github.com/ajaxorg/ace.git" + ], + "types": [ + "support.function" + ] + }, + { + "state": "githubblock", + "values": [ + " cd ace" + ], + "types": [ + "support.function" + ] + }, + { + "state": "githubblock", + "values": [ + " git submodule update --init --recursive" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [ + "```" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Embedding Ace" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "-------------" + ], + "types": [ + "markup.heading.1" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Ace can be easily embedded into any existing web page. The Ace git repository ships with a pre-packaged version of Ace inside of the ", + "`", + "build", + "`", + " directory. The same packaged files are also available as a separate [", + "download", + "](", + "https://github.com/ajaxorg/ace/downloads", + "). Simply copy the contents of the ", + "`", + "src", + "`", + " subdirectory somewhere into your project and take a look at the included demos of how to use Ace." + ], + "types": [ + "text", + "support.function", + "support.function", + "support.function", + "text", + "string", + "text", + "markup.underline", + "text", + "support.function", + "support.function", + "support.function", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "The easiest version is simply:" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "html-start", + "values": [ + "```html" + ], + "types": [ + "support.function" + ] + }, + { + "state": "html-start", + "values": [ + " ", + "<", + "div", + " ", + "id", + "=", + "\"editor\"", + ">", + "some text", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "html-start", + "values": [ + " ", + "<", + "script", + " ", + "src", + "=", + "\"src/ace.js\"", + " ", + "type", + "=", + "\"text/javascript\"", + " ", + "charset", + "=", + "\"utf-8\"", + ">", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name.script", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "meta.tag", + "meta.tag.tag-name.script", + "meta.tag" + ] + }, + { + "state": "html-js-start", + "values": [ + " ", + "<", + "script", + ">" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name.script", + "meta.tag" + ] + }, + { + "state": "html-js-regex_allowed", + "values": [ + " ", + "window", + ".", + "onload", + " ", + "=", + " ", + "function", + "(", + ")", + " ", + "{" + ], + "types": [ + "text", + "storage.type", + "punctuation.operator", + "entity.name.function", + "text", + "keyword.operator", + "text", + "storage.type", + "paren.lparen", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "html-js-regex_allowed", + "values": [ + " ", + "var", + " ", + "editor", + " ", + "=", + " ", + "ace", + ".", + "edit", + "(", + "\"editor\"", + ")", + ";" + ], + "types": [ + "text", + "storage.type", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "punctuation.operator", + "identifier", + "paren.lparen", + "string", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "html-js-regex_allowed", + "values": [ + " ", + "}", + ";" + ], + "types": [ + "text", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "html-start", + "values": [ + " ", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name.script", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "```" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "With \"editor\" being the id of the DOM element, which should be converted to an editor. Note that this element must be explicitly sized and positioned ", + "`", + "absolute", + "`", + " or ", + "`", + "relative", + "`", + " for Ace to work. e.g." + ], + "types": [ + "text", + "support.function", + "support.function", + "support.function", + "text", + "support.function", + "support.function", + "support.function", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "css-start", + "values": [ + "```css" + ], + "types": [ + "support.function" + ] + }, + { + "state": "css-ruleset", + "values": [ + " ", + "#editor", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen" + ] + }, + { + "state": "css-ruleset", + "values": [ + " ", + "position", + ": ", + "absolute", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "support.constant", + "text" + ] + }, + { + "state": "css-ruleset", + "values": [ + " ", + "width", + ": ", + "500", + "px", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "constant.numeric", + "keyword", + "text" + ] + }, + { + "state": "css-ruleset", + "values": [ + " ", + "height", + ": ", + "400", + "px", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "constant.numeric", + "keyword", + "text" + ] + }, + { + "state": "css-start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "```" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "To change the theme simply include the Theme's JavaScript file" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "html-start", + "values": [ + "```html" + ], + "types": [ + "support.function" + ] + }, + { + "state": "html-start", + "values": [ + " ", + "<", + "script", + " ", + "src", + "=", + "\"src/theme-twilight.js\"", + " ", + "type", + "=", + "\"text/javascript\"", + " ", + "charset", + "=", + "\"utf-8\"", + ">", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name.script", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "meta.tag", + "meta.tag.tag-name.script", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "```" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "and configure the editor to use the theme:" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "js-start", + "values": [ + "```javascript" + ], + "types": [ + "support.function" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "editor", + ".", + "setTheme", + "(", + "\"ace/theme/twilight\"", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "punctuation.operator", + "identifier", + "paren.lparen", + "string", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [ + "```" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "By default the editor only supports plain text mode; many other languages are available as separate modules. After including the mode's JavaScript file:" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "html-start", + "values": [ + "```html" + ], + "types": [ + "support.function" + ] + }, + { + "state": "html-start", + "values": [ + " ", + "<", + "script", + " ", + "src", + "=", + "\"src/mode-javascript.js\"", + " ", + "type", + "=", + "\"text/javascript\"", + " ", + "charset", + "=", + "\"utf-8\"", + ">", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name.script", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "meta.tag", + "meta.tag.tag-name.script", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "```" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Then the mode can be used like this:" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "js-start", + "values": [ + "```javascript" + ], + "types": [ + "support.function" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "var", + " ", + "JavaScriptMode", + " ", + "=", + " ", + "require", + "(", + "\"ace/mode/javascript\"", + ")", + ".", + "Mode", + ";" + ], + "types": [ + "text", + "storage.type", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "paren.lparen", + "string", + "paren.rparen", + "punctuation.operator", + "identifier", + "punctuation.operator" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "editor", + ".", + "getSession", + "(", + ")", + ".", + "setMode", + "(", + "new", + " ", + "JavaScriptMode", + "(", + ")", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "punctuation.operator", + "identifier", + "paren.lparen", + "paren.rparen", + "punctuation.operator", + "identifier", + "paren.lparen", + "keyword", + "text", + "identifier", + "paren.lparen", + "paren.rparen", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "start", + "values": [ + "```" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Documentation" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "-------------" + ], + "types": [ + "markup.heading.1" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "You find a lot more sample code in the [", + "demo app", + "](", + "https://github.com/ajaxorg/ace/blob/master/demo/demo.js", + ")." + ], + "types": [ + "text", + "string", + "text", + "markup.underline", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "There is also some documentation on the [", + "wiki page", + "](", + "https://github.com/ajaxorg/ace/wiki", + ")." + ], + "types": [ + "text", + "string", + "text", + "markup.underline", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "If you still need help, feel free to drop a mail on the [", + "ace mailing list", + "](", + "http://groups.google.com/group/ace-discuss", + ")." + ], + "types": [ + "text", + "string", + "text", + "markup.underline", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Running Ace" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "-----------" + ], + "types": [ + "markup.heading.1" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "After the checkout Ace works out of the box. No build step is required. Open 'editor.html' in any browser except Google Chrome. Google Chrome doesn't allow XMLHTTPRequests from files loaded from disc (i.e. with a file:/// URL). To open Ace in Chrome simply start the bundled mini HTTP server:" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "githubblock", + "values": [ + "```bash" + ], + "types": [ + "support.function" + ] + }, + { + "state": "githubblock", + "values": [ + " ./static.py" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [ + "```" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Or using Node.JS" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "githubblock", + "values": [ + "```bash" + ], + "types": [ + "support.function" + ] + }, + { + "state": "githubblock", + "values": [ + " ./static.js" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [ + "```" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "The editor can then be opened at http://localhost:8888/index.html." + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Package Ace" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "-----------" + ], + "types": [ + "markup.heading.1" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "To package Ace we use the dryice build tool developed by the Mozilla Skywriter team. Before you can build you need to make sure that the submodules are up to date." + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "githubblock", + "values": [ + "```bash" + ], + "types": [ + "support.function" + ] + }, + { + "state": "githubblock", + "values": [ + " git submodule update --init --recursive" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [ + "```" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Afterwards Ace can be built by calling" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "githubblock", + "values": [ + "```bash" + ], + "types": [ + "support.function" + ] + }, + { + "state": "githubblock", + "values": [ + " ./Makefile.dryice.js normal" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [ + "```" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "The packaged Ace will be put in the 'build' folder." + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "To build the bookmarklet version execute" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "githubblock", + "values": [ + "```bash" + ], + "types": [ + "support.function" + ] + }, + { + "state": "githubblock", + "values": [ + " ./Makefile.dryice.js bm" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [ + "```" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Running the Unit Tests" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "----------------------" + ], + "types": [ + "markup.heading.1" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "The Ace unit tests run on node.js. Before the first run a couple of node modules have to be installed. The easiest way to do this is by using the node package manager (npm). In the Ace base directory simply call" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "githubblock", + "values": [ + "```bash" + ], + "types": [ + "support.function" + ] + }, + { + "state": "githubblock", + "values": [ + " npm link ." + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [ + "```" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "To run the tests call:" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "githubblock", + "values": [ + "```bash" + ], + "types": [ + "support.function" + ] + }, + { + "state": "githubblock", + "values": [ + " node lib/ace/test/all.js" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [ + "```" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "You can also run the tests in your browser by serving:" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " http://localhost:8888/lib/ace/test/tests.html" + ], + "types": [ + "support.function" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "This makes debugging failing tests way more easier." + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Contributing" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "------------" + ], + "types": [ + "markup.heading.1" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Ace wouldn't be what it is without contributions! Feel free to fork and improve/enhance Ace any way you want. If you feel that the editor or the Ace community will benefit from your changes, please open a pull request. To protect the interests of the Ace contributors and users we require contributors to sign a Contributors License Agreement (CLA) before we pull the changes into the main repository. Our CLA is the simplest of agreements, requiring that the contributions you make to an ajax.org project are only those you're allowed to make. This helps us significantly reduce future legal risk for everyone involved. It is easy, helps everyone, takes ten minutes, and only needs to be completed once. There are two versions of the agreement:" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "listblock", + "values": [ + "1. ", + "[The Individual CLA](https://github.com/ajaxorg/ace/raw/master/doc/Contributor_License_Agreement-v2.pdf): use this version if you're working on an ajax.org in your spare time, or can clearly claim ownership of copyright in what you'll be submitting." + ], + "types": [ + "markup.list", + "markup.list" + ] + }, + { + "state": "listblock", + "values": [ + "2. [The Corporate CLA](https://github.com/ajaxorg/ace/raw/master/doc/Corporate_Contributor_License_Agreement-v2.pdf): have your corporate lawyer review and submit this if your company is going to be contributing to ajax.org projects" + ], + "types": [ + "markup.list" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "If you want to contribute to an ajax.org project please print the CLA and fill it out and sign it. Then either send it by snail mail or fax to us or send it back scanned (or as a photo) by email." + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Email: fabian.jakobs@web.de" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Fax: +31 (0) 206388953" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Address: Ajax.org B.V." + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + " Keizersgracht 241" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + " 1016 EA, Amsterdam" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + " the Netherlands" + ], + "types": [ + "text" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_ocaml.json b/lib/ace/mode/_test/tokens_ocaml.json new file mode 100644 index 00000000..8b3b2fb1 --- /dev/null +++ b/lib/ace/mode/_test/tokens_ocaml.json @@ -0,0 +1,464 @@ +[ + { + "state": "comment", + "values": [ + "(*" + ], + "types": [ + "comment" + ] + }, + { + "state": "comment", + "values": [ + " * Example of early return implementation taken from" + ], + "types": [ + "comment" + ] + }, + { + "state": "comment", + "values": [ + " * http://ocaml.janestreet.com/?q=node/91" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + " *)" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "let", + " ", + "with_return", + " ", + "(", + "type", + " ", + "t", + ")", + " ", + "(", + "f", + " : ", + "_", + " ", + "-", + ">", + " ", + "t", + ")", + " ", + "=" + ], + "types": [ + "keyword", + "text", + "identifier", + "text", + "paren.lparen", + "keyword", + "text", + "identifier", + "paren.rparen", + "text", + "paren.lparen", + "identifier", + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator", + "text", + "identifier", + "paren.rparen", + "text", + "keyword.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "let", + " ", + "module", + " ", + "M", + " ", + "=" + ], + "types": [ + "text", + "keyword", + "text", + "keyword", + "text", + "identifier", + "text", + "keyword.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "struct", + " ", + "exception", + " ", + "Return", + " ", + "of", + " ", + "t", + " ", + "end" + ], + "types": [ + "text", + "keyword", + "text", + "keyword", + "text", + "identifier", + "text", + "keyword", + "text", + "identifier", + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "in" + ], + "types": [ + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "let", + " ", + "return", + " ", + "=", + " ", + "{", + " ", + "return", + " ", + "=", + " ", + "(", + "fun", + " ", + "x", + " ", + "-", + ">", + " ", + "raise", + " ", + "(", + "M", + ".", + "Return", + " ", + "x", + ")", + ")", + "; ", + "}", + " ", + "in" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "paren.lparen", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "paren.lparen", + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator", + "text", + "support.function", + "text", + "paren.lparen", + "identifier", + "text", + "identifier", + "text", + "identifier", + "paren.rparen", + "paren.rparen", + "text", + "paren.rparen", + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "try", + " ", + "f", + " ", + "return", + " ", + "with", + " ", + "M", + ".", + "Return", + " ", + "x", + " ", + "-", + ">", + " ", + "x" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "(* Function that uses the 'early return' functionality provided by `with_return` *)" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "let", + " ", + "sum_until_first_negative", + " ", + "list", + " ", + "=" + ], + "types": [ + "keyword", + "text", + "identifier", + "text", + "support.function", + "text", + "keyword.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "with_return", + " ", + "(", + "fun", + " ", + "r", + " ", + "-", + ">" + ], + "types": [ + "text", + "identifier", + "text", + "paren.lparen", + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "List", + ".", + "fold", + " ", + "list", + " ", + "~", + "init", + ":", + "0", + " ", + "~", + "f", + ":", + "(", + "fun", + " ", + "acc", + " ", + "x", + " ", + "-", + ">" + ], + "types": [ + "text", + "support.function", + "text", + "support.function", + "text", + "support.function", + "text", + "keyword.operator", + "support.function", + "text", + "constant.numeric", + "text", + "keyword.operator", + "identifier", + "text", + "paren.lparen", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "if", + " ", + "x", + " ", + ">", + "=", + " ", + "0", + " ", + "then", + " ", + "acc", + " ", + "+", + " ", + "x", + " ", + "else", + " ", + "r", + ".", + "return", + " ", + "acc", + ")", + ")" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator", + "text", + "constant.numeric", + "text", + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "text", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "identifier", + "paren.rparen", + "paren.rparen" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_perl.json b/lib/ace/mode/_test/tokens_perl.json new file mode 100644 index 00000000..4a847f4b --- /dev/null +++ b/lib/ace/mode/_test/tokens_perl.json @@ -0,0 +1,521 @@ +[ + { + "state": "start", + "values": [ + "#!/usr/bin/perl" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "use", + " ", + "strict", + ";" + ], + "types": [ + "keyword", + "text", + "identifier", + "text" + ] + }, + { + "state": "start", + "values": [ + "use", + " ", + "warnings", + ";" + ], + "types": [ + "keyword", + "text", + "identifier", + "text" + ] + }, + { + "state": "start", + "values": [ + "my", + " ", + "$num_primes", + " ", + "=", + " ", + "0", + ";" + ], + "types": [ + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric", + "text" + ] + }, + { + "state": "start", + "values": [ + "my", + " @", + "primes", + ";" + ], + "types": [ + "keyword", + "text", + "identifier", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "# Put 2 as the first prime so we won't have an empty array" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "$primes", + "[", + "$num_primes", + "]", + " ", + "=", + " ", + "2", + ";" + ], + "types": [ + "identifier", + "lparen", + "identifier", + "rparen", + "text", + "keyword.operator", + "text", + "constant.numeric", + "text" + ] + }, + { + "state": "start", + "values": [ + "$num_primes", + "++", + ";" + ], + "types": [ + "identifier", + "keyword.operator", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "MAIN_LOOP", + ":" + ], + "types": [ + "identifier", + "text" + ] + }, + { + "state": "start", + "values": [ + "for", + " ", + "my", + " ", + "$number_to_check", + " ", + "(", + "3", + " ", + "..", + " ", + "200", + ")" + ], + "types": [ + "keyword", + "text", + "keyword", + "text", + "identifier", + "text", + "lparen", + "constant.numeric", + "text", + "keyword.operator", + "text", + "constant.numeric", + "rparen" + ] + }, + { + "state": "start", + "values": [ + "{" + ], + "types": [ + "lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "for", + " ", + "my", + " ", + "$p", + " ", + "(", + "0", + " ", + "..", + " ", + "(", + "$num_primes", + "-1", + ")", + ")" + ], + "types": [ + "text", + "keyword", + "text", + "keyword", + "text", + "identifier", + "text", + "lparen", + "constant.numeric", + "text", + "keyword.operator", + "text", + "lparen", + "identifier", + "constant.numeric", + "rparen", + "rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "{" + ], + "types": [ + "text", + "lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "if", + " ", + "(", + "$number_to_check", + " ", + "%", + " ", + "$primes", + "[", + "$p", + "]", + " ", + "==", + " ", + "0", + ")" + ], + "types": [ + "text", + "keyword", + "text", + "lparen", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "lparen", + "identifier", + "rparen", + "text", + "keyword.operator", + "text", + "constant.numeric", + "rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "{" + ], + "types": [ + "text", + "lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "next", + " ", + "MAIN_LOOP", + ";" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " ", + "# If we reached this point it means $number_to_check is not" + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + " ", + "# divisable by any prime number that came before it." + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + " ", + "$primes", + "[", + "$num_primes", + "]", + " ", + "=", + " ", + "$number_to_check", + ";" + ], + "types": [ + "text", + "identifier", + "lparen", + "identifier", + "rparen", + "text", + "keyword.operator", + "text", + "identifier", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "$num_primes", + "++", + ";" + ], + "types": [ + "text", + "identifier", + "keyword.operator", + "text" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "for", + " ", + "my", + " ", + "$p", + " ", + "(", + "0", + " ", + "..", + " ", + "(", + "$num_primes", + "-1", + ")", + ")" + ], + "types": [ + "keyword", + "text", + "keyword", + "text", + "identifier", + "text", + "lparen", + "constant.numeric", + "text", + "keyword.operator", + "text", + "lparen", + "identifier", + "constant.numeric", + "rparen", + "rparen" + ] + }, + { + "state": "start", + "values": [ + "{" + ], + "types": [ + "lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "print", + " ", + "$primes", + "[", + "$p", + "]", + ",", + " ", + "\", \"", + ";" + ], + "types": [ + "text", + "support.function", + "text", + "identifier", + "lparen", + "identifier", + "rparen", + "keyword.operator", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "rparen" + ] + }, + { + "state": "start", + "values": [ + "print", + " ", + "\"\\n\"", + ";" + ], + "types": [ + "support.function", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_pgsql.json b/lib/ace/mode/_test/tokens_pgsql.json new file mode 100644 index 00000000..d20500f6 --- /dev/null +++ b/lib/ace/mode/_test/tokens_pgsql.json @@ -0,0 +1,1735 @@ +[ + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "BEGIN", + ";" + ], + "types": [ + "keyword.statementBegin", + "statementEnd" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "doc-start", + "values": [ + "/**" + ], + "types": [ + "comment.doc" + ] + }, + { + "state": "doc-start", + "values": [ + "* Samples from PostgreSQL src/tutorial/basics.source" + ], + "types": [ + "comment.doc" + ] + }, + { + "state": "start", + "values": [ + "*/" + ], + "types": [ + "comment.doc" + ] + }, + { + "state": "statement", + "values": [ + "CREATE", + " ", + "TABLE", + " ", + "weather", + " ", + "(" + ], + "types": [ + "keyword.statementBegin", + "text", + "keyword", + "text", + "identifier", + "text", + "paren.lparen" + ] + }, + { + "state": "statement", + "values": [ + "\t", + "city", + "\t\t", + "varchar", + "(", + "80", + ")", + "," + ], + "types": [ + "text", + "identifier", + "text", + "keyword", + "paren.lparen", + "constant.numeric", + "paren.rparen", + "text" + ] + }, + { + "state": "statement", + "values": [ + "\t", + "temp_lo", + "\t\t", + "int", + ",\t\t", + "-- low temperature" + ], + "types": [ + "text", + "identifier", + "text", + "keyword", + "text", + "comment" + ] + }, + { + "state": "statement", + "values": [ + "\t", + "temp_hi", + "\t\t", + "int", + ",\t\t", + "-- high temperature" + ], + "types": [ + "text", + "identifier", + "text", + "keyword", + "text", + "comment" + ] + }, + { + "state": "statement", + "values": [ + "\t", + "prcp", + "\t\t", + "real", + ",\t\t", + "-- precipitation" + ], + "types": [ + "text", + "identifier", + "text", + "keyword", + "text", + "comment" + ] + }, + { + "state": "statement", + "values": [ + "\t", + "\"date\"", + "\t\t", + "date" + ], + "types": [ + "text", + "variable.language", + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + ")", + ";" + ], + "types": [ + "paren.rparen", + "statementEnd" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "statement", + "values": [ + "CREATE", + " ", + "TABLE", + " ", + "cities", + " ", + "(" + ], + "types": [ + "keyword.statementBegin", + "text", + "keyword", + "text", + "identifier", + "text", + "paren.lparen" + ] + }, + { + "state": "statement", + "values": [ + "\t", + "name", + "\t\t", + "varchar", + "(", + "80", + ")", + "," + ], + "types": [ + "text", + "keyword", + "text", + "keyword", + "paren.lparen", + "constant.numeric", + "paren.rparen", + "text" + ] + }, + { + "state": "statement", + "values": [ + "\t", + "location", + "\t", + "point" + ], + "types": [ + "text", + "keyword", + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + ")", + ";" + ], + "types": [ + "paren.rparen", + "statementEnd" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "statement", + "values": [ + "INSERT", + " ", + "INTO", + " ", + "weather" + ], + "types": [ + "keyword.statementBegin", + "text", + "keyword", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + " ", + "VALUES", + " ", + "(", + "'San Francisco'", + ", ", + "46", + ", ", + "50", + ", ", + "0.25", + ", ", + "'1994-11-27'", + ")", + ";" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "string", + "text", + "constant.numeric", + "text", + "constant.numeric", + "text", + "constant.numeric", + "text", + "string", + "paren.rparen", + "statementEnd" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "statement", + "values": [ + "INSERT", + " ", + "INTO", + " ", + "cities" + ], + "types": [ + "keyword.statementBegin", + "text", + "keyword", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + " ", + "VALUES", + " ", + "(", + "'San Francisco'", + ", ", + "'(-194.0, 53.0)'", + ")", + ";" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "string", + "text", + "string", + "paren.rparen", + "statementEnd" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "statement", + "values": [ + "INSERT", + " ", + "INTO", + " ", + "weather", + " ", + "(", + "city", + ", ", + "temp_lo", + ", ", + "temp_hi", + ", ", + "prcp", + ", ", + "\"date\"", + ")" + ], + "types": [ + "keyword.statementBegin", + "text", + "keyword", + "text", + "identifier", + "text", + "paren.lparen", + "identifier", + "text", + "identifier", + "text", + "identifier", + "text", + "identifier", + "text", + "variable.language", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "VALUES", + " ", + "(", + "'San Francisco'", + ", ", + "43", + ", ", + "57", + ", ", + "0.0", + ", ", + "'1994-11-29'", + ")", + ";" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "string", + "text", + "constant.numeric", + "text", + "constant.numeric", + "text", + "constant.numeric", + "text", + "string", + "paren.rparen", + "statementEnd" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "statement", + "values": [ + "INSERT", + " ", + "INTO", + " ", + "weather", + " ", + "(", + "date", + ", ", + "city", + ", ", + "temp_hi", + ", ", + "temp_lo", + ")" + ], + "types": [ + "keyword.statementBegin", + "text", + "keyword", + "text", + "identifier", + "text", + "paren.lparen", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "identifier", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "VALUES", + " ", + "(", + "'1994-11-29'", + ", ", + "'Hayward'", + ", ", + "54", + ", ", + "37", + ")", + ";" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "string", + "text", + "string", + "text", + "constant.numeric", + "text", + "constant.numeric", + "paren.rparen", + "statementEnd" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "SELECT", + " ", + "city", + ", ", + "(", + "temp_hi", + "+", + "temp_lo", + ")", + "/", + "2", + " ", + "AS", + " ", + "temp_avg", + ", ", + "\"date\"", + " ", + "FROM", + " ", + "weather", + ";" + ], + "types": [ + "keyword.statementBegin", + "text", + "identifier", + "text", + "paren.lparen", + "identifier", + "keyword.operator", + "identifier", + "paren.rparen", + "keyword.operator", + "constant.numeric", + "text", + "keyword", + "text", + "identifier", + "text", + "variable.language", + "text", + "keyword", + "text", + "identifier", + "statementEnd" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "statement", + "values": [ + "SELECT", + " ", + "city", + ", ", + "temp_lo", + ", ", + "temp_hi", + ", ", + "prcp", + ", ", + "\"date\"", + ", ", + "location" + ], + "types": [ + "keyword.statementBegin", + "text", + "identifier", + "text", + "identifier", + "text", + "identifier", + "text", + "identifier", + "text", + "variable.language", + "text", + "keyword" + ] + }, + { + "state": "statement", + "values": [ + " ", + "FROM", + " ", + "weather", + ", ", + "cities" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + " ", + "WHERE", + " ", + "city", + " ", + "=", + " ", + "name", + ";" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "keyword", + "statementEnd" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "doc-start", + "values": [ + "/**" + ], + "types": [ + "comment.doc" + ] + }, + { + "state": "doc-start", + "values": [ + "* Dollar quotes starting at the end of the line are colored as SQL unless" + ], + "types": [ + "comment.doc" + ] + }, + { + "state": "doc-start", + "values": [ + "* a special language tag is used. Pearl and Python are currently implemented" + ], + "types": [ + "comment.doc" + ] + }, + { + "state": "doc-start", + "values": [ + "* but lots of others are possible." + ], + "types": [ + "comment.doc" + ] + }, + { + "state": "start", + "values": [ + "*/" + ], + "types": [ + "comment.doc" + ] + }, + { + "state": "statement", + "values": [ + "create", + " ", + "or", + " ", + "replace", + " ", + "function", + " ", + "blob_content_chunked", + "(" + ], + "types": [ + "keyword.statementBegin", + "text", + "keyword", + "text", + "keyword", + "text", + "keyword", + "text", + "identifier", + "paren.lparen" + ] + }, + { + "state": "statement", + "values": [ + " ", + "in", + " ", + "p_data", + " ", + "bytea", + ", " + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "keyword", + "text" + ] + }, + { + "state": "statement", + "values": [ + " ", + "in", + " ", + "p_chunk", + " ", + "integer", + ")" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "keyword", + "paren.rparen" + ] + }, + { + "state": "dollarSql", + "values": [ + "returns", + " ", + "setof", + " ", + "bytea", + " ", + "as", + " ", + "$$" + ], + "types": [ + "keyword", + "text", + "keyword", + "text", + "keyword", + "text", + "keyword", + "text", + "string" + ] + }, + { + "state": "dollarSql", + "values": [ + "-- Still SQL comments" + ], + "types": [ + "comment" + ] + }, + { + "state": "dollarSql", + "values": [ + "declare" + ], + "types": [ + "keyword" + ] + }, + { + "state": "dollarSql", + "values": [ + "\t", + "v_size", + " ", + "integer", + " ", + "=", + " ", + "octet_length", + "(", + "p_data", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "text", + "keyword", + "text", + "keyword.operator", + "text", + "support.function", + "paren.lparen", + "identifier", + "paren.rparen", + "text" + ] + }, + { + "state": "dollarSql", + "values": [ + "begin" + ], + "types": [ + "keyword" + ] + }, + { + "state": "dollarSql", + "values": [ + "\t", + "for", + " ", + "i", + " ", + "in", + " ", + "1", + "..", + "v_size", + " ", + "by", + " ", + "p_chunk", + " ", + "loop" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "keyword", + "text", + "constant.numeric", + "text", + "identifier", + "text", + "keyword", + "text", + "identifier", + "text", + "identifier" + ] + }, + { + "state": "dollarSql", + "values": [ + "\t\t", + "return", + " ", + "next", + " ", + "substring", + "(", + "p_data", + " ", + "from", + " ", + "i", + " ", + "for", + " ", + "p_chunk", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "text", + "keyword", + "text", + "keyword", + "paren.lparen", + "identifier", + "text", + "keyword", + "text", + "identifier", + "text", + "keyword", + "text", + "identifier", + "paren.rparen", + "text" + ] + }, + { + "state": "dollarSql", + "values": [ + "\t", + "end", + " ", + "loop", + ";" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text" + ] + }, + { + "state": "dollarSql", + "values": [ + "end", + ";" + ], + "types": [ + "keyword", + "text" + ] + }, + { + "state": "start", + "values": [ + "$$", + " ", + "language", + " ", + "plpgsql", + " ", + "stable", + ";" + ], + "types": [ + "string", + "text", + "keyword", + "text", + "identifier", + "text", + "keyword", + "statementEnd" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "-- pl/perl" + ], + "types": [ + "comment" + ] + }, + { + "state": "perl-start", + "values": [ + "CREATE", + " ", + "FUNCTION", + " ", + "perl_max", + " ", + "(", + "integer", + ", ", + "integer", + ")", + " ", + "RETURNS", + " ", + "integer", + " ", + "AS", + " ", + "$perl$" + ], + "types": [ + "keyword.statementBegin", + "text", + "keyword", + "text", + "identifier", + "text", + "paren.lparen", + "keyword", + "text", + "keyword", + "paren.rparen", + "text", + "keyword", + "text", + "keyword", + "text", + "keyword", + "text", + "string" + ] + }, + { + "state": "perl-start", + "values": [ + " ", + "# perl comment..." + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "perl-start", + "values": [ + " ", + "my", + " ", + "(", + "$x", + ",", + "$y", + ")", + " ", + "=", + " @", + "_", + ";" + ], + "types": [ + "text", + "keyword", + "text", + "lparen", + "identifier", + "keyword.operator", + "identifier", + "rparen", + "text", + "keyword.operator", + "text", + "identifier", + "text" + ] + }, + { + "state": "perl-start", + "values": [ + " ", + "if", + " ", + "(", + "!", + " ", + "defined", + " ", + "$x", + ")", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "lparen", + "keyword.operator", + "text", + "support.function", + "text", + "identifier", + "rparen", + "text", + "lparen" + ] + }, + { + "state": "perl-start", + "values": [ + " ", + "if", + " ", + "(", + "!", + " ", + "defined", + " ", + "$y", + ")", + " ", + "{", + " ", + "return", + " ", + "undef", + "; ", + "}" + ], + "types": [ + "text", + "keyword", + "text", + "lparen", + "keyword.operator", + "text", + "support.function", + "text", + "identifier", + "rparen", + "text", + "lparen", + "text", + "support.function", + "text", + "support.function", + "text", + "rparen" + ] + }, + { + "state": "perl-start", + "values": [ + " ", + "return", + " ", + "$y", + ";" + ], + "types": [ + "text", + "support.function", + "text", + "identifier", + "text" + ] + }, + { + "state": "perl-start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "rparen" + ] + }, + { + "state": "perl-start", + "values": [ + " ", + "if", + " ", + "(", + "!", + " ", + "defined", + " ", + "$y", + ")", + " ", + "{", + " ", + "return", + " ", + "$x", + "; ", + "}" + ], + "types": [ + "text", + "keyword", + "text", + "lparen", + "keyword.operator", + "text", + "support.function", + "text", + "identifier", + "rparen", + "text", + "lparen", + "text", + "support.function", + "text", + "identifier", + "text", + "rparen" + ] + }, + { + "state": "perl-start", + "values": [ + " ", + "if", + " ", + "(", + "$x", + " ", + ">", + " ", + "$y", + ")", + " ", + "{", + " ", + "return", + " ", + "$x", + "; ", + "}" + ], + "types": [ + "text", + "keyword", + "text", + "lparen", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "rparen", + "text", + "lparen", + "text", + "support.function", + "text", + "identifier", + "text", + "rparen" + ] + }, + { + "state": "perl-start", + "values": [ + " ", + "return", + " ", + "$y", + ";" + ], + "types": [ + "text", + "support.function", + "text", + "identifier", + "text" + ] + }, + { + "state": "start", + "values": [ + "$perl$", + " ", + "LANGUAGE", + " ", + "plperl", + ";" + ], + "types": [ + "string", + "text", + "keyword", + "text", + "identifier", + "statementEnd" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "-- pl/python" + ], + "types": [ + "comment" + ] + }, + { + "state": "python-start", + "values": [ + "CREATE", + " ", + "FUNCTION", + " ", + "usesavedplan", + "(", + ")", + " ", + "RETURNS", + " ", + "trigger", + " ", + "AS", + " ", + "$python$" + ], + "types": [ + "keyword.statementBegin", + "text", + "keyword", + "text", + "identifier", + "paren.lparen", + "paren.rparen", + "text", + "keyword", + "text", + "keyword", + "text", + "keyword", + "text", + "string" + ] + }, + { + "state": "python-start", + "values": [ + " ", + "# python comment..." + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "python-start", + "values": [ + " ", + "if", + " ", + "SD", + ".", + "has_key", + "(", + "\"plan\"", + ")", + ":" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "identifier", + "paren.lparen", + "string", + "paren.rparen", + "text" + ] + }, + { + "state": "python-start", + "values": [ + " ", + "plan", + " ", + "=", + " ", + "SD", + "[", + "\"plan\"", + "]" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "paren.lparen", + "string", + "paren.rparen" + ] + }, + { + "state": "python-start", + "values": [ + " ", + "else", + ":" + ], + "types": [ + "text", + "keyword", + "text" + ] + }, + { + "state": "python-start", + "values": [ + " ", + "plan", + " ", + "=", + " ", + "plpy", + ".", + "prepare", + "(", + "\"SELECT 1\"", + ")" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "text", + "identifier", + "paren.lparen", + "string", + "paren.rparen" + ] + }, + { + "state": "python-start", + "values": [ + " ", + "SD", + "[", + "\"plan\"", + "]", + " ", + "=", + " ", + "plan" + ], + "types": [ + "text", + "identifier", + "paren.lparen", + "string", + "paren.rparen", + "text", + "keyword.operator", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + "$python$", + " ", + "LANGUAGE", + " ", + "plpythonu", + ";" + ], + "types": [ + "string", + "text", + "keyword", + "text", + "identifier", + "statementEnd" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "-- psql commands" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "\\df cash*" + ], + "types": [ + "support.buildin" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "-- Some string samples." + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "select", + " ", + "'don'", + "'t do it now;'", + " ", + "|", + "|", + " ", + "'maybe later'", + ";" + ], + "types": [ + "keyword.statementBegin", + "text", + "string", + "string", + "text", + "keyword.operator", + "keyword.operator", + "text", + "string", + "statementEnd" + ] + }, + { + "state": "start", + "values": [ + "select", + " ", + "E", + "'dont\\'t do it'", + ";" + ], + "types": [ + "keyword.statementBegin", + "text", + "identifier", + "string", + "statementEnd" + ] + }, + { + "state": "start", + "values": [ + "select", + " ", + "length", + "(", + "'some other'", + "'s stuff'", + " ", + "|", + "|", + " ", + "$$", + "cat in hat's stuff $$", + ")", + ";" + ], + "types": [ + "keyword.statementBegin", + "text", + "support.function", + "paren.lparen", + "string", + "string", + "text", + "keyword.operator", + "keyword.operator", + "text", + "string", + "string", + "paren.rparen", + "statementEnd" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "dollarStatementString", + "values": [ + "select", + " ", + "$$ strings" + ], + "types": [ + "keyword.statementBegin", + "text", + "string" + ] + }, + { + "state": "dollarStatementString", + "values": [ + "over multiple " + ], + "types": [ + "string" + ] + }, + { + "state": "dollarStatementString", + "values": [ + "lines - use dollar quotes" + ], + "types": [ + "string" + ] + }, + { + "state": "start", + "values": [ + "$$", + ";" + ], + "types": [ + "string", + "statementEnd" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "END", + ";" + ], + "types": [ + "keyword.statementBegin", + "statementEnd" + ] + }, + { + "state": "start", + "values": [], + "types": [] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_php.json b/lib/ace/mode/_test/tokens_php.json new file mode 100644 index 00000000..13dfbea4 --- /dev/null +++ b/lib/ace/mode/_test/tokens_php.json @@ -0,0 +1,417 @@ +[ + { + "state": "start", + "values": [ + "" + ], + "types": [ + "support.php_tag" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_powershell.json b/lib/ace/mode/_test/tokens_powershell.json new file mode 100644 index 00000000..9be579a1 --- /dev/null +++ b/lib/ace/mode/_test/tokens_powershell.json @@ -0,0 +1,433 @@ +[ + { + "state": "start", + "values": [ + "# This is a simple comment" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "function", + " ", + "Hello", + "(", + "$name", + ")", + " ", + "{" + ], + "types": [ + "keyword", + "text", + "identifier", + "lparen", + "variable.instance", + "rparen", + "text", + "lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "Write-host", + " ", + "\"Hello $name\"" + ], + "types": [ + "text", + "identifier", + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "function", + " ", + "add", + "(", + "$left", + ", ", + "$right", + "=", + "4", + ")", + " ", + "{" + ], + "types": [ + "keyword", + "text", + "identifier", + "lparen", + "variable.instance", + "text", + "variable.instance", + "keyword.operator", + "constant.numeric", + "rparen", + "text", + "lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "if", + " ", + "(", + "$right", + " ", + "-ne", + " ", + "4", + ")", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "lparen", + "variable.instance", + "text", + "keyword.operator", + "text", + "constant.numeric", + "rparen", + "text", + "lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "return", + " ", + "$left" + ], + "types": [ + "text", + "keyword", + "text", + "variable.instance" + ] + }, + { + "state": "start", + "values": [ + " ", + "}", + " ", + "elseif", + " ", + "(", + "$left", + " ", + "-eq", + " ", + "$null", + " ", + "-and", + " ", + "$right", + " ", + "-eq", + " ", + "2", + ")", + " ", + "{" + ], + "types": [ + "text", + "rparen", + "text", + "keyword", + "text", + "lparen", + "variable.instance", + "text", + "keyword.operator", + "text", + "constant.language", + "text", + "keyword.operator", + "text", + "variable.instance", + "text", + "keyword.operator", + "text", + "constant.numeric", + "rparen", + "text", + "lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "return", + " ", + "3" + ], + "types": [ + "text", + "keyword", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + " ", + "}", + " ", + "else", + " ", + "{" + ], + "types": [ + "text", + "rparen", + "text", + "keyword", + "text", + "lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "return", + " ", + "2" + ], + "types": [ + "text", + "keyword", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "rparen" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "$number", + " ", + "=", + " ", + "1", + " ", + "+", + " ", + "2", + ";" + ], + "types": [ + "variable.instance", + "text", + "keyword.operator", + "text", + "constant.numeric", + "text", + "keyword.operator", + "text", + "constant.numeric", + "text" + ] + }, + { + "state": "start", + "values": [ + "$number", + " ", + "+", + "=", + " ", + "3" + ], + "types": [ + "variable.instance", + "text", + "keyword.operator", + "keyword.operator", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Write-Host", + " ", + "Hello", + " ", + "-", + "name", + " ", + "\"World\"" + ], + "types": [ + "support.function", + "text", + "identifier", + "text", + "keyword.operator", + "identifier", + "text", + "string" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "$an_array", + " ", + "=", + " @", + "(", + "1", + ", ", + "2", + ", ", + "3", + ")" + ], + "types": [ + "variable.instance", + "text", + "keyword.operator", + "text", + "lparen", + "constant.numeric", + "text", + "constant.numeric", + "text", + "constant.numeric", + "rparen" + ] + }, + { + "state": "start", + "values": [ + "$a_hash", + " ", + "=", + " @", + "{", + "\"something\"", + " ", + "=", + " ", + "\"something else\"", + "}" + ], + "types": [ + "variable.instance", + "text", + "keyword.operator", + "text", + "lparen", + "string", + "text", + "keyword.operator", + "text", + "string", + "rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "&", + " ", + "notepad", + " .\\", + "readme", + ".", + "md" + ], + "types": [ + "keyword.operator", + "text", + "identifier", + "text", + "identifier", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [], + "types": [] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_python.json b/lib/ace/mode/_test/tokens_python.json new file mode 100644 index 00000000..f5416454 --- /dev/null +++ b/lib/ace/mode/_test/tokens_python.json @@ -0,0 +1,351 @@ +[ + { + "state": "start", + "values": [ + "#!/usr/local/bin/python" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "import", + " ", + "string", + ", ", + "sys" + ], + "types": [ + "keyword", + "text", + "identifier", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "# If no arguments were given, print a helpful message" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "if", + " ", + "len", + "(", + "sys", + ".", + "argv", + ")", + "==", + "1", + ":" + ], + "types": [ + "keyword", + "text", + "support.function", + "paren.lparen", + "identifier", + "text", + "identifier", + "paren.rparen", + "keyword.operator", + "constant.numeric", + "text" + ] + }, + { + "state": "qstring", + "values": [ + " ", + "print", + " ", + "'''Usage:" + ], + "types": [ + "text", + "keyword", + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + "celsius temp1 temp2 ...'''" + ], + "types": [ + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "sys", + ".", + "exit", + "(", + "0", + ")" + ], + "types": [ + "text", + "identifier", + "text", + "identifier", + "paren.lparen", + "constant.numeric", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "# Loop over the arguments" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "for", + " ", + "i", + " ", + "in", + " ", + "sys", + ".", + "argv", + "[", + "1", + ":", + "]", + ":" + ], + "types": [ + "keyword", + "text", + "identifier", + "text", + "keyword", + "text", + "identifier", + "text", + "identifier", + "paren.lparen", + "constant.numeric", + "text", + "paren.rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "try", + ":" + ], + "types": [ + "text", + "keyword", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "fahrenheit", + "=", + "float", + "(", + "string", + ".", + "atoi", + "(", + "i", + ")", + ")" + ], + "types": [ + "text", + "identifier", + "keyword.operator", + "support.function", + "paren.lparen", + "identifier", + "text", + "identifier", + "paren.lparen", + "identifier", + "paren.rparen", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "except", + " ", + "string", + ".", + "atoi_error", + ":" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "print", + " ", + "repr", + "(", + "i", + ")", + ", ", + "\"not a numeric value\"" + ], + "types": [ + "text", + "keyword", + "text", + "support.function", + "paren.lparen", + "identifier", + "paren.rparen", + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "else", + ":" + ], + "types": [ + "text", + "keyword", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "celsius", + "=", + "(", + "fahrenheit", + "-", + "32", + ")", + "*", + "5.0", + "/", + "9.0" + ], + "types": [ + "text", + "identifier", + "keyword.operator", + "paren.lparen", + "identifier", + "keyword.operator", + "constant.numeric", + "paren.rparen", + "keyword.operator", + "constant.numeric", + "keyword.operator", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + " ", + "print", + " ", + "'%i\\260F = %i\\260C'", + " ", + "%", + " ", + "(", + "int", + "(", + "fahrenheit", + ")", + ", ", + "int", + "(", + "celsius", + "+", + ".5", + ")", + ")" + ], + "types": [ + "text", + "keyword", + "text", + "string", + "text", + "keyword.operator", + "text", + "paren.lparen", + "support.function", + "paren.lparen", + "identifier", + "paren.rparen", + "text", + "support.function", + "paren.lparen", + "identifier", + "keyword.operator", + "constant.numeric", + "paren.rparen", + "paren.rparen" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_ruby.json b/lib/ace/mode/_test/tokens_ruby.json new file mode 100644 index 00000000..eeebc58e --- /dev/null +++ b/lib/ace/mode/_test/tokens_ruby.json @@ -0,0 +1,170 @@ +[ + { + "state": "start", + "values": [ + "#!/usr/bin/ruby" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "# Program to find the factorial of a number" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "def", + " ", + "fact", + "(", + "n", + ")" + ], + "types": [ + "keyword", + "text", + "identifier", + "paren.lparen", + "identifier", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "if", + " ", + "n", + " ", + "==", + " ", + "0" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + " ", + "1" + ], + "types": [ + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + " ", + "else" + ], + "types": [ + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "n", + " ", + "*", + " ", + "fact", + "(", + "n", + "-1", + ")" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "paren.lparen", + "identifier", + "constant.numeric", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "end" + ], + "types": [ + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + "end" + ], + "types": [ + "keyword" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "puts", + " ", + "fact", + "(", + "ARGV", + "[", + "0", + "]", + ".", + "to_i", + ")" + ], + "types": [ + "support.function", + "text", + "identifier", + "paren.lparen", + "variable.class", + "paren.lparen", + "constant.numeric", + "paren.rparen", + "text", + "identifier", + "paren.rparen" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_scad.json b/lib/ace/mode/_test/tokens_scad.json new file mode 100644 index 00000000..2cc2a75b --- /dev/null +++ b/lib/ace/mode/_test/tokens_scad.json @@ -0,0 +1,469 @@ +[ + { + "state": "start", + "values": [ + "// ace can highlight scad!" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "module", + " ", + "Element", + "(", + "xpos", + ", ", + "ypos", + ", ", + "zpos", + ")", + "{" + ], + "types": [ + "keyword", + "text", + "identifier", + "paren.lparen", + "identifier", + "text", + "identifier", + "text", + "identifier", + "paren.rparen", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + "\t", + "translate", + "(", + "[", + "xpos", + ",", + "ypos", + ",", + "zpos", + "]", + ")", + "{" + ], + "types": [ + "text", + "identifier", + "paren.lparen", + "paren.lparen", + "identifier", + "text", + "identifier", + "text", + "identifier", + "paren.rparen", + "paren.rparen", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + "\t\t", + "union", + "(", + ")", + "{" + ], + "types": [ + "text", + "identifier", + "paren.lparen", + "paren.rparen", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + "\t\t\t", + "cube", + "(", + "[", + "10", + ",", + "10", + ",", + "4", + "]", + ",", + "true", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "paren.lparen", + "paren.lparen", + "constant.numeric", + "text", + "constant.numeric", + "text", + "constant.numeric", + "paren.rparen", + "text", + "identifier", + "paren.rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + "\t\t\t", + "cylinder", + "(", + "10", + ",", + "15", + ",", + "5", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "paren.lparen", + "constant.numeric", + "text", + "constant.numeric", + "text", + "constant.numeric", + "paren.rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + "\t\t\t", + "translate", + "(", + "[", + "0", + ",", + "0", + ",", + "10", + "]", + ")", + "sphere", + "(", + "5", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "paren.lparen", + "paren.lparen", + "constant.numeric", + "text", + "constant.numeric", + "text", + "constant.numeric", + "paren.rparen", + "paren.rparen", + "identifier", + "paren.lparen", + "constant.numeric", + "paren.rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + "\t\t", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "\t", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "union", + "(", + ")", + "{" + ], + "types": [ + "identifier", + "paren.lparen", + "paren.rparen", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + "\t", + "for", + "(", + "i", + "=", + "[", + "0", + ":", + "30", + "]", + ")", + "{" + ], + "types": [ + "text", + "keyword", + "paren.lparen", + "identifier", + "keyword.operator", + "paren.lparen", + "constant.numeric", + "text", + "constant.numeric", + "paren.rparen", + "paren.rparen", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + "\t\t# ", + "Element", + "(", + "0", + ",", + "0", + ",", + "0", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "paren.lparen", + "constant.numeric", + "text", + "constant.numeric", + "text", + "constant.numeric", + "paren.rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + "\t\t", + "Element", + "(", + "15", + "*", + "i", + ",", + "0", + ",", + "0", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "paren.lparen", + "constant.numeric", + "keyword.operator", + "identifier", + "text", + "constant.numeric", + "text", + "constant.numeric", + "paren.rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + "\t", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "for", + " ", + "(", + "i", + " ", + "=", + " ", + "[", + "3", + ", ", + "5", + ", ", + "7", + ", ", + "11", + "]", + ")", + "{" + ], + "types": [ + "keyword", + "text", + "paren.lparen", + "identifier", + "text", + "keyword.operator", + "text", + "paren.lparen", + "constant.numeric", + "text", + "constant.numeric", + "text", + "constant.numeric", + "text", + "constant.numeric", + "paren.rparen", + "paren.rparen", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + "\t", + "rotate", + "(", + "[", + "i", + "*", + "10", + ",", + "0", + ",", + "0", + "]", + ")", + "scale", + "(", + "[", + "1", + ",", + "1", + ",", + "i", + "]", + ")", + "cube", + "(", + "10", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "paren.lparen", + "paren.lparen", + "identifier", + "keyword.operator", + "constant.numeric", + "text", + "constant.numeric", + "text", + "constant.numeric", + "paren.rparen", + "paren.rparen", + "identifier", + "paren.lparen", + "paren.lparen", + "constant.numeric", + "text", + "constant.numeric", + "text", + "identifier", + "paren.rparen", + "paren.rparen", + "identifier", + "paren.lparen", + "constant.numeric", + "paren.rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_scala.json b/lib/ace/mode/_test/tokens_scala.json new file mode 100644 index 00000000..ace5ed7c --- /dev/null +++ b/lib/ace/mode/_test/tokens_scala.json @@ -0,0 +1,1287 @@ +[ + { + "state": "start", + "values": [ + "// http://www.scala-lang.org/node/54" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "package", + " ", + "examples", + ".", + "actors" + ], + "types": [ + "keyword", + "text", + "identifier", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "import", + " ", + "scala", + ".", + "actors", + ".", + "Actor" + ], + "types": [ + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + "import", + " ", + "scala", + ".", + "actors", + ".", + "Actor", + ".", + "_" + ], + "types": [ + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "identifier", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "abstract", + " ", + "class", + " ", + "PingMessage" + ], + "types": [ + "keyword", + "text", + "keyword", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + "case", + " ", + "object", + " ", + "Start", + " ", + "extends", + " ", + "PingMessage" + ], + "types": [ + "keyword", + "text", + "keyword", + "text", + "identifier", + "text", + "keyword", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + "case", + " ", + "object", + " ", + "SendPing", + " ", + "extends", + " ", + "PingMessage" + ], + "types": [ + "keyword", + "text", + "keyword", + "text", + "identifier", + "text", + "keyword", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + "case", + " ", + "object", + " ", + "Pong", + " ", + "extends", + " ", + "PingMessage" + ], + "types": [ + "keyword", + "text", + "keyword", + "text", + "identifier", + "text", + "keyword", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "abstract", + " ", + "class", + " ", + "PongMessage" + ], + "types": [ + "keyword", + "text", + "keyword", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + "case", + " ", + "object", + " ", + "Ping", + " ", + "extends", + " ", + "PongMessage" + ], + "types": [ + "keyword", + "text", + "keyword", + "text", + "identifier", + "text", + "keyword", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + "case", + " ", + "object", + " ", + "Stop", + " ", + "extends", + " ", + "PongMessage" + ], + "types": [ + "keyword", + "text", + "keyword", + "text", + "identifier", + "text", + "keyword", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "object", + " ", + "pingpong", + " ", + "extends", + " ", + "Application", + " ", + "{" + ], + "types": [ + "keyword", + "text", + "identifier", + "text", + "keyword", + "text", + "identifier", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "val", + " ", + "pong", + " ", + "=", + " ", + "new", + " ", + "Pong" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "keyword", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + " ", + "val", + " ", + "ping", + " ", + "=", + " ", + "new", + " ", + "Ping", + "(", + "100000", + ", ", + "pong", + ")" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "keyword", + "text", + "identifier", + "paren.lparen", + "constant.numeric", + "text", + "identifier", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "ping", + ".", + "start" + ], + "types": [ + "text", + "identifier", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + " ", + "pong", + ".", + "start" + ], + "types": [ + "text", + "identifier", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + " ", + "ping", + " ", + "!", + " ", + "Start" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "class", + " ", + "Ping", + "(", + "count", + ": ", + "Int", + ", ", + "pong", + ": ", + "Actor", + ")", + " ", + "extends", + " ", + "Actor", + " ", + "{" + ], + "types": [ + "keyword", + "text", + "identifier", + "paren.lparen", + "identifier", + "text", + "support.function", + "text", + "identifier", + "text", + "identifier", + "paren.rparen", + "text", + "keyword", + "text", + "identifier", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "def", + " ", + "act", + "(", + ")", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "paren.lparen", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "println", + "(", + "\"Ping: Initializing with count \"", + "+", + "count", + "+", + "\": \"", + "+", + "pong", + ")" + ], + "types": [ + "text", + "identifier", + "paren.lparen", + "string", + "keyword.operator", + "identifier", + "keyword.operator", + "string", + "keyword.operator", + "identifier", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "var", + " ", + "pingsLeft", + " ", + "=", + " ", + "count" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + " ", + "loop", + " ", + "{" + ], + "types": [ + "text", + "identifier", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "react", + " ", + "{" + ], + "types": [ + "text", + "identifier", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "case", + " ", + "Start", + " ", + "=", + ">" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "println", + "(", + "\"Ping: starting.\"", + ")" + ], + "types": [ + "text", + "identifier", + "paren.lparen", + "string", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "pong", + " ", + "!", + " ", + "Ping" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + " ", + "pingsLeft", + " ", + "=", + " ", + "pingsLeft", + " ", + "-", + " ", + "1" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + " ", + "case", + " ", + "SendPing", + " ", + "=", + ">" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "pong", + " ", + "!", + " ", + "Ping" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + " ", + "pingsLeft", + " ", + "=", + " ", + "pingsLeft", + " ", + "-", + " ", + "1" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + " ", + "case", + " ", + "Pong", + " ", + "=", + ">" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "if", + " ", + "(", + "pingsLeft", + " ", + "%", + " ", + "1000", + " ", + "==", + " ", + "0", + ")" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric", + "text", + "keyword.operator", + "text", + "constant.numeric", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "println", + "(", + "\"Ping: pong from: \"", + "+", + "sender", + ")" + ], + "types": [ + "text", + "identifier", + "paren.lparen", + "string", + "keyword.operator", + "identifier", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "if", + " ", + "(", + "pingsLeft", + " ", + ">", + " ", + "0", + ")" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "self", + " ", + "!", + " ", + "SendPing" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + " ", + "else", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "println", + "(", + "\"Ping: Stop.\"", + ")" + ], + "types": [ + "text", + "identifier", + "paren.lparen", + "string", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "pong", + " ", + "!", + " ", + "Stop" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + " ", + "exit", + "(", + "'stop", + ")" + ], + "types": [ + "text", + "identifier", + "paren.lparen", + "symbol.constant", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "class", + " ", + "Pong", + " ", + "extends", + " ", + "Actor", + " ", + "{" + ], + "types": [ + "keyword", + "text", + "identifier", + "text", + "keyword", + "text", + "identifier", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "def", + " ", + "act", + "(", + ")", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "paren.lparen", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "var", + " ", + "pongCount", + " ", + "=", + " ", + "0" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + " ", + "loop", + " ", + "{" + ], + "types": [ + "text", + "identifier", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "react", + " ", + "{" + ], + "types": [ + "text", + "identifier", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "case", + " ", + "Ping", + " ", + "=", + ">" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "if", + " ", + "(", + "pongCount", + " ", + "%", + " ", + "1000", + " ", + "==", + " ", + "0", + ")" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric", + "text", + "keyword.operator", + "text", + "constant.numeric", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "println", + "(", + "\"Pong: ping \"", + "+", + "pongCount", + "+", + "\" from \"", + "+", + "sender", + ")" + ], + "types": [ + "text", + "identifier", + "paren.lparen", + "string", + "keyword.operator", + "identifier", + "keyword.operator", + "string", + "keyword.operator", + "identifier", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "sender", + " ", + "!", + " ", + "Pong" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + " ", + "pongCount", + " ", + "=", + " ", + "pongCount", + " ", + "+", + " ", + "1" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + " ", + "case", + " ", + "Stop", + " ", + "=", + ">" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator" + ] + }, + { + "state": "start", + "values": [ + " ", + "println", + "(", + "\"Pong: Stop.\"", + ")" + ], + "types": [ + "text", + "identifier", + "paren.lparen", + "string", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "exit", + "(", + "'stop", + ")" + ], + "types": [ + "text", + "identifier", + "paren.lparen", + "symbol.constant", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_scss.json b/lib/ace/mode/_test/tokens_scss.json new file mode 100644 index 00000000..91197988 --- /dev/null +++ b/lib/ace/mode/_test/tokens_scss.json @@ -0,0 +1,300 @@ +[ + { + "state": "start", + "values": [ + "/*", + " style.scss */" + ], + "types": [ + "comment", + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "#navbar", + " ", + "{" + ], + "types": [ + "variable.language", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "$navbar-width", + ": ", + "800px", + ";" + ], + "types": [ + "text", + "variable", + "text", + "constant.numeric", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "$items", + ": ", + "5", + ";" + ], + "types": [ + "text", + "variable", + "text", + "constant.numeric", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "$navbar-color", + ": ", + "#ce4dd6", + ";" + ], + "types": [ + "text", + "variable", + "text", + "constant.numeric", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " ", + "width", + ": ", + "$navbar-width", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "variable", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "border-bottom", + ": ", + "2px", + " ", + "solid", + " ", + "$navbar-color", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "constant.numeric", + "text", + "constant.language", + "text", + "variable", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " ", + "li", + " ", + "{" + ], + "types": [ + "text", + "variable.language", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "float", + ": ", + "left", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "support.type", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "width", + ": ", + "$navbar-width", + "/", + "$items", + " ", + "-", + " ", + "10px", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "variable", + "text", + "variable", + "text", + "constant", + "text", + "constant.numeric", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " ", + "background-color", + ": ", + "lighten", + "(", + "$navbar-color", + ", ", + "20%", + ")", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "support.function", + "paren.lparen", + "variable", + "text", + "constant.numeric", + "paren.rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + " &", + ":hover", + " ", + "{" + ], + "types": [ + "text", + "variable.language", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "background-color", + ": ", + "lighten", + "(", + "$navbar-color", + ", ", + "10%", + ")", + ";" + ], + "types": [ + "text", + "support.type", + "text", + "support.function", + "paren.lparen", + "variable", + "text", + "constant.numeric", + "paren.rparen", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_sh.json b/lib/ace/mode/_test/tokens_sh.json new file mode 100644 index 00000000..639699ef --- /dev/null +++ b/lib/ace/mode/_test/tokens_sh.json @@ -0,0 +1,749 @@ +[ + { + "state": "start", + "values": [ + "#!/bin/sh" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "# Script to open a browser to current branch" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "# Repo formats:" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "# ssh git@github.com:richoH/gh_pr.git" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "# http https://richoH@github.com/richoH/gh_pr.git" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "# git git://github.com/richoH/gh_pr.git" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "username=", + "`", + "git", + " ", + "config", + " ", + "-", + "-", + "get", + " ", + "github", + ".", + "user", + "`" + ], + "types": [ + "variable", + "text", + "identifier", + "text", + "identifier", + "text", + "keyword.operator", + "keyword.operator", + "identifier", + "text", + "identifier", + "text", + "identifier", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "get_repo()", + " ", + "{" + ], + "types": [ + "support.function", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "git", + " ", + "remote", + " ", + "-", + "v", + " | ", + "grep", + " $", + "{", + "@:", + "-", + "$username", + "}", + " | ", + "while", + " ", + "read", + " ", + "remote", + "; ", + "do" + ], + "types": [ + "text", + "identifier", + "text", + "identifier", + "text", + "keyword.operator", + "identifier", + "text", + "identifier", + "text", + "paren.lparen", + "text", + "keyword.operator", + "variable", + "paren.rparen", + "text", + "keyword", + "text", + "keyword", + "text", + "identifier", + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "if", + " ", + "repo=", + "`", + "echo", + " ", + "$remote", + " | ", + "grep", + " ", + "-", + "E", + " ", + "-", + "o", + " ", + "\"git@github.com:[^ ]*\"", + "`; ", + "then" + ], + "types": [ + "text", + "keyword", + "text", + "variable", + "text", + "constant.language", + "text", + "variable", + "text", + "identifier", + "text", + "keyword.operator", + "identifier", + "text", + "keyword.operator", + "identifier", + "text", + "string", + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "echo", + " ", + "$repo", + " | ", + "sed", + " ", + "-", + "e", + " ", + "\"s/^git@github\\.com://\"", + " ", + "-", + "e", + " ", + "\"s/\\.git$//\"" + ], + "types": [ + "text", + "constant.language", + "text", + "variable", + "text", + "identifier", + "text", + "keyword.operator", + "identifier", + "text", + "string", + "text", + "keyword.operator", + "identifier", + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "exit", + " ", + "1" + ], + "types": [ + "text", + "constant.language", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + " ", + "fi" + ], + "types": [ + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "if", + " ", + "repo=", + "`", + "echo", + " ", + "$remote", + " | ", + "grep", + " ", + "-", + "E", + " ", + "-", + "o", + " ", + "\"https?://([^@]*@)?github.com/[^ ]*\\.git\"", + "`; ", + "then" + ], + "types": [ + "text", + "keyword", + "text", + "variable", + "text", + "constant.language", + "text", + "variable", + "text", + "identifier", + "text", + "keyword.operator", + "identifier", + "text", + "keyword.operator", + "identifier", + "text", + "string", + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "echo", + " ", + "$repo", + " | ", + "sed", + " ", + "-", + "e", + " ", + "\"s|^https?://||\"", + " ", + "-", + "e", + " ", + "\"s/^.*github\\.com\\///\"", + " ", + "-", + "e", + " ", + "\"s/\\.git$//\"" + ], + "types": [ + "text", + "constant.language", + "text", + "variable", + "text", + "identifier", + "text", + "keyword.operator", + "identifier", + "text", + "string", + "text", + "keyword.operator", + "identifier", + "text", + "string", + "text", + "keyword.operator", + "identifier", + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "exit", + " ", + "1" + ], + "types": [ + "text", + "constant.language", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + " ", + "fi" + ], + "types": [ + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "if", + " ", + "repo=", + "`", + "echo", + " ", + "$remote", + " | ", + "grep", + " ", + "-", + "E", + " ", + "-", + "o", + " ", + "\"git://github.com/[^ ]*\\.git\"", + "`; ", + "then" + ], + "types": [ + "text", + "keyword", + "text", + "variable", + "text", + "constant.language", + "text", + "variable", + "text", + "identifier", + "text", + "keyword.operator", + "identifier", + "text", + "keyword.operator", + "identifier", + "text", + "string", + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "echo", + " ", + "$repo", + " | ", + "sed", + " ", + "-", + "e", + " ", + "\"s|^git://github.com/||\"", + " ", + "-", + "e", + " ", + "\"s/\\.git$//\"" + ], + "types": [ + "text", + "constant.language", + "text", + "variable", + "text", + "identifier", + "text", + "keyword.operator", + "identifier", + "text", + "string", + "text", + "keyword.operator", + "identifier", + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "exit", + " ", + "1" + ], + "types": [ + "text", + "constant.language", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + " ", + "fi" + ], + "types": [ + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "done" + ], + "types": [ + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " ", + "if", + " ", + "[", + " ", + "$?", + " ", + "-", + "eq", + " ", + "0", + " ", + "]", + "; ", + "then" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "text", + "variable.language", + "text", + "keyword.operator", + "identifier", + "text", + "constant.numeric", + "text", + "paren.rparen", + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "echo", + " ", + "\"Couldn't find a valid remote\"", + " ", + ">", + "&2" + ], + "types": [ + "text", + "constant.language", + "text", + "string", + "text", + "keyword.operator", + "support.function" + ] + }, + { + "state": "start", + "values": [ + " ", + "exit", + " ", + "1" + ], + "types": [ + "text", + "constant.language", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + " ", + "fi" + ], + "types": [ + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + "}" + ], + "types": [ + "paren.rparen" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "if", + " ", + "repo=", + "`", + "get_repo", + " $@`; ", + "then" + ], + "types": [ + "keyword", + "text", + "variable", + "text", + "identifier", + "text", + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "branch=", + "`", + "git", + " ", + "symbolic", + "-", + "ref", + " ", + "HEAD", + " ", + "2", + ">", + "/", + "dev", + "/", + "null", + "`" + ], + "types": [ + "text", + "variable", + "text", + "identifier", + "text", + "identifier", + "keyword.operator", + "identifier", + "text", + "identifier", + "text", + "constant.numeric", + "keyword.operator", + "keyword.operator", + "identifier", + "keyword.operator", + "identifier", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "echo", + " ", + "\"http://github.com/$repo/pull/new/${branch##refs/heads/}\"" + ], + "types": [ + "text", + "constant.language", + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + "else" + ], + "types": [ + "keyword" + ] + }, + { + "state": "start", + "values": [ + " ", + "exit", + " ", + "1" + ], + "types": [ + "text", + "constant.language", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + "fi" + ], + "types": [ + "keyword" + ] + }, + { + "state": "start", + "values": [], + "types": [] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_sql.json b/lib/ace/mode/_test/tokens_sql.json new file mode 100644 index 00000000..ffb5bb78 --- /dev/null +++ b/lib/ace/mode/_test/tokens_sql.json @@ -0,0 +1,126 @@ +[ + { + "state": "start", + "values": [ + "SELECT", + " ", + "city", + ", ", + "COUNT", + "(", + "id", + ")", + " ", + "AS", + " ", + "users_count" + ], + "types": [ + "keyword", + "text", + "identifier", + "text", + "support.function", + "paren.lparen", + "identifier", + "paren.rparen", + "text", + "keyword", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + "FROM", + " ", + "users" + ], + "types": [ + "keyword", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + "WHERE", + " ", + "group_name", + " ", + "=", + " ", + "'salesman'" + ], + "types": [ + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + "AND", + " ", + "created", + " ", + ">", + " ", + "'2011-05-21'" + ], + "types": [ + "keyword", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + "GROUP", + " ", + "BY", + " ", + "1" + ], + "types": [ + "keyword", + "text", + "keyword", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + "ORDER", + " ", + "BY", + " ", + "2", + " ", + "DESC" + ], + "types": [ + "keyword", + "text", + "keyword", + "text", + "constant.numeric", + "text", + "keyword" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_svg.json b/lib/ace/mode/_test/tokens_svg.json new file mode 100644 index 00000000..72e412ab --- /dev/null +++ b/lib/ace/mode/_test/tokens_svg.json @@ -0,0 +1,1611 @@ +[ + { + "state": "tag_embed_attribute_list", + "values": [ + "<", + "svg" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "width", + "=", + "\"800\"", + " ", + "height", + "=", + "\"600\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "xmlns", + "=", + "\"http://www.w3.org/2000/svg\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "onload", + "=", + "\"StartAnimation(evt)\"", + ">" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " ", + "<", + "title", + ">", + "Test Tube Progress Bar", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "desc", + ">", + "Created for the Web Directions SVG competition", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "<", + "script", + " ", + "type", + "=", + "\"text/ecmascript\"", + ">", + "<", + "!", + "[", + "CDATA", + "[" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "keyword.operator", + "keyword.operator", + "paren.lparen", + "identifier", + "paren.lparen" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "var", + " ", + "timevalue", + " ", + "=", + " ", + "0", + ";" + ], + "types": [ + "text", + "storage.type", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric", + "punctuation.operator" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "var", + " ", + "timer_increment", + " ", + "=", + " ", + "1", + ";" + ], + "types": [ + "text", + "storage.type", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric", + "punctuation.operator" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "var", + " ", + "max_time", + " ", + "=", + " ", + "100", + ";" + ], + "types": [ + "text", + "storage.type", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric", + "punctuation.operator" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "var", + " ", + "hickory", + ";" + ], + "types": [ + "text", + "storage.type", + "text", + "identifier", + "punctuation.operator" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "var", + " ", + "dickory", + ";" + ], + "types": [ + "text", + "storage.type", + "text", + "identifier", + "punctuation.operator" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "var", + " ", + "dock", + ";" + ], + "types": [ + "text", + "storage.type", + "text", + "identifier", + "punctuation.operator" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "var", + " ", + "i", + ";" + ], + "types": [ + "text", + "storage.type", + "text", + "identifier", + "punctuation.operator" + ] + }, + { + "state": "js-start", + "values": [], + "types": [] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "function", + " ", + "StartAnimation", + "(", + "evt", + ")", + " ", + "{" + ], + "types": [ + "text", + "storage.type", + "text", + "entity.name.function", + "paren.lparen", + "variable.parameter", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "hickory", + " ", + "=", + " ", + "evt", + ".", + "target", + ".", + "ownerDocument", + ".", + "getElementById", + "(", + "\"hickory\"", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "punctuation.operator", + "identifier", + "punctuation.operator", + "identifier", + "punctuation.operator", + "support.function.dom", + "paren.lparen", + "string", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "dickory", + " ", + "=", + " ", + "evt", + ".", + "target", + ".", + "ownerDocument", + ".", + "getElementById", + "(", + "\"dickory\"", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "punctuation.operator", + "identifier", + "punctuation.operator", + "identifier", + "punctuation.operator", + "support.function.dom", + "paren.lparen", + "string", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "dock", + " ", + "=", + " ", + "evt", + ".", + "target", + ".", + "ownerDocument", + ".", + "getElementById", + "(", + "\"dock\"", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "punctuation.operator", + "identifier", + "punctuation.operator", + "identifier", + "punctuation.operator", + "support.function.dom", + "paren.lparen", + "string", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "js-start", + "values": [], + "types": [] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "ShowAndGrowElement", + "(", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "paren.lparen", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "js-start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "function", + " ", + "ShowAndGrowElement", + "(", + ")", + " ", + "{" + ], + "types": [ + "text", + "storage.type", + "text", + "entity.name.function", + "paren.lparen", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "timevalue", + " ", + "=", + " ", + "timevalue", + " ", + "+", + " ", + "timer_increment", + ";" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "punctuation.operator" + ] + }, + { + "state": "js-start", + "values": [ + " ", + "if", + " ", + "(", + "timevalue", + " ", + ">", + " ", + "max_time", + ")" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "identifier", + "text", + "keyword.operator", + "text", + "identifier", + "paren.rparen" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "return", + ";" + ], + "types": [ + "text", + "keyword", + "punctuation.operator" + ] + }, + { + "state": "js-start", + "values": [ + " ", + "// Scale the text string gradually until it is 20 times larger" + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "scalefactor", + " ", + "=", + " ", + "(", + "timevalue", + " ", + "*", + " ", + "650", + ")", + " ", + "/", + " ", + "max_time", + ";" + ], + "types": [ + "text", + "identifier", + "text", + "keyword.operator", + "text", + "paren.lparen", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric", + "paren.rparen", + "text", + "keyword.operator", + "text", + "identifier", + "punctuation.operator" + ] + }, + { + "state": "js-start", + "values": [], + "types": [] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "if", + " ", + "(", + "timevalue", + " ", + "<", + " ", + "30", + ")", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "hickory", + ".", + "setAttribute", + "(", + "\"display\"", + ",", + " ", + "\"\"", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "punctuation.operator", + "support.function.dom", + "paren.lparen", + "string", + "punctuation.operator", + "text", + "string", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "hickory", + ".", + "setAttribute", + "(", + "\"transform\"", + ",", + " ", + "\"translate(\"", + " ", + "+", + " ", + "(", + "600", + "+", + "scalefactor", + "*", + "3", + "*", + "-1", + " ", + ")", + " ", + "+", + " ", + "\", -144 )\"", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "punctuation.operator", + "support.function.dom", + "paren.lparen", + "string", + "punctuation.operator", + "text", + "string", + "text", + "keyword.operator", + "text", + "paren.lparen", + "constant.numeric", + "keyword.operator", + "identifier", + "keyword.operator", + "constant.numeric", + "keyword.operator", + "constant.numeric", + "text", + "paren.rparen", + "text", + "keyword.operator", + "text", + "string", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "js-start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "js-start", + "values": [], + "types": [] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "if", + " ", + "(", + "timevalue", + " ", + ">", + " ", + "30", + " ", + "&", + "&", + " ", + "timevalue", + " ", + "<", + " ", + "66", + ")", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric", + "text", + "keyword.operator", + "keyword.operator", + "text", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "dickory", + ".", + "setAttribute", + "(", + "\"display\"", + ",", + " ", + "\"\"", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "punctuation.operator", + "support.function.dom", + "paren.lparen", + "string", + "punctuation.operator", + "text", + "string", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "dickory", + ".", + "setAttribute", + "(", + "\"transform\"", + ",", + " ", + "\"translate(\"", + " ", + "+", + " ", + "(", + "-795", + "+", + "scalefactor", + "*", + "2", + ")", + " ", + "+", + " ", + "\", 0 )\"", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "punctuation.operator", + "support.function.dom", + "paren.lparen", + "string", + "punctuation.operator", + "text", + "string", + "text", + "keyword.operator", + "text", + "paren.lparen", + "constant.numeric", + "keyword.operator", + "identifier", + "keyword.operator", + "constant.numeric", + "paren.rparen", + "text", + "keyword.operator", + "text", + "string", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "js-start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "if", + " ", + "(", + "timevalue", + " ", + ">", + " ", + "66", + ")", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "identifier", + "text", + "keyword.operator", + "text", + "constant.numeric", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "dock", + ".", + "setAttribute", + "(", + "\"display\"", + ",", + " ", + "\"\"", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "punctuation.operator", + "support.function.dom", + "paren.lparen", + "string", + "punctuation.operator", + "text", + "string", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "js-regex_allowed", + "values": [ + " ", + "dock", + ".", + "setAttribute", + "(", + "\"transform\"", + ",", + " ", + "\"translate(\"", + " ", + "+", + " ", + "(", + "1450", + "+", + "scalefactor", + "*", + "2", + "*", + "-1", + ")", + " ", + "+", + " ", + "\", 144 )\"", + ")", + ";" + ], + "types": [ + "text", + "identifier", + "punctuation.operator", + "support.function.dom", + "paren.lparen", + "string", + "punctuation.operator", + "text", + "string", + "text", + "keyword.operator", + "text", + "paren.lparen", + "constant.numeric", + "keyword.operator", + "identifier", + "keyword.operator", + "constant.numeric", + "keyword.operator", + "constant.numeric", + "paren.rparen", + "text", + "keyword.operator", + "text", + "string", + "paren.rparen", + "punctuation.operator" + ] + }, + { + "state": "js-start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "js-start", + "values": [], + "types": [] + }, + { + "state": "js-start", + "values": [ + " ", + "// Call ShowAndGrowElement again milliseconds later." + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "js-start", + "values": [ + " ", + "setTimeout", + "(", + "\"ShowAndGrowElement()\"", + ",", + " ", + "timer_increment", + ")" + ], + "types": [ + "text", + "identifier", + "paren.lparen", + "string", + "punctuation.operator", + "text", + "identifier", + "paren.rparen" + ] + }, + { + "state": "js-start", + "values": [ + " ", + "}" + ], + "types": [ + "text", + "paren.rparen" + ] + }, + { + "state": "js-start", + "values": [ + " ", + "window", + ".", + "ShowAndGrowElement", + " ", + "=", + " ", + "ShowAndGrowElement" + ], + "types": [ + "text", + "variable.language", + "punctuation.operator", + "identifier", + "text", + "keyword.operator", + "text", + "identifier" + ] + }, + { + "state": "start", + "values": [ + " ", + "]", + "]", + "" + ], + "types": [ + "text", + "paren.rparen", + "paren.rparen", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "<", + "rect" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "fill", + "=", + "\"#2e3436\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "fill-rule", + "=", + "\"nonzero\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "stroke-width", + "=", + "\"3\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "y", + "=", + "\"0\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "x", + "=", + "\"0\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "height", + "=", + "\"600\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "width", + "=", + "\"800\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "id", + "=", + "\"rect3590\"", + "/>" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "<", + "text" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "style", + "=", + "\"font-size:144px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "x", + "=", + "\"50\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "y", + "=", + "\"350\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "id", + "=", + "\"hickory\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "display", + "=", + "\"none\"", + ">" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " Hickory,", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "<", + "text" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "style", + "=", + "\"font-size:144px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "x", + "=", + "\"50\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "y", + "=", + "\"350\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "id", + "=", + "\"dickory\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "display", + "=", + "\"none\"", + ">" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " dickory,", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "<", + "text" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "style", + "=", + "\"font-size:144px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "x", + "=", + "\"50\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "y", + "=", + "\"350\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "id", + "=", + "\"dock\"" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "display", + "=", + "\"none\"", + ">" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " dock!", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_tcl.json b/lib/ace/mode/_test/tokens_tcl.json new file mode 100644 index 00000000..2b6abcf9 --- /dev/null +++ b/lib/ace/mode/_test/tokens_tcl.json @@ -0,0 +1,950 @@ +[ + { + "state": "commandItem", + "values": [], + "types": [] + }, + { + "state": "commandItem", + "values": [ + "proc", + " ", + "dijkstra", + " ", + "{", + "graph", + " ", + "origin", + "}", + " ", + "{" + ], + "types": [ + "keyword", + "text", + "identifier", + "text", + "paren.lparen", + "keyword", + "text", + "identifier", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "# Initialize" + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "commandItem", + "values": [ + " ", + "dict", + " ", + "for", + " ", + "{", + "vertex", + " ", + "distmap", + "}", + " ", + "$", + "graph", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "paren.lparen", + "keyword", + "text", + "identifier", + "paren.rparen", + "text", + "variable.instancce", + "variable.instancce", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + "\t", + "dict", + " ", + "set", + " ", + "dist", + " ", + "$", + "vertex", + " ", + "Inf" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "variable.instancce", + "variable.instancce", + "text", + "identifier" + ] + }, + { + "state": "commandItem", + "values": [ + "\t", + "dict", + " ", + "set", + " ", + "path", + " ", + "$", + "vertex", + " ", + "{", + "}" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "variable.instancce", + "variable.instancce", + "text", + "paren.lparen", + "text" + ] + }, + { + "state": "commandItem", + "values": [ + " }" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "dict", + " ", + "set", + " ", + "dist", + " ", + "$", + "origin", + " 0" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "variable.instancce", + "variable.instancce", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "dict", + " ", + "set", + " ", + "path", + " ", + "$", + "origin", + " ", + "[", + "list", + " ", + "$", + "origin", + "]" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "variable.instancce", + "variable.instancce", + "text", + "paren.lparen", + "keyword", + "text", + "variable.instancce", + "variable.instancce", + "paren.rparen" + ] + }, + { + "state": "commandItem", + "values": [ + " " + ], + "types": [ + "text" + ] + }, + { + "state": "commandItem", + "values": [ + " ", + "while", + " ", + "{", + "[", + "dict", + " ", + "size", + " ", + "$", + "graph", + "]", + "}", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "text", + "keyword", + "text", + "identifier", + "text", + "variable.instancce", + "variable.instancce", + "paren.rparen", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + "\t", + "# Find unhandled node with least weight" + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + "\t", + "set", + " ", + "d", + " ", + "Inf" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "identifier" + ] + }, + { + "state": "commandItem", + "values": [ + "\t", + "dict", + " ", + "for", + " ", + "{", + "uu", + " ", + "-", + "}", + " ", + "$", + "graph", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "paren.lparen", + "keyword", + "text", + "support.function", + "paren.rparen", + "text", + "variable.instancce", + "variable.instancce", + "text", + "paren.lparen" + ] + }, + { + "state": "commandItem", + "values": [ + "\t ", + "if", + " ", + "{", + "$", + "d", + " ", + ">", + " ", + "[", + "set", + " ", + "dd", + " ", + "[", + "dict", + " ", + "get", + " ", + "$", + "dist", + " ", + "$", + "uu", + "]", + "]", + "}", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "variable.instancce", + "variable.instancce", + "text", + "support.function", + "text", + "paren.lparen", + "keyword", + "text", + "identifier", + "text", + "paren.lparen", + "keyword", + "text", + "identifier", + "text", + "variable.instancce", + "variable.instancce", + "text", + "variable.instancce", + "variable.instancce", + "paren.rparen", + "paren.rparen", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + "\t\t", + "set", + " ", + "u", + " ", + "$", + "uu" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "variable.instancce", + "variable.instancce" + ] + }, + { + "state": "start", + "values": [ + "\t\t", + "set", + " ", + "d", + " ", + "$", + "dd" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "variable.instancce", + "variable.instancce" + ] + }, + { + "state": "commandItem", + "values": [ + "\t }" + ], + "types": [ + "text" + ] + }, + { + "state": "commandItem", + "values": [ + "\t}" + ], + "types": [ + "text" + ] + }, + { + "state": "commandItem", + "values": [ + " " + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "\t", + "# No such node; graph must be disconnected" + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + "\t", + "if", + " ", + "{", + "$", + "d", + " ", + "==", + " ", + "Inf", + "}", + " ", + "break" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "variable.instancce", + "variable.instancce", + "text", + "support.function", + "text", + "identifier", + "paren.rparen", + "text", + "identifier" + ] + }, + { + "state": "commandItem", + "values": [ + " " + ], + "types": [ + "text" + ] + }, + { + "state": "commentfollow", + "values": [ + "\t", + "# Update the weights for nodes\\" + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + "\t lead to by the node we've picked" + ], + "types": [ + "comment" + ] + }, + { + "state": "commandItem", + "values": [ + "\t", + "dict", + " ", + "for", + " ", + "{", + "v", + " ", + "dd", + "}", + " ", + "[", + "dict", + " ", + "get", + " ", + "$", + "graph", + " ", + "$", + "u", + "]", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "paren.lparen", + "keyword", + "text", + "identifier", + "paren.rparen", + "text", + "paren.lparen", + "keyword", + "text", + "identifier", + "text", + "variable.instancce", + "variable.instancce", + "text", + "variable.instancce", + "variable.instancce", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "commandItem", + "values": [ + "\t ", + "if", + " ", + "{", + "[", + "dict", + " ", + "exists", + " ", + "$", + "graph", + " ", + "$", + "v", + "]", + "}", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "text", + "keyword", + "text", + "identifier", + "text", + "variable.instancce", + "variable.instancce", + "text", + "variable.instancce", + "variable.instancce", + "paren.rparen", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + "\t\t", + "set", + " ", + "alt", + " ", + "[", + "expr", + " ", + "{", + "$", + "d", + " ", + "+", + " ", + "$", + "dd", + "}", + "]" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "paren.lparen", + "keyword", + "text", + "paren.lparen", + "variable.instancce", + "variable.instancce", + "text", + "support.function", + "text", + "variable.instancce", + "variable.instancce", + "paren.rparen", + "paren.rparen" + ] + }, + { + "state": "commandItem", + "values": [ + "\t\t", + "if", + " ", + "{", + "$", + "alt", + " ", + "<", + " ", + "[", + "dict", + " ", + "get", + " ", + "$", + "dist", + " ", + "$", + "v", + "]", + "}", + " ", + "{" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "variable.instancce", + "variable.instancce", + "text", + "support.function", + "text", + "paren.lparen", + "keyword", + "text", + "identifier", + "text", + "variable.instancce", + "variable.instancce", + "text", + "variable.instancce", + "variable.instancce", + "paren.rparen", + "paren.rparen", + "text", + "paren.lparen" + ] + }, + { + "state": "start", + "values": [ + "\t\t ", + "dict", + " ", + "set", + " ", + "dist", + " ", + "$", + "v", + " ", + "$", + "alt" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "variable.instancce", + "variable.instancce", + "text", + "variable.instancce", + "variable.instancce" + ] + }, + { + "state": "start", + "values": [ + "\t\t ", + "dict", + " ", + "set", + " ", + "path", + " ", + "$", + "v", + " ", + "[", + "list", + " ", + "{*}", + "[", + "dict", + " ", + "get", + " ", + "$", + "path", + " ", + "$", + "u", + "]", + " ", + "$", + "v", + "]" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "variable.instancce", + "variable.instancce", + "text", + "paren.lparen", + "keyword", + "text", + "support.function", + "paren.lparen", + "keyword", + "text", + "identifier", + "text", + "variable.instancce", + "variable.instancce", + "text", + "variable.instancce", + "variable.instancce", + "paren.rparen", + "text", + "variable.instancce", + "variable.instancce", + "paren.rparen" + ] + }, + { + "state": "commandItem", + "values": [ + "\t\t}" + ], + "types": [ + "text" + ] + }, + { + "state": "commandItem", + "values": [ + "\t }" + ], + "types": [ + "text" + ] + }, + { + "state": "commandItem", + "values": [ + "\t}" + ], + "types": [ + "text" + ] + }, + { + "state": "commandItem", + "values": [ + " " + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "\t", + "# Remove chosen node from graph still to be handled" + ], + "types": [ + "text", + "comment" + ] + }, + { + "state": "start", + "values": [ + "\t", + "dict", + " ", + "unset", + " ", + "graph", + " ", + "$", + "u" + ], + "types": [ + "text", + "keyword", + "text", + "identifier", + "text", + "identifier", + "text", + "variable.instancce", + "variable.instancce" + ] + }, + { + "state": "commandItem", + "values": [ + " }" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "return", + " ", + "[", + "list", + " ", + "$", + "dist", + " ", + "$", + "path", + "]" + ], + "types": [ + "text", + "keyword", + "text", + "paren.lparen", + "keyword", + "text", + "variable.instancce", + "variable.instancce", + "text", + "variable.instancce", + "variable.instancce", + "paren.rparen" + ] + }, + { + "state": "commandItem", + "values": [ + "}" + ], + "types": [ + "text" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_text.json b/lib/ace/mode/_test/tokens_text.json new file mode 100644 index 00000000..04841ed6 --- /dev/null +++ b/lib/ace/mode/_test/tokens_text.json @@ -0,0 +1,81 @@ +[ + { + "state": "start", + "values": [ + "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat." + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi." + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat." + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis." + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur" + ], + "types": [ + "text" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_textile.json b/lib/ace/mode/_test/tokens_textile.json new file mode 100644 index 00000000..c610133a --- /dev/null +++ b/lib/ace/mode/_test/tokens_textile.json @@ -0,0 +1,301 @@ +[ + { + "state": "start", + "values": [ + "h1", + ". ", + "Textile document" + ], + "types": [ + "markup.heading.1", + "keyword", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "h2", + ". ", + "Heading Two" + ], + "types": [ + "markup.heading.2", + "keyword", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "h3", + ". ", + "A two-line" + ], + "types": [ + "markup.heading.3", + "keyword", + "text" + ] + }, + { + "state": "start", + "values": [ + " header" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "h2", + ". ", + "Another two-line" + ], + "types": [ + "markup.heading.2", + "keyword", + "text" + ] + }, + { + "state": "start", + "values": [ + "header" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "Paragraph:" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "one, two," + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + "thee lines!" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "p", + "(", + "classone", + " ", + "two", + " ", + "three", + ")", + ". ", + "This is a paragraph with classes" + ], + "types": [ + "markup.heading", + "keyword", + "string", + "text", + "string", + "text", + "string", + "keyword", + "keyword", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "p", + "(", + "#", + "id", + ")", + ". ", + "(one with an id)" + ], + "types": [ + "markup.heading", + "keyword", + "keyword", + "string", + "keyword", + "keyword", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "p", + "(", + "one", + " ", + "two", + " ", + "three", + "#", + "my_id", + ")", + ". ", + "..classes + id" + ], + "types": [ + "markup.heading", + "keyword", + "string", + "text", + "string", + "text", + "string", + "keyword", + "string", + "keyword", + "keyword", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "*", + " Unordered list" + ], + "types": [ + "keyword", + "text" + ] + }, + { + "state": "start", + "values": [ + "**", + " sublist" + ], + "types": [ + "keyword", + "text" + ] + }, + { + "state": "start", + "values": [ + "*", + " back again!" + ], + "types": [ + "keyword", + "text" + ] + }, + { + "state": "start", + "values": [ + "**", + " sublist again.." + ], + "types": [ + "keyword", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "#", + " ordered" + ], + "types": [ + "keyword", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "bg. Blockquote!" + ], + "types": [ + "text" + ] + }, + { + "state": "start", + "values": [ + " This is a two-list blockquote..!" + ], + "types": [ + "text" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_xml.json b/lib/ace/mode/_test/tokens_xml.json new file mode 100644 index 00000000..e5047146 --- /dev/null +++ b/lib/ace/mode/_test/tokens_xml.json @@ -0,0 +1,1243 @@ +[ + { + "state": "start", + "values": [ + "" + ], + "types": [ + "xml_pe" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + "<", + "query", + " ", + "xmlns:yahoo", + "=", + "\"http://www.yahooapis.com/v1/base.rng\"" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "yahoo:count", + "=", + "\"7\"", + " ", + "yahoo:created", + "=", + "\"2011-10-11T08:40:23Z\"", + " ", + "yahoo:lang", + "=", + "\"en-US\"", + ">" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "diagnostics", + ">" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "publiclyCallable", + ">", + "true", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "url", + " ", + "execution-start-time", + "=", + "\"0\"", + " ", + "execution-stop-time", + "=", + "\"25\"", + " ", + "execution-time", + "=", + "\"25\"", + ">", + "", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "user-time", + ">", + "26", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "service-time", + ">", + "25", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "build-version", + ">", + "21978", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "", + " " + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "results", + ">" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "<", + "place", + " ", + "xmlns", + "=", + "\"http://where.yahooapis.com/v1/schema.rng\"" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "xml:lang", + "=", + "\"en-US\"", + " ", + "yahoo:uri", + "=", + "\"http://where.yahooapis.com/v1/place/24865670\"", + ">" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "woeid", + ">", + "24865670", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "placeTypeName", + " ", + "code", + "=", + "\"29\"", + ">", + "Continent", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "name", + ">", + "Africa", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "<", + "place", + " ", + "xmlns", + "=", + "\"http://where.yahooapis.com/v1/schema.rng\"" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "xml:lang", + "=", + "\"en-US\"", + " ", + "yahoo:uri", + "=", + "\"http://where.yahooapis.com/v1/place/24865675\"", + ">" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "woeid", + ">", + "24865675", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "placeTypeName", + " ", + "code", + "=", + "\"29\"", + ">", + "Continent", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "name", + ">", + "Europe", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "<", + "place", + " ", + "xmlns", + "=", + "\"http://where.yahooapis.com/v1/schema.rng\"" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "xml:lang", + "=", + "\"en-US\"", + " ", + "yahoo:uri", + "=", + "\"http://where.yahooapis.com/v1/place/24865673\"", + ">" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "woeid", + ">", + "24865673", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "placeTypeName", + " ", + "code", + "=", + "\"29\"", + ">", + "Continent", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "name", + ">", + "South America", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "<", + "place", + " ", + "xmlns", + "=", + "\"http://where.yahooapis.com/v1/schema.rng\"" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "xml:lang", + "=", + "\"en-US\"", + " ", + "yahoo:uri", + "=", + "\"http://where.yahooapis.com/v1/place/28289421\"", + ">" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "woeid", + ">", + "28289421", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "placeTypeName", + " ", + "code", + "=", + "\"29\"", + ">", + "Continent", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "name", + ">", + "Antarctic", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "<", + "place", + " ", + "xmlns", + "=", + "\"http://where.yahooapis.com/v1/schema.rng\"" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "xml:lang", + "=", + "\"en-US\"", + " ", + "yahoo:uri", + "=", + "\"http://where.yahooapis.com/v1/place/24865671\"", + ">" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "woeid", + ">", + "24865671", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "placeTypeName", + " ", + "code", + "=", + "\"29\"", + ">", + "Continent", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "name", + ">", + "Asia", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "<", + "place", + " ", + "xmlns", + "=", + "\"http://where.yahooapis.com/v1/schema.rng\"" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "xml:lang", + "=", + "\"en-US\"", + " ", + "yahoo:uri", + "=", + "\"http://where.yahooapis.com/v1/place/24865672\"", + ">" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "woeid", + ">", + "24865672", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "placeTypeName", + " ", + "code", + "=", + "\"29\"", + ">", + "Continent", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "name", + ">", + "North America", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "tag_embed_attribute_list", + "values": [ + " ", + "<", + "place", + " ", + "xmlns", + "=", + "\"http://where.yahooapis.com/v1/schema.rng\"" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "xml:lang", + "=", + "\"en-US\"", + " ", + "yahoo:uri", + "=", + "\"http://where.yahooapis.com/v1/place/55949070\"", + ">" + ], + "types": [ + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "woeid", + ">", + "55949070", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "placeTypeName", + " ", + "code", + "=", + "\"29\"", + ">", + "Continent", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "text", + "entity.other.attribute-name", + "keyword.operator", + "string", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "<", + "name", + ">", + "Australia", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag", + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + " ", + "" + ], + "types": [ + "text", + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + }, + { + "state": "start", + "values": [ + "" + ], + "types": [ + "meta.tag", + "meta.tag.tag-name", + "meta.tag" + ] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_xquery.json b/lib/ace/mode/_test/tokens_xquery.json new file mode 100644 index 00000000..2c1a8499 --- /dev/null +++ b/lib/ace/mode/_test/tokens_xquery.json @@ -0,0 +1,105 @@ +[ + { + "state": "start", + "values": [ + "xquery", + " ", + "version", + " ", + "\"1.0\"", + ";" + ], + "types": [ + "keyword", + "text", + "keyword", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "let", + " ", + "$message", + " :", + "=", + " ", + "\"Hello World!\"" + ], + "types": [ + "keyword", + "text", + "variable", + "text", + "keyword.operator", + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + "return", + " <", + "results", + ">" + ], + "types": [ + "keyword", + "text", + "meta.tag", + "text" + ] + }, + { + "state": "start", + "values": [ + " <", + "message", + ">", + "{", + "$message", + "}", + "" + ], + "types": [ + "text", + "meta.tag", + "text", + "lparen", + "variable", + "rparen", + "text", + "meta.tag", + "text" + ] + }, + { + "state": "start", + "values": [ + "" + ], + "types": [ + "text", + "meta.tag", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + } +] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_yaml.json b/lib/ace/mode/_test/tokens_yaml.json new file mode 100644 index 00000000..4b5c63b5 --- /dev/null +++ b/lib/ace/mode/_test/tokens_yaml.json @@ -0,0 +1,410 @@ +[ + { + "state": "start", + "values": [ + "# This sample document was taken from wikipedia:" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "# http://en.wikipedia.org/wiki/YAML#Sample_document" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "---" + ], + "types": [ + "comment" + ] + }, + { + "state": "start", + "values": [ + "receipt:", + " Oz-Ware Purchase Invoice" + ], + "types": [ + "identifier", + "text" + ] + }, + { + "state": "start", + "values": [ + "date:", + " ", + "2007", + "-08", + "-06" + ], + "types": [ + "identifier", + "text", + "constant.numeric", + "constant.numeric", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + "customer:" + ], + "types": [ + "identifier" + ] + }, + { + "state": "start", + "values": [ + " ", + "given:", + " Dorothy" + ], + "types": [ + "text", + "identifier", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "family:", + " Gale" + ], + "types": [ + "text", + "identifier", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "items:" + ], + "types": [ + "identifier" + ] + }, + { + "state": "start", + "values": [ + " - ", + "part_no:", + " ", + "'A4786'" + ], + "types": [ + "text", + "identifier", + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "descrip:", + " Water Bucket ", + "(", + "Filled", + ")" + ], + "types": [ + "text", + "identifier", + "text", + "paren.lparen", + "text", + "paren.rparen" + ] + }, + { + "state": "start", + "values": [ + " ", + "price:", + " ", + "1.47" + ], + "types": [ + "text", + "identifier", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + " ", + "quantity:", + " ", + "4" + ], + "types": [ + "text", + "identifier", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + " - ", + "part_no:", + " ", + "'E1628'" + ], + "types": [ + "text", + "identifier", + "text", + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "descrip:", + " High Heeled ", + "\"Ruby\"", + " Slippers" + ], + "types": [ + "text", + "identifier", + "text", + "string", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "size:", + " ", + "8" + ], + "types": [ + "text", + "identifier", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + " ", + "price:", + " ", + "100.27" + ], + "types": [ + "text", + "identifier", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [ + " ", + "quantity:", + " ", + "1" + ], + "types": [ + "text", + "identifier", + "text", + "constant.numeric" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "bill-", + "to:", + " ", + "&id001" + ], + "types": [ + "text", + "identifier", + "text", + "variable" + ] + }, + { + "state": "qqstring", + "values": [ + " ", + "street:", + " ", + "|" + ], + "types": [ + "text", + "identifier", + "text", + "string" + ] + }, + { + "state": "qqstring", + "values": [ + " 123 Tornado Alley" + ], + "types": [ + "string" + ] + }, + { + "state": "qqstring", + "values": [ + " Suite 16" + ], + "types": [ + "string" + ] + }, + { + "state": "start", + "values": [ + " ", + "city:", + " East Centerville" + ], + "types": [ + "text", + "identifier", + "text" + ] + }, + { + "state": "start", + "values": [ + " ", + "state:", + " KS" + ], + "types": [ + "text", + "identifier", + "text" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "start", + "values": [ + "ship-", + "to:", + " ", + "*id001" + ], + "types": [ + "text", + "identifier", + "text", + "variable" + ] + }, + { + "state": "start", + "values": [], + "types": [] + }, + { + "state": "qqstring", + "values": [ + "specialDelivery:", + " ", + ">" + ], + "types": [ + "identifier", + "text", + "string" + ] + }, + { + "state": "qqstring", + "values": [ + " Follow the Yellow Brick" + ], + "types": [ + "string" + ] + }, + { + "state": "qqstring", + "values": [ + " Road to the Emerald City." + ], + "types": [ + "string" + ] + }, + { + "state": "qqstring", + "values": [ + " Pay no attention to the" + ], + "types": [ + "string" + ] + }, + { + "state": "qqstring", + "values": [ + " man behind the curtain." + ], + "types": [ + "string" + ] + }, + { + "state": "qqstring", + "values": [], + "types": [] + } +] \ No newline at end of file diff --git a/lib/ace/mode/pgsql.js b/lib/ace/mode/pgsql.js index 0ac91688..1794fbcf 100755 --- a/lib/ace/mode/pgsql.js +++ b/lib/ace/mode/pgsql.js @@ -20,12 +20,11 @@ define(function(require, exports, module) { - var oop = require("ace/lib/oop"); - var TextMode = require("ace/mode/text").Mode; - var Tokenizer = require("ace/tokenizer").Tokenizer; - var PgsqlHighlightRules = require("ace/mode/pgsql_highlight_rules").PgsqlHighlightRules; - var Range = require("ace/range").Range; - // var EditSession = require("ace/edit_session").EditSession; + var oop = require("../lib/oop"); + var TextMode = require("../mode/text").Mode; + var Tokenizer = require("../tokenizer").Tokenizer; + var PgsqlHighlightRules = require("./pgsql_highlight_rules").PgsqlHighlightRules; + var Range = require("../range").Range; var Mode = function() { this.$tokenizer = new Tokenizer(new PgsqlHighlightRules().getRules()); diff --git a/lib/ace/mode/pgsql_highlight_rules.js b/lib/ace/mode/pgsql_highlight_rules.js index ca381b14..688e9ac7 100755 --- a/lib/ace/mode/pgsql_highlight_rules.js +++ b/lib/ace/mode/pgsql_highlight_rules.js @@ -23,8 +23,8 @@ define(function(require, exports, module) { -var oop = require("ace/lib/oop"); -var lang = require("ace/lib/lang"); +var oop = require("../lib/oop"); +var lang = require("../lib/lang"); var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; // Supporting perl and python for now -- both in pg core and ace