add tests for all highlighters

This commit is contained in:
nightwing 2012-08-31 00:08:01 +04:00
commit 6b96cd1229
47 changed files with 25312 additions and 8 deletions

View file

@ -0,0 +1,8 @@
{
"name": "ace-mode-creator",
"version": "0.1.0",
"dependencies": {
"connect": "",
"socket.io": ""
}
}

View file

@ -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()
}

View file

@ -0,0 +1,47 @@
function foo(items, nada) {
for (var i=0; i<items.length; i++) {
alert(items[i] + "juhu\n");
} // Real Tab.
}
/************************************/
/** total mess, tricky to highlight**/
function () {
/**
* docComment
**/
r = /u\t*/
g = 1.00E^1, y = 1.2 + .2 + 052 + 0x25
t = ['d', '']
}
function () {
/* eee */
}
"s\
s\u7824sss\u1"
'\
string'
'
string'
"trailing space\
" " /not a regexp/g
/**
*doc
*/
a = {
'a': b,
'g': function(t)
gta:function(a,b)
}
foo.protoype.d = function(a, b,
c, d)
foo.d =function(a, b)
foo.d =function(a, /*****/ d"string"

View file

@ -0,0 +1,273 @@
[
{
"state": "start",
"values": [
"Searching for 'var' in /workspace/configs"
],
"types": [
"text"
]
},
{
"state": "start",
"values": [],
"types": []
},
{
"state": "start",
"values": [
"configs/default.js",
":"
],
"types": [
"string",
"text"
]
},
{
"state": "start",
"values": [
" 1",
": ",
"var fs = require(\"fs\");"
],
"types": [
"c9searchresults.constant.numeric",
"c9searchresults.text",
"c9searchresults.text"
]
},
{
"state": "start",
"values": [
"\t2",
": ",
"var argv = require('optimist').argv;"
],
"types": [
"c9searchresults.constant.numeric",
"c9searchresults.text",
"c9searchresults.text"
]
},
{
"state": "start",
"values": [
"\t3",
": ",
"var path = require(\"path\");"
],
"types": [
"c9searchresults.constant.numeric",
"c9searchresults.text",
"c9searchresults.text"
]
},
{
"state": "start",
"values": [
"\t5",
": ",
"var clientExtensions = {};"
],
"types": [
"c9searchresults.constant.numeric",
"c9searchresults.text",
"c9searchresults.text"
]
},
{
"state": "start",
"values": [
"\t6",
": ",
"var clientDirs = fs.readdirSync(__dirname + \"/../plugins-client\");"
],
"types": [
"c9searchresults.constant.numeric",
"c9searchresults.text",
"c9searchresults.text"
]
},
{
"state": "start",
"values": [
"\t7",
": ",
"for (var i = 0; i < clientDirs.length; i++) {"
],
"types": [
"c9searchresults.constant.numeric",
"c9searchresults.text",
"c9searchresults.text"
]
},
{
"state": "start",
"values": [
"\t8",
": ",
"var dir = clientDirs[i];"
],
"types": [
"c9searchresults.constant.numeric",
"c9searchresults.text",
"c9searchresults.text"
]
},
{
"state": "start",
"values": [
"\t12",
": ",
"var name = dir.split(\".\")[1];"
],
"types": [
"c9searchresults.constant.numeric",
"c9searchresults.text",
"c9searchresults.text"
]
},
{
"state": "start",
"values": [
"\t16",
": ",
"var projectDir = (argv.w && path.resolve(process.cwd(), argv.w)) || process.cwd();"
],
"types": [
"c9searchresults.constant.numeric",
"c9searchresults.text",
"c9searchresults.text"
]
},
{
"state": "start",
"values": [
"\t17",
": ",
"var fsUrl = \"/workspace\";"
],
"types": [
"c9searchresults.constant.numeric",
"c9searchresults.text",
"c9searchresults.text"
]
},
{
"state": "start",
"values": [
"\t19",
": ",
"var port = argv.p || process.env.PORT || 3131;"
],
"types": [
"c9searchresults.constant.numeric",
"c9searchresults.text",
"c9searchresults.text"
]
},
{
"state": "start",
"values": [
"\t20",
": ",
"var host = argv.l || \"localhost\";"
],
"types": [
"c9searchresults.constant.numeric",
"c9searchresults.text",
"c9searchresults.text"
]
},
{
"state": "start",
"values": [
"\t22",
": ",
"var config = {"
],
"types": [
"c9searchresults.constant.numeric",
"c9searchresults.text",
"c9searchresults.text"
]
},
{
"state": "start",
"values": [],
"types": []
},
{
"state": "start",
"values": [
"configs/local.js",
":"
],
"types": [
"string",
"text"
]
},
{
"state": "start",
"values": [
"\t2",
": ",
"var config = require(\"./default\");"
],
"types": [
"c9searchresults.constant.numeric",
"c9searchresults.text",
"c9searchresults.text"
]
},
{
"state": "start",
"values": [],
"types": []
},
{
"state": "start",
"values": [
"configs/packed.js",
":"
],
"types": [
"string",
"text"
]
},
{
"state": "start",
"values": [
"\t1",
": ",
"var config = require(\"./default\");"
],
"types": [
"c9searchresults.constant.numeric",
"c9searchresults.text",
"c9searchresults.text"
]
},
{
"state": "start",
"values": [],
"types": []
},
{
"state": "start",
"values": [],
"types": []
},
{
"state": "start",
"values": [
"Found 15 matches in 3 files"
],
"types": [
"text"
]
}
]

View file

@ -0,0 +1,207 @@
[
{
"state": "start",
"values": [
"// compound assignment operators"
],
"types": [
"comment"
]
},
{
"state": "start",
"values": [],
"types": []
},
{
"state": "start",
"values": [
"#include",
" ",
"<iostream>"
],
"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"
]
}
]

View file

@ -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"
]
}
]

View file

@ -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"
]
}
]

View file

@ -0,0 +1,65 @@
[
{
"state": "start",
"values": [
"<!--",
"- hello world --->"
],
"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#",
"</",
"cfoutput",
">"
],
"types": [
"meta.tag",
"meta.tag.tag-name",
"meta.tag",
"text",
"meta.tag",
"meta.tag.tag-name",
"meta.tag"
]
}
]

View file

@ -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"
]
}
]

View file

@ -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"
]
}
]

File diff suppressed because it is too large Load diff

View file

@ -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"
]
}
]

View file

@ -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": []
}
]

View file

@ -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"
]
}
]

View file

@ -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"
]
}
]

View file

@ -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": [
" ",
"</",
"style",
">"
],
"types": [
"text",
"meta.tag",
"meta.tag.tag-name.style",
"meta.tag"
]
},
{
"state": "start",
"values": [],
"types": []
},
{
"state": "start",
"values": [
" ",
"</",
"head",
">"
],
"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",
"</",
"h1",
">"
],
"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": [
" ",
"</",
"body",
">"
],
"types": [
"text",
"meta.tag",
"meta.tag.tag-name",
"meta.tag"
]
},
{
"state": "start",
"values": [
"</",
"html",
">"
],
"types": [
"meta.tag",
"meta.tag.tag-name",
"meta.tag"
]
}
]

View file

@ -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"
]
}
]

View file

@ -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": []
}
]

File diff suppressed because it is too large Load diff

View file

@ -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"
]
}
]

Some files were not shown because too many files have changed in this diff Show more