tests for all modes

This commit is contained in:
nightwing 2013-01-20 16:47:49 +04:00
commit f9d4bbac49
79 changed files with 18431 additions and 23112 deletions

View file

@ -0,0 +1,9 @@
`tokens_<modeName>.json` files keep information about correct tokens and tokenizer states for all modes supported by ace.
They are generated from `text_<modeName>.txt` or `demo/kitchen-sink/doc/*` with
```sh
node highlight_rules_test.js gen
```
command.

View file

@ -0,0 +1,152 @@
var fs = require("fs");
if (!fs.existsSync)
fs.existsSync = require("path").existsSync;
require("amd-loader");
var cwd = __dirname + "/";
function generateTestData() {
var root = Array(5).join("../") + "/demo/kitchen-sink/docs";
var docs = fs.readdirSync(cwd + root);
var specialDocs = fs.readdirSync(cwd);
var modes = fs.readdirSync(cwd + "../").filter(function(x){
return /^\w+_highlight_rules.js$/.test(x);
}).map(function(x) {
return x.replace(/_highlight_rules.js$/, "");
});
console.log("Docs:", docs);
console.log("Modes:", modes);
docs.forEach(function(docName) {
var p = docName.toLowerCase().split(".");
if (!p[1])
return;
var 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]];
var filePath = "text_" + modeName + ".txt";
if (specialDocs.indexOf(filePath) == -1) {
filePath = root + "/" + docName;
}
var text = fs.readFileSync(cwd + filePath, "utf8");
try {
var Mode = require("../" + modeName).Mode;
} catch(e) {
console.warn("Can't load mode :" + modeName, p, e);
return;
}
var tokenizer = new Mode().getTokenizer();
var state = "start";
var data = text.split(/\n|\r|\r\n/).map(function(line) {
var data = tokenizer.getLineTokens(line, state);
var tmp = [];
tmp.push(JSON.stringify(data.state));
data.tokens.forEach(function(x) {
tmp.push(JSON.stringify([x.type, x.value]));
});
state = data.state;
return tmp.join(",\n ");
});
jsonStr = "[[\n " + data.join("\n],[\n ") + "\n]]";
fs.writeFileSync(cwd + "tokens_" + modeName + ".json", jsonStr, "utf8");
});
}
function test(startAt) {
var modes = fs.readdirSync(cwd).map(function(x) {
return (x.match(/tokens_(.*).json/) || {})[1];
}).filter(function(x){return !!x});
for (var i = Math.max(0, startAt||0); i < modes.length; i++)
testMode(modes[i], i);
console.log("\u001b[32m" + "all ok" + "\u001b[0m");
}
function testMode(modeName, i) {
console.log(padNumber(i+1, 3) + ") testing: \u001b[33m" + modeName + "\u001b[0m");
var text = fs.readFileSync(cwd + "tokens_" + modeName + ".json", "utf8");
var data = JSON.parse(text);
var Mode = require("../" + modeName).Mode;
var tokenizer = new Mode().getTokenizer();
var state = "start";
data.forEach(function(lineData) {
lineData.values = [];
lineData.types = [];
lineData.state = lineData.shift();
lineData.forEach(function(x) {
lineData.types.push(x[0]);
lineData.values.push(x[1]);
});
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;});
var success = true;
var err = testEqual([
lineData.state, tokens.state,
lineData.types, types,
lineData.values, values]);
if (err) {
console.log(line)
throw "error";
}
state = lineData.state;
});
}
function testEqual(a) {
var err;
if (a[0] !== a[1]) {
console.log(a[0],a[1]);
err = 1;
}
if ( a[2] + "" !== a[3] + "" || a[4] + "" !== a[5] + "") {
arrayDiff(a[2],a[3]);
arrayDiff(a[4],a[5]);
err = 1;
}
return err;
}
function arrayDiff(a1, a2) {
var l = Math.max(a1.length, a2.length);
var out = [];
for (var i = 0; i < l; i++) {
out.push("\n", padNumber(i+1, 3), ") ");
if (a1[i] !== a2[i])
out.push("\u001b[31m", a1[i], "\u001b[0m != \u001b[32m", a2[i], "\u001b[0m");
else
out.push(a1[i]);
}
console.log(out.join(""));
}
function padNumber(num, digits) {
return (" " + num).slice(-digits);
}
// cli
var arg = process.argv[2];
if (!arg)
test()
else if (/--?g(en)?/.test(arg))
generateTestData(process.argv.splice(3));
else if (/\d+/.test(arg))
test(parseInt(process.argv[2],10) || 0);
else
testMode(arg, -1)

View file

@ -1,144 +0,0 @@
var fs = require("fs");
if (!fs.existsSync)
fs.existsSync = require("path").existsSync;
require("amd-loader");
var cwd = __dirname + "/";
function generateTestData() {
var root = Array(5).join("../") + "/demo/kitchen-sink/docs";
var docs = fs.readdirSync(cwd + root);
var specialDocs = fs.readdirSync(cwd);
var modes = fs.readdirSync(cwd + "../").filter(function(x){
return /^\w+_highlight_rules.js$/.test(x);
}).map(function(x) {
return x.replace(/_highlight_rules.js$/, "");
});
console.log("Docs:", docs);
console.log("Modes:", modes);
docs.forEach(function(docName) {
var p = docName.toLowerCase().split(".");
if (!p[1])
return;
var 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]];
var filePath = "text_" + modeName + ".txt";
if (specialDocs.indexOf(filePath) == -1) {
filePath = root + "/" + docName;
}
var text = fs.readFileSync(cwd + filePath, "utf8");
try {
var Mode = require("../" + modeName).Mode;
} catch(e) {
console.warn("Can't load mode :" + modeName, e);
return;
}
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,
data: tokens.map(function(x) {return [x.type, x.value]})
};
});
var jsonStr = JSON.stringify(data, null, 1);
jsonStr = jsonStr.replace(/\n {4}/g, " ").replace(/\n {3}]/g, " ]");
fs.writeFileSync(cwd + "tokens_" + modeName + ".json", jsonStr, "utf8");
});
}
function test(startAt) {
var docs = fs.readdirSync(cwd).filter(function(x) {
return /^tokens_\w+.json$/.test(x);
});
if (startAt && startAt > 1)
docs = docs.slice(startAt - 1);
docs.forEach(function(x, i) {
var modeName = x.match(/tokens_(.*).json/)[1];
console.log(padNumber(i+1, 3) + ") testing: \u001b[33m" + modeName + "\u001b[0m");
var text = fs.readFileSync(cwd + x, "utf8");
var data = JSON.parse(text);
var Mode = require("../" + modeName).Mode;
var tokenizer = new Mode().getTokenizer();
var state = "start";
data.forEach(function(lineData) {
lineData.values = [];
lineData.types = [];
lineData.data.forEach(function(x) {
lineData.types.push(x[0]);
lineData.values.push(x[1]);
});
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;});
var success = true;
testEqual([
lineData.state, tokens.state,
lineData.types, types,
lineData.values, values]);
state = lineData.state;
});
});
console.log("\u001b[32m" + "all ok" + "\u001b[0m");
function testEqual(a) {
var err;
if (a[0] !== a[1]) {
console.log(a[0],a[1]);
err = 1;
}
if ( a[2] + "" !== a[3] + "" || a[4] + "" !== a[5] + "") {
arrayDiff(a[2],a[3]);
arrayDiff(a[4],a[5]);
err = 1;
}
if (err) {
throw "error";
}
}
function arrayDiff(a1, a2) {
var l = Math.max(a1.length, a2.length);
var out = [];
for (var i = 0; i < l; i++) {
out.push("\n", padNumber(i+1, 3), ") ");
if (a1[i] !== a2[i])
out.push("\u001b[31m", a1[i], " != ", a2[i], "\u001b[0m");
else
out.push(a1[i]);
}
console.log(out.join(""));
}
function padNumber(num, digits) {
return (" " + num).slice(-digits);
}
}
if (process.argv[2] == "gen")
generateTestData(process.argv.splice(3));
else
test(parseInt(process.argv[2],10) || 0);

View file

@ -0,0 +1,56 @@
#test: tokenize keyword
for (i 1..2)
#test: tokenize regexp
/"[a]/
#test: tokenize functions
foo = ({args}) ->
foo = ({a1, a2}) ->
foo = ({@a1, a2}) ->
foo : ({args}) ->
foo = ({args}) ->
foo = ({0abc}) ->
foo = ({/abc}) =>
foo = ({abc/}) ->
foo = ({#abc}) ->
foo = ({abc#}) ->
foo = ({)abc}) ->
foo = ({abc)}) ->
foo = ({a{bc}) ->
foo = ({}) ->
foo = ({ }) ->
foo : ({}) ->
foo = (args) ->
foo = (arg1, arg2) ->
foo = (arg1 = 1, arg2 = 'name') ->
foo = (@arg1 = /abc/, arg2 = 'name') ->
#test: tokenize function: invalid case:
foo=(/args) ->
foo = () ->
foo = ( ) ->
foo : ( ) ->
window.foo = (args) ->
foo = ->
foo = ->
foo : ->
#test: tokenize callback function
foo bar: 1, (args) ->
foo = (1, 2 (x) ->
#test: tokenize class
class Foo
class Foo extends Bar
#test: tokenize illegal name property
foo.static.function
#!test tokenize string with interpolation
a = "#{ 22 / 7 + {x: "#{a + b}"} + 2}"
"""heredoc
"""
do ->
###
herecomment
###
re = /regex/imgy.test ///
heregex # comment
///imgy
this isnt: `just
JavaScript`
undefined

View file

@ -0,0 +1,9 @@
tokenize Curly template{{test}}
tokenize embedded script
<script a='a'>var</script>'123'
tokenize multiline attribute value with double quotes
<a href="abc{{xyz}}
def">
tokenize multiline attribute value with single quotes
<a href='abc
def\"'>

View file

@ -0,0 +1,8 @@
<html>
<script a='a'>var</script>'123'
<a href="abc
def">
<a href='abc
def\'>
</html>

View file

@ -1,3 +1,37 @@
//test: tokenize 'standard' functions
string.charCodeAt(23); document.getElementById('test'); console.log('Here it is');";
test: /**tokenize doc*/ comment
/**tokenize doc comment with @tag {}*/
//test: tokenize parens
var line = "[{( )}]";
//test tokenize arithmetic expression which looks like a regexp
a/b/c
a/=b/c
//test tokenize reg exps
a=/b/g
a+/b/g
a = 1 + /2 + 1/b
a=/a/ / /a/
case /a/.test(c)
//test tokenize multi-line comment containing a single line comment
noRegex
/* foo // bar */
canBeRegex;
/* foo // bar */
// test tokenize identifier with umlauts
fu?e
// test // is not a regexp
{ // 123
//test skipping escaped chars
'Meh\\nNeh'
console.log('\\u1232Feh'
"test multiline\
strings"
a='
b="\
still a string
function foo(items, nada) {
for (var i=0; i<items.length; i++) {
alert(items[i] + "juhu\n");

View file

@ -0,0 +1,16 @@
test: recognises AND as keyword
test: recognises OR as keyword
test: recognises NOT as keyword
test: recognises "hello this is dog" as string
test: recognises -"hello this is dog" as negation with string
test: recognises ~100 as text with proximity
test: recognises "hello this is dog"~100 as string with proximity
test: recognises raw:"hello this is dog" as keyword
test: recognises raw:foo as"keyword'
test: recognises "(" as opening parenthesis
test: recognises ")" as closing parenthesis
test: recognises foo* as text with asterisk
test: recognises foo? as text with interro
test: recognises single word as text
foo

View file

@ -0,0 +1,13 @@
test: header 1
#f
test: header 2
## foo
test: header ends with ' #'
# # #
test: header ends with '#'
#foo#
test: 6+ #s is not a valid header
####### foo
test: # followed be only space is not a valid header
test: only space between #s is not a valid header
# #

View file

@ -0,0 +1,15 @@
#test: symbol tokenizer
[:@thing, :$thing, :_thing, :thing, :Thing, :thing1, :thing_a,
:THING, :thing!, :thing=, :thing?, :t?,
:, :@, :$, :1, :1thing, :th?ing, :thi=ng, :1thing,
:th!ing, :thing#
]
#test: namespaces aren't symbols" : function() {
Namespaced::Class
#test: hex tokenizer
0x9a, 0XA1, 0x9_a, 0x, 0x_9a, 0x9a_,
#test: float tokenizer
[1, +1, -1, 12_345, 0.000_1,
_, 3_1, 1_2, 1_.0, 0._1];

View file

@ -0,0 +1,7 @@
<Juhu>//Juhu Kinners</Kinners>
test: two tags in the same lines should be in separate tokens"
<Juhu><Kinners>
test: multiline attributes"
<copy set="{
}" undo="{
}"/>

View file

@ -1,294 +1,189 @@
[
{
"state": "start",
"data": [
[ "doc.comment", "***************************************" ]
]
},
{
"state": "start",
"data": [
[ "doc.comment", "** Program: EXAMPLE **" ]
]
},
{
"state": "start",
"data": [
[ "doc.comment", "** Author: Joe Byte, 07-Jul-2007 **" ]
]
},
{
"state": "start",
"data": [
[ "doc.comment", "***************************************" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "keyword", "REPORT" ],
[ "text", " BOOKINGS" ],
[ "keyword.operator", "." ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "doc.comment", "* Read flight bookings from the database" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "SELECT" ],
[ "keyword.operator", " * " ],
[ "keyword", "FROM" ],
[ "text", " FLIGHTINFO" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "WHERE" ],
[ "text", " " ],
[ "keyword", "CLASS" ],
[ "keyword.operator", " = " ],
[ "string", "'Y'" ],
[ "text", " " ],
[ "comment", "\"Y = economy" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "OR" ],
[ "text", " " ],
[ "keyword", "CLASS" ],
[ "keyword.operator", " = " ],
[ "string", "'C'" ],
[ "keyword.operator", "." ],
[ "text", " " ],
[ "comment", "\"C = business" ]
]
},
{
"state": "start",
"data": [
[ "paren.lparen", "(" ],
[ "invalid", "..." ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "REPORT" ],
[ "text", " TEST" ],
[ "keyword.operator", "." ]
]
},
{
"state": "start",
"data": [
[ "keyword", "WRITE" ],
[ "text", " " ],
[ "string", "'Hello World'" ],
[ "keyword.operator", "." ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", "USERPROMPT" ],
[ "keyword.operator", " = " ],
[ "string", "'Please double-click on a line in the output list '" ],
[ "text", " " ],
[ "keyword.operator", "&" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "string", "'to see the complete details of the transaction.'" ],
[ "keyword.operator", "." ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "DATA" ],
[ "text", " LAST_EOM " ],
[ "keyword", "TYPE" ],
[ "text", " " ],
[ "support.type", "D" ],
[ "keyword.operator", "." ],
[ "text", " " ],
[ "comment", "\"last end-of-month date" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "doc.comment", "* Start from today's date" ]
]
},
{
"state": "start",
"data": [
[ "text", " LAST_EOM" ],
[ "keyword.operator", " = " ],
[ "variable.parameter", "SY" ],
[ "keyword.operator", "-" ],
[ "text", "DATUM" ],
[ "keyword.operator", "." ]
]
},
{
"state": "start",
"data": [
[ "doc.comment", "* Set characters 6 and 7 (0-relative) of the YYYYMMDD string to \"01\"," ]
]
},
{
"state": "start",
"data": [
[ "doc.comment", "* giving the first day of the current month" ]
]
},
{
"state": "start",
"data": [
[ "text", " LAST_EOM" ],
[ "constant.numeric", "+6" ],
[ "paren.lparen", "(" ],
[ "constant.numeric", "2" ],
[ "paren.rparen", ")" ],
[ "keyword.operator", " = " ],
[ "string", "'01'" ],
[ "keyword.operator", "." ]
]
},
{
"state": "start",
"data": [
[ "doc.comment", "* Subtract one day" ]
]
},
{
"state": "start",
"data": [
[ "text", " LAST_EOM" ],
[ "keyword.operator", " = " ],
[ "text", "LAST_EOM" ],
[ "keyword.operator", " - " ],
[ "constant.numeric", "1" ],
[ "keyword.operator", "." ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "WRITE" ],
[ "keyword.operator", ":" ],
[ "text", " " ],
[ "string", "'Last day of previous month was'" ],
[ "keyword.operator", "," ],
[ "text", " LAST_EOM" ],
[ "keyword.operator", "." ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "keyword", "DATA" ],
[ "text", " " ],
[ "keyword.operator", ":" ],
[ "text", " " ],
[ "keyword", "BEGIN OF" ],
[ "text", " I_VBRK " ],
[ "keyword", "OCCURS" ],
[ "text", " " ],
[ "constant.numeric", "0" ],
[ "keyword.operator", "," ]
]
},
{
"state": "start",
"data": [
[ "text", " VBELN " ],
[ "keyword", "LIKE" ],
[ "text", " " ],
[ "variable.parameter", "VBRK-VBELN" ],
[ "keyword.operator", "," ]
]
},
{
"state": "start",
"data": [
[ "text", " ZUONR " ],
[ "keyword", "LIKE" ],
[ "text", " " ],
[ "variable.parameter", "VBRK-ZUONR" ],
[ "keyword.operator", "," ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "END OF" ],
[ "text", " I_VBRK" ],
[ "keyword.operator", "." ]
]
}
]
[[
"start",
["doc.comment","***************************************"]
],[
"start",
["doc.comment","** Program: EXAMPLE **"]
],[
"start",
["doc.comment","** Author: Joe Byte, 07-Jul-2007 **"]
],[
"start",
["doc.comment","***************************************"]
],[
"start",
["text"," "]
],[
"start",
["keyword","REPORT"],
["text"," BOOKINGS"],
["keyword.operator","."]
],[
"start",
["text"," "]
],[
"start",
["doc.comment","* Read flight bookings from the database"]
],[
"start",
["keyword","SELECT"],
["keyword.operator"," * "],
["keyword","FROM"],
["text"," FLIGHTINFO"]
],[
"start",
["text"," "],
["keyword","WHERE"],
["text"," "],
["keyword","CLASS"],
["keyword.operator"," = "],
["string","'Y'"],
["text"," "],
["comment","\"Y = economy"]
],[
"start",
["text"," "],
["keyword","OR"],
["text"," "],
["keyword","CLASS"],
["keyword.operator"," = "],
["string","'C'"],
["keyword.operator","."],
["text"," "],
["comment","\"C = business"]
],[
"start",
["paren.lparen","("],
["invalid","..."],
["paren.rparen",")"]
],[
"start"
],[
"start",
["keyword","REPORT"],
["text"," TEST"],
["keyword.operator","."]
],[
"start",
["keyword","WRITE"],
["text"," "],
["string","'Hello World'"],
["keyword.operator","."]
],[
"start"
],[
"start",
["text","USERPROMPT"],
["keyword.operator"," = "],
["string","'Please double-click on a line in the output list '"],
["text"," "],
["keyword.operator","&"]
],[
"start",
["text"," "],
["string","'to see the complete details of the transaction.'"],
["keyword.operator","."]
],[
"start"
],[
"start"
],[
"start",
["keyword","DATA"],
["text"," LAST_EOM "],
["keyword","TYPE"],
["text"," "],
["support.type","D"],
["keyword.operator","."],
["text"," "],
["comment","\"last end-of-month date"]
],[
"start",
["text"," "]
],[
"start",
["doc.comment","* Start from today's date"]
],[
"start",
["text"," LAST_EOM"],
["keyword.operator"," = "],
["variable.parameter","SY"],
["keyword.operator","-"],
["text","DATUM"],
["keyword.operator","."]
],[
"start",
["doc.comment","* Set characters 6 and 7 (0-relative) of the YYYYMMDD string to \"01\","]
],[
"start",
["doc.comment","* giving the first day of the current month"]
],[
"start",
["text"," LAST_EOM"],
["constant.numeric","+6"],
["paren.lparen","("],
["constant.numeric","2"],
["paren.rparen",")"],
["keyword.operator"," = "],
["string","'01'"],
["keyword.operator","."]
],[
"start",
["doc.comment","* Subtract one day"]
],[
"start",
["text"," LAST_EOM"],
["keyword.operator"," = "],
["text","LAST_EOM"],
["keyword.operator"," - "],
["constant.numeric","1"],
["keyword.operator","."]
],[
"start",
["text"," "]
],[
"start",
["text"," "],
["keyword","WRITE"],
["keyword.operator",":"],
["text"," "],
["string","'Last day of previous month was'"],
["keyword.operator",","],
["text"," LAST_EOM"],
["keyword.operator","."]
],[
"start",
["text"," "]
],[
"start",
["keyword","DATA"],
["text"," "],
["keyword.operator",":"],
["text"," "],
["keyword","BEGIN OF"],
["text"," I_VBRK "],
["keyword","OCCURS"],
["text"," "],
["constant.numeric","0"],
["keyword.operator",","]
],[
"start",
["text"," VBELN "],
["keyword","LIKE"],
["text"," "],
["variable.parameter","VBRK-VBELN"],
["keyword.operator",","]
],[
"start",
["text"," ZUONR "],
["keyword","LIKE"],
["text"," "],
["variable.parameter","VBRK-ZUONR"],
["keyword.operator",","]
],[
"start",
["text"," "],
["keyword","END OF"],
["text"," I_VBRK"],
["keyword.operator","."]
]]

File diff suppressed because it is too large Load diff

View file

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

View file

@ -1,273 +1,166 @@
[
{
"state": "start",
"data": [
[ "comment", "// compound assignment operators" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "#include" ],
[ "constant.other", " <iostream>" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "directive",
"data": [
[ "keyword", "#include" ],
[ "constant.other.multiline", " \\" ]
]
},
{
"state": "start",
"data": [
[ "constant.other", " <iostream>" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "directive",
"data": [
[ "keyword", "#include" ],
[ "constant.other.multiline", " \\" ]
]
},
{
"state": "directive",
"data": [
[ "constant.other.multiline", " \\" ]
]
},
{
"state": "start",
"data": [
[ "constant.other", " <iostream>" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "directive",
"data": [
[ "keyword", "#include" ],
[ "constant.other.multiline", " \\" ]
]
},
{
"state": "directive",
"data": [
[ "constant.other.multiline", " \\" ]
]
},
{
"state": "start",
"data": [
[ "constant.other", " \"iostream\"" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "#include" ],
[ "constant.other", " <boost/asio/io_service.hpp>" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "#include" ],
[ "constant.other", " \"boost/asio/io_service.hpp\"" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword.control", "using" ],
[ "text", " " ],
[ "keyword.operator", "namespace" ],
[ "text", " " ],
[ "identifier", "std" ],
[ "punctuation.operator", ";" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "storage.type", "int" ],
[ "text", " " ],
[ "identifier", "main" ],
[ "text", " " ],
[ "paren.lparen", "(" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "storage.type", "int" ],
[ "text", " " ],
[ "identifier", "a" ],
[ "punctuation.operator", "," ],
[ "text", " " ],
[ "identifier", "b" ],
[ "keyword.operator", "=" ],
[ "constant.numeric", "3" ],
[ "punctuation.operator", ";" ],
[ "text", " " ],
[ "comment", "/* foobar */" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "a" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "identifier", "b" ],
[ "punctuation.operator", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "a" ],
[ "keyword.operator", "+=" ],
[ "constant.numeric", "2" ],
[ "punctuation.operator", ";" ],
[ "text", " " ],
[ "comment", "// equivalent to a=a+2" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "cout" ],
[ "text", " " ],
[ "keyword.operator", "<<" ],
[ "text", " " ],
[ "identifier", "a" ],
[ "punctuation.operator", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "#if" ],
[ "constant.other", " VERBOSE >= 2" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "prints" ],
[ "paren.lparen", "(" ],
[ "string", "\"trace message\"" ],
[ "paren.rparen", ")" ],
[ "punctuation.operator", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "#endif" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword.control", "return" ],
[ "text", " " ],
[ "constant.numeric", "0" ],
[ "punctuation.operator", ";" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "comment", "/* Print an error message and get out */" ]
]
},
{
"state": "directive",
"data": [
[ "keyword", "#define" ],
[ "constant.other.multiline", " ABORT \\" ]
]
},
{
"state": "directive",
"data": [
[ "constant.other.multiline", " do { \\" ]
]
},
{
"state": "directive",
"data": [
[ "constant.other.multiline", " print( \"Abort\\n\" ); \\" ]
]
},
{
"state": "directive",
"data": [
[ "constant.other.multiline", " exit(8); \\" ]
]
},
{
"state": "start",
"data": [
[ "constant.other", "} while (0) " ],
[ "comment", "/* Note: No semicolon */" ]
]
}
]
[[
"start",
["comment","// compound assignment operators"]
],[
"start"
],[
"start",
["keyword","#include"],
["constant.other"," <iostream>"]
],[
"start"
],[
"directive",
["keyword","#include"],
["constant.other.multiline"," \\"]
],[
"start",
["constant.other"," <iostream>"]
],[
"start"
],[
"directive",
["keyword","#include"],
["constant.other.multiline"," \\"]
],[
"directive",
["constant.other.multiline"," \\"]
],[
"start",
["constant.other"," <iostream>"]
],[
"start"
],[
"directive",
["keyword","#include"],
["constant.other.multiline"," \\"]
],[
"directive",
["constant.other.multiline"," \\"]
],[
"start",
["constant.other"," \"iostream\""]
],[
"start"
],[
"start",
["keyword","#include"],
["constant.other"," <boost/asio/io_service.hpp>"]
],[
"start",
["keyword","#include"],
["constant.other"," \"boost/asio/io_service.hpp\""]
],[
"start"
],[
"start",
["keyword.control","using"],
["text"," "],
["keyword.operator","namespace"],
["text"," "],
["identifier","std"],
["punctuation.operator",";"]
],[
"start"
],[
"start",
["storage.type","int"],
["text"," "],
["identifier","main"],
["text"," "],
["paren.lparen","("],
["paren.rparen",")"]
],[
"start",
["paren.lparen","{"]
],[
"start",
["text"," "],
["storage.type","int"],
["text"," "],
["identifier","a"],
["punctuation.operator",","],
["text"," "],
["identifier","b"],
["keyword.operator","="],
["constant.numeric","3"],
["punctuation.operator",";"],
["text"," "],
["comment","/* foobar */"]
],[
"start",
["text"," "],
["identifier","a"],
["text"," "],
["keyword.operator","="],
["text"," "],
["identifier","b"],
["punctuation.operator",";"]
],[
"start",
["text"," "],
["identifier","a"],
["keyword.operator","+="],
["constant.numeric","2"],
["punctuation.operator",";"],
["text"," "],
["comment","// equivalent to a=a+2"]
],[
"start",
["text"," "],
["identifier","cout"],
["text"," "],
["keyword.operator","<<"],
["text"," "],
["identifier","a"],
["punctuation.operator",";"]
],[
"start",
["text"," "],
["keyword","#if"],
["constant.other"," VERBOSE >= 2"]
],[
"start",
["text"," "],
["identifier","prints"],
["paren.lparen","("],
["string","\"trace message\""],
["paren.rparen",")"],
["punctuation.operator",";"]
],[
"start",
["text"," "],
["keyword","#endif"]
],[
"start",
["text"," "],
["keyword.control","return"],
["text"," "],
["constant.numeric","0"],
["punctuation.operator",";"]
],[
"start",
["paren.rparen","}"]
],[
"start"
],[
"start",
["comment","/* Print an error message and get out */"]
],[
"directive",
["keyword","#define"],
["constant.other.multiline"," ABORT \\"]
],[
"directive",
["constant.other.multiline"," do { \\"]
],[
"directive",
["constant.other.multiline"," print( \"Abort\\n\" ); \\"]
],[
"directive",
["constant.other.multiline"," exit(8); \\"]
],[
"start",
["constant.other","} while (0) "],
["comment","/* Note: No semicolon */"]
]]

View file

@ -1,219 +1,162 @@
[
{
"state": "start",
"data": [
[ "keyword", "(" ],
[ "support.function", "defn" ],
[ "text", " " ],
[ "identifier", "parting" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "string", "\"returns a String parting in a given language\"" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "([]" ],
[ "text", " " ],
[ "keyword", "(" ],
[ "identifier", "parting" ],
[ "text", " " ],
[ "string", "\"World\"" ],
[ "keyword", "))" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "([" ],
[ "support.function", "name" ],
[ "keyword", "]" ],
[ "text", " " ],
[ "keyword", "(" ],
[ "identifier", "parting" ],
[ "text", " " ],
[ "support.function", "name" ],
[ "text", " " ],
[ "string", "\"en\"" ],
[ "keyword", "))" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "([" ],
[ "support.function", "name" ],
[ "text", " " ],
[ "identifier", "language" ],
[ "keyword", "]" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "; condp is similar to a case statement in other languages." ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "; It is described in more detail later." ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "; It is used here to take different actions based on whether the" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "; parameter \"language\" is set to \"en\", \"es\" or something else." ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "(" ],
[ "support.function", "condp" ],
[ "text", " " ],
[ "constant.language", "=" ],
[ "text", " " ],
[ "identifier", "language" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "string", "\"en\"" ],
[ "text", " " ],
[ "keyword", "(" ],
[ "support.function", "str" ],
[ "text", " " ],
[ "string", "\"Goodbye, \"" ],
[ "text", " " ],
[ "support.function", "name" ],
[ "keyword", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "string", "\"es\"" ],
[ "text", " " ],
[ "keyword", "(" ],
[ "support.function", "str" ],
[ "text", " " ],
[ "string", "\"Adios, \"" ],
[ "text", " " ],
[ "support.function", "name" ],
[ "keyword", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "(throw" ],
[ "text", " " ],
[ "keyword", "(" ],
[ "identifier", "IllegalArgumentException" ],
[ "text", "." ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "(" ],
[ "support.function", "str" ],
[ "text", " " ],
[ "string", "\"unsupported language \"" ],
[ "text", " " ],
[ "identifier", "language" ],
[ "keyword", "))))))" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "(" ],
[ "support.function", "println" ],
[ "text", " " ],
[ "keyword", "(" ],
[ "identifier", "parting" ],
[ "keyword", "))" ],
[ "text", " " ],
[ "comment", "; -> Goodbye, World" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "(" ],
[ "support.function", "println" ],
[ "text", " " ],
[ "keyword", "(" ],
[ "identifier", "parting" ],
[ "text", " " ],
[ "string", "\"Mark\"" ],
[ "keyword", "))" ],
[ "text", " " ],
[ "comment", "; -> Goodbye, Mark" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "(" ],
[ "support.function", "println" ],
[ "text", " " ],
[ "keyword", "(" ],
[ "identifier", "parting" ],
[ "text", " " ],
[ "string", "\"Mark\"" ],
[ "text", " " ],
[ "string", "\"es\"" ],
[ "keyword", "))" ],
[ "text", " " ],
[ "comment", "; -> Adios, Mark" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "(" ],
[ "support.function", "println" ],
[ "text", " " ],
[ "keyword", "(" ],
[ "identifier", "parting" ],
[ "text", " " ],
[ "string", "\"Mark\"" ],
[ "text", ", " ],
[ "string", "\"xy\"" ],
[ "keyword", "))" ],
[ "text", " " ],
[ "comment", "; -> java.lang.IllegalArgumentException: unsupported language xy" ]
]
}
]
[[
"start",
["keyword","("],
["support.function","defn"],
["text"," "],
["identifier","parting"]
],[
"start",
["text"," "],
["string","\"returns a String parting in a given language\""]
],[
"start",
["text"," "],
["keyword","([]"],
["text"," "],
["keyword","("],
["identifier","parting"],
["text"," "],
["string","\"World\""],
["keyword","))"]
],[
"start",
["text"," "],
["keyword","(["],
["support.function","name"],
["keyword","]"],
["text"," "],
["keyword","("],
["identifier","parting"],
["text"," "],
["support.function","name"],
["text"," "],
["string","\"en\""],
["keyword","))"]
],[
"start",
["text"," "],
["keyword","(["],
["support.function","name"],
["text"," "],
["identifier","language"],
["keyword","]"]
],[
"start",
["text"," "],
["comment","; condp is similar to a case statement in other languages."]
],[
"start",
["text"," "],
["comment","; It is described in more detail later."]
],[
"start",
["text"," "],
["comment","; It is used here to take different actions based on whether the"]
],[
"start",
["text"," "],
["comment","; parameter \"language\" is set to \"en\", \"es\" or something else."]
],[
"start",
["text"," "],
["keyword","("],
["support.function","condp"],
["text"," "],
["constant.language","="],
["text"," "],
["identifier","language"]
],[
"start",
["text"," "],
["string","\"en\""],
["text"," "],
["keyword","("],
["support.function","str"],
["text"," "],
["string","\"Goodbye, \""],
["text"," "],
["support.function","name"],
["keyword",")"]
],[
"start",
["text"," "],
["string","\"es\""],
["text"," "],
["keyword","("],
["support.function","str"],
["text"," "],
["string","\"Adios, \""],
["text"," "],
["support.function","name"],
["keyword",")"]
],[
"start",
["text"," "],
["keyword","(throw"],
["text"," "],
["keyword","("],
["identifier","IllegalArgumentException"],
["text","."]
],[
"start",
["text"," "],
["keyword","("],
["support.function","str"],
["text"," "],
["string","\"unsupported language \""],
["text"," "],
["identifier","language"],
["keyword","))))))"]
],[
"start"
],[
"start",
["keyword","("],
["support.function","println"],
["text"," "],
["keyword","("],
["identifier","parting"],
["keyword","))"],
["text"," "],
["comment","; -> Goodbye, World"]
],[
"start",
["keyword","("],
["support.function","println"],
["text"," "],
["keyword","("],
["identifier","parting"],
["text"," "],
["string","\"Mark\""],
["keyword","))"],
["text"," "],
["comment","; -> Goodbye, Mark"]
],[
"start",
["keyword","("],
["support.function","println"],
["text"," "],
["keyword","("],
["identifier","parting"],
["text"," "],
["string","\"Mark\""],
["text"," "],
["string","\"es\""],
["keyword","))"],
["text"," "],
["comment","; -> Adios, Mark"]
],[
"start",
["keyword","("],
["support.function","println"],
["text"," "],
["keyword","("],
["identifier","parting"],
["text"," "],
["string","\"Mark\""],
["text",", "],
["string","\"xy\""],
["keyword","))"],
["text"," "],
["comment","; -> java.lang.IllegalArgumentException: unsupported language xy"]
]]

View file

@ -1,190 +1,483 @@
[
{
"state": "start",
"data": [
[ "comment", "#!/usr/bin/env coffee" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "try" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "throw" ],
[ "text", " " ],
[ "language.support.class", "URIError" ],
[ "text", " " ],
[ "language.support.function", "decodeURI" ],
[ "paren.lparen", "(" ],
[ "constant.numeric", "0xC0ffee" ],
[ "text", " " ],
[ "keyword.operator", "*" ],
[ "text", " " ],
[ "constant.numeric", "123456.7e-8" ],
[ "text", " " ],
[ "keyword.operator", "/" ],
[ "text", " " ],
[ "constant.numeric", ".9" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "catch" ],
[ "text", " " ],
[ "identifier", "e" ]
]
},
{
"state": "qdoc",
"data": [
[ "text", " " ],
[ "identifier", "console" ],
[ "punctuation.operator", "." ],
[ "identifier", "log" ],
[ "text", " " ],
[ "string", "'qstring'" ],
[ "text", " " ],
[ "keyword.operator", "+" ],
[ "text", " " ],
[ "string", "\"qqstring\"" ],
[ "text", " " ],
[ "keyword.operator", "+" ],
[ "text", " " ],
[ "string", "'''" ]
]
},
{
"state": "qdoc",
"data": [
[ "string", " qdoc" ]
]
},
{
"state": "qqdoc",
"data": [
[ "string", " '''" ],
[ "text", " " ],
[ "keyword.operator", "+" ],
[ "text", " " ],
[ "string", "\"\"\"" ]
]
},
{
"state": "qqdoc",
"data": [
[ "string", " qqdoc" ]
]
},
{
"state": "start",
"data": [
[ "string", " \"\"\"" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "do" ],
[ "text", " " ],
[ "storage.type", "->" ]
]
},
{
"state": "comment",
"data": [
[ "text", " " ],
[ "comment", "###" ]
]
},
{
"state": "comment",
"data": [
[ "comment", " herecomment" ]
]
},
{
"state": "start",
"data": [
[ "comment", " ###" ]
]
},
{
"state": "heregex",
"data": [
[ "text", " " ],
[ "identifier", "re" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "string.regex", "/regex/imgy" ],
[ "punctuation.operator", "." ],
[ "identifier", "test" ],
[ "text", " " ],
[ "string.regex", "///" ]
]
},
{
"state": "heregex",
"data": [
[ "comment.regex", " " ],
[ "string.regex", "heregex" ],
[ "comment.regex", " # comment" ]
]
},
{
"state": "start",
"data": [
[ "string.regex", " ///imgy" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "this" ],
[ "text", " " ],
[ "keyword", "isnt" ],
[ "punctuation.operator", ":" ],
[ "text", " " ],
[ "string", "`just JavaScript`" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "constant.language", "undefined" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "identifier", "sentence" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "string", "\"#{ 22 / 7 } is a decent approximation of π\"" ]
]
}
]
[[
"start",
["comment","#test: tokenize keyword"]
],[
"start",
["text"," "],
["keyword","for"],
["text"," "],
["paren.lparen","("],
["identifier","i"],
["text"," "],
["constant.numeric","1"],
["punctuation.operator","."],
["constant.numeric",".2"],
["paren.rparen",")"]
],[
"start",
["comment","#test: tokenize regexp"]
],[
"start",
["string.regex","/\"[a]/"]
],[
"start",
["comment","#test: tokenize functions"]
],[
"start",
["entity.name.function","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","({"],
["variable.parameter","args"],
["paren.rparen","})"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["entity.name.function","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","({"],
["variable.parameter","a1, a2"],
["paren.rparen","})"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["entity.name.function","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","({"],
["variable.parameter","@a1, a2"],
["paren.rparen","})"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["entity.name.function","foo"],
["text"," "],
["punctuation.operator",":"],
["text"," "],
["paren.lparen","({"],
["variable.parameter","args"],
["paren.rparen","})"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["entity.name.function","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","({"],
["variable.parameter","args"],
["paren.rparen","})"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["identifier","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","({"],
["constant.numeric","0"],
["identifier","abc"],
["paren.rparen","})"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["identifier","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","({"],
["keyword.operator","/"],
["identifier","abc"],
["paren.rparen","})"],
["text"," "],
["storage.type","=>"]
],[
"start",
["text"," "],
["identifier","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","({"],
["identifier","abc"],
["keyword.operator","/"],
["paren.rparen","})"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["identifier","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","({"],
["comment","#abc}) ->"]
],[
"start",
["text"," "],
["identifier","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","({"],
["identifier","abc"],
["comment","#}) ->"]
],[
"start",
["text"," "],
["identifier","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","({"],
["paren.rparen",")"],
["identifier","abc"],
["paren.rparen","})"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["identifier","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","({"],
["identifier","abc"],
["paren.rparen",")})"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["identifier","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","({"],
["identifier","a"],
["paren.lparen","{"],
["identifier","bc"],
["paren.rparen","})"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["entity.name.function","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","({"],
["paren.rparen","})"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["entity.name.function","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","({"],
["text"," "],
["paren.rparen","})"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["entity.name.function","foo"],
["text"," "],
["punctuation.operator",":"],
["text"," "],
["paren.lparen","({"],
["paren.rparen","})"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["entity.name.function","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","("],
["variable.parameter","args"],
["paren.rparen",")"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["entity.name.function","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","("],
["variable.parameter","arg1, arg2"],
["paren.rparen",")"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["entity.name.function","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","("],
["variable.parameter","arg1 = 1, arg2 = 'name'"],
["paren.rparen",")"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["entity.name.function","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","("],
["variable.parameter","@arg1 = /abc/, arg2 = 'name'"],
["paren.rparen",")"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["comment","#test: tokenize function: invalid case:"]
],[
"start",
["text"," "],
["identifier","foo"],
["keyword.operator","="],
["paren.lparen","("],
["keyword.operator","/"],
["identifier","args"],
["paren.rparen",")"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["entity.name.function","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","("],
["paren.rparen",")"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["entity.name.function","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","("],
["text"," "],
["paren.rparen",")"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["entity.name.function","foo"],
["text"," "],
["punctuation.operator",":"],
["text"," "],
["paren.lparen","("],
["text"," "],
["paren.rparen",")"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["variable.language","window"],
["punctuation.operator","."],
["entity.name.function","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","("],
["variable.parameter","args"],
["paren.rparen",")"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["entity.name.function","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["entity.name.function","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["entity.name.function","foo"],
["text"," "],
["punctuation.operator",":"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["comment","#test: tokenize callback function"]
],[
"start",
["text"," "],
["identifier","foo"],
["text"," "],
["identifier","bar"],
["punctuation.operator",":"],
["text"," "],
["constant.numeric","1"],
["punctuation.operator",","],
["text"," "],
["paren.lparen","("],
["variable.parameter","args"],
["paren.rparen",")"],
["text"," "],
["storage.type","->"]
],[
"start",
["text"," "],
["identifier","foo"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","("],
["constant.numeric","1"],
["punctuation.operator",","],
["text"," "],
["constant.numeric","2"],
["text"," "],
["paren.lparen","("],
["variable.parameter","x"],
["paren.rparen",")"],
["text"," "],
["storage.type","->"]
],[
"start",
["comment","#test: tokenize class"]
],[
"start",
["keyword","class"],
["text"," "],
["language.support.class","Foo"]
],[
"start",
["keyword","class"],
["text"," "],
["language.support.class","Foo"],
["text"," "],
["keyword","extends"],
["text"," "],
["language.support.class","Bar"]
],[
"start",
["comment","#test: tokenize illegal name property"]
],[
"start",
["identifier","foo"],
["punctuation.operator","."],
["identifier","static"],
["punctuation.operator","."],
["identifier","function"]
],[
"start",
["comment","#!test tokenize string with interpolation"]
],[
"start",
["identifier","a"],
["text"," "],
["keyword.operator","="],
["text"," "],
["string","\"#{ 22 / 7 + {x: \""],
["comment","#{a + b}\"} + 2}\""]
],[
"qqdoc",
["string","\"\"\"heredoc"]
],[
"start",
["string"," \"\"\""]
],[
"start",
["keyword","do"],
["text"," "],
["storage.type","->"]
],[
"comment",
["text"," "],
["comment","###"]
],[
"comment",
["comment"," herecomment"]
],[
"start",
["comment"," ###"]
],[
"heregex",
["text"," "],
["identifier","re"],
["text"," "],
["keyword.operator","="],
["text"," "],
["string.regex","/regex/imgy"],
["punctuation.operator","."],
["identifier","test"],
["text"," "],
["string.regex","///"]
],[
"heregex",
["comment.regex"," "],
["string.regex","heregex"],
["comment.regex"," # comment"]
],[
"start",
["string.regex"," ///imgy"]
],[
"start",
["text"," "],
["keyword","this"],
["text"," "],
["keyword","isnt"],
["punctuation.operator",":"],
["text"," "],
["string","`just JavaScript`"]
],[
"start",
["text"," "],
["constant.language","undefined"]
],[
"start"
]]

View file

@ -1,40 +1,26 @@
[
{
"state": "start",
"data": [
[ "comment", "<!--- hello world --->" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "meta.tag", "<" ],
[ "meta.tag.tag-name", "cfset" ],
[ "text", " " ],
[ "entity.other.attribute-name", "welcome" ],
[ "keyword.operator", "=" ],
[ "string", "\"Hello World!\"" ],
[ "meta.tag.r", ">" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "meta.tag", "<" ],
[ "meta.tag.tag-name", "cfoutput" ],
[ "meta.tag.r", ">" ],
[ "text", "#welcome#" ],
[ "meta.tag", "</" ],
[ "meta.tag.tag-name", "cfoutput" ],
[ "meta.tag.r", ">" ]
]
}
]
[[
"start",
["comment","<!--- hello world --->"]
],[
"start"
],[
"start",
["meta.tag","<"],
["meta.tag.tag-name","cfset"],
["text"," "],
["entity.other.attribute-name","welcome"],
["keyword.operator","="],
["string","\"Hello World!\""],
["meta.tag.r",">"]
],[
"start"
],[
"start",
["meta.tag","<"],
["meta.tag.tag-name","cfoutput"],
["meta.tag.r",">"],
["text","#welcome#"],
["meta.tag","</"],
["meta.tag.tag-name","cfoutput"],
["meta.tag.r",">"]
]]

View file

@ -1,42 +1,29 @@
[
{
"state": "start",
"data": [
[ "keyword", "public" ],
[ "text", " " ],
[ "keyword", "void" ],
[ "text", " " ],
[ "identifier", "HelloWorld" ],
[ "paren.lparen", "(" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "//Say Hello!" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "Console" ],
[ "punctuation.operator", "." ],
[ "identifier", "WriteLine" ],
[ "paren.lparen", "(" ],
[ "string", "\"Hello World\"" ],
[ "paren.rparen", ")" ],
[ "punctuation.operator", ";" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
}
]
[[
"start",
["keyword","public"],
["text"," "],
["keyword","void"],
["text"," "],
["identifier","HelloWorld"],
["paren.lparen","("],
["paren.rparen",")"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text"," "],
["comment","//Say Hello!"]
],[
"start",
["text"," "],
["identifier","Console"],
["punctuation.operator","."],
["identifier","WriteLine"],
["paren.lparen","("],
["string","\"Hello World\""],
["paren.rparen",")"],
["punctuation.operator",";"]
],[
"start",
["paren.rparen","}"]
]]

View file

@ -1,231 +1,148 @@
[
{
"state": "ruleset",
"data": [
[ "variable", ".text-layer" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "ruleset",
"data": [
[ "text", " " ],
[ "support.type", "font-family" ],
[ "text", ": Monaco, " ],
[ "string", "\"Courier New\"" ],
[ "text", ", " ],
[ "support.constant.fonts", "monospace" ],
[ "text", ";" ]
]
},
{
"state": "ruleset",
"data": [
[ "text", " " ],
[ "support.type", "font-size" ],
[ "text", ": " ],
[ "constant.numeric", "12" ],
[ "keyword", "px" ],
[ "text", ";" ]
]
},
{
"state": "ruleset",
"data": [
[ "text", " " ],
[ "support.type", "cursor" ],
[ "text", ": " ],
[ "support.constant", "text" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "ruleset",
"data": [
[ "variable", ".blinker" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "ruleset",
"data": [
[ "text", " " ],
[ "support.type", "animation-duration" ],
[ "text", ": " ],
[ "constant.numeric", "1" ],
[ "keyword", "s" ],
[ "text", ";" ]
]
},
{
"state": "ruleset",
"data": [
[ "text", " " ],
[ "support.type", "animation-name" ],
[ "text", ": blink;" ]
]
},
{
"state": "ruleset",
"data": [
[ "text", " " ],
[ "support.type", "animation-iteration-count" ],
[ "text", ": infinite;" ]
]
},
{
"state": "ruleset",
"data": [
[ "text", " " ],
[ "support.type", "animation-direction" ],
[ "text", ": alternate;" ]
]
},
{
"state": "ruleset",
"data": [
[ "text", " " ],
[ "support.type", "animation-timing-function" ],
[ "text", ": " ],
[ "support.constant", "linear" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "media",
"data": [
[ "string", "@keyframes blink {" ]
]
},
{
"state": "media_ruleset",
"data": [
[ "text", " " ],
[ "constant", "0" ],
[ "text", "% " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "media_ruleset",
"data": [
[ "text", " " ],
[ "support.type", "opacity" ],
[ "text", ": " ],
[ "constant.numeric", "0" ],
[ "text", ";" ]
]
},
{
"state": "media",
"data": [
[ "text", " " ],
[ "paren.rparen", "}" ]
]
},
{
"state": "media_ruleset",
"data": [
[ "text", " " ],
[ "constant", "40" ],
[ "text", "% " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "media_ruleset",
"data": [
[ "text", " " ],
[ "support.type", "opacity" ],
[ "text", ": " ],
[ "constant.numeric", "0" ],
[ "text", ";" ]
]
},
{
"state": "media",
"data": [
[ "text", " " ],
[ "paren.rparen", "}" ]
]
},
{
"state": "media_ruleset",
"data": [
[ "text", " " ],
[ "constant", "40" ],
[ "variable", ".5" ],
[ "text", "% " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "media_ruleset",
"data": [
[ "text", " " ],
[ "support.type", "opacity" ],
[ "text", ": " ],
[ "constant.numeric", "1" ]
]
},
{
"state": "media",
"data": [
[ "text", " " ],
[ "paren.rparen", "}" ]
]
},
{
"state": "media_ruleset",
"data": [
[ "text", " " ],
[ "constant", "100" ],
[ "text", "% " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "media_ruleset",
"data": [
[ "text", " " ],
[ "support.type", "opacity" ],
[ "text", ": " ],
[ "constant.numeric", "1" ]
]
},
{
"state": "media",
"data": [
[ "text", " " ],
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "string", "}" ]
]
}
]
[[
"ruleset",
["variable",".text-layer"],
["text"," "],
["paren.lparen","{"]
],[
"ruleset",
["text"," "],
["support.type","font-family"],
["text",": Monaco, "],
["string","\"Courier New\""],
["text",", "],
["support.constant.fonts","monospace"],
["text",";"]
],[
"ruleset",
["text"," "],
["support.type","font-size"],
["text",": "],
["constant.numeric","12"],
["keyword","px"],
["text",";"]
],[
"ruleset",
["text"," "],
["support.type","cursor"],
["text",": "],
["support.constant","text"],
["text",";"]
],[
"start",
["paren.rparen","}"]
],[
"start"
],[
"ruleset",
["variable",".blinker"],
["text"," "],
["paren.lparen","{"]
],[
"ruleset",
["text"," "],
["support.type","animation-duration"],
["text",": "],
["constant.numeric","1"],
["keyword","s"],
["text",";"]
],[
"ruleset",
["text"," "],
["support.type","animation-name"],
["text",": blink;"]
],[
"ruleset",
["text"," "],
["support.type","animation-iteration-count"],
["text",": infinite;"]
],[
"ruleset",
["text"," "],
["support.type","animation-direction"],
["text",": alternate;"]
],[
"ruleset",
["text"," "],
["support.type","animation-timing-function"],
["text",": "],
["support.constant","linear"],
["text",";"]
],[
"start",
["paren.rparen","}"]
],[
"start"
],[
"media",
["string","@keyframes blink {"]
],[
"media_ruleset",
["text"," "],
["constant","0"],
["text","% "],
["paren.lparen","{"]
],[
"media_ruleset",
["text"," "],
["support.type","opacity"],
["text",": "],
["constant.numeric","0"],
["text",";"]
],[
"media",
["text"," "],
["paren.rparen","}"]
],[
"media_ruleset",
["text"," "],
["constant","40"],
["text","% "],
["paren.lparen","{"]
],[
"media_ruleset",
["text"," "],
["support.type","opacity"],
["text",": "],
["constant.numeric","0"],
["text",";"]
],[
"media",
["text"," "],
["paren.rparen","}"]
],[
"media_ruleset",
["text"," "],
["constant","40"],
["variable",".5"],
["text","% "],
["paren.lparen","{"]
],[
"media_ruleset",
["text"," "],
["support.type","opacity"],
["text",": "],
["constant.numeric","1"]
],[
"media",
["text"," "],
["paren.rparen","}"]
],[
"media_ruleset",
["text"," "],
["constant","100"],
["text","% "],
["paren.lparen","{"]
],[
"media_ruleset",
["text"," "],
["support.type","opacity"],
["text",": "],
["constant.numeric","1"]
],[
"media",
["text"," "],
["paren.rparen","}"]
],[
"start",
["string","}"]
]]

View file

@ -0,0 +1,107 @@
[[
"start",
["meta.tag","<"],
["meta.tag.tag-name","html"],
["meta.tag.r",">"]
],[
"start",
["text"," "],
["meta.tag","<"],
["meta.tag.tag-name","head"],
["meta.tag.r",">"]
],[
"start"
],[
"css-start",
["text"," "],
["meta.tag","<"],
["meta.tag.tag-name.style","style"],
["text"," "],
["entity.other.attribute-name","type"],
["keyword.operator","="],
["string","\"text/css\""],
["meta.tag.r",">"]
],[
"css-ruleset",
["text"," "],
["variable",".text-layer"],
["text"," "],
["paren.lparen","{"]
],[
"css-ruleset",
["text"," "],
["support.type","font-family"],
["text",": Monaco, "],
["string","\"Courier New\""],
["text",", "],
["support.constant.fonts","monospace"],
["text",";"]
],[
"css-ruleset",
["text"," "],
["support.type","font-size"],
["text",": "],
["constant.numeric","12"],
["keyword","px"],
["text",";"]
],[
"css-ruleset",
["text"," "],
["support.type","cursor"],
["text",": "],
["support.constant","text"],
["text",";"]
],[
"css-start",
["text"," "],
["paren.rparen","}"]
],[
"start",
["text"," "],
["meta.tag","</"],
["meta.tag.tag-name.style","style"],
["meta.tag.r",">"]
],[
"start"
],[
"start",
["text"," "],
["meta.tag","</"],
["meta.tag.tag-name","head"],
["meta.tag.r",">"]
],[
"start",
["text"," "],
["meta.tag","<"],
["meta.tag.tag-name","body"],
["meta.tag.r",">"]
],[
"start",
["text"," "],
["meta.tag","<"],
["meta.tag.tag-name","h1"],
["text"," "],
["entity.other.attribute-name","style"],
["keyword.operator","="],
["string","\"color:red\""],
["meta.tag.r",">"],
["variable","{{"],
["text","author_name"],
["variable","}}"],
["meta.tag","</"],
["meta.tag.tag-name","h1"],
["meta.tag.r",">"]
],[
"start",
["text"," "],
["meta.tag","</"],
["meta.tag.tag-name","body"],
["meta.tag.r",">"]
],[
"start",
["meta.tag","</"],
["meta.tag.tag-name","html"],
["meta.tag.r",">"]
],[
"start"
]]

View file

@ -1,537 +1,368 @@
[
{
"state": "start",
"data": [
[ "identifier", "main" ],
[ "text", "() {" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "print" ],
[ "text", "(" ],
[ "string", "'Hello World!'" ],
[ "text", ");" ]
]
},
{
"state": "start",
"data": [
[ "text", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "storage.type.primitive.dart", "int" ],
[ "text", " " ],
[ "identifier", "fib" ],
[ "text", "(" ],
[ "storage.type.primitive.dart", "int" ],
[ "text", " " ],
[ "identifier", "n" ],
[ "text", ") " ],
[ "keyword.operator.assignment.dart", "=" ],
[ "keyword.operator.comparison.dart", ">" ],
[ "text", " (" ],
[ "identifier", "n" ],
[ "text", " " ],
[ "keyword.operator.comparison.dart", ">" ],
[ "text", " " ],
[ "constant.numeric", "1" ],
[ "text", ") " ],
[ "keyword.control.ternary.dart", "?" ],
[ "text", " (" ],
[ "identifier", "fib" ],
[ "text", "(" ],
[ "identifier", "n" ],
[ "text", " " ],
[ "keyword.operator.arithmetic.dart", "-" ],
[ "text", " " ],
[ "constant.numeric", "1" ],
[ "text", ") " ],
[ "keyword.operator.arithmetic.dart", "+" ],
[ "text", " " ],
[ "identifier", "fib" ],
[ "text", "(" ],
[ "identifier", "n" ],
[ "text", " " ],
[ "keyword.operator.arithmetic.dart", "-" ],
[ "text", " " ],
[ "constant.numeric", "2" ],
[ "text", ")) " ],
[ "keyword.control.ternary.dart", ":" ],
[ "text", " " ],
[ "identifier", "n" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "identifier", "main" ],
[ "text", "() {" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "print" ],
[ "text", "(" ],
[ "string", "'fib(20) = ${fib(20)}'" ],
[ "text", ");" ]
]
},
{
"state": "start",
"data": [
[ "text", "}" ]
]
},
{
"state": "comment",
"data": [
[ "comment", "/*asd" ]
]
},
{
"state": "comment",
"data": [
[ "comment", "asdad" ]
]
},
{
"state": "start",
"data": [
[ "comment", "*/" ]
]
},
{
"state": "start",
"data": [
[ "constant.numeric", "0.67" ]
]
},
{
"state": "start",
"data": [
[ "constant.numeric", "77" ]
]
},
{
"state": "start",
"data": [
[ "text", "." ],
[ "constant.numeric", "86" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword.other.import.dart", "#import" ],
[ "text", "(" ],
[ "string", "\"http://dartwatch.com/myOtherLibrary.dart\"" ],
[ "text", ");" ]
]
},
{
"state": "start",
"data": [
[ "keyword.other.import.dart", "#import" ],
[ "text", "(" ],
[ "string", "\"myOtherLibrary.dart\"" ],
[ "text", ", " ],
[ "keyword.other.import.dart", "prefix" ],
[ "text", ":" ],
[ "string", "\"lib1\"" ],
[ "text", ");" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "qqdoc",
"data": [
[ "string", "\"\"\"asdasdads" ]
]
},
{
"state": "qqdoc",
"data": [
[ "string", "asdadsadsasd" ]
]
},
{
"state": "start",
"data": [
[ "string", "asdasdasdad\"\"\"" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "string", "'23424'" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "constant.numeric", "0x234" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "identifier", "foo" ],
[ "text", " " ],
[ "keyword.operator.dart", "is" ],
[ "text", " " ],
[ "identifier", "bar" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "storage.type.primitive.dart", "int" ],
[ "text", " " ],
[ "identifier", "x" ],
[ "text", " " ],
[ "keyword.operator.assignment.dart", "=" ],
[ "text", " " ],
[ "constant.numeric", "4" ],
[ "text", " " ],
[ "keyword.operator.bitwise.dart", "<<" ],
[ "text", " " ],
[ "constant.numeric", "10" ],
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "comment", "// Create a class for Point." ]
]
},
{
"state": "start",
"data": [
[ "keyword.declaration.dart", "class" ],
[ "text", " " ],
[ "identifier", "Point" ],
[ "text", " {" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "// Final variables cannot be changed once they are assigned." ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "// Create two instance variables." ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "storage.modifier.dart", "final" ],
[ "text", " " ],
[ "storage.type.primitive.dart", "num" ],
[ "text", " " ],
[ "identifier", "x" ],
[ "text", ", " ],
[ "identifier", "y" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "// A constructor, with syntactic sugar for setting instance variables." ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "Point" ],
[ "text", "(" ],
[ "variable.language.dart", "this" ],
[ "text", "." ],
[ "identifier", "x" ],
[ "text", ", " ],
[ "variable.language.dart", "this" ],
[ "text", "." ],
[ "identifier", "y" ],
[ "text", ");" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "// A named constructor with an initializer list." ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "Point" ],
[ "text", "." ],
[ "identifier", "origin" ],
[ "text", "() " ],
[ "keyword.control.ternary.dart", ":" ],
[ "text", " " ],
[ "identifier", "x" ],
[ "text", " " ],
[ "keyword.operator.assignment.dart", "=" ],
[ "text", " " ],
[ "constant.numeric", "0" ],
[ "text", ", " ],
[ "identifier", "y" ],
[ "text", " " ],
[ "keyword.operator.assignment.dart", "=" ],
[ "text", " " ],
[ "constant.numeric", "0" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "// A method." ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "storage.type.primitive.dart", "num" ],
[ "text", " " ],
[ "identifier", "distanceTo" ],
[ "text", "(" ],
[ "identifier", "Point" ],
[ "text", " " ],
[ "identifier", "other" ],
[ "text", ") {" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "storage.type.primitive.dart", "var" ],
[ "text", " " ],
[ "identifier", "dx" ],
[ "text", " " ],
[ "keyword.operator.assignment.dart", "=" ],
[ "text", " " ],
[ "identifier", "x" ],
[ "text", " " ],
[ "keyword.operator.arithmetic.dart", "-" ],
[ "text", " " ],
[ "identifier", "other" ],
[ "text", "." ],
[ "identifier", "x" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "storage.type.primitive.dart", "var" ],
[ "text", " " ],
[ "identifier", "dy" ],
[ "text", " " ],
[ "keyword.operator.assignment.dart", "=" ],
[ "text", " " ],
[ "identifier", "y" ],
[ "text", " " ],
[ "keyword.operator.arithmetic.dart", "-" ],
[ "text", " " ],
[ "identifier", "other" ],
[ "text", "." ],
[ "identifier", "y" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword.control.dart", "return" ],
[ "text", " " ],
[ "identifier", "sqrt" ],
[ "text", "(" ],
[ "identifier", "dx" ],
[ "text", " " ],
[ "keyword.operator.arithmetic.dart", "*" ],
[ "text", " " ],
[ "identifier", "dx" ],
[ "text", " " ],
[ "keyword.operator.arithmetic.dart", "+" ],
[ "text", " " ],
[ "identifier", "dy" ],
[ "text", " " ],
[ "keyword.operator.arithmetic.dart", "*" ],
[ "text", " " ],
[ "identifier", "dy" ],
[ "text", ");" ]
]
},
{
"state": "start",
"data": [
[ "text", " }" ]
]
},
{
"state": "start",
"data": [
[ "text", "}" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "// Check for null." ]
]
},
{
"state": "start",
"data": [
[ "storage.type.primitive.dart", "var" ],
[ "text", " " ],
[ "identifier", "unicorn" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "identifier", "assert" ],
[ "text", "(" ],
[ "identifier", "unicorn" ],
[ "text", " " ],
[ "keyword.operator.comparison.dart", "==" ],
[ "text", " " ],
[ "constant.language.dart", "null" ],
[ "text", ");" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "comment", "// Check for NaN." ]
]
},
{
"state": "start",
"data": [
[ "storage.type.primitive.dart", "var" ],
[ "text", " " ],
[ "identifier", "iMeantToDoThis" ],
[ "text", " " ],
[ "keyword.operator.assignment.dart", "=" ],
[ "text", " " ],
[ "constant.numeric", "0" ],
[ "keyword.operator.arithmetic.dart", "/" ],
[ "constant.numeric", "0" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "identifier", "assert" ],
[ "text", "(" ],
[ "identifier", "iMeantToDoThis" ],
[ "text", "." ],
[ "identifier", "isNaN" ],
[ "text", "());" ]
]
},
{
"state": "start",
"data": []
}
]
[[
"start",
["identifier","main"],
["text","() {"]
],[
"start",
["text"," "],
["identifier","print"],
["text","("],
["string","'Hello World!'"],
["text",");"]
],[
"start",
["text","}"]
],[
"start"
],[
"start"
],[
"start",
["storage.type.primitive.dart","int"],
["text"," "],
["identifier","fib"],
["text","("],
["storage.type.primitive.dart","int"],
["text"," "],
["identifier","n"],
["text",") "],
["keyword.operator.assignment.dart","="],
["keyword.operator.comparison.dart",">"],
["text"," ("],
["identifier","n"],
["text"," "],
["keyword.operator.comparison.dart",">"],
["text"," "],
["constant.numeric","1"],
["text",") "],
["keyword.control.ternary.dart","?"],
["text"," ("],
["identifier","fib"],
["text","("],
["identifier","n"],
["text"," "],
["keyword.operator.arithmetic.dart","-"],
["text"," "],
["constant.numeric","1"],
["text",") "],
["keyword.operator.arithmetic.dart","+"],
["text"," "],
["identifier","fib"],
["text","("],
["identifier","n"],
["text"," "],
["keyword.operator.arithmetic.dart","-"],
["text"," "],
["constant.numeric","2"],
["text",")) "],
["keyword.control.ternary.dart",":"],
["text"," "],
["identifier","n"],
["text",";"]
],[
"start",
["identifier","main"],
["text","() {"]
],[
"start",
["text"," "],
["identifier","print"],
["text","("],
["string","'fib(20) = ${fib(20)}'"],
["text",");"]
],[
"start",
["text","}"]
],[
"comment",
["comment","/*asd"]
],[
"comment",
["comment","asdad"]
],[
"start",
["comment","*/"]
],[
"start",
["constant.numeric","0.67"]
],[
"start",
["constant.numeric","77"]
],[
"start",
["text","."],
["constant.numeric","86"]
],[
"start"
],[
"start",
["keyword.other.import.dart","#import"],
["text","("],
["string","\"http://dartwatch.com/myOtherLibrary.dart\""],
["text",");"]
],[
"start",
["keyword.other.import.dart","#import"],
["text","("],
["string","\"myOtherLibrary.dart\""],
["text",", "],
["keyword.other.import.dart","prefix"],
["text",":"],
["string","\"lib1\""],
["text",");"]
],[
"start"
],[
"qqdoc",
["string","\"\"\"asdasdads"]
],[
"qqdoc",
["string","asdadsadsasd"]
],[
"start",
["string","asdasdasdad\"\"\""]
],[
"start",
["text"," "]
],[
"start",
["string","'23424'"]
],[
"start"
],[
"start",
["constant.numeric","0x234"]
],[
"start"
],[
"start",
["identifier","foo"],
["text"," "],
["keyword.operator.dart","is"],
["text"," "],
["identifier","bar"]
],[
"start"
],[
"start",
["storage.type.primitive.dart","int"],
["text"," "],
["identifier","x"],
["text"," "],
["keyword.operator.assignment.dart","="],
["text"," "],
["constant.numeric","4"],
["text"," "],
["keyword.operator.bitwise.dart","<<"],
["text"," "],
["constant.numeric","10"],
["text"," "]
],[
"start",
["comment","// Create a class for Point."]
],[
"start",
["keyword.declaration.dart","class"],
["text"," "],
["identifier","Point"],
["text"," {"]
],[
"start",
["text"," "]
],[
"start",
["text"," "],
["comment","// Final variables cannot be changed once they are assigned."]
],[
"start",
["text"," "],
["comment","// Create two instance variables."]
],[
"start",
["text"," "],
["storage.modifier.dart","final"],
["text"," "],
["storage.type.primitive.dart","num"],
["text"," "],
["identifier","x"],
["text",", "],
["identifier","y"],
["text",";"]
],[
"start",
["text"," "]
],[
"start",
["text"," "],
["comment","// A constructor, with syntactic sugar for setting instance variables."]
],[
"start",
["text"," "],
["identifier","Point"],
["text","("],
["variable.language.dart","this"],
["text","."],
["identifier","x"],
["text",", "],
["variable.language.dart","this"],
["text","."],
["identifier","y"],
["text",");"]
],[
"start",
["text"," "]
],[
"start",
["text"," "],
["comment","// A named constructor with an initializer list."]
],[
"start",
["text"," "],
["identifier","Point"],
["text","."],
["identifier","origin"],
["text","() "],
["keyword.control.ternary.dart",":"],
["text"," "],
["identifier","x"],
["text"," "],
["keyword.operator.assignment.dart","="],
["text"," "],
["constant.numeric","0"],
["text",", "],
["identifier","y"],
["text"," "],
["keyword.operator.assignment.dart","="],
["text"," "],
["constant.numeric","0"],
["text",";"]
],[
"start",
["text"," "]
],[
"start",
["text"," "],
["comment","// A method."]
],[
"start",
["text"," "],
["storage.type.primitive.dart","num"],
["text"," "],
["identifier","distanceTo"],
["text","("],
["identifier","Point"],
["text"," "],
["identifier","other"],
["text",") {"]
],[
"start",
["text"," "],
["storage.type.primitive.dart","var"],
["text"," "],
["identifier","dx"],
["text"," "],
["keyword.operator.assignment.dart","="],
["text"," "],
["identifier","x"],
["text"," "],
["keyword.operator.arithmetic.dart","-"],
["text"," "],
["identifier","other"],
["text","."],
["identifier","x"],
["text",";"]
],[
"start",
["text"," "],
["storage.type.primitive.dart","var"],
["text"," "],
["identifier","dy"],
["text"," "],
["keyword.operator.assignment.dart","="],
["text"," "],
["identifier","y"],
["text"," "],
["keyword.operator.arithmetic.dart","-"],
["text"," "],
["identifier","other"],
["text","."],
["identifier","y"],
["text",";"]
],[
"start",
["text"," "],
["keyword.control.dart","return"],
["text"," "],
["identifier","sqrt"],
["text","("],
["identifier","dx"],
["text"," "],
["keyword.operator.arithmetic.dart","*"],
["text"," "],
["identifier","dx"],
["text"," "],
["keyword.operator.arithmetic.dart","+"],
["text"," "],
["identifier","dy"],
["text"," "],
["keyword.operator.arithmetic.dart","*"],
["text"," "],
["identifier","dy"],
["text",");"]
],[
"start",
["text"," }"]
],[
"start",
["text","}"]
],[
"start",
["text"," "]
],[
"start",
["text"," "],
["comment","// Check for null."]
],[
"start",
["storage.type.primitive.dart","var"],
["text"," "],
["identifier","unicorn"],
["text",";"]
],[
"start",
["identifier","assert"],
["text","("],
["identifier","unicorn"],
["text"," "],
["keyword.operator.comparison.dart","=="],
["text"," "],
["constant.language.dart","null"],
["text",");"]
],[
"start"
],[
"start",
["comment","// Check for NaN."]
],[
"start",
["storage.type.primitive.dart","var"],
["text"," "],
["identifier","iMeantToDoThis"],
["text"," "],
["keyword.operator.assignment.dart","="],
["text"," "],
["constant.numeric","0"],
["keyword.operator.arithmetic.dart","/"],
["constant.numeric","0"],
["text",";"]
],[
"start",
["identifier","assert"],
["text","("],
["identifier","iMeantToDoThis"],
["text","."],
["identifier","isNaN"],
["text","());"]
],[
"start"
]]

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,185 +1,127 @@
[
{
"state": "start",
"data": [
[ "keyword", "uniform" ],
[ "text", " " ],
[ "keyword", "float" ],
[ "text", " " ],
[ "identifier", "amplitude" ],
[ "punctuation.operator", ";" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "attribute" ],
[ "text", " " ],
[ "keyword", "float" ],
[ "text", " " ],
[ "identifier", "displacement" ],
[ "punctuation.operator", ";" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "varying" ],
[ "text", " " ],
[ "keyword", "vec3" ],
[ "text", " " ],
[ "identifier", "vNormal" ],
[ "punctuation.operator", ";" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "void" ],
[ "text", " " ],
[ "identifier", "main" ],
[ "paren.lparen", "(" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "vNormal" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "identifier", "normal" ],
[ "punctuation.operator", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "// multiply our displacement by the" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "// amplitude. The amp will get animated" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "// so we'll have animated displacement" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "vec3" ],
[ "text", " " ],
[ "identifier", "newPosition" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "identifier", "position" ],
[ "text", " " ],
[ "keyword.operator", "+" ],
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "normal" ],
[ "text", " " ],
[ "keyword.operator", "*" ],
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "vec3" ],
[ "paren.lparen", "(" ],
[ "identifier", "displacement" ],
[ "text", " " ],
[ "keyword.operator", "*" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "amplitude" ],
[ "paren.rparen", ")" ],
[ "punctuation.operator", ";" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "constant.language", "gl_Position" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "identifier", "projectionMatrix" ],
[ "text", " " ],
[ "keyword.operator", "*" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "modelViewMatrix" ],
[ "text", " " ],
[ "keyword.operator", "*" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "vec4" ],
[ "paren.lparen", "(" ],
[ "identifier", "newPosition" ],
[ "punctuation.operator", "," ],
[ "constant.numeric", "1.0" ],
[ "paren.rparen", ")" ],
[ "punctuation.operator", ";" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
}
]
[[
"start",
["keyword","uniform"],
["text"," "],
["keyword","float"],
["text"," "],
["identifier","amplitude"],
["punctuation.operator",";"]
],[
"start",
["keyword","attribute"],
["text"," "],
["keyword","float"],
["text"," "],
["identifier","displacement"],
["punctuation.operator",";"]
],[
"start",
["keyword","varying"],
["text"," "],
["keyword","vec3"],
["text"," "],
["identifier","vNormal"],
["punctuation.operator",";"]
],[
"start"
],[
"start",
["keyword","void"],
["text"," "],
["identifier","main"],
["paren.lparen","("],
["paren.rparen",")"],
["text"," "],
["paren.lparen","{"]
],[
"start"
],[
"start",
["text"," "],
["identifier","vNormal"],
["text"," "],
["keyword.operator","="],
["text"," "],
["identifier","normal"],
["punctuation.operator",";"]
],[
"start",
["text"," "]
],[
"start",
["text"," "],
["comment","// multiply our displacement by the"]
],[
"start",
["text"," "],
["comment","// amplitude. The amp will get animated"]
],[
"start",
["text"," "],
["comment","// so we'll have animated displacement"]
],[
"start",
["text"," "],
["keyword","vec3"],
["text"," "],
["identifier","newPosition"],
["text"," "],
["keyword.operator","="],
["text"," "],
["identifier","position"],
["text"," "],
["keyword.operator","+"],
["text"," "]
],[
"start",
["text"," "],
["identifier","normal"],
["text"," "],
["keyword.operator","*"],
["text"," "]
],[
"start",
["text"," "],
["keyword","vec3"],
["paren.lparen","("],
["identifier","displacement"],
["text"," "],
["keyword.operator","*"]
],[
"start",
["text"," "],
["identifier","amplitude"],
["paren.rparen",")"],
["punctuation.operator",";"]
],[
"start"
],[
"start",
["text"," "],
["constant.language","gl_Position"],
["text"," "],
["keyword.operator","="],
["text"," "],
["identifier","projectionMatrix"],
["text"," "],
["keyword.operator","*"]
],[
"start",
["text"," "],
["identifier","modelViewMatrix"],
["text"," "],
["keyword.operator","*"]
],[
"start",
["text"," "],
["keyword","vec4"],
["paren.lparen","("],
["identifier","newPosition"],
["punctuation.operator",","],
["constant.numeric","1.0"],
["paren.rparen",")"],
["punctuation.operator",";"]
],[
"start",
["paren.rparen","}"]
]]

View file

@ -1,357 +1,256 @@
[
{
"state": "start",
"data": [
[ "comment", "// Concurrent computation of pi." ]
]
},
{
"state": "start",
"data": [
[ "comment", "// See http://goo.gl/ZuTZM." ]
]
},
{
"state": "start",
"data": [
[ "comment", "//" ]
]
},
{
"state": "start",
"data": [
[ "comment", "// This demonstrates Go's ability to handle" ]
]
},
{
"state": "start",
"data": [
[ "comment", "// large numbers of concurrent processes." ]
]
},
{
"state": "start",
"data": [
[ "comment", "// It is an unreasonable way to calculate pi." ]
]
},
{
"state": "start",
"data": [
[ "keyword", "package" ],
[ "text", " " ],
[ "identifier", "main" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "import" ],
[ "text", " " ],
[ "paren.lparen", "(" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "string", "\"fmt\"" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "string", "\"math\"" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "func" ],
[ "text", " " ],
[ "identifier", "main" ],
[ "paren.lparen", "(" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "fmt" ],
[ "punctuation.operator", "." ],
[ "identifier", "Println" ],
[ "paren.lparen", "(" ],
[ "identifier", "pi" ],
[ "paren.lparen", "(" ],
[ "constant.numeric", "5000" ],
[ "paren.rparen", "))" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "comment", "// pi launches n goroutines to compute an" ]
]
},
{
"state": "start",
"data": [
[ "comment", "// approximation of pi." ]
]
},
{
"state": "start",
"data": [
[ "keyword", "func" ],
[ "text", " " ],
[ "identifier", "pi" ],
[ "paren.lparen", "(" ],
[ "identifier", "n" ],
[ "text", " " ],
[ "identifier", "int" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "identifier", "float64" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "ch" ],
[ "text", " " ],
[ "punctuation.operator", ":" ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "identifier", "make" ],
[ "paren.lparen", "(" ],
[ "keyword", "chan" ],
[ "text", " " ],
[ "identifier", "float64" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "for" ],
[ "text", " " ],
[ "identifier", "k" ],
[ "text", " " ],
[ "punctuation.operator", ":" ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "constant.numeric", "0" ],
[ "punctuation.operator", ";" ],
[ "text", " " ],
[ "identifier", "k" ],
[ "text", " " ],
[ "keyword.operator", "<=" ],
[ "text", " " ],
[ "identifier", "n" ],
[ "punctuation.operator", ";" ],
[ "text", " " ],
[ "identifier", "k" ],
[ "keyword.operator", "++" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "go" ],
[ "text", " " ],
[ "identifier", "term" ],
[ "paren.lparen", "(" ],
[ "identifier", "ch" ],
[ "punctuation.operator", "," ],
[ "text", " " ],
[ "identifier", "float64" ],
[ "paren.lparen", "(" ],
[ "identifier", "k" ],
[ "paren.rparen", "))" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "f" ],
[ "text", " " ],
[ "punctuation.operator", ":" ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "constant.numeric", "0.0" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "for" ],
[ "text", " " ],
[ "identifier", "k" ],
[ "text", " " ],
[ "punctuation.operator", ":" ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "constant.numeric", "0" ],
[ "punctuation.operator", ";" ],
[ "text", " " ],
[ "identifier", "k" ],
[ "text", " " ],
[ "keyword.operator", "<=" ],
[ "text", " " ],
[ "identifier", "n" ],
[ "punctuation.operator", ";" ],
[ "text", " " ],
[ "identifier", "k" ],
[ "keyword.operator", "++" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "f" ],
[ "text", " " ],
[ "keyword.operator", "+=" ],
[ "text", " " ],
[ "keyword.operator", "<-" ],
[ "identifier", "ch" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "return" ],
[ "text", " " ],
[ "identifier", "f" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "func" ],
[ "text", " " ],
[ "identifier", "term" ],
[ "paren.lparen", "(" ],
[ "identifier", "ch" ],
[ "text", " " ],
[ "keyword", "chan" ],
[ "text", " " ],
[ "identifier", "float64" ],
[ "punctuation.operator", "," ],
[ "text", " " ],
[ "identifier", "k" ],
[ "text", " " ],
[ "identifier", "float64" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "ch" ],
[ "text", " " ],
[ "keyword.operator", "<-" ],
[ "text", " " ],
[ "constant.numeric", "4" ],
[ "text", " " ],
[ "keyword.operator", "*" ],
[ "text", " " ],
[ "identifier", "math" ],
[ "punctuation.operator", "." ],
[ "identifier", "Pow" ],
[ "paren.lparen", "(" ],
[ "constant.numeric", "-1" ],
[ "punctuation.operator", "," ],
[ "text", " " ],
[ "identifier", "k" ],
[ "paren.rparen", ")" ],
[ "text", " / " ],
[ "paren.lparen", "(" ],
[ "constant.numeric", "2" ],
[ "keyword.operator", "*" ],
[ "identifier", "k" ],
[ "text", " " ],
[ "keyword.operator", "+" ],
[ "text", " " ],
[ "constant.numeric", "1" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": []
}
]
[[
"start",
["comment","// Concurrent computation of pi."]
],[
"start",
["comment","// See http://goo.gl/ZuTZM."]
],[
"start",
["comment","//"]
],[
"start",
["comment","// This demonstrates Go's ability to handle"]
],[
"start",
["comment","// large numbers of concurrent processes."]
],[
"start",
["comment","// It is an unreasonable way to calculate pi."]
],[
"start",
["keyword","package"],
["text"," "],
["identifier","main"]
],[
"start"
],[
"start",
["keyword","import"],
["text"," "],
["paren.lparen","("]
],[
"start",
["text"," "],
["string","\"fmt\""]
],[
"start",
["text"," "],
["string","\"math\""]
],[
"start",
["paren.rparen",")"]
],[
"start"
],[
"start",
["keyword","func"],
["text"," "],
["identifier","main"],
["paren.lparen","("],
["paren.rparen",")"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text"," "],
["identifier","fmt"],
["punctuation.operator","."],
["identifier","Println"],
["paren.lparen","("],
["identifier","pi"],
["paren.lparen","("],
["constant.numeric","5000"],
["paren.rparen","))"]
],[
"start",
["paren.rparen","}"]
],[
"start"
],[
"start",
["comment","// pi launches n goroutines to compute an"]
],[
"start",
["comment","// approximation of pi."]
],[
"start",
["keyword","func"],
["text"," "],
["identifier","pi"],
["paren.lparen","("],
["identifier","n"],
["text"," "],
["identifier","int"],
["paren.rparen",")"],
["text"," "],
["identifier","float64"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text"," "],
["identifier","ch"],
["text"," "],
["punctuation.operator",":"],
["keyword.operator","="],
["text"," "],
["identifier","make"],
["paren.lparen","("],
["keyword","chan"],
["text"," "],
["identifier","float64"],
["paren.rparen",")"]
],[
"start",
["text"," "],
["keyword","for"],
["text"," "],
["identifier","k"],
["text"," "],
["punctuation.operator",":"],
["keyword.operator","="],
["text"," "],
["constant.numeric","0"],
["punctuation.operator",";"],
["text"," "],
["identifier","k"],
["text"," "],
["keyword.operator","<="],
["text"," "],
["identifier","n"],
["punctuation.operator",";"],
["text"," "],
["identifier","k"],
["keyword.operator","++"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text"," "],
["keyword","go"],
["text"," "],
["identifier","term"],
["paren.lparen","("],
["identifier","ch"],
["punctuation.operator",","],
["text"," "],
["identifier","float64"],
["paren.lparen","("],
["identifier","k"],
["paren.rparen","))"]
],[
"start",
["text"," "],
["paren.rparen","}"]
],[
"start",
["text"," "],
["identifier","f"],
["text"," "],
["punctuation.operator",":"],
["keyword.operator","="],
["text"," "],
["constant.numeric","0.0"]
],[
"start",
["text"," "],
["keyword","for"],
["text"," "],
["identifier","k"],
["text"," "],
["punctuation.operator",":"],
["keyword.operator","="],
["text"," "],
["constant.numeric","0"],
["punctuation.operator",";"],
["text"," "],
["identifier","k"],
["text"," "],
["keyword.operator","<="],
["text"," "],
["identifier","n"],
["punctuation.operator",";"],
["text"," "],
["identifier","k"],
["keyword.operator","++"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text"," "],
["identifier","f"],
["text"," "],
["keyword.operator","+="],
["text"," "],
["keyword.operator","<-"],
["identifier","ch"]
],[
"start",
["text"," "],
["paren.rparen","}"]
],[
"start",
["text"," "],
["keyword","return"],
["text"," "],
["identifier","f"]
],[
"start",
["paren.rparen","}"]
],[
"start"
],[
"start",
["keyword","func"],
["text"," "],
["identifier","term"],
["paren.lparen","("],
["identifier","ch"],
["text"," "],
["keyword","chan"],
["text"," "],
["identifier","float64"],
["punctuation.operator",","],
["text"," "],
["identifier","k"],
["text"," "],
["identifier","float64"],
["paren.rparen",")"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text"," "],
["identifier","ch"],
["text"," "],
["keyword.operator","<-"],
["text"," "],
["constant.numeric","4"],
["text"," "],
["keyword.operator","*"],
["text"," "],
["identifier","math"],
["punctuation.operator","."],
["identifier","Pow"],
["paren.lparen","("],
["constant.numeric","-1"],
["punctuation.operator",","],
["text"," "],
["identifier","k"],
["paren.rparen",")"],
["text"," / "],
["paren.lparen","("],
["constant.numeric","2"],
["keyword.operator","*"],
["identifier","k"],
["text"," "],
["keyword.operator","+"],
["text"," "],
["constant.numeric","1"],
["paren.rparen",")"]
],[
"start",
["paren.rparen","}"]
],[
"start"
]]

View file

@ -1,523 +1,410 @@
[
{
"state": "start",
"data": [
[ "comment", "//http://groovy.codehaus.org/Martin+Fowler%27s+closure+examples+in+Groovy" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "class" ],
[ "text", " " ],
[ "identifier", "Employee" ],
[ "text", " " ],
[ "lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "def" ],
[ "text", " " ],
[ "identifier", "name" ],
[ "text", ", " ],
[ "identifier", "salary" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "boolean" ],
[ "text", " " ],
[ "identifier", "manager" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.function", "String" ],
[ "text", " " ],
[ "identifier", "toString" ],
[ "lparen", "(" ],
[ "rparen", ")" ],
[ "text", " " ],
[ "lparen", "{" ],
[ "text", " " ],
[ "keyword", "return" ],
[ "text", " " ],
[ "identifier", "name" ],
[ "text", " " ],
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "def" ],
[ "text", " " ],
[ "identifier", "emps" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "lparen", "[" ],
[ "keyword", "new" ],
[ "text", " " ],
[ "identifier", "Employee" ],
[ "lparen", "(" ],
[ "identifier", "name" ],
[ "text", ":" ],
[ "string", "'Guillaume'" ],
[ "text", ", " ],
[ "identifier", "manager" ],
[ "text", ":" ],
[ "constant.language.boolean", "true" ],
[ "text", ", " ],
[ "identifier", "salary" ],
[ "text", ":" ],
[ "constant.numeric", "200" ],
[ "rparen", ")" ],
[ "text", "," ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "new" ],
[ "text", " " ],
[ "identifier", "Employee" ],
[ "lparen", "(" ],
[ "identifier", "name" ],
[ "text", ":" ],
[ "string", "'Graeme'" ],
[ "text", ", " ],
[ "identifier", "manager" ],
[ "text", ":" ],
[ "constant.language.boolean", "true" ],
[ "text", ", " ],
[ "identifier", "salary" ],
[ "text", ":" ],
[ "constant.numeric", "200" ],
[ "rparen", ")" ],
[ "text", "," ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "new" ],
[ "text", " " ],
[ "identifier", "Employee" ],
[ "lparen", "(" ],
[ "identifier", "name" ],
[ "text", ":" ],
[ "string", "'Dierk'" ],
[ "text", ", " ],
[ "identifier", "manager" ],
[ "text", ":" ],
[ "constant.language.boolean", "false" ],
[ "text", ", " ],
[ "identifier", "salary" ],
[ "text", ":" ],
[ "constant.numeric", "151" ],
[ "rparen", ")" ],
[ "text", "," ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "new" ],
[ "text", " " ],
[ "identifier", "Employee" ],
[ "lparen", "(" ],
[ "identifier", "name" ],
[ "text", ":" ],
[ "string", "'Bernd'" ],
[ "text", ", " ],
[ "identifier", "manager" ],
[ "text", ":" ],
[ "constant.language.boolean", "false" ],
[ "text", ", " ],
[ "identifier", "salary" ],
[ "text", ":" ],
[ "constant.numeric", "50" ],
[ "rparen", ")]" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "def" ],
[ "text", " " ],
[ "identifier", "managers" ],
[ "lparen", "(" ],
[ "identifier", "emps" ],
[ "rparen", ")" ],
[ "text", " " ],
[ "lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "emps" ],
[ "text", "." ],
[ "identifier", "findAll" ],
[ "text", " " ],
[ "lparen", "{" ],
[ "text", " " ],
[ "identifier", "e" ],
[ "text", " " ],
[ "keyword.operator", "->" ],
[ "text", " " ],
[ "identifier", "e" ],
[ "text", "." ],
[ "identifier", "isManager" ],
[ "lparen", "(" ],
[ "rparen", ")" ],
[ "text", " " ],
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "assert" ],
[ "text", " " ],
[ "identifier", "emps" ],
[ "lparen", "[" ],
[ "constant.numeric", "0" ],
[ "text", ".." ],
[ "constant.numeric", "1" ],
[ "rparen", "]" ],
[ "text", " " ],
[ "keyword.operator", "==" ],
[ "text", " " ],
[ "identifier", "managers" ],
[ "lparen", "(" ],
[ "identifier", "emps" ],
[ "rparen", ")" ],
[ "text", " " ],
[ "comment", "// [Guillaume, Graeme]" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "def" ],
[ "text", " " ],
[ "identifier", "highPaid" ],
[ "lparen", "(" ],
[ "identifier", "emps" ],
[ "rparen", ")" ],
[ "text", " " ],
[ "lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "threshold" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "constant.numeric", "150" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "emps" ],
[ "text", "." ],
[ "identifier", "findAll" ],
[ "text", " " ],
[ "lparen", "{" ],
[ "text", " " ],
[ "identifier", "e" ],
[ "text", " " ],
[ "keyword.operator", "->" ],
[ "text", " " ],
[ "identifier", "e" ],
[ "text", "." ],
[ "identifier", "salary" ],
[ "text", " " ],
[ "keyword.operator", ">" ],
[ "text", " " ],
[ "identifier", "threshold" ],
[ "text", " " ],
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "assert" ],
[ "text", " " ],
[ "identifier", "emps" ],
[ "lparen", "[" ],
[ "constant.numeric", "0" ],
[ "text", ".." ],
[ "constant.numeric", "2" ],
[ "rparen", "]" ],
[ "text", " " ],
[ "keyword.operator", "==" ],
[ "text", " " ],
[ "identifier", "highPaid" ],
[ "lparen", "(" ],
[ "identifier", "emps" ],
[ "rparen", ")" ],
[ "text", " " ],
[ "comment", "// [Guillaume, Graeme, Dierk]" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "def" ],
[ "text", " " ],
[ "identifier", "paidMore" ],
[ "lparen", "(" ],
[ "identifier", "amount" ],
[ "rparen", ")" ],
[ "text", " " ],
[ "lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "lparen", "{" ],
[ "text", " " ],
[ "identifier", "e" ],
[ "text", " " ],
[ "keyword.operator", "->" ],
[ "text", " " ],
[ "identifier", "e" ],
[ "text", "." ],
[ "identifier", "salary" ],
[ "text", " " ],
[ "keyword.operator", ">" ],
[ "text", " " ],
[ "identifier", "amount" ],
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "def" ],
[ "text", " " ],
[ "identifier", "highPaid" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "identifier", "paidMore" ],
[ "lparen", "(" ],
[ "constant.numeric", "150" ],
[ "rparen", ")" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "assert" ],
[ "text", " " ],
[ "identifier", "highPaid" ],
[ "lparen", "(" ],
[ "identifier", "emps" ],
[ "lparen", "[" ],
[ "constant.numeric", "0" ],
[ "rparen", "])" ],
[ "text", " " ],
[ "comment", "// true" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "assert" ],
[ "text", " " ],
[ "identifier", "emps" ],
[ "lparen", "[" ],
[ "constant.numeric", "0" ],
[ "text", ".." ],
[ "constant.numeric", "2" ],
[ "rparen", "]" ],
[ "text", " " ],
[ "keyword.operator", "==" ],
[ "text", " " ],
[ "identifier", "emps" ],
[ "text", "." ],
[ "identifier", "findAll" ],
[ "lparen", "(" ],
[ "identifier", "highPaid" ],
[ "rparen", ")" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "def" ],
[ "text", " " ],
[ "identifier", "filename" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "string", "'test.txt'" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "new" ],
[ "text", " " ],
[ "identifier", "File" ],
[ "lparen", "(" ],
[ "identifier", "filename" ],
[ "rparen", ")" ],
[ "text", "." ],
[ "identifier", "withReader" ],
[ "lparen", "{" ],
[ "text", " " ],
[ "identifier", "reader" ],
[ "text", " " ],
[ "keyword.operator", "->" ],
[ "text", " " ],
[ "identifier", "doSomethingWith" ],
[ "lparen", "(" ],
[ "identifier", "reader" ],
[ "rparen", ")" ],
[ "text", " " ],
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "def" ],
[ "text", " " ],
[ "identifier", "readersText" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "def" ],
[ "text", " " ],
[ "identifier", "doSomethingWith" ],
[ "lparen", "(" ],
[ "identifier", "reader" ],
[ "rparen", ")" ],
[ "text", " " ],
[ "lparen", "{" ],
[ "text", " " ],
[ "identifier", "readersText" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "identifier", "reader" ],
[ "text", "." ],
[ "identifier", "text" ],
[ "text", " " ],
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "assert" ],
[ "text", " " ],
[ "keyword", "new" ],
[ "text", " " ],
[ "identifier", "File" ],
[ "lparen", "(" ],
[ "identifier", "filename" ],
[ "rparen", ")" ],
[ "text", "." ],
[ "identifier", "text" ],
[ "text", " " ],
[ "keyword.operator", "==" ],
[ "text", " " ],
[ "identifier", "readersText" ]
]
}
]
[[
"start",
["comment","//http://groovy.codehaus.org/Martin+Fowler%27s+closure+examples+in+Groovy"]
],[
"start"
],[
"start",
["keyword","class"],
["text"," "],
["identifier","Employee"],
["text"," "],
["lparen","{"]
],[
"start",
["text"," "],
["keyword","def"],
["text"," "],
["identifier","name"],
["text",", "],
["identifier","salary"]
],[
"start",
["text"," "],
["keyword","boolean"],
["text"," "],
["identifier","manager"]
],[
"start",
["text"," "],
["support.function","String"],
["text"," "],
["identifier","toString"],
["lparen","("],
["rparen",")"],
["text"," "],
["lparen","{"],
["text"," "],
["keyword","return"],
["text"," "],
["identifier","name"],
["text"," "],
["rparen","}"]
],[
"start",
["rparen","}"]
],[
"start"
],[
"start",
["keyword","def"],
["text"," "],
["identifier","emps"],
["text"," "],
["keyword.operator","="],
["text"," "],
["lparen","["],
["keyword","new"],
["text"," "],
["identifier","Employee"],
["lparen","("],
["identifier","name"],
["text",":"],
["string","'Guillaume'"],
["text",", "],
["identifier","manager"],
["text",":"],
["constant.language.boolean","true"],
["text",", "],
["identifier","salary"],
["text",":"],
["constant.numeric","200"],
["rparen",")"],
["text",","]
],[
"start",
["text"," "],
["keyword","new"],
["text"," "],
["identifier","Employee"],
["lparen","("],
["identifier","name"],
["text",":"],
["string","'Graeme'"],
["text",", "],
["identifier","manager"],
["text",":"],
["constant.language.boolean","true"],
["text",", "],
["identifier","salary"],
["text",":"],
["constant.numeric","200"],
["rparen",")"],
["text",","]
],[
"start",
["text"," "],
["keyword","new"],
["text"," "],
["identifier","Employee"],
["lparen","("],
["identifier","name"],
["text",":"],
["string","'Dierk'"],
["text",", "],
["identifier","manager"],
["text",":"],
["constant.language.boolean","false"],
["text",", "],
["identifier","salary"],
["text",":"],
["constant.numeric","151"],
["rparen",")"],
["text",","]
],[
"start",
["text"," "],
["keyword","new"],
["text"," "],
["identifier","Employee"],
["lparen","("],
["identifier","name"],
["text",":"],
["string","'Bernd'"],
["text",", "],
["identifier","manager"],
["text",":"],
["constant.language.boolean","false"],
["text",", "],
["identifier","salary"],
["text",":"],
["constant.numeric","50"],
["rparen",")]"]
],[
"start"
],[
"start",
["keyword","def"],
["text"," "],
["identifier","managers"],
["lparen","("],
["identifier","emps"],
["rparen",")"],
["text"," "],
["lparen","{"]
],[
"start",
["text"," "],
["identifier","emps"],
["text","."],
["identifier","findAll"],
["text"," "],
["lparen","{"],
["text"," "],
["identifier","e"],
["text"," "],
["keyword.operator","->"],
["text"," "],
["identifier","e"],
["text","."],
["identifier","isManager"],
["lparen","("],
["rparen",")"],
["text"," "],
["rparen","}"]
],[
"start",
["rparen","}"]
],[
"start"
],[
"start",
["keyword","assert"],
["text"," "],
["identifier","emps"],
["lparen","["],
["constant.numeric","0"],
["text",".."],
["constant.numeric","1"],
["rparen","]"],
["text"," "],
["keyword.operator","=="],
["text"," "],
["identifier","managers"],
["lparen","("],
["identifier","emps"],
["rparen",")"],
["text"," "],
["comment","// [Guillaume, Graeme]"]
],[
"start"
],[
"start",
["keyword","def"],
["text"," "],
["identifier","highPaid"],
["lparen","("],
["identifier","emps"],
["rparen",")"],
["text"," "],
["lparen","{"]
],[
"start",
["text"," "],
["identifier","threshold"],
["text"," "],
["keyword.operator","="],
["text"," "],
["constant.numeric","150"]
],[
"start",
["text"," "],
["identifier","emps"],
["text","."],
["identifier","findAll"],
["text"," "],
["lparen","{"],
["text"," "],
["identifier","e"],
["text"," "],
["keyword.operator","->"],
["text"," "],
["identifier","e"],
["text","."],
["identifier","salary"],
["text"," "],
["keyword.operator",">"],
["text"," "],
["identifier","threshold"],
["text"," "],
["rparen","}"]
],[
"start",
["rparen","}"]
],[
"start"
],[
"start",
["keyword","assert"],
["text"," "],
["identifier","emps"],
["lparen","["],
["constant.numeric","0"],
["text",".."],
["constant.numeric","2"],
["rparen","]"],
["text"," "],
["keyword.operator","=="],
["text"," "],
["identifier","highPaid"],
["lparen","("],
["identifier","emps"],
["rparen",")"],
["text"," "],
["comment","// [Guillaume, Graeme, Dierk]"]
],[
"start"
],[
"start",
["keyword","def"],
["text"," "],
["identifier","paidMore"],
["lparen","("],
["identifier","amount"],
["rparen",")"],
["text"," "],
["lparen","{"]
],[
"start",
["text"," "],
["lparen","{"],
["text"," "],
["identifier","e"],
["text"," "],
["keyword.operator","->"],
["text"," "],
["identifier","e"],
["text","."],
["identifier","salary"],
["text"," "],
["keyword.operator",">"],
["text"," "],
["identifier","amount"],
["rparen","}"]
],[
"start",
["rparen","}"]
],[
"start",
["keyword","def"],
["text"," "],
["identifier","highPaid"],
["text"," "],
["keyword.operator","="],
["text"," "],
["identifier","paidMore"],
["lparen","("],
["constant.numeric","150"],
["rparen",")"]
],[
"start"
],[
"start",
["keyword","assert"],
["text"," "],
["identifier","highPaid"],
["lparen","("],
["identifier","emps"],
["lparen","["],
["constant.numeric","0"],
["rparen","])"],
["text"," "],
["comment","// true"]
],[
"start",
["keyword","assert"],
["text"," "],
["identifier","emps"],
["lparen","["],
["constant.numeric","0"],
["text",".."],
["constant.numeric","2"],
["rparen","]"],
["text"," "],
["keyword.operator","=="],
["text"," "],
["identifier","emps"],
["text","."],
["identifier","findAll"],
["lparen","("],
["identifier","highPaid"],
["rparen",")"]
],[
"start"
],[
"start",
["keyword","def"],
["text"," "],
["identifier","filename"],
["text"," "],
["keyword.operator","="],
["text"," "],
["string","'test.txt'"]
],[
"start",
["keyword","new"],
["text"," "],
["identifier","File"],
["lparen","("],
["identifier","filename"],
["rparen",")"],
["text","."],
["identifier","withReader"],
["lparen","{"],
["text"," "],
["identifier","reader"],
["text"," "],
["keyword.operator","->"],
["text"," "],
["identifier","doSomethingWith"],
["lparen","("],
["identifier","reader"],
["rparen",")"],
["text"," "],
["rparen","}"]
],[
"start"
],[
"start",
["keyword","def"],
["text"," "],
["identifier","readersText"]
],[
"start",
["keyword","def"],
["text"," "],
["identifier","doSomethingWith"],
["lparen","("],
["identifier","reader"],
["rparen",")"],
["text"," "],
["lparen","{"],
["text"," "],
["identifier","readersText"],
["text"," "],
["keyword.operator","="],
["text"," "],
["identifier","reader"],
["text","."],
["identifier","text"],
["text"," "],
["rparen","}"]
],[
"start"
],[
"start",
["keyword","assert"],
["text"," "],
["keyword","new"],
["text"," "],
["identifier","File"],
["lparen","("],
["identifier","filename"],
["rparen",")"],
["text","."],
["identifier","text"],
["text"," "],
["keyword.operator","=="],
["text"," "],
["identifier","readersText"]
]]

View file

@ -1,280 +1,174 @@
[
{
"state": "start",
"data": [
[ "keyword.other.doctype", "!!!5" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "punctuation.section.comment", "# <!--[if lt IE 7]> <html class=\"no-js lt-ie9 lt-ie8 lt-ie7\" lang=\"en\"> <![endif]-->" ]
]
},
{
"state": "start",
"data": [
[ "punctuation.section.comment", "# <!--[if IE 7]> <html class=\"no-js lt-ie9 lt-ie8\" lang=\"en\"> <![endif]-->" ]
]
},
{
"state": "start",
"data": [
[ "punctuation.section.comment", "# <!--[if IE 8]> <html class=\"no-js lt-ie9\" lang=\"en\"> <![endif]-->" ]
]
},
{
"state": "start",
"data": [
[ "punctuation.section.comment", "# <!--[if gt IE 8]><!--> <html class=\"no-js\" lang=\"en\"> <!--<![endif]-->" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "punctuation.section.comment", "/adasdasdad" ]
]
},
{
"state": "start",
"data": [
[ "entity.name.tag.haml", "%div" ],
[ "punctuation.section", "{" ],
[ "constant.other.symbol.ruby", ":id" ],
[ "text", " => " ],
[ "string", "\"#{@item.type}_#{@item.number}\"" ],
[ "text", ", " ],
[ "constant.other.symbol.ruby", ":class" ],
[ "text", " => " ],
[ "string", "'#{@item.type} #{@item.urgency}'" ],
[ "text", ", " ],
[ "constant.other.symbol.ruby", ":phoney" ],
[ "text", " => " ],
[ "string", "`asdasdasd`" ],
[ "punctuation.section", "}" ]
]
},
{
"state": "start",
"data": [
[ "punctuation.section.comment", "/ file: app/views/movies/index.html.haml" ]
]
},
{
"state": "start",
"data": [
[ "meta.escape.haml", "\\d" ]
]
},
{
"state": "start",
"data": [
[ "entity.name.tag.haml", "%ads:" ],
[ "punctuation.section", "{" ],
[ "constant.other.symbol.ruby", ":bleh" ],
[ "text", " => " ],
[ "constant.numeric", "33" ],
[ "punctuation.section", "}" ]
]
},
{
"state": "embedded_ruby",
"data": [
[ "entity.name.tag.haml", "%p" ],
[ "text", "==ddd==" ]
]
},
{
"state": "start",
"data": [
[ "text", " Date/Time:" ]
]
},
{
"state": "embedded_ruby",
"data": [
[ "text", " - " ],
[ "identifier", "now" ],
[ "text", " = " ],
[ "support.class", "DateTime" ],
[ "text", "." ],
[ "identifier", "now" ],
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "entity.name.tag.haml", " %strong" ],
[ "text", "= now" ]
]
},
{
"state": "embedded_ruby",
"data": [
[ "text", " = " ],
[ "keyword", "if" ],
[ "text", " " ],
[ "identifier", "now" ],
[ "text", " " ],
[ "support.class", "DateTime" ],
[ "text", "." ],
[ "identifier", "parse" ],
[ "text", "(\"" ],
[ "support.class", "December" ],
[ "text", " " ],
[ "constant.numeric", "31" ],
[ "text", ", " ],
[ "constant.numeric", "2006" ],
[ "text", "\")" ]
]
},
{
"state": "embedded_ruby",
"data": [
[ "text", " = \"" ],
[ "support.class", "Happy" ],
[ "text", " " ],
[ "identifier", "new" ],
[ "text", " \" + \"" ],
[ "identifier", "year" ],
[ "text", "!\"" ]
]
},
{
"state": "start",
"data": [
[ "entity.name.tag.haml", "%sfd" ],
[ "entity.other.attribute-name.class.haml", ".dfdfg" ]
]
},
{
"state": "start",
"data": [
[ "punctuation.section.comment", "#content" ]
]
},
{
"state": "start",
"data": [
[ "text", " .title" ]
]
},
{
"state": "start",
"data": [
[ "entity.name.tag.haml", " %h1" ],
[ "text", "= @title" ]
]
},
{
"state": "embedded_ruby",
"data": [
[ "text", " = " ],
[ "support.function", "link_to" ],
[ "text", " '" ],
[ "support.class", "Home" ],
[ "text", "', " ],
[ "identifier", "home_url" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "punctuation.section.comment", " #contents" ]
]
},
{
"state": "start",
"data": [
[ "entity.name.tag.haml", "%div" ],
[ "entity.other.attribute-name.id.haml", "#content" ]
]
},
{
"state": "start",
"data": [
[ "entity.name.tag.haml", " %div" ],
[ "entity.other.attribute-name.class.haml", ".articles" ]
]
},
{
"state": "start",
"data": [
[ "entity.name.tag.haml", " %div" ],
[ "entity.other.attribute-name.class.haml", ".article.title" ],
[ "text", " Blah" ]
]
},
{
"state": "start",
"data": [
[ "entity.name.tag.haml", " %div" ],
[ "entity.other.attribute-name.class.haml", ".article.date" ],
[ "text", " " ],
[ "constant.numeric", "2006-11-05" ]
]
},
{
"state": "start",
"data": [
[ "entity.name.tag.haml", " %div" ],
[ "entity.other.attribute-name.class.haml", ".article.entry" ]
]
},
{
"state": "start",
"data": [
[ "text", " Neil Patrick Harris " ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "entity.name.tag.haml", "%div" ],
[ "text", "[@user, " ],
[ "constant.other.symbol.ruby", ":greeting" ],
[ "text", "]" ]
]
},
{
"state": "start",
"data": [
[ "entity.name.tag.haml", " %bar" ],
[ "text", "[" ],
[ "constant.numeric", "290" ],
[ "text", "]/" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "string.quoted.double", "==Hello!==" ]
]
},
{
"state": "start",
"data": []
}
]
[[
"start",
["keyword.other.doctype","!!!5"]
],[
"start"
],[
"start",
["punctuation.section.comment","# <!--[if lt IE 7]> <html class=\"no-js lt-ie9 lt-ie8 lt-ie7\" lang=\"en\"> <![endif]-->"]
],[
"start",
["punctuation.section.comment","# <!--[if IE 7]> <html class=\"no-js lt-ie9 lt-ie8\" lang=\"en\"> <![endif]-->"]
],[
"start",
["punctuation.section.comment","# <!--[if IE 8]> <html class=\"no-js lt-ie9\" lang=\"en\"> <![endif]-->"]
],[
"start",
["punctuation.section.comment","# <!--[if gt IE 8]><!--> <html class=\"no-js\" lang=\"en\"> <!--<![endif]-->"]
],[
"start"
],[
"start"
],[
"start",
["punctuation.section.comment","/adasdasdad"]
],[
"start",
["entity.name.tag.haml","%div"],
["punctuation.section","{"],
["constant.other.symbol.ruby",":id"],
["text"," => "],
["string","\"#{@item.type}_#{@item.number}\""],
["text",", "],
["constant.other.symbol.ruby",":class"],
["text"," => "],
["string","'#{@item.type} #{@item.urgency}'"],
["text",", "],
["constant.other.symbol.ruby",":phoney"],
["text"," => "],
["string","`asdasdasd`"],
["punctuation.section","}"]
],[
"start",
["punctuation.section.comment","/ file: app/views/movies/index.html.haml"]
],[
"start",
["meta.escape.haml","\\d"]
],[
"start",
["entity.name.tag.haml","%ads:"],
["punctuation.section","{"],
["constant.other.symbol.ruby",":bleh"],
["text"," => "],
["constant.numeric","33"],
["punctuation.section","}"]
],[
"embedded_ruby",
["entity.name.tag.haml","%p"],
["text","==ddd=="]
],[
"start",
["text"," Date/Time:"]
],[
"embedded_ruby",
["text"," - "],
["identifier","now"],
["text"," = "],
["support.class","DateTime"],
["text","."],
["identifier","now"],
["text"," "]
],[
"start",
["entity.name.tag.haml"," %strong"],
["text","= now"]
],[
"embedded_ruby",
["text"," = "],
["keyword","if"],
["text"," "],
["identifier","now"],
["text"," "],
["support.class","DateTime"],
["text","."],
["identifier","parse"],
["text","(\""],
["support.class","December"],
["text"," "],
["constant.numeric","31"],
["text",", "],
["constant.numeric","2006"],
["text","\")"]
],[
"embedded_ruby",
["text"," = \""],
["support.class","Happy"],
["text"," "],
["identifier","new"],
["text"," \" + \""],
["identifier","year"],
["text","!\""]
],[
"start",
["entity.name.tag.haml","%sfd"],
["entity.other.attribute-name.class.haml",".dfdfg"]
],[
"start",
["punctuation.section.comment","#content"]
],[
"start",
["text"," .title"]
],[
"start",
["entity.name.tag.haml"," %h1"],
["text","= @title"]
],[
"embedded_ruby",
["text"," = "],
["support.function","link_to"],
["text"," '"],
["support.class","Home"],
["text","', "],
["identifier","home_url"]
],[
"start"
],[
"start",
["punctuation.section.comment"," #contents"]
],[
"start",
["entity.name.tag.haml","%div"],
["entity.other.attribute-name.id.haml","#content"]
],[
"start",
["entity.name.tag.haml"," %div"],
["entity.other.attribute-name.class.haml",".articles"]
],[
"start",
["entity.name.tag.haml"," %div"],
["entity.other.attribute-name.class.haml",".article.title"],
["text"," Blah"]
],[
"start",
["entity.name.tag.haml"," %div"],
["entity.other.attribute-name.class.haml",".article.date"],
["text"," "],
["constant.numeric","2006-11-05"]
],[
"start",
["entity.name.tag.haml"," %div"],
["entity.other.attribute-name.class.haml",".article.entry"]
],[
"start",
["text"," Neil Patrick Harris "]
],[
"start"
],[
"start",
["entity.name.tag.haml","%div"],
["text","[@user, "],
["constant.other.symbol.ruby",":greeting"],
["text","]"]
],[
"start",
["entity.name.tag.haml"," %bar"],
["text","["],
["constant.numeric","290"],
["text","]/"]
],[
"start",
["text"," "],
["string.quoted.double","==Hello!=="]
],[
"start"
]]

View file

@ -1,195 +1,143 @@
[
{
"state": "start",
"data": [
[ "keyword", "class" ],
[ "text", " " ],
[ "identifier", "Haxe" ],
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "public" ],
[ "text", " " ],
[ "keyword", "static" ],
[ "text", " " ],
[ "keyword", "function" ],
[ "text", " " ],
[ "identifier", "main" ],
[ "paren.lparen", "(" ],
[ "paren.rparen", ")" ],
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "// Say Hello!" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "var" ],
[ "text", " " ],
[ "identifier", "greeting" ],
[ "punctuation.operator", ":" ],
[ "keyword", "String" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "string", "\"Hello World\"" ],
[ "punctuation.operator", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "trace" ],
[ "paren.lparen", "(" ],
[ "identifier", "greeting" ],
[ "paren.rparen", ")" ],
[ "punctuation.operator", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "var" ],
[ "text", " " ],
[ "identifier", "targets" ],
[ "punctuation.operator", ":" ],
[ "keyword", "Array" ],
[ "keyword.operator", "<" ],
[ "keyword", "String" ],
[ "keyword.operator", ">" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "paren.lparen", "[" ],
[ "string", "\"Flash\"" ],
[ "punctuation.operator", "," ],
[ "string", "\"Javascript\"" ],
[ "punctuation.operator", "," ],
[ "string", "\"PHP\"" ],
[ "punctuation.operator", "," ],
[ "string", "\"Neko\"" ],
[ "punctuation.operator", "," ],
[ "string", "\"C++\"" ],
[ "punctuation.operator", "," ],
[ "string", "\"iOS\"" ],
[ "punctuation.operator", "," ],
[ "string", "\"Android\"" ],
[ "punctuation.operator", "," ],
[ "string", "\"webOS\"" ],
[ "paren.rparen", "]" ],
[ "punctuation.operator", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "trace" ],
[ "paren.lparen", "(" ],
[ "string", "\"Haxe is a great language that can target:\"" ],
[ "paren.rparen", ")" ],
[ "punctuation.operator", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "for" ],
[ "text", " " ],
[ "paren.lparen", "(" ],
[ "identifier", "target" ],
[ "text", " " ],
[ "keyword", "in" ],
[ "text", " " ],
[ "identifier", "targets" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "trace" ],
[ "text", " " ],
[ "paren.lparen", "(" ],
[ "string", "\" - \"" ],
[ "text", " " ],
[ "keyword.operator", "+" ],
[ "text", " " ],
[ "identifier", "target" ],
[ "paren.rparen", ")" ],
[ "punctuation.operator", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "trace" ],
[ "paren.lparen", "(" ],
[ "string", "\"And many more!\"" ],
[ "paren.rparen", ")" ],
[ "punctuation.operator", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
}
]
[[
"start",
["keyword","class"],
["text"," "],
["identifier","Haxe"],
["text"," "]
],[
"start",
["paren.lparen","{"]
],[
"start",
["text"," "],
["keyword","public"],
["text"," "],
["keyword","static"],
["text"," "],
["keyword","function"],
["text"," "],
["identifier","main"],
["paren.lparen","("],
["paren.rparen",")"],
["text"," "]
],[
"start",
["text"," "],
["paren.lparen","{"]
],[
"start",
["text"," "],
["comment","// Say Hello!"]
],[
"start",
["text"," "],
["keyword","var"],
["text"," "],
["identifier","greeting"],
["punctuation.operator",":"],
["keyword","String"],
["text"," "],
["keyword.operator","="],
["text"," "],
["string","\"Hello World\""],
["punctuation.operator",";"]
],[
"start",
["text"," "],
["keyword","trace"],
["paren.lparen","("],
["identifier","greeting"],
["paren.rparen",")"],
["punctuation.operator",";"]
],[
"start",
["text"," "]
],[
"start",
["text"," "],
["keyword","var"],
["text"," "],
["identifier","targets"],
["punctuation.operator",":"],
["keyword","Array"],
["keyword.operator","<"],
["keyword","String"],
["keyword.operator",">"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","["],
["string","\"Flash\""],
["punctuation.operator",","],
["string","\"Javascript\""],
["punctuation.operator",","],
["string","\"PHP\""],
["punctuation.operator",","],
["string","\"Neko\""],
["punctuation.operator",","],
["string","\"C++\""],
["punctuation.operator",","],
["string","\"iOS\""],
["punctuation.operator",","],
["string","\"Android\""],
["punctuation.operator",","],
["string","\"webOS\""],
["paren.rparen","]"],
["punctuation.operator",";"]
],[
"start",
["text"," "],
["keyword","trace"],
["paren.lparen","("],
["string","\"Haxe is a great language that can target:\""],
["paren.rparen",")"],
["punctuation.operator",";"]
],[
"start",
["text"," "],
["keyword","for"],
["text"," "],
["paren.lparen","("],
["identifier","target"],
["text"," "],
["keyword","in"],
["text"," "],
["identifier","targets"],
["paren.rparen",")"]
],[
"start",
["text"," "],
["paren.lparen","{"]
],[
"start",
["text"," "],
["keyword","trace"],
["text"," "],
["paren.lparen","("],
["string","\" - \""],
["text"," "],
["keyword.operator","+"],
["text"," "],
["identifier","target"],
["paren.rparen",")"],
["punctuation.operator",";"]
],[
"start",
["text"," "],
["paren.rparen","}"]
],[
"start",
["text"," "],
["keyword","trace"],
["paren.lparen","("],
["string","\"And many more!\""],
["paren.rparen",")"],
["punctuation.operator",";"]
],[
"start",
["text"," "],
["paren.rparen","}"]
],[
"start",
["paren.rparen","}"]
]]

View file

@ -1,150 +1,103 @@
[
{
"state": "start",
"data": [
[ "meta.tag", "<" ],
[ "meta.tag.tag-name", "html" ],
[ "meta.tag.r", ">" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "meta.tag", "<" ],
[ "meta.tag.tag-name", "head" ],
[ "meta.tag.r", ">" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "css-start",
"data": [
[ "text", " " ],
[ "meta.tag", "<" ],
[ "meta.tag.tag-name.style", "style" ],
[ "text", " " ],
[ "entity.other.attribute-name", "type" ],
[ "keyword.operator", "=" ],
[ "string", "\"text/css\"" ],
[ "meta.tag.r", ">" ]
]
},
{
"state": "css-ruleset",
"data": [
[ "text", " " ],
[ "variable", ".text-layer" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "css-ruleset",
"data": [
[ "text", " " ],
[ "support.type", "font-family" ],
[ "text", ": Monaco, " ],
[ "string", "\"Courier New\"" ],
[ "text", ", " ],
[ "support.constant.fonts", "monospace" ],
[ "text", ";" ]
]
},
{
"state": "css-ruleset",
"data": [
[ "text", " " ],
[ "support.type", "font-size" ],
[ "text", ": " ],
[ "constant.numeric", "12" ],
[ "keyword", "px" ],
[ "text", ";" ]
]
},
{
"state": "css-ruleset",
"data": [
[ "text", " " ],
[ "support.type", "cursor" ],
[ "text", ": " ],
[ "support.constant", "text" ],
[ "text", ";" ]
]
},
{
"state": "css-start",
"data": [
[ "text", " " ],
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "meta.tag", "</" ],
[ "meta.tag.tag-name.style", "style" ],
[ "meta.tag.r", ">" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "meta.tag", "</" ],
[ "meta.tag.tag-name", "head" ],
[ "meta.tag.r", ">" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "meta.tag", "<" ],
[ "meta.tag.tag-name", "body" ],
[ "meta.tag.r", ">" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "meta.tag", "<" ],
[ "meta.tag.tag-name", "h1" ],
[ "text", " " ],
[ "entity.other.attribute-name", "style" ],
[ "keyword.operator", "=" ],
[ "string", "\"color:red\"" ],
[ "meta.tag.r", ">" ],
[ "text", "Juhu Kinners" ],
[ "meta.tag", "</" ],
[ "meta.tag.tag-name", "h1" ],
[ "meta.tag.r", ">" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "meta.tag", "</" ],
[ "meta.tag.tag-name", "body" ],
[ "meta.tag.r", ">" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag", "</" ],
[ "meta.tag.tag-name", "html" ],
[ "meta.tag.r", ">" ]
]
}
]
[[
"start",
["meta.tag","<"],
["meta.tag.tag-name","html"],
["meta.tag.r",">"]
],[
"start",
["text"," "],
["meta.tag","<"],
["meta.tag.tag-name","head"],
["meta.tag.r",">"]
],[
"start"
],[
"css-start",
["text"," "],
["meta.tag","<"],
["meta.tag.tag-name.style","style"],
["text"," "],
["entity.other.attribute-name","type"],
["keyword.operator","="],
["string","\"text/css\""],
["meta.tag.r",">"]
],[
"css-ruleset",
["text"," "],
["variable",".text-layer"],
["text"," "],
["paren.lparen","{"]
],[
"css-ruleset",
["text"," "],
["support.type","font-family"],
["text",": Monaco, "],
["string","\"Courier New\""],
["text",", "],
["support.constant.fonts","monospace"],
["text",";"]
],[
"css-ruleset",
["text"," "],
["support.type","font-size"],
["text",": "],
["constant.numeric","12"],
["keyword","px"],
["text",";"]
],[
"css-ruleset",
["text"," "],
["support.type","cursor"],
["text",": "],
["support.constant","text"],
["text",";"]
],[
"css-start",
["text"," "],
["paren.rparen","}"]
],[
"start",
["text"," "],
["meta.tag","</"],
["meta.tag.tag-name.style","style"],
["meta.tag.r",">"]
],[
"start"
],[
"start",
["text"," "],
["meta.tag","</"],
["meta.tag.tag-name","head"],
["meta.tag.r",">"]
],[
"start",
["text"," "],
["meta.tag","<"],
["meta.tag.tag-name","body"],
["meta.tag.r",">"]
],[
"start",
["text"," "],
["meta.tag","<"],
["meta.tag.tag-name","h1"],
["text"," "],
["entity.other.attribute-name","style"],
["keyword.operator","="],
["string","\"color:red\""],
["meta.tag.r",">"],
["text","Juhu Kinners"],
["meta.tag","</"],
["meta.tag.tag-name","h1"],
["meta.tag.r",">"]
],[
"start",
["text"," "],
["meta.tag","</"],
["meta.tag.tag-name","body"],
["meta.tag.r",">"]
],[
"start",
["meta.tag","</"],
["meta.tag.tag-name","html"],
["meta.tag.r",">"]
]]

View file

@ -1,309 +1,187 @@
[
{
"state": "start",
"data": [
[ "keyword.other.doctype.jade", "!!!doctype" ]
]
},
{
"state": "start",
"data": [
[ "keyword.other.doctype.jade", "!!!5" ]
]
},
{
"state": "start",
"data": [
[ "keyword.other.doctype.jade", "!!!" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword.control.import.include.jade", "include" ],
[ "text", " something" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword.control.import.include.jade", " include" ],
[ "text", " another_thing" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "punctuation.section.comment", " // let's talk about it" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "comment_block",
"data": [
[ "punctuation.section.comment", "//" ]
]
},
{
"state": "comment_block",
"data": [
[ "comment.block.jade", " here it is. a block comment!" ]
]
},
{
"state": "comment_block",
"data": [
[ "comment.block.jade", " and another row!" ]
]
},
{
"state": "start",
"data": [
[ "text", "but not here." ]
]
},
{
"state": "start",
"data": []
},
{
"state": "comment_block",
"data": [
[ "punctuation.section.comment", " // " ]
]
},
{
"state": "comment_block",
"data": [
[ "comment.block.jade", " a far spaced" ]
]
},
{
"state": "comment_block",
"data": [
[ "comment.block.jade", " should be lack of block" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "punctuation.section.comment", " // also not a comment" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag.any.jade", " div" ],
[ "entity.other.attribute-name.class.jade", ".attemptAtBlock" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "meta.tag.any.jade", " span" ],
[ "entity.other.attribute-name.id.jade", "#myName" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "string.interpolated.jade", "#{implicit}" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "string.interpolated.jade", "!{more_explicit}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "suport.type.attribute.id.jade", "#idDiv" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "suport.type.attribute.class.jade", ".idDiv" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "meta.tag.any.jade", " test" ],
[ "punctuation", "(" ],
[ "entity.other.attribute-name.jade", "id" ],
[ "text", "=" ],
[ "string", "\"tag\"" ],
[ "punctuation", ")" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag.any.jade", " header" ],
[ "punctuation", "(" ],
[ "entity.other.attribute-name.jade", "id" ],
[ "text", "=" ],
[ "string", "\"tag\"" ],
[ "text", ", " ],
[ "entity.other.attribute-name.jade", "blah" ],
[ "text", "=" ],
[ "string", "\"foo\"" ],
[ "text", ", " ],
[ "entity.other.attribute-name.jade", "meh" ],
[ "text", "=" ],
[ "string", "\"aads\"" ],
[ "punctuation", ")" ]
]
},
{
"state": "start",
"data": [
[ "storage.type.function.jade", "mixin" ],
[ "entity.name.function.jade", " article" ],
[ "punctuation.definition.parameters.begin.jade", "(" ],
[ "variable.parameter.function.jade", "obj, parents" ],
[ "punctuation.definition.parameters.end.jade", ")" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "storage.type.function.jade", " mixin" ],
[ "entity.name.function.jade", " bleh" ],
[ "punctuation.definition.parameters.begin.jade", "(" ],
[ "punctuation.definition.parameters.end.jade", ")" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "storage.type.function.jade", " mixin" ],
[ "entity.name.function.jade", " clever-name" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "source.js.embedded.jade", " -" ],
[ "storage.type", "var" ],
[ "text", " " ],
[ "identifier", "x" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "string", "\"0\"" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "source.js.embedded.jade", " -" ],
[ "text", " " ],
[ "identifier", "y" ],
[ "text", " " ],
[ "identifier", "each" ],
[ "text", " z" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "source.js.embedded.jade", " -" ],
[ "text", " " ],
[ "storage.type", "var" ],
[ "text", " " ],
[ "identifier", "items" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "paren.lparen", "[" ],
[ "string", "\"one\"" ],
[ "punctuation.operator", "," ],
[ "text", " " ],
[ "string", "\"two\"" ],
[ "punctuation.operator", "," ],
[ "text", " " ],
[ "string", "\"three\"" ],
[ "text", "]" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag.any.jade", " each" ],
[ "text", " item in items" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag.any.jade", " li" ],
[ "text", "= item" ]
]
}
]
[[
"start",
["keyword.other.doctype.jade","!!!doctype"]
],[
"start",
["keyword.other.doctype.jade","!!!5"]
],[
"start",
["keyword.other.doctype.jade","!!!"]
],[
"start"
],[
"start",
["keyword.control.import.include.jade","include"],
["text"," something"]
],[
"start"
],[
"start",
["keyword.control.import.include.jade"," include"],
["text"," another_thing"]
],[
"start"
],[
"start",
["punctuation.section.comment"," // let's talk about it"]
],[
"start"
],[
"comment_block",
["punctuation.section.comment","//"]
],[
"comment_block",
["comment.block.jade"," here it is. a block comment!"]
],[
"comment_block",
["comment.block.jade"," and another row!"]
],[
"start",
["text","but not here."]
],[
"start"
],[
"comment_block",
["punctuation.section.comment"," // "]
],[
"comment_block",
["comment.block.jade"," a far spaced"]
],[
"comment_block",
["comment.block.jade"," should be lack of block"]
],[
"start"
],[
"start",
["punctuation.section.comment"," // also not a comment"]
],[
"start",
["meta.tag.any.jade"," div"],
["entity.other.attribute-name.class.jade",".attemptAtBlock"]
],[
"start",
["text"," "]
],[
"start",
["meta.tag.any.jade"," span"],
["entity.other.attribute-name.id.jade","#myName"]
],[
"start"
],[
"start",
["text"," "],
["string.interpolated.jade","#{implicit}"]
],[
"start",
["text"," "],
["string.interpolated.jade","!{more_explicit}"]
],[
"start"
],[
"start",
["text"," "],
["suport.type.attribute.id.jade","#idDiv"]
],[
"start"
],[
"start",
["text"," "],
["suport.type.attribute.class.jade",".idDiv"]
],[
"start"
],[
"start",
["meta.tag.any.jade"," test"],
["punctuation","("],
["entity.other.attribute-name.jade","id"],
["text","="],
["string","\"tag\""],
["punctuation",")"]
],[
"start",
["meta.tag.any.jade"," header"],
["punctuation","("],
["entity.other.attribute-name.jade","id"],
["text","="],
["string","\"tag\""],
["text",", "],
["entity.other.attribute-name.jade","blah"],
["text","="],
["string","\"foo\""],
["text",", "],
["entity.other.attribute-name.jade","meh"],
["text","="],
["string","\"aads\""],
["punctuation",")"]
],[
"start",
["storage.type.function.jade","mixin"],
["entity.name.function.jade"," article"],
["punctuation.definition.parameters.begin.jade","("],
["variable.parameter.function.jade","obj, parents"],
["punctuation.definition.parameters.end.jade",")"]
],[
"start"
],[
"start",
["storage.type.function.jade"," mixin"],
["entity.name.function.jade"," bleh"],
["punctuation.definition.parameters.begin.jade","("],
["punctuation.definition.parameters.end.jade",")"]
],[
"start"
],[
"start",
["storage.type.function.jade"," mixin"],
["entity.name.function.jade"," clever-name"]
],[
"start"
],[
"start",
["source.js.embedded.jade"," -"],
["storage.type","var"],
["text"," "],
["identifier","x"],
["text"," "],
["keyword.operator","="],
["text"," "],
["string","\"0\""],
["text",";"]
],[
"start",
["source.js.embedded.jade"," -"],
["text"," "],
["identifier","y"],
["text"," "],
["identifier","each"],
["text"," z"]
],[
"start"
],[
"start",
["source.js.embedded.jade"," -"],
["text"," "],
["storage.type","var"],
["text"," "],
["identifier","items"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","["],
["string","\"one\""],
["punctuation.operator",","],
["text"," "],
["string","\"two\""],
["punctuation.operator",","],
["text"," "],
["string","\"three\""],
["text","]"]
],[
"start",
["meta.tag.any.jade"," each"],
["text"," item in items"]
],[
"start",
["meta.tag.any.jade"," li"],
["text","= item"]
]]

View file

@ -1,139 +1,95 @@
[
{
"state": "start",
"data": [
[ "keyword", "public" ],
[ "text", " " ],
[ "keyword", "class" ],
[ "text", " " ],
[ "identifier", "InfiniteLoop" ],
[ "text", " " ],
[ "lparen", "{" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "comment",
"data": [
[ "text", " " ],
[ "comment", "/*" ]
]
},
{
"state": "comment",
"data": [
[ "comment", " * This will cause the program to hang..." ]
]
},
{
"state": "comment",
"data": [
[ "comment", " *" ]
]
},
{
"state": "comment",
"data": [
[ "comment", " * Taken from:" ]
]
},
{
"state": "comment",
"data": [
[ "comment", " * http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/" ]
]
},
{
"state": "start",
"data": [
[ "comment", " */" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "public" ],
[ "text", " " ],
[ "keyword", "static" ],
[ "text", " " ],
[ "keyword", "void" ],
[ "text", " " ],
[ "identifier", "main" ],
[ "lparen", "(" ],
[ "support.function", "String" ],
[ "lparen", "[" ],
[ "rparen", "]" ],
[ "text", " " ],
[ "identifier", "args" ],
[ "rparen", ")" ],
[ "text", " " ],
[ "lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "double" ],
[ "text", " " ],
[ "identifier", "d" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "support.function", "Double" ],
[ "text", "." ],
[ "identifier", "parseDouble" ],
[ "lparen", "(" ],
[ "string", "\"2.2250738585072012e-308\"" ],
[ "rparen", ")" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "// unreachable code" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.function", "System" ],
[ "text", "." ],
[ "identifier", "out" ],
[ "text", "." ],
[ "identifier", "println" ],
[ "lparen", "(" ],
[ "string", "\"Value: \"" ],
[ "text", " " ],
[ "keyword.operator", "+" ],
[ "text", " " ],
[ "identifier", "d" ],
[ "rparen", ")" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "rparen", "}" ]
]
}
]
[[
"start",
["keyword","public"],
["text"," "],
["keyword","class"],
["text"," "],
["identifier","InfiniteLoop"],
["text"," "],
["lparen","{"]
],[
"start"
],[
"comment",
["text"," "],
["comment","/*"]
],[
"comment",
["comment"," * This will cause the program to hang..."]
],[
"comment",
["comment"," *"]
],[
"comment",
["comment"," * Taken from:"]
],[
"comment",
["comment"," * http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/"]
],[
"start",
["comment"," */"]
],[
"start",
["text"," "],
["keyword","public"],
["text"," "],
["keyword","static"],
["text"," "],
["keyword","void"],
["text"," "],
["identifier","main"],
["lparen","("],
["support.function","String"],
["lparen","["],
["rparen","]"],
["text"," "],
["identifier","args"],
["rparen",")"],
["text"," "],
["lparen","{"]
],[
"start",
["text"," "],
["keyword","double"],
["text"," "],
["identifier","d"],
["text"," "],
["keyword.operator","="],
["text"," "],
["support.function","Double"],
["text","."],
["identifier","parseDouble"],
["lparen","("],
["string","\"2.2250738585072012e-308\""],
["rparen",")"],
["text",";"]
],[
"start"
],[
"start",
["text"," "],
["comment","// unreachable code"]
],[
"start",
["text"," "],
["support.function","System"],
["text","."],
["identifier","out"],
["text","."],
["identifier","println"],
["lparen","("],
["string","\"Value: \""],
["text"," "],
["keyword.operator","+"],
["text"," "],
["identifier","d"],
["rparen",")"],
["text",";"]
],[
"start",
["text"," "],
["rparen","}"]
],[
"start",
["rparen","}"]
]]

View file

@ -1,545 +1,397 @@
[
{
"state": "regex_allowed",
"data": [
[ "storage.type", "function" ],
[ "text", " " ],
[ "entity.name.function", "foo" ],
[ "paren.lparen", "(" ],
[ "variable.parameter", "items" ],
[ "punctuation.operator", ", " ],
[ "variable.parameter", "nada" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "regex_allowed",
"data": [
[ "text", " " ],
[ "keyword", "for" ],
[ "text", " " ],
[ "paren.lparen", "(" ],
[ "storage.type", "var" ],
[ "text", " " ],
[ "identifier", "i" ],
[ "keyword.operator", "=" ],
[ "constant.numeric", "0" ],
[ "punctuation.operator", ";" ],
[ "text", " " ],
[ "identifier", "i" ],
[ "keyword.operator", "<" ],
[ "identifier", "items" ],
[ "punctuation.operator", "." ],
[ "support.constant", "length" ],
[ "punctuation.operator", ";" ],
[ "text", " " ],
[ "identifier", "i" ],
[ "keyword.operator", "++" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "regex_allowed",
"data": [
[ "text", " " ],
[ "support.function", "alert" ],
[ "paren.lparen", "(" ],
[ "identifier", "items" ],
[ "paren.lparen", "[" ],
[ "identifier", "i" ],
[ "paren.rparen", "]" ],
[ "text", " " ],
[ "keyword.operator", "+" ],
[ "text", " " ],
[ "string", "\"juhu" ],
[ "constant.language.escape", "\\n" ],
[ "string", "\"" ],
[ "paren.rparen", ")" ],
[ "punctuation.operator", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "paren.rparen", "}" ],
[ "text", "\t" ],
[ "comment", "// Real Tab." ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "identifier", "regexp" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "string.regexp", "/p" ],
[ "constant.language.escape", "|" ],
[ "string.regexp", "p/" ],
[ "text", " " ],
[ "comment", "// ends here" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "identifier", "r" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "string.regexp", "/d" ],
[ "constant.language.escape", "{1,2}?" ],
[ "string.regexp", "f{e}" ],
[ "invalid", "++" ],
[ "string.regexp", "r" ],
[ "constant.language.escape", "*?" ],
[ "regexp.keyword.operator", "\\d" ],
[ "constant.language.escape", "+?[]" ],
[ "string.regexp", "r" ],
[ "constant.language.escape", "[^" ],
[ "string.regexp.charachterclass", "r" ],
[ "constant.language.escape", "-" ],
[ "string.regexp.charachterclass", "o" ],
[ "regexp.keyword.operator", "\\f\\f" ],
[ "string.regexp.charachterclass", "[" ],
[ "regexp.keyword.operator", "\\f" ],
[ "constant.language.escape", "]?" ],
[ "string.regexp", "r" ],
[ "invalid", "{7}+" ],
[ "string.regexp", "r" ],
[ "regexp.keyword.operator", "\\{" ],
[ "string.regexp", "7}" ],
[ "constant.language.escape", "+" ],
[ "string.regexp", "rr--rr" ],
[ "constant.language.escape", "$^(?:" ],
[ "string.regexp", "d" ],
[ "constant.language.escape", "|" ],
[ "string.regexp", "s" ],
[ "constant.language.escape", ")(?=" ],
[ "string.regexp", "a" ],
[ "constant.language.escape", "|)(?!" ],
[ "string.regexp", "y" ],
[ "constant.language.escape", ")[]|" ],
[ "invalid", "$?" ],
[ "constant.language.escape", "|" ],
[ "invalid", "^*" ],
[ "string.regexp", "/" ],
[ "text", " " ],
[ "identifier", "o" ]
]
},
{
"state": "start",
"data": [
[ "identifier", "a" ],
[ "keyword.operator", "=" ],
[ "string.regexp", "/a/" ],
[ "text", " " ],
[ "identifier", "jk" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "string.regexp", "/ /" ],
[ "text", " " ],
[ "keyword.operator", "/" ],
[ "text", " " ],
[ "string.regexp", "/ /" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment.doc", "/************************************/" ]
]
},
{
"state": "start",
"data": [
[ "comment.doc", "/** total mess, tricky to highlight**/" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "regex_allowed",
"data": [
[ "storage.type", "function" ],
[ "text", " " ],
[ "paren.lparen", "(" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "doc-start",
"data": [
[ "text", "\t" ],
[ "comment.doc", "/**" ]
]
},
{
"state": "doc-start",
"data": [
[ "comment.doc", "\t * docComment" ]
]
},
{
"state": "start",
"data": [
[ "comment.doc", "\t **/" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "identifier", "r" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "string.regexp", "/u" ],
[ "regexp.keyword.operator", "\\t" ],
[ "constant.language.escape", "*" ],
[ "string.regexp", "/" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "identifier", "g" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "constant.numeric", "1." ],
[ "text", "00" ],
[ "identifier", "E" ],
[ "text", "^" ],
[ "constant.numeric", "1" ],
[ "punctuation.operator", "," ],
[ "text", " " ],
[ "identifier", "y" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "constant.numeric", "1.2" ],
[ "text", " " ],
[ "keyword.operator", "+" ],
[ "text", " " ],
[ "punctuation.operator", "." ],
[ "constant.numeric", "2" ],
[ "text", " " ],
[ "keyword.operator", "+" ],
[ "text", " " ],
[ "constant.numeric", "052" ],
[ "text", " " ],
[ "keyword.operator", "+" ],
[ "text", " " ],
[ "constant.numeric", "0x25" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "identifier", "t" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "paren.lparen", "[" ],
[ "string", "'d'" ],
[ "punctuation.operator", "," ],
[ "text", " " ],
[ "string", "''" ],
[ "paren.rparen", "]" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
},
{
"state": "regex_allowed",
"data": [
[ "storage.type", "function" ],
[ "text", " " ],
[ "paren.lparen", "(" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "regex_allowed",
"data": [
[ "text", "\t" ],
[ "comment", "/* eee */" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "qqstring",
"data": [
[ "string", "\"s\\" ]
]
},
{
"state": "start",
"data": [
[ "string", "s" ],
[ "constant.language.escape", "\\u7824" ],
[ "string", "sss" ],
[ "constant.language.escape", "\\u" ],
[ "string", "1\"" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "qstring",
"data": [
[ "string", "'\\" ]
]
},
{
"state": "start",
"data": [
[ "string", "string'" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", "'" ]
]
},
{
"state": "start",
"data": [
[ "identifier", "string" ],
[ "text", "'" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "string", "\"trailing space" ],
[ "constant.language.escape", "\\ " ],
[ "string", " " ]
]
},
{
"state": "start",
"data": [
[ "string", "\" \"" ],
[ "text", " " ],
[ "keyword.operator", "/" ],
[ "identifier", "not" ],
[ "text", " " ],
[ "identifier", "a" ],
[ "text", " " ],
[ "identifier", "regexp" ],
[ "keyword.operator", "/" ],
[ "identifier", "g" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "doc-start",
"data": [
[ "comment.doc", "/**" ]
]
},
{
"state": "doc-start",
"data": [
[ "comment.doc", " *doc" ]
]
},
{
"state": "start",
"data": [
[ "comment.doc", " */" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "regex_allowed",
"data": [
[ "identifier", "a" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "regex_allowed",
"data": [
[ "text", "\t" ],
[ "string", "'a'" ],
[ "punctuation.operator", ":" ],
[ "text", " " ],
[ "identifier", "b" ],
[ "punctuation.operator", "," ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "string", "'g'" ],
[ "text", ": " ],
[ "storage.type", "function" ],
[ "paren.lparen", "(" ],
[ "variable.parameter", "t" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "entity.name.function", "gta" ],
[ "punctuation.operator", ":" ],
[ "storage.type", "function" ],
[ "paren.lparen", "(" ],
[ "variable.parameter", "a" ],
[ "punctuation.operator", "," ],
[ "variable.parameter", "b" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": []
},
{
"state": "function_arguments",
"data": [
[ "identifier", "foo" ],
[ "punctuation.operator", "." ],
[ "storage.type", "protoype" ],
[ "punctuation.operator", "." ],
[ "entity.name.function", "d" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "storage.type", "function" ],
[ "paren.lparen", "(" ],
[ "variable.parameter", "a" ],
[ "punctuation.operator", ", " ],
[ "variable.parameter", "b" ],
[ "punctuation.operator", "," ]
]
},
{
"state": "start",
"data": [
[ "punctuation.operator", " " ],
[ "variable.parameter", "c" ],
[ "punctuation.operator", ", " ],
[ "variable.parameter", "d" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "storage.type", "foo" ],
[ "punctuation.operator", "." ],
[ "entity.name.function", "d" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "storage.type", "function" ],
[ "paren.lparen", "(" ],
[ "variable.parameter", "a" ],
[ "punctuation.operator", ", " ],
[ "variable.parameter", "b" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "storage.type", "foo" ],
[ "punctuation.operator", "." ],
[ "entity.name.function", "d" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "storage.type", "function" ],
[ "paren.lparen", "(" ],
[ "variable.parameter", "a" ],
[ "punctuation.operator", ", " ],
[ "comment.doc", "/*****/" ],
[ "text", " " ],
[ "identifier", "d" ],
[ "string", "\"string\"" ],
[ "text", " " ]
]
},
{
"state": "start",
"data": []
}
]
[[
"regex_allowed",
["storage.type","function"],
["text"," "],
["entity.name.function","foo"],
["paren.lparen","("],
["variable.parameter","items"],
["punctuation.operator",", "],
["variable.parameter","nada"],
["paren.rparen",")"],
["text"," "],
["paren.lparen","{"]
],[
"regex_allowed",
["text"," "],
["keyword","for"],
["text"," "],
["paren.lparen","("],
["storage.type","var"],
["text"," "],
["identifier","i"],
["keyword.operator","="],
["constant.numeric","0"],
["punctuation.operator",";"],
["text"," "],
["identifier","i"],
["keyword.operator","<"],
["identifier","items"],
["punctuation.operator","."],
["support.constant","length"],
["punctuation.operator",";"],
["text"," "],
["identifier","i"],
["keyword.operator","++"],
["paren.rparen",")"],
["text"," "],
["paren.lparen","{"]
],[
"regex_allowed",
["text"," "],
["support.function","alert"],
["paren.lparen","("],
["identifier","items"],
["paren.lparen","["],
["identifier","i"],
["paren.rparen","]"],
["text"," "],
["keyword.operator","+"],
["text"," "],
["string","\"juhu"],
["constant.language.escape","\\n"],
["string","\""],
["paren.rparen",")"],
["punctuation.operator",";"]
],[
"start",
["text"," "],
["paren.rparen","}"],
["text","\t"],
["comment","// Real Tab."]
],[
"start",
["paren.rparen","}"]
],[
"start"
],[
"start",
["identifier","regexp"],
["text"," "],
["keyword.operator","="],
["text"," "],
["string.regexp","/p"],
["constant.language.escape","|"],
["string.regexp","p/"],
["text"," "],
["comment","// ends here"]
],[
"start"
],[
"start",
["identifier","r"],
["text"," "],
["keyword.operator","="],
["text"," "],
["string.regexp","/d"],
["constant.language.escape","{1,2}?"],
["string.regexp","f{e}"],
["invalid","++"],
["string.regexp","r"],
["constant.language.escape","*?"],
["regexp.keyword.operator","\\d"],
["constant.language.escape","+?[]"],
["string.regexp","r"],
["constant.language.escape","[^"],
["string.regexp.charachterclass","r"],
["constant.language.escape","-"],
["string.regexp.charachterclass","o"],
["regexp.keyword.operator","\\f\\f"],
["string.regexp.charachterclass","["],
["regexp.keyword.operator","\\f"],
["constant.language.escape","]?"],
["string.regexp","r"],
["invalid","{7}+"],
["string.regexp","r"],
["regexp.keyword.operator","\\{"],
["string.regexp","7}"],
["constant.language.escape","+"],
["string.regexp","rr--rr"],
["constant.language.escape","$^(?:"],
["string.regexp","d"],
["constant.language.escape","|"],
["string.regexp","s"],
["constant.language.escape",")(?="],
["string.regexp","a"],
["constant.language.escape","|)(?!"],
["string.regexp","y"],
["constant.language.escape",")[]|"],
["invalid","$?"],
["constant.language.escape","|"],
["invalid","^*"],
["string.regexp","/"],
["text"," "],
["identifier","o"]
],[
"start",
["identifier","a"],
["keyword.operator","="],
["string.regexp","/a/"],
["text"," "],
["identifier","jk"],
["text"," "],
["keyword.operator","="],
["text"," "],
["string.regexp","/ /"],
["text"," "],
["keyword.operator","/"],
["text"," "],
["string.regexp","/ /"]
],[
"start",
["text"," "],
["comment.doc","/************************************/"]
],[
"start",
["comment.doc","/** total mess, tricky to highlight**/"]
],[
"start"
],[
"regex_allowed",
["storage.type","function"],
["text"," "],
["paren.lparen","("],
["paren.rparen",")"],
["text"," "],
["paren.lparen","{"]
],[
"doc-start",
["text","\t"],
["comment.doc","/**"]
],[
"doc-start",
["comment.doc","\t * docComment"]
],[
"start",
["comment.doc","\t **/"]
],[
"start",
["text","\t"],
["identifier","r"],
["text"," "],
["keyword.operator","="],
["text"," "],
["string.regexp","/u"],
["regexp.keyword.operator","\\t"],
["constant.language.escape","*"],
["string.regexp","/"]
],[
"start",
["text","\t"],
["identifier","g"],
["text"," "],
["keyword.operator","="],
["text"," "],
["constant.numeric","1."],
["text","00"],
["identifier","E"],
["text","^"],
["constant.numeric","1"],
["punctuation.operator",","],
["text"," "],
["identifier","y"],
["text"," "],
["keyword.operator","="],
["text"," "],
["constant.numeric","1.2"],
["text"," "],
["keyword.operator","+"],
["text"," "],
["punctuation.operator","."],
["constant.numeric","2"],
["text"," "],
["keyword.operator","+"],
["text"," "],
["constant.numeric","052"],
["text"," "],
["keyword.operator","+"],
["text"," "],
["constant.numeric","0x25"]
],[
"start",
["text","\t"],
["identifier","t"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","["],
["string","'d'"],
["punctuation.operator",","],
["text"," "],
["string","''"],
["paren.rparen","]"]
],[
"start",
["paren.rparen","}"]
],[
"regex_allowed",
["storage.type","function"],
["text"," "],
["paren.lparen","("],
["paren.rparen",")"],
["text"," "],
["paren.lparen","{"]
],[
"regex_allowed",
["text","\t"],
["comment","/* eee */"]
],[
"start",
["paren.rparen","}"]
],[
"start"
],[
"qqstring",
["string","\"s\\"]
],[
"start",
["string","s"],
["constant.language.escape","\\u7824"],
["string","sss"],
["constant.language.escape","\\u"],
["string","1\""]
],[
"start"
],[
"qstring",
["string","'\\"]
],[
"start",
["string","string'"]
],[
"start"
],[
"start",
["text","'"]
],[
"start",
["identifier","string"],
["text","'"]
],[
"start"
],[
"start",
["string","\"trailing space"],
["constant.language.escape","\\ "],
["string"," "]
],[
"start",
["string","\" \""],
["text"," "],
["keyword.operator","/"],
["identifier","not"],
["text"," "],
["identifier","a"],
["text"," "],
["identifier","regexp"],
["keyword.operator","/"],
["identifier","g"]
],[
"start"
],[
"doc-start",
["comment.doc","/**"]
],[
"doc-start",
["comment.doc"," *doc"]
],[
"start",
["comment.doc"," */"]
],[
"start"
],[
"regex_allowed",
["identifier","a"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","{"]
],[
"regex_allowed",
["text","\t"],
["string","'a'"],
["punctuation.operator",":"],
["text"," "],
["identifier","b"],
["punctuation.operator",","]
],[
"start",
["text","\t"],
["string","'g'"],
["text",": "],
["storage.type","function"],
["paren.lparen","("],
["variable.parameter","t"],
["paren.rparen",")"]
],[
"start",
["text","\t"],
["entity.name.function","gta"],
["punctuation.operator",":"],
["storage.type","function"],
["paren.lparen","("],
["variable.parameter","a"],
["punctuation.operator",","],
["variable.parameter","b"],
["paren.rparen",")"]
],[
"start",
["paren.rparen","}"]
],[
"start"
],[
"start"
],[
"function_arguments",
["identifier","foo"],
["punctuation.operator","."],
["storage.type","protoype"],
["punctuation.operator","."],
["entity.name.function","d"],
["text"," "],
["keyword.operator","="],
["text"," "],
["storage.type","function"],
["paren.lparen","("],
["variable.parameter","a"],
["punctuation.operator",", "],
["variable.parameter","b"],
["punctuation.operator",","]
],[
"start",
["punctuation.operator"," "],
["variable.parameter","c"],
["punctuation.operator",", "],
["variable.parameter","d"],
["paren.rparen",")"]
],[
"start",
["storage.type","foo"],
["punctuation.operator","."],
["entity.name.function","d"],
["text"," "],
["keyword.operator","="],
["storage.type","function"],
["paren.lparen","("],
["variable.parameter","a"],
["punctuation.operator",", "],
["variable.parameter","b"],
["paren.rparen",")"]
],[
"start",
["storage.type","foo"],
["punctuation.operator","."],
["entity.name.function","d"],
["text"," "],
["keyword.operator","="],
["storage.type","function"],
["paren.lparen","("],
["variable.parameter","a"],
["punctuation.operator",", "],
["comment.doc","/*****/"],
["text"," "],
["identifier","d"],
["string","\"string\""],
["text"," "]
],[
"start"
]]

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,79 +1,51 @@
[
{
"state": "comment",
"data": [
[ "comment", "/*EXPECTED" ]
]
},
{
"state": "comment",
"data": [
[ "comment", "hello world!" ]
]
},
{
"state": "start",
"data": [
[ "comment", "*/" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "class" ],
[ "text", " " ],
[ "language.support.class", "Test" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "static" ],
[ "text", " " ],
[ "storage.type", "function" ],
[ "text", " " ],
[ "entity.name.function", "run" ],
[ "paren.lparen", "(" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "punctuation.operator", ":" ],
[ "text", " " ],
[ "keyword", "void" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "// console.log(\"hello world!\");" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "log" ],
[ "text", " " ],
[ "string", "\"hello world!\"" ],
[ "punctuation.operator", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
}
]
[[
"comment",
["comment","/*EXPECTED"]
],[
"comment",
["comment","hello world!"]
],[
"start",
["comment","*/"]
],[
"start",
["keyword","class"],
["text"," "],
["language.support.class","Test"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text"," "],
["keyword","static"],
["text"," "],
["storage.type","function"],
["text"," "],
["entity.name.function","run"],
["paren.lparen","("],
["paren.rparen",")"],
["text"," "],
["punctuation.operator",":"],
["text"," "],
["keyword","void"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text"," "],
["comment","// console.log(\"hello world!\");"]
],[
"start",
["text"," "],
["keyword","log"],
["text"," "],
["string","\"hello world!\""],
["punctuation.operator",";"]
],[
"start",
["text"," "],
["paren.rparen","}"]
],[
"start",
["paren.rparen","}"]
]]

View file

@ -1,194 +1,127 @@
[
{
"state": "start",
"data": [
[ "keyword", "\\usepackage" ],
[ "lparen", "{" ],
[ "text", "amsmath" ],
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "\\title" ],
[ "lparen", "{" ],
[ "keyword", "\\LaTeX" ],
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "\\date" ],
[ "lparen", "{" ],
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "\\begin" ],
[ "lparen", "{" ],
[ "text", "document" ],
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "\\maketitle" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "\\LaTeX" ],
[ "lparen", "{" ],
[ "rparen", "}" ],
[ "text", " is a document preparation system for the " ],
[ "keyword", "\\TeX" ],
[ "lparen", "{" ],
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "text", " typesetting program. It offers programmable desktop publishing" ]
]
},
{
"state": "start",
"data": [
[ "text", " features and extensive facilities for automating most aspects of" ]
]
},
{
"state": "start",
"data": [
[ "text", " typesetting and desktop publishing, including numbering and" ]
]
},
{
"state": "start",
"data": [
[ "text", " cross-referencing, tables and figures, page layout, bibliographies," ]
]
},
{
"state": "start",
"data": [
[ "text", " and much more. " ],
[ "keyword", "\\LaTeX" ],
[ "lparen", "{" ],
[ "rparen", "}" ],
[ "text", " was originally written in 1984 by Leslie" ]
]
},
{
"state": "start",
"data": [
[ "text", " Lamport and has become the dominant method for using " ],
[ "keyword", "\\TeX" ],
[ "text", "; few" ]
]
},
{
"state": "start",
"data": [
[ "text", " people write in plain " ],
[ "keyword", "\\TeX" ],
[ "lparen", "{" ],
[ "rparen", "}" ],
[ "text", " anymore. The current version is" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "\\LaTeXe" ],
[ "text", "." ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "% This is a comment; it will not be shown in the final output." ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "% The following shows a little of the typesetting power of LaTeX:" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "\\begin" ],
[ "lparen", "{" ],
[ "text", "align" ],
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "text", " E &= mc^2 " ],
[ "keyword", "\\\\" ]
]
},
{
"state": "start",
"data": [
[ "text", " m &= " ],
[ "keyword", "\\frac" ],
[ "lparen", "{" ],
[ "text", "m_0" ],
[ "rparen", "}" ],
[ "lparen", "{" ],
[ "keyword", "\\sqrt" ],
[ "lparen", "{" ],
[ "text", "1-" ],
[ "keyword", "\\frac" ],
[ "lparen", "{" ],
[ "text", "v^2" ],
[ "rparen", "}" ],
[ "lparen", "{" ],
[ "text", "c^2" ],
[ "rparen", "}}}" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "\\end" ],
[ "lparen", "{" ],
[ "text", "align" ],
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "\\end" ],
[ "lparen", "{" ],
[ "text", "document" ],
[ "rparen", "}" ]
]
}
]
[[
"start",
["keyword","\\usepackage"],
["lparen","{"],
["text","amsmath"],
["rparen","}"]
],[
"start",
["keyword","\\title"],
["lparen","{"],
["keyword","\\LaTeX"],
["rparen","}"]
],[
"start",
["keyword","\\date"],
["lparen","{"],
["rparen","}"]
],[
"start",
["keyword","\\begin"],
["lparen","{"],
["text","document"],
["rparen","}"]
],[
"start",
["text"," "],
["keyword","\\maketitle"]
],[
"start",
["text"," "],
["keyword","\\LaTeX"],
["lparen","{"],
["rparen","}"],
["text"," is a document preparation system for the "],
["keyword","\\TeX"],
["lparen","{"],
["rparen","}"]
],[
"start",
["text"," typesetting program. It offers programmable desktop publishing"]
],[
"start",
["text"," features and extensive facilities for automating most aspects of"]
],[
"start",
["text"," typesetting and desktop publishing, including numbering and"]
],[
"start",
["text"," cross-referencing, tables and figures, page layout, bibliographies,"]
],[
"start",
["text"," and much more. "],
["keyword","\\LaTeX"],
["lparen","{"],
["rparen","}"],
["text"," was originally written in 1984 by Leslie"]
],[
"start",
["text"," Lamport and has become the dominant method for using "],
["keyword","\\TeX"],
["text","; few"]
],[
"start",
["text"," people write in plain "],
["keyword","\\TeX"],
["lparen","{"],
["rparen","}"],
["text"," anymore. The current version is"]
],[
"start",
["text"," "],
["keyword","\\LaTeXe"],
["text","."]
],[
"start",
["text"," "]
],[
"start",
["text"," "],
["comment","% This is a comment; it will not be shown in the final output."]
],[
"start",
["text"," "],
["comment","% The following shows a little of the typesetting power of LaTeX:"]
],[
"start",
["text"," "],
["keyword","\\begin"],
["lparen","{"],
["text","align"],
["rparen","}"]
],[
"start",
["text"," E &= mc^2 "],
["keyword","\\\\"]
],[
"start",
["text"," m &= "],
["keyword","\\frac"],
["lparen","{"],
["text","m_0"],
["rparen","}"],
["lparen","{"],
["keyword","\\sqrt"],
["lparen","{"],
["text","1-"],
["keyword","\\frac"],
["lparen","{"],
["text","v^2"],
["rparen","}"],
["lparen","{"],
["text","c^2"],
["rparen","}}}"]
],[
"start",
["text"," "],
["keyword","\\end"],
["lparen","{"],
["text","align"],
["rparen","}"]
],[
"start",
["keyword","\\end"],
["lparen","{"],
["text","document"],
["rparen","}"]
]]

View file

@ -1,288 +1,204 @@
[
{
"state": "start",
"data": [
[ "comment", "/* styles.less */" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "variable", "@base" ],
[ "text", ": " ],
[ "constant.numeric", "#f938ab" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "variable.language", ".box-shadow" ],
[ "paren.lparen", "(" ],
[ "variable", "@style" ],
[ "text", ", " ],
[ "variable", "@c" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "keyword", "when" ],
[ "text", " " ],
[ "paren.lparen", "(" ],
[ "support.function", "iscolor" ],
[ "paren.lparen", "(" ],
[ "variable", "@c" ],
[ "paren.rparen", "))" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " box-shadow: " ],
[ "variable", "@style" ],
[ "text", " " ],
[ "variable", "@c" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " -webkit-box-shadow: " ],
[ "variable", "@style" ],
[ "text", " " ],
[ "variable", "@c" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " -moz-box-shadow: " ],
[ "variable", "@style" ],
[ "text", " " ],
[ "variable", "@c" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "variable.language", ".box-shadow" ],
[ "paren.lparen", "(" ],
[ "variable", "@style" ],
[ "text", ", " ],
[ "variable", "@alpha" ],
[ "text", ": " ],
[ "constant.numeric", "50%" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "keyword", "when" ],
[ "text", " " ],
[ "paren.lparen", "(" ],
[ "support.function", "isnumber" ],
[ "paren.lparen", "(" ],
[ "variable", "@alpha" ],
[ "paren.rparen", "))" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "variable.language", ".box-shadow" ],
[ "paren.lparen", "(" ],
[ "variable", "@style" ],
[ "text", ", " ],
[ "support.function", "rgba" ],
[ "paren.lparen", "(" ],
[ "constant.numeric", "0" ],
[ "text", ", " ],
[ "constant.numeric", "0" ],
[ "text", ", " ],
[ "constant.numeric", "0" ],
[ "text", ", " ],
[ "variable", "@alpha" ],
[ "paren.rparen", "))" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "comment", "// Box styles" ]
]
},
{
"state": "start",
"data": [
[ "variable.language", ".box" ],
[ "text", " " ],
[ "paren.lparen", "{" ],
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "color" ],
[ "text", ": " ],
[ "support.function", "saturate" ],
[ "paren.lparen", "(" ],
[ "variable", "@base" ],
[ "text", ", " ],
[ "constant.numeric", "5%" ],
[ "paren.rparen", ")" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "border-color" ],
[ "text", ": " ],
[ "support.function", "lighten" ],
[ "paren.lparen", "(" ],
[ "variable", "@base" ],
[ "text", ", " ],
[ "constant.numeric", "30%" ],
[ "paren.rparen", ")" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "variable.language", "div" ],
[ "text", " " ],
[ "paren.lparen", "{" ],
[ "text", " " ],
[ "variable.language", ".box-shadow" ],
[ "paren.lparen", "(" ],
[ "constant.numeric", "0" ],
[ "text", " " ],
[ "constant.numeric", "0" ],
[ "text", " " ],
[ "constant.numeric", "5px" ],
[ "text", ", " ],
[ "constant.numeric", "30%" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "variable.language", "a" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "color" ],
[ "text", ": " ],
[ "variable", "@base" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "text", " &" ],
[ "variable.language", ":hover" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "color" ],
[ "text", ": " ],
[ "support.function", "lighten" ],
[ "paren.lparen", "(" ],
[ "variable", "@base" ],
[ "text", ", " ],
[ "constant.numeric", "50%" ],
[ "paren.rparen", ")" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": []
}
]
[[
"start",
["comment","/* styles.less */"]
],[
"start"
],[
"start",
["variable","@base"],
["text",": "],
["constant.numeric","#f938ab"],
["text",";"]
],[
"start"
],[
"start",
["variable.language",".box-shadow"],
["paren.lparen","("],
["variable","@style"],
["text",", "],
["variable","@c"],
["paren.rparen",")"],
["text"," "],
["keyword","when"],
["text"," "],
["paren.lparen","("],
["support.function","iscolor"],
["paren.lparen","("],
["variable","@c"],
["paren.rparen","))"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text"," box-shadow: "],
["variable","@style"],
["text"," "],
["variable","@c"],
["text",";"]
],[
"start",
["text"," -webkit-box-shadow: "],
["variable","@style"],
["text"," "],
["variable","@c"],
["text",";"]
],[
"start",
["text"," -moz-box-shadow: "],
["variable","@style"],
["text"," "],
["variable","@c"],
["text",";"]
],[
"start",
["paren.rparen","}"]
],[
"start",
["variable.language",".box-shadow"],
["paren.lparen","("],
["variable","@style"],
["text",", "],
["variable","@alpha"],
["text",": "],
["constant.numeric","50%"],
["paren.rparen",")"],
["text"," "],
["keyword","when"],
["text"," "],
["paren.lparen","("],
["support.function","isnumber"],
["paren.lparen","("],
["variable","@alpha"],
["paren.rparen","))"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text"," "],
["variable.language",".box-shadow"],
["paren.lparen","("],
["variable","@style"],
["text",", "],
["support.function","rgba"],
["paren.lparen","("],
["constant.numeric","0"],
["text",", "],
["constant.numeric","0"],
["text",", "],
["constant.numeric","0"],
["text",", "],
["variable","@alpha"],
["paren.rparen","))"],
["text",";"]
],[
"start",
["paren.rparen","}"]
],[
"start"
],[
"start",
["comment","// Box styles"]
],[
"start",
["variable.language",".box"],
["text"," "],
["paren.lparen","{"],
["text"," "]
],[
"start",
["text"," "],
["support.type","color"],
["text",": "],
["support.function","saturate"],
["paren.lparen","("],
["variable","@base"],
["text",", "],
["constant.numeric","5%"],
["paren.rparen",")"],
["text",";"]
],[
"start",
["text"," "],
["support.type","border-color"],
["text",": "],
["support.function","lighten"],
["paren.lparen","("],
["variable","@base"],
["text",", "],
["constant.numeric","30%"],
["paren.rparen",")"],
["text",";"]
],[
"start",
["text"," "]
],[
"start",
["text"," "],
["variable.language","div"],
["text"," "],
["paren.lparen","{"],
["text"," "],
["variable.language",".box-shadow"],
["paren.lparen","("],
["constant.numeric","0"],
["text"," "],
["constant.numeric","0"],
["text"," "],
["constant.numeric","5px"],
["text",", "],
["constant.numeric","30%"],
["paren.rparen",")"],
["text"," "],
["paren.rparen","}"]
],[
"start",
["text"," "]
],[
"start",
["text"," "],
["variable.language","a"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text"," "],
["support.type","color"],
["text",": "],
["variable","@base"],
["text",";"]
],[
"start",
["text"," "]
],[
"start",
["text"," &"],
["variable.language",":hover"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text"," "],
["support.type","color"],
["text",": "],
["support.function","lighten"],
["paren.lparen","("],
["variable","@base"],
["text",", "],
["constant.numeric","50%"],
["paren.rparen",")"],
["text",";"]
],[
"start",
["text"," "],
["paren.rparen","}"]
],[
"start",
["text"," "],
["paren.rparen","}"]
],[
"start",
["paren.rparen","}"]
],[
"start"
]]

File diff suppressed because it is too large Load diff

View file

@ -1,314 +1,248 @@
[
{
"state": "start",
"data": [
[ "text", "(" ],
[ "storage.type.function-type.lisp", "defun" ],
[ "text", " " ],
[ "entity.name.function.lisp", "prompt-for-cd" ],
[ "text", " ()" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "string", "\"Prompts" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "for" ],
[ "text", " " ],
[ "identifier", "CD" ],
[ "text", "\"" ]
]
},
{
"state": "start",
"data": [
[ "text", " (" ],
[ "identifier", "prompt" ],
[ "text", "-" ],
[ "identifier", "read" ],
[ "text", " " ],
[ "string", "\"Title\"" ],
[ "text", " " ],
[ "constant.numeric", "1.53" ],
[ "text", " " ],
[ "constant.numeric", "1" ],
[ "text", " " ],
[ "constant.numeric", "2" ],
[ "text", "/" ],
[ "constant.numeric", "4" ],
[ "text", " " ],
[ "constant.numeric", "1.7" ],
[ "text", " " ],
[ "constant.numeric", "1.7e0" ],
[ "text", " " ],
[ "constant.numeric", "2.9E-4" ],
[ "text", " " ],
[ "constant.numeric", "+42" ],
[ "text", " " ],
[ "constant.numeric", "-7" ],
[ "text", " " ],
[ "punctuation.definition.constant.character.lisp", "#" ],
[ "constant.character.lisp", "b001" ],
[ "text", " " ],
[ "punctuation.definition.constant.character.lisp", "#" ],
[ "constant.character.lisp", "b001/100" ],
[ "text", " " ],
[ "punctuation.definition.constant.character.lisp", "#" ],
[ "constant.character.lisp", "o777" ],
[ "text", " " ],
[ "punctuation.definition.constant.character.lisp", "#" ],
[ "constant.character.lisp", "O777" ],
[ "text", " " ],
[ "punctuation.definition.constant.character.lisp", "#" ],
[ "constant.character.lisp", "xabc55" ],
[ "text", " " ],
[ "punctuation.definition.constant.character.lisp", "#" ],
[ "constant.character.lisp", "c" ],
[ "text", "(" ],
[ "constant.numeric", "0" ],
[ "text", " " ],
[ "constant.numeric", "-5.6" ],
[ "text", "))" ]
]
},
{
"state": "start",
"data": [
[ "text", " (" ],
[ "identifier", "prompt" ],
[ "text", "-" ],
[ "identifier", "read" ],
[ "text", " " ],
[ "string", "\"Artist\"" ],
[ "text", " &" ],
[ "identifier", "rest" ],
[ "text", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " (" ],
[ "keyword.operator", "or" ],
[ "text", " (" ],
[ "identifier", "parse" ],
[ "text", "-" ],
[ "identifier", "integer" ],
[ "text", " (" ],
[ "identifier", "prompt" ],
[ "text", "-" ],
[ "identifier", "read" ],
[ "text", " " ],
[ "string", "\"Rating\"" ],
[ "text", ") :" ],
[ "identifier", "junk" ],
[ "text", "-" ],
[ "identifier", "allowed" ],
[ "text", " " ],
[ "support.function", "t" ],
[ "text", ") " ],
[ "constant.numeric", "0" ],
[ "text", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " (" ],
[ "keyword.control", "if" ],
[ "text", " " ],
[ "identifier", "x" ],
[ "text", " (" ],
[ "support.function", "format" ],
[ "text", " " ],
[ "support.function", "t" ],
[ "text", " " ],
[ "string", "\"yes\"" ],
[ "text", ") (" ],
[ "support.function", "format" ],
[ "text", " " ],
[ "support.function", "t" ],
[ "text", " " ],
[ "string", "\"no\"" ],
[ "text", " " ],
[ "constant.language", "nil" ],
[ "text", ") " ],
[ "comment", ";and here comment" ]
]
},
{
"state": "start",
"data": [
[ "text", " ) " ],
[ "constant.numeric", "0xFFLL" ],
[ "text", " " ],
[ "constant.numeric", "-23ull" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", ";; second line comment" ]
]
},
{
"state": "start",
"data": [
[ "text", " '(+ " ],
[ "constant.numeric", "1" ],
[ "text", " " ],
[ "constant.numeric", "2" ],
[ "text", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " (" ],
[ "identifier", "defvar" ],
[ "text", " " ],
[ "punctuation.definition.variable.lisp", "*" ],
[ "variable.other.global.lisp", "lines" ],
[ "punctuation.definition.variable.lisp", "*" ],
[ "text", ") " ],
[ "comment", "; list of all lines" ]
]
},
{
"state": "start",
"data": [
[ "text", " (" ],
[ "identifier", "position" ],
[ "text", "-" ],
[ "keyword.control", "if" ],
[ "text", "-" ],
[ "identifier", "not" ],
[ "text", " " ],
[ "punctuation.definition.constant.character.lisp", "#" ],
[ "constant.character.lisp", "'sys::whitespacep" ],
[ "text", " " ],
[ "identifier", "line" ],
[ "text", " :" ],
[ "identifier", "start" ],
[ "text", " " ],
[ "identifier", "beg" ],
[ "text", "))" ]
]
},
{
"state": "start",
"data": [
[ "text", " (" ],
[ "support.function", "quote" ],
[ "text", " (" ],
[ "identifier", "privet" ],
[ "text", " " ],
[ "constant.numeric", "1" ],
[ "text", " " ],
[ "constant.numeric", "2" ],
[ "text", " " ],
[ "constant.numeric", "3" ],
[ "text", "))" ]
]
},
{
"state": "start",
"data": [
[ "text", " '(" ],
[ "identifier", "hello" ],
[ "text", " " ],
[ "identifier", "world" ],
[ "text", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " (* " ],
[ "constant.numeric", "5" ],
[ "text", " " ],
[ "constant.numeric", "7" ],
[ "text", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " (" ],
[ "constant.numeric", "1" ],
[ "text", " " ],
[ "constant.numeric", "2" ],
[ "text", " " ],
[ "constant.numeric", "34" ],
[ "text", " " ],
[ "constant.numeric", "5" ],
[ "text", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " (:" ],
[ "identifier", "use" ],
[ "text", " " ],
[ "string", "\"aaaa\"" ],
[ "text", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " (" ],
[ "keyword.control", "let" ],
[ "text", " ((" ],
[ "identifier", "x" ],
[ "text", " " ],
[ "constant.numeric", "10" ],
[ "text", ") (" ],
[ "identifier", "y" ],
[ "text", " " ],
[ "constant.numeric", "20" ],
[ "text", "))" ]
]
},
{
"state": "start",
"data": [
[ "text", " (" ],
[ "identifier", "print" ],
[ "text", " (+ " ],
[ "identifier", "x" ],
[ "text", " " ],
[ "identifier", "y" ],
[ "text", "))" ]
]
},
{
"state": "start",
"data": [
[ "text", " ) " ],
[ "support.function", "LAmbDa" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "string", "\"asdad" ],
[ "constant.character.escape.lisp", "\\0" ],
[ "string", "eqweqe\"" ]
]
}
]
[[
"start",
["text","("],
["storage.type.function-type.lisp","defun"],
["text"," "],
["entity.name.function.lisp","prompt-for-cd"],
["text"," ()"]
],[
"start",
["text"," "],
["string","\"Prompts"]
],[
"start",
["text"," "],
["identifier","for"],
["text"," "],
["identifier","CD"],
["text","\""]
],[
"start",
["text"," ("],
["identifier","prompt"],
["text","-"],
["identifier","read"],
["text"," "],
["string","\"Title\""],
["text"," "],
["constant.numeric","1.53"],
["text"," "],
["constant.numeric","1"],
["text"," "],
["constant.numeric","2"],
["text","/"],
["constant.numeric","4"],
["text"," "],
["constant.numeric","1.7"],
["text"," "],
["constant.numeric","1.7e0"],
["text"," "],
["constant.numeric","2.9E-4"],
["text"," "],
["constant.numeric","+42"],
["text"," "],
["constant.numeric","-7"],
["text"," "],
["punctuation.definition.constant.character.lisp","#"],
["constant.character.lisp","b001"],
["text"," "],
["punctuation.definition.constant.character.lisp","#"],
["constant.character.lisp","b001/100"],
["text"," "],
["punctuation.definition.constant.character.lisp","#"],
["constant.character.lisp","o777"],
["text"," "],
["punctuation.definition.constant.character.lisp","#"],
["constant.character.lisp","O777"],
["text"," "],
["punctuation.definition.constant.character.lisp","#"],
["constant.character.lisp","xabc55"],
["text"," "],
["punctuation.definition.constant.character.lisp","#"],
["constant.character.lisp","c"],
["text","("],
["constant.numeric","0"],
["text"," "],
["constant.numeric","-5.6"],
["text","))"]
],[
"start",
["text"," ("],
["identifier","prompt"],
["text","-"],
["identifier","read"],
["text"," "],
["string","\"Artist\""],
["text"," &"],
["identifier","rest"],
["text",")"]
],[
"start",
["text"," ("],
["keyword.operator","or"],
["text"," ("],
["identifier","parse"],
["text","-"],
["identifier","integer"],
["text"," ("],
["identifier","prompt"],
["text","-"],
["identifier","read"],
["text"," "],
["string","\"Rating\""],
["text",") :"],
["identifier","junk"],
["text","-"],
["identifier","allowed"],
["text"," "],
["support.function","t"],
["text",") "],
["constant.numeric","0"],
["text",")"]
],[
"start",
["text"," ("],
["keyword.control","if"],
["text"," "],
["identifier","x"],
["text"," ("],
["support.function","format"],
["text"," "],
["support.function","t"],
["text"," "],
["string","\"yes\""],
["text",") ("],
["support.function","format"],
["text"," "],
["support.function","t"],
["text"," "],
["string","\"no\""],
["text"," "],
["constant.language","nil"],
["text",") "],
["comment",";and here comment"]
],[
"start",
["text"," ) "],
["constant.numeric","0xFFLL"],
["text"," "],
["constant.numeric","-23ull"]
],[
"start",
["text"," "],
["comment",";; second line comment"]
],[
"start",
["text"," '(+ "],
["constant.numeric","1"],
["text"," "],
["constant.numeric","2"],
["text",")"]
],[
"start",
["text"," ("],
["identifier","defvar"],
["text"," "],
["punctuation.definition.variable.lisp","*"],
["variable.other.global.lisp","lines"],
["punctuation.definition.variable.lisp","*"],
["text",") "],
["comment","; list of all lines"]
],[
"start",
["text"," ("],
["identifier","position"],
["text","-"],
["keyword.control","if"],
["text","-"],
["identifier","not"],
["text"," "],
["punctuation.definition.constant.character.lisp","#"],
["constant.character.lisp","'sys::whitespacep"],
["text"," "],
["identifier","line"],
["text"," :"],
["identifier","start"],
["text"," "],
["identifier","beg"],
["text","))"]
],[
"start",
["text"," ("],
["support.function","quote"],
["text"," ("],
["identifier","privet"],
["text"," "],
["constant.numeric","1"],
["text"," "],
["constant.numeric","2"],
["text"," "],
["constant.numeric","3"],
["text","))"]
],[
"start",
["text"," '("],
["identifier","hello"],
["text"," "],
["identifier","world"],
["text",")"]
],[
"start",
["text"," (* "],
["constant.numeric","5"],
["text"," "],
["constant.numeric","7"],
["text",")"]
],[
"start",
["text"," ("],
["constant.numeric","1"],
["text"," "],
["constant.numeric","2"],
["text"," "],
["constant.numeric","34"],
["text"," "],
["constant.numeric","5"],
["text",")"]
],[
"start",
["text"," (:"],
["identifier","use"],
["text"," "],
["string","\"aaaa\""],
["text",")"]
],[
"start",
["text"," ("],
["keyword.control","let"],
["text"," (("],
["identifier","x"],
["text"," "],
["constant.numeric","10"],
["text",") ("],
["identifier","y"],
["text"," "],
["constant.numeric","20"],
["text","))"]
],[
"start",
["text"," ("],
["identifier","print"],
["text"," (+ "],
["identifier","x"],
["text"," "],
["identifier","y"],
["text","))"]
],[
"start",
["text"," ) "],
["support.function","LAmbDa"]
],[
"start"
],[
"start",
["text"," "],
["string","\"asdad"],
["constant.character.escape.lisp","\\0"],
["string","eqweqe\""]
]]

View file

@ -1,444 +1,340 @@
[
{
"state": "qcomment",
"data": [
[ "comment", "--[[--" ]
]
},
{
"state": "qcomment",
"data": [
[ "comment", "num_args takes in 5.1 byte code and extracts the number of arguments" ]
]
},
{
"state": "qcomment",
"data": [
[ "comment", "from its function header." ]
]
},
{
"state": "start",
"data": [
[ "comment", "--]]--" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "function" ],
[ "text", " " ],
[ "identifier", "int" ],
[ "paren.lparen", "(" ],
[ "identifier", "t" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "keyword", "return" ],
[ "text", " " ],
[ "identifier", "t" ],
[ "keyword.operator", ":" ],
[ "support.function", "byte" ],
[ "paren.lparen", "(" ],
[ "constant.numeric", "1" ],
[ "paren.rparen", ")" ],
[ "keyword.operator", "+" ],
[ "identifier", "t" ],
[ "keyword.operator", ":" ],
[ "support.function", "byte" ],
[ "paren.lparen", "(" ],
[ "constant.numeric", "2" ],
[ "paren.rparen", ")" ],
[ "keyword.operator", "*" ],
[ "constant.numeric", "0x100" ],
[ "keyword.operator", "+" ],
[ "identifier", "t" ],
[ "keyword.operator", ":" ],
[ "support.function", "byte" ],
[ "paren.lparen", "(" ],
[ "constant.numeric", "3" ],
[ "paren.rparen", ")" ],
[ "keyword.operator", "*" ],
[ "constant.numeric", "0x10000" ],
[ "keyword.operator", "+" ],
[ "identifier", "t" ],
[ "keyword.operator", ":" ],
[ "support.function", "byte" ],
[ "paren.lparen", "(" ],
[ "constant.numeric", "4" ],
[ "paren.rparen", ")" ],
[ "keyword.operator", "*" ],
[ "constant.numeric", "0x1000000" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "end" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "function" ],
[ "text", " " ],
[ "identifier", "num_args" ],
[ "paren.lparen", "(" ],
[ "identifier", "func" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "keyword", "local" ],
[ "text", " " ],
[ "support.function", "dump" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "constant.library", "string" ],
[ "text", "." ],
[ "support.function", "dump" ],
[ "paren.lparen", "(" ],
[ "identifier", "func" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "keyword", "local" ],
[ "text", " " ],
[ "identifier", "offset" ],
[ "text", ", " ],
[ "identifier", "cursor" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "identifier", "int" ],
[ "paren.lparen", "(" ],
[ "support.function", "dump" ],
[ "keyword.operator", ":" ],
[ "support.function", "sub" ],
[ "paren.lparen", "(" ],
[ "constant.numeric", "13" ],
[ "paren.rparen", "))" ],
[ "text", ", " ],
[ "identifier", "offset" ],
[ "text", " " ],
[ "keyword.operator", "+" ],
[ "text", " " ],
[ "constant.numeric", "26" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "comment", "--Get the params and var flag (whether there's a ... in the param)" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "keyword", "return" ],
[ "text", " " ],
[ "support.function", "dump" ],
[ "keyword.operator", ":" ],
[ "support.function", "sub" ],
[ "paren.lparen", "(" ],
[ "identifier", "cursor" ],
[ "paren.rparen", ")" ],
[ "keyword.operator", ":" ],
[ "support.function", "byte" ],
[ "paren.lparen", "(" ],
[ "paren.rparen", ")" ],
[ "text", ", " ],
[ "support.function", "dump" ],
[ "keyword.operator", ":" ],
[ "support.function", "sub" ],
[ "paren.lparen", "(" ],
[ "identifier", "cursor" ],
[ "keyword.operator", "+" ],
[ "constant.numeric", "1" ],
[ "paren.rparen", ")" ],
[ "keyword.operator", ":" ],
[ "support.function", "byte" ],
[ "paren.lparen", "(" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "end" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "comment", "-- Usage:" ]
]
},
{
"state": "start",
"data": [
[ "identifier", "num_args" ],
[ "paren.lparen", "(" ],
[ "keyword", "function" ],
[ "paren.lparen", "(" ],
[ "identifier", "a" ],
[ "text", "," ],
[ "identifier", "b" ],
[ "text", "," ],
[ "identifier", "c" ],
[ "text", "," ],
[ "identifier", "d" ],
[ "text", ", " ],
[ "keyword.operator", "..." ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "keyword", "end" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "comment", "-- return 4, 7" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "comment", "-- Python styled string format operator" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "local" ],
[ "text", " " ],
[ "identifier", "gm" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "constant.library", "debug" ],
[ "text", "." ],
[ "support.function", "getmetatable" ],
[ "paren.lparen", "(" ],
[ "string", "\"\"" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "identifier", "gm" ],
[ "text", "." ],
[ "support.function", "__mod" ],
[ "keyword.operator", "=" ],
[ "keyword", "function" ],
[ "paren.lparen", "(" ],
[ "identifier", "self" ],
[ "text", ", " ],
[ "identifier", "other" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "if" ],
[ "text", " " ],
[ "support.function", "type" ],
[ "paren.lparen", "(" ],
[ "identifier", "other" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "keyword.operator", "~=" ],
[ "text", " " ],
[ "string", "\"table\"" ],
[ "text", " " ],
[ "keyword", "then" ],
[ "text", " " ],
[ "identifier", "other" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "paren.lparen", "{" ],
[ "identifier", "other" ],
[ "paren.rparen", "}" ],
[ "text", " " ],
[ "keyword", "end" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "for" ],
[ "text", " " ],
[ "identifier", "i" ],
[ "text", "," ],
[ "identifier", "v" ],
[ "text", " " ],
[ "keyword", "in" ],
[ "text", " " ],
[ "support.function", "ipairs" ],
[ "paren.lparen", "(" ],
[ "identifier", "other" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "keyword", "do" ],
[ "text", " " ],
[ "identifier", "other" ],
[ "paren.lparen", "[" ],
[ "identifier", "i" ],
[ "paren.rparen", "]" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "support.function", "tostring" ],
[ "paren.lparen", "(" ],
[ "identifier", "v" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "keyword", "end" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "return" ],
[ "text", " " ],
[ "identifier", "self" ],
[ "keyword.operator", ":" ],
[ "support.function", "format" ],
[ "paren.lparen", "(" ],
[ "support.function", "unpack" ],
[ "paren.lparen", "(" ],
[ "identifier", "other" ],
[ "paren.rparen", "))" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "end" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "qstring3",
"data": [
[ "support.function", "print" ],
[ "paren.lparen", "(" ],
[ "string", "[===[" ]
]
},
{
"state": "qstring3",
"data": [
[ "string", " blah blah %s, (%d %d)" ]
]
},
{
"state": "start",
"data": [
[ "string", "]===]" ],
[ "keyword.operator", "%" ],
[ "paren.lparen", "{" ],
[ "string", "\"blah\"" ],
[ "text", ", " ],
[ "identifier", "num_args" ],
[ "paren.lparen", "(" ],
[ "identifier", "int" ],
[ "paren.rparen", ")})" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "qcomment1",
"data": [
[ "comment", "--[=[--" ]
]
},
{
"state": "qcomment1",
"data": [
[ "comment", "table.maxn is deprecated, use # instead." ]
]
},
{
"state": "start",
"data": [
[ "comment", "--]=]--" ]
]
},
{
"state": "start",
"data": [
[ "support.function", "print" ],
[ "paren.lparen", "(" ],
[ "constant.library", "table" ],
[ "text", "." ],
[ "invalid.deprecated", "maxn" ],
[ "paren.lparen", "{" ],
[ "constant.numeric", "1" ],
[ "text", "," ],
[ "constant.numeric", "2" ],
[ "text", "," ],
[ "paren.lparen", "[" ],
[ "constant.numeric", "4" ],
[ "paren.rparen", "]" ],
[ "keyword.operator", "=" ],
[ "constant.numeric", "4" ],
[ "text", "," ],
[ "paren.lparen", "[" ],
[ "constant.numeric", "8" ],
[ "paren.rparen", "]" ],
[ "keyword.operator", "=" ],
[ "constant.numeric", "8" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "comment", "-- outputs 8 instead of 2" ]
]
},
{
"state": "start",
"data": []
}
]
[[
"qcomment",
["comment","--[[--"]
],[
"qcomment",
["comment","num_args takes in 5.1 byte code and extracts the number of arguments"]
],[
"qcomment",
["comment","from its function header."]
],[
"start",
["comment","--]]--"]
],[
"start"
],[
"start",
["keyword","function"],
["text"," "],
["identifier","int"],
["paren.lparen","("],
["identifier","t"],
["paren.rparen",")"]
],[
"start",
["text","\t"],
["keyword","return"],
["text"," "],
["identifier","t"],
["keyword.operator",":"],
["support.function","byte"],
["paren.lparen","("],
["constant.numeric","1"],
["paren.rparen",")"],
["keyword.operator","+"],
["identifier","t"],
["keyword.operator",":"],
["support.function","byte"],
["paren.lparen","("],
["constant.numeric","2"],
["paren.rparen",")"],
["keyword.operator","*"],
["constant.numeric","0x100"],
["keyword.operator","+"],
["identifier","t"],
["keyword.operator",":"],
["support.function","byte"],
["paren.lparen","("],
["constant.numeric","3"],
["paren.rparen",")"],
["keyword.operator","*"],
["constant.numeric","0x10000"],
["keyword.operator","+"],
["identifier","t"],
["keyword.operator",":"],
["support.function","byte"],
["paren.lparen","("],
["constant.numeric","4"],
["paren.rparen",")"],
["keyword.operator","*"],
["constant.numeric","0x1000000"]
],[
"start",
["keyword","end"]
],[
"start"
],[
"start",
["keyword","function"],
["text"," "],
["identifier","num_args"],
["paren.lparen","("],
["identifier","func"],
["paren.rparen",")"]
],[
"start",
["text","\t"],
["keyword","local"],
["text"," "],
["support.function","dump"],
["text"," "],
["keyword.operator","="],
["text"," "],
["constant.library","string"],
["text","."],
["support.function","dump"],
["paren.lparen","("],
["identifier","func"],
["paren.rparen",")"]
],[
"start",
["text","\t"],
["keyword","local"],
["text"," "],
["identifier","offset"],
["text",", "],
["identifier","cursor"],
["text"," "],
["keyword.operator","="],
["text"," "],
["identifier","int"],
["paren.lparen","("],
["support.function","dump"],
["keyword.operator",":"],
["support.function","sub"],
["paren.lparen","("],
["constant.numeric","13"],
["paren.rparen","))"],
["text",", "],
["identifier","offset"],
["text"," "],
["keyword.operator","+"],
["text"," "],
["constant.numeric","26"]
],[
"start",
["text","\t"],
["comment","--Get the params and var flag (whether there's a ... in the param)"]
],[
"start",
["text","\t"],
["keyword","return"],
["text"," "],
["support.function","dump"],
["keyword.operator",":"],
["support.function","sub"],
["paren.lparen","("],
["identifier","cursor"],
["paren.rparen",")"],
["keyword.operator",":"],
["support.function","byte"],
["paren.lparen","("],
["paren.rparen",")"],
["text",", "],
["support.function","dump"],
["keyword.operator",":"],
["support.function","sub"],
["paren.lparen","("],
["identifier","cursor"],
["keyword.operator","+"],
["constant.numeric","1"],
["paren.rparen",")"],
["keyword.operator",":"],
["support.function","byte"],
["paren.lparen","("],
["paren.rparen",")"]
],[
"start",
["keyword","end"]
],[
"start"
],[
"start",
["comment","-- Usage:"]
],[
"start",
["identifier","num_args"],
["paren.lparen","("],
["keyword","function"],
["paren.lparen","("],
["identifier","a"],
["text",","],
["identifier","b"],
["text",","],
["identifier","c"],
["text",","],
["identifier","d"],
["text",", "],
["keyword.operator","..."],
["paren.rparen",")"],
["text"," "],
["keyword","end"],
["paren.rparen",")"],
["text"," "],
["comment","-- return 4, 7"]
],[
"start"
],[
"start",
["comment","-- Python styled string format operator"]
],[
"start",
["keyword","local"],
["text"," "],
["identifier","gm"],
["text"," "],
["keyword.operator","="],
["text"," "],
["constant.library","debug"],
["text","."],
["support.function","getmetatable"],
["paren.lparen","("],
["string","\"\""],
["paren.rparen",")"]
],[
"start"
],[
"start",
["identifier","gm"],
["text","."],
["support.function","__mod"],
["keyword.operator","="],
["keyword","function"],
["paren.lparen","("],
["identifier","self"],
["text",", "],
["identifier","other"],
["paren.rparen",")"]
],[
"start",
["text"," "],
["keyword","if"],
["text"," "],
["support.function","type"],
["paren.lparen","("],
["identifier","other"],
["paren.rparen",")"],
["text"," "],
["keyword.operator","~="],
["text"," "],
["string","\"table\""],
["text"," "],
["keyword","then"],
["text"," "],
["identifier","other"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","{"],
["identifier","other"],
["paren.rparen","}"],
["text"," "],
["keyword","end"]
],[
"start",
["text"," "],
["keyword","for"],
["text"," "],
["identifier","i"],
["text",","],
["identifier","v"],
["text"," "],
["keyword","in"],
["text"," "],
["support.function","ipairs"],
["paren.lparen","("],
["identifier","other"],
["paren.rparen",")"],
["text"," "],
["keyword","do"],
["text"," "],
["identifier","other"],
["paren.lparen","["],
["identifier","i"],
["paren.rparen","]"],
["text"," "],
["keyword.operator","="],
["text"," "],
["support.function","tostring"],
["paren.lparen","("],
["identifier","v"],
["paren.rparen",")"],
["text"," "],
["keyword","end"]
],[
"start",
["text"," "],
["keyword","return"],
["text"," "],
["identifier","self"],
["keyword.operator",":"],
["support.function","format"],
["paren.lparen","("],
["support.function","unpack"],
["paren.lparen","("],
["identifier","other"],
["paren.rparen","))"]
],[
"start",
["keyword","end"]
],[
"start"
],[
"qstring3",
["support.function","print"],
["paren.lparen","("],
["string","[===["]
],[
"qstring3",
["string"," blah blah %s, (%d %d)"]
],[
"start",
["string","]===]"],
["keyword.operator","%"],
["paren.lparen","{"],
["string","\"blah\""],
["text",", "],
["identifier","num_args"],
["paren.lparen","("],
["identifier","int"],
["paren.rparen",")})"]
],[
"start"
],[
"qcomment1",
["comment","--[=[--"]
],[
"qcomment1",
["comment","table.maxn is deprecated, use # instead."]
],[
"start",
["comment","--]=]--"]
],[
"start",
["support.function","print"],
["paren.lparen","("],
["constant.library","table"],
["text","."],
["invalid.deprecated","maxn"],
["paren.lparen","{"],
["constant.numeric","1"],
["text",","],
["constant.numeric","2"],
["text",","],
["paren.lparen","["],
["constant.numeric","4"],
["paren.rparen","]"],
["keyword.operator","="],
["constant.numeric","4"],
["text",","],
["paren.lparen","["],
["constant.numeric","8"],
["paren.rparen","]"],
["keyword.operator","="],
["constant.numeric","8"],
["paren.rparen",")"],
["text"," "],
["comment","-- outputs 8 instead of 2"]
],[
"start"
]]

File diff suppressed because it is too large Load diff

View file

@ -1,21 +1,17 @@
[
{
"state": "start",
"data": [
[ "paren.lparen", "(" ],
[ "keyword", "title:" ],
[ "string", "\"foo bar\"" ],
[ "text", " " ],
[ "keyword.operator", "AND" ],
[ "text", " " ],
[ "keyword", "body:" ],
[ "string", "\"quick fox\"" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "keyword.operator", "OR" ],
[ "text", " " ],
[ "keyword", "title:" ],
[ "text", "fox" ]
]
}
]
[[
"start",
["paren.lparen","("],
["keyword","title:"],
["string","\"foo bar\""],
["text"," "],
["keyword.operator","AND"],
["text"," "],
["keyword","body:"],
["string","\"quick fox\""],
["paren.rparen",")"],
["text"," "],
["keyword.operator","OR"],
["text"," "],
["keyword","title:"],
["text","fox"]
]]

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,252 +1,200 @@
[
{
"state": "comment",
"data": [
[ "comment", "(*" ]
]
},
{
"state": "comment",
"data": [
[ "comment", " * Example of early return implementation taken from" ]
]
},
{
"state": "comment",
"data": [
[ "comment", " * http://ocaml.janestreet.com/?q=node/91" ]
]
},
{
"state": "start",
"data": [
[ "comment", " *)" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "let" ],
[ "text", " " ],
[ "identifier", "with_return" ],
[ "text", " " ],
[ "paren.lparen", "(" ],
[ "keyword", "type" ],
[ "text", " " ],
[ "identifier", "t" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "paren.lparen", "(" ],
[ "identifier", "f" ],
[ "text", " : " ],
[ "identifier", "_" ],
[ "text", " " ],
[ "keyword.operator", "->" ],
[ "text", " " ],
[ "identifier", "t" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "keyword.operator", "=" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "let" ],
[ "text", " " ],
[ "keyword", "module" ],
[ "text", " " ],
[ "identifier", "M" ],
[ "text", " " ],
[ "keyword.operator", "=" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "struct" ],
[ "text", " " ],
[ "keyword", "exception" ],
[ "text", " " ],
[ "identifier", "Return" ],
[ "text", " " ],
[ "keyword", "of" ],
[ "text", " " ],
[ "identifier", "t" ],
[ "text", " " ],
[ "keyword", "end" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "in" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "let" ],
[ "text", " " ],
[ "identifier", "return" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "paren.lparen", "{" ],
[ "text", " " ],
[ "identifier", "return" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "paren.lparen", "(" ],
[ "keyword", "fun" ],
[ "text", " " ],
[ "identifier", "x" ],
[ "text", " " ],
[ "keyword.operator", "->" ],
[ "text", " " ],
[ "support.function", "raise" ],
[ "text", " " ],
[ "paren.lparen", "(" ],
[ "identifier", "M" ],
[ "text", "." ],
[ "identifier", "Return" ],
[ "text", " " ],
[ "identifier", "x" ],
[ "paren.rparen", "))" ],
[ "text", "; " ],
[ "paren.rparen", "}" ],
[ "text", " " ],
[ "keyword", "in" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "try" ],
[ "text", " " ],
[ "identifier", "f" ],
[ "text", " " ],
[ "identifier", "return" ],
[ "text", " " ],
[ "keyword", "with" ],
[ "text", " " ],
[ "identifier", "M" ],
[ "text", "." ],
[ "identifier", "Return" ],
[ "text", " " ],
[ "identifier", "x" ],
[ "text", " " ],
[ "keyword.operator", "->" ],
[ "text", " " ],
[ "identifier", "x" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "comment", "(* Function that uses the 'early return' functionality provided by `with_return` *)" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "let" ],
[ "text", " " ],
[ "identifier", "sum_until_first_negative" ],
[ "text", " " ],
[ "support.function", "list" ],
[ "text", " " ],
[ "keyword.operator", "=" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "with_return" ],
[ "text", " " ],
[ "paren.lparen", "(" ],
[ "keyword", "fun" ],
[ "text", " " ],
[ "identifier", "r" ],
[ "text", " " ],
[ "keyword.operator", "->" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.function", "List" ],
[ "text", "." ],
[ "support.function", "fold" ],
[ "text", " " ],
[ "support.function", "list" ],
[ "text", " " ],
[ "keyword.operator", "~" ],
[ "support.function", "init" ],
[ "text", ":" ],
[ "constant.numeric", "0" ],
[ "text", " " ],
[ "keyword.operator", "~" ],
[ "identifier", "f" ],
[ "text", ":" ],
[ "paren.lparen", "(" ],
[ "keyword", "fun" ],
[ "text", " " ],
[ "identifier", "acc" ],
[ "text", " " ],
[ "identifier", "x" ],
[ "text", " " ],
[ "keyword.operator", "->" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "if" ],
[ "text", " " ],
[ "identifier", "x" ],
[ "text", " " ],
[ "keyword.operator", ">=" ],
[ "text", " " ],
[ "constant.numeric", "0" ],
[ "text", " " ],
[ "keyword", "then" ],
[ "text", " " ],
[ "identifier", "acc" ],
[ "text", " " ],
[ "keyword.operator", "+" ],
[ "text", " " ],
[ "identifier", "x" ],
[ "text", " " ],
[ "keyword", "else" ],
[ "text", " " ],
[ "identifier", "r" ],
[ "text", "." ],
[ "identifier", "return" ],
[ "text", " " ],
[ "identifier", "acc" ],
[ "paren.rparen", "))" ]
]
}
]
[[
"comment",
["comment","(*"]
],[
"comment",
["comment"," * Example of early return implementation taken from"]
],[
"comment",
["comment"," * http://ocaml.janestreet.com/?q=node/91"]
],[
"start",
["comment"," *)"]
],[
"start"
],[
"start",
["keyword","let"],
["text"," "],
["identifier","with_return"],
["text"," "],
["paren.lparen","("],
["keyword","type"],
["text"," "],
["identifier","t"],
["paren.rparen",")"],
["text"," "],
["paren.lparen","("],
["identifier","f"],
["text"," : "],
["identifier","_"],
["text"," "],
["keyword.operator","->"],
["text"," "],
["identifier","t"],
["paren.rparen",")"],
["text"," "],
["keyword.operator","="]
],[
"start",
["text"," "],
["keyword","let"],
["text"," "],
["keyword","module"],
["text"," "],
["identifier","M"],
["text"," "],
["keyword.operator","="]
],[
"start",
["text"," "],
["keyword","struct"],
["text"," "],
["keyword","exception"],
["text"," "],
["identifier","Return"],
["text"," "],
["keyword","of"],
["text"," "],
["identifier","t"],
["text"," "],
["keyword","end"]
],[
"start",
["text"," "],
["keyword","in"]
],[
"start",
["text"," "],
["keyword","let"],
["text"," "],
["identifier","return"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","{"],
["text"," "],
["identifier","return"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","("],
["keyword","fun"],
["text"," "],
["identifier","x"],
["text"," "],
["keyword.operator","->"],
["text"," "],
["support.function","raise"],
["text"," "],
["paren.lparen","("],
["identifier","M"],
["text","."],
["identifier","Return"],
["text"," "],
["identifier","x"],
["paren.rparen","))"],
["text","; "],
["paren.rparen","}"],
["text"," "],
["keyword","in"]
],[
"start",
["text"," "],
["keyword","try"],
["text"," "],
["identifier","f"],
["text"," "],
["identifier","return"],
["text"," "],
["keyword","with"],
["text"," "],
["identifier","M"],
["text","."],
["identifier","Return"],
["text"," "],
["identifier","x"],
["text"," "],
["keyword.operator","->"],
["text"," "],
["identifier","x"]
],[
"start"
],[
"start"
],[
"start",
["comment","(* Function that uses the 'early return' functionality provided by `with_return` *)"]
],[
"start",
["keyword","let"],
["text"," "],
["identifier","sum_until_first_negative"],
["text"," "],
["support.function","list"],
["text"," "],
["keyword.operator","="]
],[
"start",
["text"," "],
["identifier","with_return"],
["text"," "],
["paren.lparen","("],
["keyword","fun"],
["text"," "],
["identifier","r"],
["text"," "],
["keyword.operator","->"]
],[
"start",
["text"," "],
["support.function","List"],
["text","."],
["support.function","fold"],
["text"," "],
["support.function","list"],
["text"," "],
["keyword.operator","~"],
["support.function","init"],
["text",":"],
["constant.numeric","0"],
["text"," "],
["keyword.operator","~"],
["identifier","f"],
["text",":"],
["paren.lparen","("],
["keyword","fun"],
["text"," "],
["identifier","acc"],
["text"," "],
["identifier","x"],
["text"," "],
["keyword.operator","->"]
],[
"start",
["text"," "],
["keyword","if"],
["text"," "],
["identifier","x"],
["text"," "],
["keyword.operator",">="],
["text"," "],
["constant.numeric","0"],
["text"," "],
["keyword","then"],
["text"," "],
["identifier","acc"],
["text"," "],
["keyword.operator","+"],
["text"," "],
["identifier","x"],
["text"," "],
["keyword","else"],
["text"," "],
["identifier","r"],
["text","."],
["identifier","return"],
["text"," "],
["identifier","acc"],
["paren.rparen","))"]
]]

View file

@ -1,309 +1,214 @@
[
{
"state": "start",
"data": [
[ "comment", "#!/usr/bin/perl" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "use" ],
[ "text", " " ],
[ "identifier", "strict" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "use" ],
[ "text", " " ],
[ "identifier", "warnings" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "my" ],
[ "text", " " ],
[ "identifier", "$num_primes" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "constant.numeric", "0" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "my" ],
[ "text", " @" ],
[ "identifier", "primes" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "comment", "# Put 2 as the first prime so we won't have an empty array" ]
]
},
{
"state": "start",
"data": [
[ "identifier", "$primes" ],
[ "lparen", "[" ],
[ "identifier", "$num_primes" ],
[ "rparen", "]" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "constant.numeric", "2" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "identifier", "$num_primes" ],
[ "keyword.operator", "++" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "identifier", "MAIN_LOOP" ],
[ "text", ":" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "for" ],
[ "text", " " ],
[ "keyword", "my" ],
[ "text", " " ],
[ "identifier", "$number_to_check" ],
[ "text", " " ],
[ "lparen", "(" ],
[ "constant.numeric", "3" ],
[ "text", " " ],
[ "keyword.operator", ".." ],
[ "text", " " ],
[ "constant.numeric", "200" ],
[ "rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "for" ],
[ "text", " " ],
[ "keyword", "my" ],
[ "text", " " ],
[ "identifier", "$p" ],
[ "text", " " ],
[ "lparen", "(" ],
[ "constant.numeric", "0" ],
[ "text", " " ],
[ "keyword.operator", ".." ],
[ "text", " " ],
[ "lparen", "(" ],
[ "identifier", "$num_primes" ],
[ "constant.numeric", "-1" ],
[ "rparen", "))" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "if" ],
[ "text", " " ],
[ "lparen", "(" ],
[ "identifier", "$number_to_check" ],
[ "text", " " ],
[ "keyword.operator", "%" ],
[ "text", " " ],
[ "identifier", "$primes" ],
[ "lparen", "[" ],
[ "identifier", "$p" ],
[ "rparen", "]" ],
[ "text", " " ],
[ "keyword.operator", "==" ],
[ "text", " " ],
[ "constant.numeric", "0" ],
[ "rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "next" ],
[ "text", " " ],
[ "identifier", "MAIN_LOOP" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "# If we reached this point it means $number_to_check is not" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "# divisable by any prime number that came before it." ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "$primes" ],
[ "lparen", "[" ],
[ "identifier", "$num_primes" ],
[ "rparen", "]" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "identifier", "$number_to_check" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "$num_primes" ],
[ "keyword.operator", "++" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "for" ],
[ "text", " " ],
[ "keyword", "my" ],
[ "text", " " ],
[ "identifier", "$p" ],
[ "text", " " ],
[ "lparen", "(" ],
[ "constant.numeric", "0" ],
[ "text", " " ],
[ "keyword.operator", ".." ],
[ "text", " " ],
[ "lparen", "(" ],
[ "identifier", "$num_primes" ],
[ "constant.numeric", "-1" ],
[ "rparen", "))" ]
]
},
{
"state": "start",
"data": [
[ "lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.function", "print" ],
[ "text", " " ],
[ "identifier", "$primes" ],
[ "lparen", "[" ],
[ "identifier", "$p" ],
[ "rparen", "]" ],
[ "keyword.operator", "," ],
[ "text", " " ],
[ "string", "\", \"" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "support.function", "print" ],
[ "text", " " ],
[ "string", "\"\\n\"" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": []
}
]
[[
"start",
["comment","#!/usr/bin/perl"]
],[
"start",
["keyword","use"],
["text"," "],
["identifier","strict"],
["text",";"]
],[
"start",
["keyword","use"],
["text"," "],
["identifier","warnings"],
["text",";"]
],[
"start",
["keyword","my"],
["text"," "],
["identifier","$num_primes"],
["text"," "],
["keyword.operator","="],
["text"," "],
["constant.numeric","0"],
["text",";"]
],[
"start",
["keyword","my"],
["text"," @"],
["identifier","primes"],
["text",";"]
],[
"start"
],[
"start",
["comment","# Put 2 as the first prime so we won't have an empty array"]
],[
"start",
["identifier","$primes"],
["lparen","["],
["identifier","$num_primes"],
["rparen","]"],
["text"," "],
["keyword.operator","="],
["text"," "],
["constant.numeric","2"],
["text",";"]
],[
"start",
["identifier","$num_primes"],
["keyword.operator","++"],
["text",";"]
],[
"start"
],[
"start",
["identifier","MAIN_LOOP"],
["text",":"]
],[
"start",
["keyword","for"],
["text"," "],
["keyword","my"],
["text"," "],
["identifier","$number_to_check"],
["text"," "],
["lparen","("],
["constant.numeric","3"],
["text"," "],
["keyword.operator",".."],
["text"," "],
["constant.numeric","200"],
["rparen",")"]
],[
"start",
["lparen","{"]
],[
"start",
["text"," "],
["keyword","for"],
["text"," "],
["keyword","my"],
["text"," "],
["identifier","$p"],
["text"," "],
["lparen","("],
["constant.numeric","0"],
["text"," "],
["keyword.operator",".."],
["text"," "],
["lparen","("],
["identifier","$num_primes"],
["constant.numeric","-1"],
["rparen","))"]
],[
"start",
["text"," "],
["lparen","{"]
],[
"start",
["text"," "],
["keyword","if"],
["text"," "],
["lparen","("],
["identifier","$number_to_check"],
["text"," "],
["keyword.operator","%"],
["text"," "],
["identifier","$primes"],
["lparen","["],
["identifier","$p"],
["rparen","]"],
["text"," "],
["keyword.operator","=="],
["text"," "],
["constant.numeric","0"],
["rparen",")"]
],[
"start",
["text"," "],
["lparen","{"]
],[
"start",
["text"," "],
["keyword","next"],
["text"," "],
["identifier","MAIN_LOOP"],
["text",";"]
],[
"start",
["text"," "],
["rparen","}"]
],[
"start",
["text"," "],
["rparen","}"]
],[
"start"
],[
"start",
["text"," "],
["comment","# If we reached this point it means $number_to_check is not"]
],[
"start",
["text"," "],
["comment","# divisable by any prime number that came before it."]
],[
"start",
["text"," "],
["identifier","$primes"],
["lparen","["],
["identifier","$num_primes"],
["rparen","]"],
["text"," "],
["keyword.operator","="],
["text"," "],
["identifier","$number_to_check"],
["text",";"]
],[
"start",
["text"," "],
["identifier","$num_primes"],
["keyword.operator","++"],
["text",";"]
],[
"start",
["rparen","}"]
],[
"start"
],[
"start",
["keyword","for"],
["text"," "],
["keyword","my"],
["text"," "],
["identifier","$p"],
["text"," "],
["lparen","("],
["constant.numeric","0"],
["text"," "],
["keyword.operator",".."],
["text"," "],
["lparen","("],
["identifier","$num_primes"],
["constant.numeric","-1"],
["rparen","))"]
],[
"start",
["lparen","{"]
],[
"start",
["text"," "],
["support.function","print"],
["text"," "],
["identifier","$primes"],
["lparen","["],
["identifier","$p"],
["rparen","]"],
["keyword.operator",","],
["text"," "],
["string","\", \""],
["text",";"]
],[
"start",
["rparen","}"]
],[
"start",
["support.function","print"],
["text"," "],
["string","\"\\n\""],
["text",";"]
],[
"start"
]]

File diff suppressed because it is too large Load diff

View file

@ -1,188 +1,134 @@
[
{
"state": "php-start",
"data": [
[ "support.php_tag", "<?php" ]
]
},
{
"state": "php-start",
"data": []
},
{
"state": "php-start",
"data": [
[ "keyword", "function" ],
[ "text", " " ],
[ "identifier", "nfact" ],
[ "lparen", "(" ],
[ "variable", "$n" ],
[ "rparen", ")" ],
[ "text", " " ],
[ "lparen", "{" ]
]
},
{
"state": "php-start",
"data": [
[ "text", " " ],
[ "keyword", "if" ],
[ "text", " " ],
[ "lparen", "(" ],
[ "variable", "$n" ],
[ "text", " " ],
[ "keyword.operator", "==" ],
[ "text", " " ],
[ "constant.numeric", "0" ],
[ "rparen", ")" ],
[ "text", " " ],
[ "lparen", "{" ]
]
},
{
"state": "php-start",
"data": [
[ "text", " " ],
[ "support.function", "return" ],
[ "text", " " ],
[ "constant.numeric", "1" ],
[ "text", ";" ]
]
},
{
"state": "php-start",
"data": [
[ "text", " " ],
[ "rparen", "}" ]
]
},
{
"state": "php-start",
"data": [
[ "text", " " ],
[ "keyword", "else" ],
[ "text", " " ],
[ "lparen", "{" ]
]
},
{
"state": "php-start",
"data": [
[ "text", " " ],
[ "support.function", "return" ],
[ "text", " " ],
[ "variable", "$n" ],
[ "text", " " ],
[ "keyword.operator", "*" ],
[ "text", " " ],
[ "identifier", "nfact" ],
[ "lparen", "(" ],
[ "variable", "$n" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "text", " " ],
[ "constant.numeric", "1" ],
[ "rparen", ")" ],
[ "text", ";" ]
]
},
{
"state": "php-start",
"data": [
[ "text", " " ],
[ "rparen", "}" ]
]
},
{
"state": "php-start",
"data": [
[ "rparen", "}" ]
]
},
{
"state": "php-start",
"data": []
},
{
"state": "php-start",
"data": [
[ "support.function", "echo" ],
[ "text", " " ],
[ "string", "\"" ],
[ "constant.language.escape", "\\n\\n" ],
[ "string", "Please enter a whole number ... \"" ],
[ "text", ";" ]
]
},
{
"state": "php-start",
"data": [
[ "variable", "$num" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "support.function", "trim" ],
[ "lparen", "(" ],
[ "support.function", "fgets" ],
[ "lparen", "(" ],
[ "constant.language", "STDIN" ],
[ "rparen", "))" ],
[ "text", ";" ]
]
},
{
"state": "php-start",
"data": []
},
{
"state": "php-start",
"data": [
[ "comment", "// ===== PROCESS - Determing the factorial of the input number =====" ]
]
},
{
"state": "php-start",
"data": [
[ "variable", "$output" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "string", "\"" ],
[ "constant.language.escape", "\\n\\n" ],
[ "string", "Factorial \"" ],
[ "text", " . " ],
[ "variable", "$num" ],
[ "text", " . " ],
[ "string", "\" = \"" ],
[ "text", " . " ],
[ "identifier", "nfact" ],
[ "lparen", "(" ],
[ "variable", "$num" ],
[ "rparen", ")" ],
[ "text", " . " ],
[ "string", "\"" ],
[ "constant.language.escape", "\\n\\n" ],
[ "string", "\"" ],
[ "text", ";" ]
]
},
{
"state": "php-start",
"data": [
[ "support.function", "echo" ],
[ "text", " " ],
[ "variable", "$output" ],
[ "text", ";" ]
]
},
{
"state": "php-start",
"data": []
},
{
"state": "start",
"data": [
[ "support.php_tag", "?>" ]
]
}
]
[[
"php-start",
["support.php_tag","<?php"]
],[
"php-start"
],[
"php-start",
["keyword","function"],
["text"," "],
["identifier","nfact"],
["lparen","("],
["variable","$n"],
["rparen",")"],
["text"," "],
["lparen","{"]
],[
"php-start",
["text"," "],
["keyword","if"],
["text"," "],
["lparen","("],
["variable","$n"],
["text"," "],
["keyword.operator","=="],
["text"," "],
["constant.numeric","0"],
["rparen",")"],
["text"," "],
["lparen","{"]
],[
"php-start",
["text"," "],
["support.function","return"],
["text"," "],
["constant.numeric","1"],
["text",";"]
],[
"php-start",
["text"," "],
["rparen","}"]
],[
"php-start",
["text"," "],
["keyword","else"],
["text"," "],
["lparen","{"]
],[
"php-start",
["text"," "],
["support.function","return"],
["text"," "],
["variable","$n"],
["text"," "],
["keyword.operator","*"],
["text"," "],
["identifier","nfact"],
["lparen","("],
["variable","$n"],
["text"," "],
["keyword.operator","-"],
["text"," "],
["constant.numeric","1"],
["rparen",")"],
["text",";"]
],[
"php-start",
["text"," "],
["rparen","}"]
],[
"php-start",
["rparen","}"]
],[
"php-start"
],[
"php-start",
["support.function","echo"],
["text"," "],
["string","\""],
["constant.language.escape","\\n\\n"],
["string","Please enter a whole number ... \""],
["text",";"]
],[
"php-start",
["variable","$num"],
["text"," "],
["keyword.operator","="],
["text"," "],
["support.function","trim"],
["lparen","("],
["support.function","fgets"],
["lparen","("],
["constant.language","STDIN"],
["rparen","))"],
["text",";"]
],[
"php-start"
],[
"php-start",
["comment","// ===== PROCESS - Determing the factorial of the input number ====="]
],[
"php-start",
["variable","$output"],
["text"," "],
["keyword.operator","="],
["text"," "],
["string","\""],
["constant.language.escape","\\n\\n"],
["string","Factorial \""],
["text"," . "],
["variable","$num"],
["text"," . "],
["string","\" = \""],
["text"," . "],
["identifier","nfact"],
["lparen","("],
["variable","$num"],
["rparen",")"],
["text"," . "],
["string","\""],
["constant.language.escape","\\n\\n"],
["string","\""],
["text",";"]
],[
"php-start",
["support.function","echo"],
["text"," "],
["variable","$output"],
["text",";"]
],[
"php-start"
],[
"start",
["support.php_tag","?>"]
]]

View file

@ -1,254 +1,184 @@
[
{
"state": "start",
"data": [
[ "comment", "# This is a simple comment" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "function" ],
[ "text", " " ],
[ "identifier", "Hello" ],
[ "lparen", "(" ],
[ "variable.instance", "$name" ],
[ "rparen", ")" ],
[ "text", " " ],
[ "lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "Write-host" ],
[ "text", " " ],
[ "string", "\"Hello $name\"" ]
]
},
{
"state": "start",
"data": [
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "function" ],
[ "text", " " ],
[ "identifier", "add" ],
[ "lparen", "(" ],
[ "variable.instance", "$left" ],
[ "text", ", " ],
[ "variable.instance", "$right" ],
[ "keyword.operator", "=" ],
[ "constant.numeric", "4" ],
[ "rparen", ")" ],
[ "text", " " ],
[ "lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "if" ],
[ "text", " " ],
[ "lparen", "(" ],
[ "variable.instance", "$right" ],
[ "text", " " ],
[ "keyword.operator", "-ne" ],
[ "text", " " ],
[ "constant.numeric", "4" ],
[ "rparen", ")" ],
[ "text", " " ],
[ "lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "return" ],
[ "text", " " ],
[ "variable.instance", "$left" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "rparen", "}" ],
[ "text", " " ],
[ "keyword", "elseif" ],
[ "text", " " ],
[ "lparen", "(" ],
[ "variable.instance", "$left" ],
[ "text", " " ],
[ "keyword.operator", "-eq" ],
[ "text", " " ],
[ "constant.language", "$null" ],
[ "text", " " ],
[ "keyword.operator", "-and" ],
[ "text", " " ],
[ "variable.instance", "$right" ],
[ "text", " " ],
[ "keyword.operator", "-eq" ],
[ "text", " " ],
[ "constant.numeric", "2" ],
[ "rparen", ")" ],
[ "text", " " ],
[ "lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "return" ],
[ "text", " " ],
[ "constant.numeric", "3" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "rparen", "}" ],
[ "text", " " ],
[ "keyword", "else" ],
[ "text", " " ],
[ "lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "return" ],
[ "text", " " ],
[ "constant.numeric", "2" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "variable.instance", "$number" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "constant.numeric", "1" ],
[ "text", " " ],
[ "keyword.operator", "+" ],
[ "text", " " ],
[ "constant.numeric", "2" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "variable.instance", "$number" ],
[ "text", " " ],
[ "keyword.operator", "+=" ],
[ "text", " " ],
[ "constant.numeric", "3" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "support.function", "Write-Host" ],
[ "text", " " ],
[ "identifier", "Hello" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "identifier", "name" ],
[ "text", " " ],
[ "string", "\"World\"" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "variable.instance", "$an_array" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " @" ],
[ "lparen", "(" ],
[ "constant.numeric", "1" ],
[ "text", ", " ],
[ "constant.numeric", "2" ],
[ "text", ", " ],
[ "constant.numeric", "3" ],
[ "rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "variable.instance", "$a_hash" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " @" ],
[ "lparen", "{" ],
[ "string", "\"something\"" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "string", "\"something else\"" ],
[ "rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword.operator", "&" ],
[ "text", " " ],
[ "identifier", "notepad" ],
[ "text", " .\\" ],
[ "identifier", "readme" ],
[ "text", "." ],
[ "identifier", "md" ]
]
},
{
"state": "start",
"data": []
}
]
[[
"start",
["comment","# This is a simple comment"]
],[
"start",
["keyword","function"],
["text"," "],
["identifier","Hello"],
["lparen","("],
["variable.instance","$name"],
["rparen",")"],
["text"," "],
["lparen","{"]
],[
"start",
["text"," "],
["identifier","Write-host"],
["text"," "],
["string","\"Hello $name\""]
],[
"start",
["rparen","}"]
],[
"start"
],[
"start",
["keyword","function"],
["text"," "],
["identifier","add"],
["lparen","("],
["variable.instance","$left"],
["text",", "],
["variable.instance","$right"],
["keyword.operator","="],
["constant.numeric","4"],
["rparen",")"],
["text"," "],
["lparen","{"]
],[
"start",
["text"," "],
["keyword","if"],
["text"," "],
["lparen","("],
["variable.instance","$right"],
["text"," "],
["keyword.operator","-ne"],
["text"," "],
["constant.numeric","4"],
["rparen",")"],
["text"," "],
["lparen","{"]
],[
"start",
["text"," "],
["keyword","return"],
["text"," "],
["variable.instance","$left"]
],[
"start",
["text"," "],
["rparen","}"],
["text"," "],
["keyword","elseif"],
["text"," "],
["lparen","("],
["variable.instance","$left"],
["text"," "],
["keyword.operator","-eq"],
["text"," "],
["constant.language","$null"],
["text"," "],
["keyword.operator","-and"],
["text"," "],
["variable.instance","$right"],
["text"," "],
["keyword.operator","-eq"],
["text"," "],
["constant.numeric","2"],
["rparen",")"],
["text"," "],
["lparen","{"]
],[
"start",
["text"," "],
["keyword","return"],
["text"," "],
["constant.numeric","3"]
],[
"start",
["text"," "],
["rparen","}"],
["text"," "],
["keyword","else"],
["text"," "],
["lparen","{"]
],[
"start",
["text"," "],
["keyword","return"],
["text"," "],
["constant.numeric","2"]
],[
"start",
["text"," "],
["rparen","}"]
],[
"start",
["rparen","}"]
],[
"start"
],[
"start",
["variable.instance","$number"],
["text"," "],
["keyword.operator","="],
["text"," "],
["constant.numeric","1"],
["text"," "],
["keyword.operator","+"],
["text"," "],
["constant.numeric","2"],
["text",";"]
],[
"start",
["variable.instance","$number"],
["text"," "],
["keyword.operator","+="],
["text"," "],
["constant.numeric","3"]
],[
"start"
],[
"start",
["support.function","Write-Host"],
["text"," "],
["identifier","Hello"],
["text"," "],
["keyword.operator","-"],
["identifier","name"],
["text"," "],
["string","\"World\""]
],[
"start"
],[
"start",
["variable.instance","$an_array"],
["text"," "],
["keyword.operator","="],
["text"," @"],
["lparen","("],
["constant.numeric","1"],
["text",", "],
["constant.numeric","2"],
["text",", "],
["constant.numeric","3"],
["rparen",")"]
],[
"start",
["variable.instance","$a_hash"],
["text"," "],
["keyword.operator","="],
["text"," @"],
["lparen","{"],
["string","\"something\""],
["text"," "],
["keyword.operator","="],
["text"," "],
["string","\"something else\""],
["rparen","}"]
],[
"start"
],[
"start",
["keyword.operator","&"],
["text"," "],
["identifier","notepad"],
["text"," .\\"],
["identifier","readme"],
["text","."],
["identifier","md"]
],[
"start"
]]

View file

@ -1,203 +1,148 @@
[
{
"state": "start",
"data": [
[ "comment", "#!/usr/local/bin/python" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "import" ],
[ "text", " " ],
[ "identifier", "string" ],
[ "text", ", " ],
[ "identifier", "sys" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "comment", "# If no arguments were given, print a helpful message" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "if" ],
[ "text", " " ],
[ "support.function", "len" ],
[ "paren.lparen", "(" ],
[ "identifier", "sys" ],
[ "text", "." ],
[ "identifier", "argv" ],
[ "paren.rparen", ")" ],
[ "keyword.operator", "==" ],
[ "constant.numeric", "1" ],
[ "text", ":" ]
]
},
{
"state": "qstring",
"data": [
[ "text", " " ],
[ "keyword", "print" ],
[ "text", " " ],
[ "string", "'''Usage:" ]
]
},
{
"state": "start",
"data": [
[ "string", "celsius temp1 temp2 ...'''" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "sys" ],
[ "text", "." ],
[ "identifier", "exit" ],
[ "paren.lparen", "(" ],
[ "constant.numeric", "0" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "comment", "# Loop over the arguments" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "for" ],
[ "text", " " ],
[ "identifier", "i" ],
[ "text", " " ],
[ "keyword", "in" ],
[ "text", " " ],
[ "identifier", "sys" ],
[ "text", "." ],
[ "identifier", "argv" ],
[ "paren.lparen", "[" ],
[ "constant.numeric", "1" ],
[ "text", ":" ],
[ "paren.rparen", "]" ],
[ "text", ":" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "try" ],
[ "text", ":" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "fahrenheit" ],
[ "keyword.operator", "=" ],
[ "support.function", "float" ],
[ "paren.lparen", "(" ],
[ "identifier", "string" ],
[ "text", "." ],
[ "identifier", "atoi" ],
[ "paren.lparen", "(" ],
[ "identifier", "i" ],
[ "paren.rparen", "))" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "except" ],
[ "text", " " ],
[ "identifier", "string" ],
[ "text", "." ],
[ "identifier", "atoi_error" ],
[ "text", ":" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "print" ],
[ "text", " " ],
[ "support.function", "repr" ],
[ "paren.lparen", "(" ],
[ "identifier", "i" ],
[ "paren.rparen", ")" ],
[ "text", ", " ],
[ "string", "\"not a numeric value\"" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "else" ],
[ "text", ":" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "celsius" ],
[ "keyword.operator", "=" ],
[ "paren.lparen", "(" ],
[ "identifier", "fahrenheit" ],
[ "keyword.operator", "-" ],
[ "constant.numeric", "32" ],
[ "paren.rparen", ")" ],
[ "keyword.operator", "*" ],
[ "constant.numeric", "5.0" ],
[ "keyword.operator", "/" ],
[ "constant.numeric", "9.0" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "print" ],
[ "text", " " ],
[ "string", "'%i\\260F = %i\\260C'" ],
[ "text", " " ],
[ "keyword.operator", "%" ],
[ "text", " " ],
[ "paren.lparen", "(" ],
[ "support.function", "int" ],
[ "paren.lparen", "(" ],
[ "identifier", "fahrenheit" ],
[ "paren.rparen", ")" ],
[ "text", ", " ],
[ "support.function", "int" ],
[ "paren.lparen", "(" ],
[ "identifier", "celsius" ],
[ "keyword.operator", "+" ],
[ "constant.numeric", ".5" ],
[ "paren.rparen", "))" ]
]
}
]
[[
"start",
["comment","#!/usr/local/bin/python"]
],[
"start"
],[
"start",
["keyword","import"],
["text"," "],
["identifier","string"],
["text",", "],
["identifier","sys"]
],[
"start"
],[
"start",
["comment","# If no arguments were given, print a helpful message"]
],[
"start",
["keyword","if"],
["text"," "],
["support.function","len"],
["paren.lparen","("],
["identifier","sys"],
["text","."],
["identifier","argv"],
["paren.rparen",")"],
["keyword.operator","=="],
["constant.numeric","1"],
["text",":"]
],[
"qstring",
["text"," "],
["keyword","print"],
["text"," "],
["string","'''Usage:"]
],[
"start",
["string","celsius temp1 temp2 ...'''"]
],[
"start",
["text"," "],
["identifier","sys"],
["text","."],
["identifier","exit"],
["paren.lparen","("],
["constant.numeric","0"],
["paren.rparen",")"]
],[
"start"
],[
"start",
["comment","# Loop over the arguments"]
],[
"start",
["keyword","for"],
["text"," "],
["identifier","i"],
["text"," "],
["keyword","in"],
["text"," "],
["identifier","sys"],
["text","."],
["identifier","argv"],
["paren.lparen","["],
["constant.numeric","1"],
["text",":"],
["paren.rparen","]"],
["text",":"]
],[
"start",
["text"," "],
["keyword","try"],
["text",":"]
],[
"start",
["text"," "],
["identifier","fahrenheit"],
["keyword.operator","="],
["support.function","float"],
["paren.lparen","("],
["identifier","string"],
["text","."],
["identifier","atoi"],
["paren.lparen","("],
["identifier","i"],
["paren.rparen","))"]
],[
"start",
["text"," "],
["keyword","except"],
["text"," "],
["identifier","string"],
["text","."],
["identifier","atoi_error"],
["text",":"]
],[
"start",
["text"," "],
["keyword","print"],
["text"," "],
["support.function","repr"],
["paren.lparen","("],
["identifier","i"],
["paren.rparen",")"],
["text",", "],
["string","\"not a numeric value\""]
],[
"start",
["text"," "],
["keyword","else"],
["text",":"]
],[
"start",
["text"," "],
["identifier","celsius"],
["keyword.operator","="],
["paren.lparen","("],
["identifier","fahrenheit"],
["keyword.operator","-"],
["constant.numeric","32"],
["paren.rparen",")"],
["keyword.operator","*"],
["constant.numeric","5.0"],
["keyword.operator","/"],
["constant.numeric","9.0"]
],[
"start",
["text"," "],
["keyword","print"],
["text"," "],
["string","'%i\\260F = %i\\260C'"],
["text"," "],
["keyword.operator","%"],
["text"," "],
["paren.lparen","("],
["support.function","int"],
["paren.lparen","("],
["identifier","fahrenheit"],
["paren.rparen",")"],
["text",", "],
["support.function","int"],
["paren.lparen","("],
["identifier","celsius"],
["keyword.operator","+"],
["constant.numeric",".5"],
["paren.rparen","))"]
]]

View file

@ -1,296 +1,235 @@
[
{
"state": "start",
"data": [
[ "identifier", "Call" ],
[ "keyword.operator", ":" ]
]
},
{
"state": "start",
"data": [
[ "identifier", "lm" ],
[ "paren.keyword.operator", "(" ],
[ "identifier", "formula" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "identifier", "y" ],
[ "text", " " ],
[ "keyword.operator", "~" ],
[ "text", " " ],
[ "identifier", "x" ],
[ "paren.keyword.operator", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "identifier", "Residuals" ],
[ "keyword.operator", ":" ]
]
},
{
"state": "start",
"data": [
[ "constant.numeric", "1" ],
[ "text", " " ],
[ "constant.numeric", "2" ],
[ "text", " " ],
[ "constant.numeric", "3" ],
[ "text", " " ],
[ "constant.numeric", "4" ],
[ "text", " " ],
[ "constant.numeric", "5" ],
[ "text", " " ],
[ "constant.numeric", "6" ]
]
},
{
"state": "start",
"data": [
[ "constant.numeric", "3.3333" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "constant.numeric", "0.6667" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "constant.numeric", "2.6667" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "constant.numeric", "2.6667" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "constant.numeric", "0.6667" ],
[ "text", " " ],
[ "constant.numeric", "3.3333" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "identifier", "Coefficients" ],
[ "keyword.operator", ":" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "Estimate" ],
[ "text", " " ],
[ "identifier", "Std" ],
[ "text", ". " ],
[ "identifier", "Error" ],
[ "text", " " ],
[ "identifier", "t" ],
[ "text", " " ],
[ "identifier", "value" ],
[ "text", " " ],
[ "identifier", "Pr" ],
[ "paren.keyword.operator", "(" ],
[ "keyword.operator", ">|" ],
[ "identifier", "t" ],
[ "keyword.operator", "|" ],
[ "paren.keyword.operator", ")" ]
]
},
{
"state": "start",
"data": [
[ "paren.keyword.operator", "(" ],
[ "identifier", "Intercept" ],
[ "paren.keyword.operator", ")" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "constant.numeric", "9.3333" ],
[ "text", " " ],
[ "constant.numeric", "2.8441" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "constant.numeric", "3.282" ],
[ "text", " " ],
[ "constant.numeric", "0.030453" ],
[ "text", " " ],
[ "keyword.operator", "*" ]
]
},
{
"state": "start",
"data": [
[ "identifier", "x" ],
[ "text", " " ],
[ "constant.numeric", "7.0000" ],
[ "text", " " ],
[ "constant.numeric", "0.7303" ],
[ "text", " " ],
[ "constant.numeric", "9.585" ],
[ "text", " " ],
[ "constant.numeric", "0.000662" ],
[ "text", " " ],
[ "keyword.operator", "***" ]
]
},
{
"state": "start",
"data": [
[ "keyword.operator", "---" ]
]
},
{
"state": "start",
"data": [
[ "identifier", "Signif" ],
[ "text", ". " ],
[ "identifier", "codes" ],
[ "keyword.operator", ":" ],
[ "text", " " ],
[ "constant.numeric", "0" ],
[ "text", " " ],
[ "keyword.operator", "***" ],
[ "text", " " ],
[ "constant.numeric", "0.001" ],
[ "text", " " ],
[ "keyword.operator", "**" ],
[ "text", " " ],
[ "constant.numeric", "0.01" ],
[ "text", " " ],
[ "keyword.operator", "*" ],
[ "text", " " ],
[ "constant.numeric", "0.05" ],
[ "text", " . " ],
[ "constant.numeric", "0.1" ],
[ "text", " " ],
[ "constant.numeric", "1" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "identifier", "Residual" ],
[ "text", " " ],
[ "identifier", "standard" ],
[ "text", " " ],
[ "identifier", "error" ],
[ "keyword.operator", ":" ],
[ "text", " " ],
[ "constant.numeric", "3.055" ],
[ "text", " " ],
[ "identifier", "on" ],
[ "text", " " ],
[ "constant.numeric", "4" ],
[ "text", " " ],
[ "identifier", "degrees" ],
[ "text", " " ],
[ "identifier", "of" ],
[ "text", " " ],
[ "identifier", "freedom" ]
]
},
{
"state": "start",
"data": [
[ "identifier", "Multiple" ],
[ "text", " " ],
[ "identifier", "R" ],
[ "keyword.operator", "-" ],
[ "identifier", "squared" ],
[ "keyword.operator", ":" ],
[ "text", " " ],
[ "constant.numeric", "0.9583" ],
[ "text", ", " ],
[ "identifier", "Adjusted" ],
[ "text", " " ],
[ "identifier", "R" ],
[ "keyword.operator", "-" ],
[ "identifier", "squared" ],
[ "keyword.operator", ":" ],
[ "text", " " ],
[ "constant.numeric", "0.9478" ]
]
},
{
"state": "start",
"data": [
[ "constant.language.boolean", "F" ],
[ "keyword.operator", "-" ],
[ "identifier", "statistic" ],
[ "keyword.operator", ":" ],
[ "text", " " ],
[ "constant.numeric", "91.88" ],
[ "text", " " ],
[ "identifier", "on" ],
[ "text", " " ],
[ "constant.numeric", "1" ],
[ "text", " " ],
[ "identifier", "and" ],
[ "text", " " ],
[ "constant.numeric", "4" ],
[ "text", " " ],
[ "identifier", "DF" ],
[ "text", ", " ],
[ "identifier", "p" ],
[ "keyword.operator", "-" ],
[ "identifier", "value" ],
[ "keyword.operator", ":" ],
[ "text", " " ],
[ "constant.numeric", "0.000662" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "keyword.operator", ">" ],
[ "text", " " ],
[ "identifier", "par" ],
[ "paren.keyword.operator", "(" ],
[ "identifier", "mfrow" ],
[ "keyword.operator", "=" ],
[ "identifier", "c" ],
[ "paren.keyword.operator", "(" ],
[ "constant.numeric", "2" ],
[ "text", ", " ],
[ "constant.numeric", "2" ],
[ "paren.keyword.operator", "))" ],
[ "text", " " ],
[ "comment", "# Request 2x2 plot layout" ]
]
},
{
"state": "start",
"data": [
[ "keyword.operator", ">" ],
[ "text", " " ],
[ "identifier", "plot" ],
[ "paren.keyword.operator", "(" ],
[ "identifier", "lm_1" ],
[ "paren.keyword.operator", ")" ],
[ "text", " " ],
[ "comment", "# Diagnostic plot of regression model" ]
]
}
]
[[
"start",
["identifier","Call"],
["keyword.operator",":"]
],[
"start",
["identifier","lm"],
["paren.keyword.operator","("],
["identifier","formula"],
["text"," "],
["keyword.operator","="],
["text"," "],
["identifier","y"],
["text"," "],
["keyword.operator","~"],
["text"," "],
["identifier","x"],
["paren.keyword.operator",")"]
],[
"start",
["text"," "]
],[
"start",
["identifier","Residuals"],
["keyword.operator",":"]
],[
"start",
["constant.numeric","1"],
["text"," "],
["constant.numeric","2"],
["text"," "],
["constant.numeric","3"],
["text"," "],
["constant.numeric","4"],
["text"," "],
["constant.numeric","5"],
["text"," "],
["constant.numeric","6"]
],[
"start",
["constant.numeric","3.3333"],
["text"," "],
["keyword.operator","-"],
["constant.numeric","0.6667"],
["text"," "],
["keyword.operator","-"],
["constant.numeric","2.6667"],
["text"," "],
["keyword.operator","-"],
["constant.numeric","2.6667"],
["text"," "],
["keyword.operator","-"],
["constant.numeric","0.6667"],
["text"," "],
["constant.numeric","3.3333"]
],[
"start",
["text"," "]
],[
"start",
["identifier","Coefficients"],
["keyword.operator",":"]
],[
"start",
["text"," "],
["identifier","Estimate"],
["text"," "],
["identifier","Std"],
["text",". "],
["identifier","Error"],
["text"," "],
["identifier","t"],
["text"," "],
["identifier","value"],
["text"," "],
["identifier","Pr"],
["paren.keyword.operator","("],
["keyword.operator",">|"],
["identifier","t"],
["keyword.operator","|"],
["paren.keyword.operator",")"]
],[
"start",
["paren.keyword.operator","("],
["identifier","Intercept"],
["paren.keyword.operator",")"],
["text"," "],
["keyword.operator","-"],
["constant.numeric","9.3333"],
["text"," "],
["constant.numeric","2.8441"],
["text"," "],
["keyword.operator","-"],
["constant.numeric","3.282"],
["text"," "],
["constant.numeric","0.030453"],
["text"," "],
["keyword.operator","*"]
],[
"start",
["identifier","x"],
["text"," "],
["constant.numeric","7.0000"],
["text"," "],
["constant.numeric","0.7303"],
["text"," "],
["constant.numeric","9.585"],
["text"," "],
["constant.numeric","0.000662"],
["text"," "],
["keyword.operator","***"]
],[
"start",
["keyword.operator","---"]
],[
"start",
["identifier","Signif"],
["text",". "],
["identifier","codes"],
["keyword.operator",":"],
["text"," "],
["constant.numeric","0"],
["text"," "],
["keyword.operator","***"],
["text"," "],
["constant.numeric","0.001"],
["text"," "],
["keyword.operator","**"],
["text"," "],
["constant.numeric","0.01"],
["text"," "],
["keyword.operator","*"],
["text"," "],
["constant.numeric","0.05"],
["text"," . "],
["constant.numeric","0.1"],
["text"," "],
["constant.numeric","1"]
],[
"start",
["text"," "]
],[
"start",
["identifier","Residual"],
["text"," "],
["identifier","standard"],
["text"," "],
["identifier","error"],
["keyword.operator",":"],
["text"," "],
["constant.numeric","3.055"],
["text"," "],
["identifier","on"],
["text"," "],
["constant.numeric","4"],
["text"," "],
["identifier","degrees"],
["text"," "],
["identifier","of"],
["text"," "],
["identifier","freedom"]
],[
"start",
["identifier","Multiple"],
["text"," "],
["identifier","R"],
["keyword.operator","-"],
["identifier","squared"],
["keyword.operator",":"],
["text"," "],
["constant.numeric","0.9583"],
["text",", "],
["identifier","Adjusted"],
["text"," "],
["identifier","R"],
["keyword.operator","-"],
["identifier","squared"],
["keyword.operator",":"],
["text"," "],
["constant.numeric","0.9478"]
],[
"start",
["constant.language.boolean","F"],
["keyword.operator","-"],
["identifier","statistic"],
["keyword.operator",":"],
["text"," "],
["constant.numeric","91.88"],
["text"," "],
["identifier","on"],
["text"," "],
["constant.numeric","1"],
["text"," "],
["identifier","and"],
["text"," "],
["constant.numeric","4"],
["text"," "],
["identifier","DF"],
["text",", "],
["identifier","p"],
["keyword.operator","-"],
["identifier","value"],
["keyword.operator",":"],
["text"," "],
["constant.numeric","0.000662"]
],[
"start",
["text"," "]
],[
"start",
["keyword.operator",">"],
["text"," "],
["identifier","par"],
["paren.keyword.operator","("],
["identifier","mfrow"],
["keyword.operator","="],
["identifier","c"],
["paren.keyword.operator","("],
["constant.numeric","2"],
["text",", "],
["constant.numeric","2"],
["paren.keyword.operator","))"],
["text"," "],
["comment","# Request 2x2 plot layout"]
],[
"start",
["keyword.operator",">"],
["text"," "],
["identifier","plot"],
["paren.keyword.operator","("],
["identifier","lm_1"],
["paren.keyword.operator",")"],
["text"," "],
["comment","# Diagnostic plot of regression model"]
]]

File diff suppressed because it is too large Load diff

View file

@ -1,168 +1,106 @@
[
{
"state": "start",
"data": [
[ "meta.tag", "<" ],
[ "meta.tag.tag-name", "html" ],
[ "meta.tag.r", ">" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "meta.tag", "<" ],
[ "meta.tag.tag-name", "head" ],
[ "meta.tag.r", ">" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag", "<" ],
[ "meta.tag.tag-name", "title" ],
[ "meta.tag.r", ">" ],
[ "text", "Title" ],
[ "meta.tag", "</" ],
[ "meta.tag.tag-name", "title" ],
[ "meta.tag.r", ">" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag", "</" ],
[ "meta.tag.tag-name", "head" ],
[ "meta.tag.r", ">" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "meta.tag", "<" ],
[ "meta.tag.tag-name", "body" ],
[ "meta.tag.r", ">" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "meta.tag", "<" ],
[ "meta.tag.tag-name", "p" ],
[ "meta.tag.r", ">" ],
[ "text", "This is an R HTML document. When you click the " ],
[ "meta.tag", "<" ],
[ "meta.tag.tag-name", "b" ],
[ "meta.tag.r", ">" ],
[ "text", "Knit HTML" ],
[ "meta.tag", "</" ],
[ "meta.tag.tag-name", "b" ],
[ "meta.tag.r", ">" ],
[ "text", " button a web page will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:" ],
[ "meta.tag", "</" ],
[ "meta.tag.tag-name", "p" ],
[ "meta.tag.r", ">" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "r-start",
"data": [
[ "support.function.codebegin", "<!--begin.rcode" ]
]
},
{
"state": "r-start",
"data": [
[ "identifier", "summary" ],
[ "paren.keyword.operator", "(" ],
[ "identifier", "cars" ],
[ "paren.keyword.operator", ")" ]
]
},
{
"state": "start",
"data": [
[ "support.function.codeend", "end.rcode-->" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "meta.tag", "<" ],
[ "meta.tag.tag-name", "p" ],
[ "meta.tag.r", ">" ],
[ "text", "You can also embed plots, for example:" ],
[ "meta.tag", "</" ],
[ "meta.tag.tag-name", "p" ],
[ "meta.tag.r", ">" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "r-start",
"data": [
[ "support.function.codebegin", "<!--begin.rcode fig.width=7, fig.height=6" ]
]
},
{
"state": "r-start",
"data": [
[ "identifier", "plot" ],
[ "paren.keyword.operator", "(" ],
[ "identifier", "cars" ],
[ "paren.keyword.operator", ")" ]
]
},
{
"state": "start",
"data": [
[ "support.function.codeend", "end.rcode-->" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "meta.tag", "</" ],
[ "meta.tag.tag-name", "body" ],
[ "meta.tag.r", ">" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag", "</" ],
[ "meta.tag.tag-name", "html" ],
[ "meta.tag.r", ">" ]
]
},
{
"state": "start",
"data": []
}
]
[[
"start",
["meta.tag","<"],
["meta.tag.tag-name","html"],
["meta.tag.r",">"]
],[
"start"
],[
"start",
["meta.tag","<"],
["meta.tag.tag-name","head"],
["meta.tag.r",">"]
],[
"start",
["meta.tag","<"],
["meta.tag.tag-name","title"],
["meta.tag.r",">"],
["text","Title"],
["meta.tag","</"],
["meta.tag.tag-name","title"],
["meta.tag.r",">"]
],[
"start",
["meta.tag","</"],
["meta.tag.tag-name","head"],
["meta.tag.r",">"]
],[
"start"
],[
"start",
["meta.tag","<"],
["meta.tag.tag-name","body"],
["meta.tag.r",">"]
],[
"start"
],[
"start",
["meta.tag","<"],
["meta.tag.tag-name","p"],
["meta.tag.r",">"],
["text","This is an R HTML document. When you click the "],
["meta.tag","<"],
["meta.tag.tag-name","b"],
["meta.tag.r",">"],
["text","Knit HTML"],
["meta.tag","</"],
["meta.tag.tag-name","b"],
["meta.tag.r",">"],
["text"," button a web page will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:"],
["meta.tag","</"],
["meta.tag.tag-name","p"],
["meta.tag.r",">"]
],[
"start"
],[
"r-start",
["support.function.codebegin","<!--begin.rcode"]
],[
"r-start",
["identifier","summary"],
["paren.keyword.operator","("],
["identifier","cars"],
["paren.keyword.operator",")"]
],[
"start",
["support.function.codeend","end.rcode-->"]
],[
"start"
],[
"start",
["meta.tag","<"],
["meta.tag.tag-name","p"],
["meta.tag.r",">"],
["text","You can also embed plots, for example:"],
["meta.tag","</"],
["meta.tag.tag-name","p"],
["meta.tag.r",">"]
],[
"start"
],[
"r-start",
["support.function.codebegin","<!--begin.rcode fig.width=7, fig.height=6"]
],[
"r-start",
["identifier","plot"],
["paren.keyword.operator","("],
["identifier","cars"],
["paren.keyword.operator",")"]
],[
"start",
["support.function.codeend","end.rcode-->"]
],[
"start"
],[
"start",
["meta.tag","</"],
["meta.tag.tag-name","body"],
["meta.tag.r",">"]
],[
"start",
["meta.tag","</"],
["meta.tag.tag-name","html"],
["meta.tag.r",">"]
],[
"start"
]]

View file

@ -1,220 +1,154 @@
[
{
"state": "start",
"data": [
[ "comment", "#!/usr/bin/ruby" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "comment", "# Program to find the factorial of a number" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "def" ],
[ "text", " " ],
[ "identifier", "fact" ],
[ "paren.lparen", "(" ],
[ "identifier", "n" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "if" ],
[ "text", " " ],
[ "identifier", "n" ],
[ "text", " " ],
[ "keyword.operator", "==" ],
[ "text", " " ],
[ "constant.numeric", "0" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "constant.numeric", "1" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "else" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "n" ],
[ "text", " " ],
[ "keyword.operator", "*" ],
[ "text", " " ],
[ "identifier", "fact" ],
[ "paren.lparen", "(" ],
[ "identifier", "n" ],
[ "constant.numeric", "-1" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "end" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "end" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "support.function", "puts" ],
[ "text", " " ],
[ "identifier", "fact" ],
[ "paren.lparen", "(" ],
[ "support.class", "ARGV" ],
[ "paren.lparen", "[" ],
[ "constant.numeric", "0" ],
[ "paren.rparen", "]" ],
[ "text", "." ],
[ "identifier", "to_i" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "class" ],
[ "text", " " ],
[ "support.class", "Range" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "def" ],
[ "text", " " ],
[ "identifier", "to_json" ],
[ "paren.lparen", "(" ],
[ "keyword.operator", "*" ],
[ "identifier", "a" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "string", "'json_class'" ],
[ "text", " " ],
[ "punctuation.separator.key-value", "=>" ],
[ "text", " " ],
[ "variable.language", "self" ],
[ "text", "." ],
[ "keyword", "class" ],
[ "text", "." ],
[ "identifier", "name" ],
[ "text", ", " ],
[ "comment", "# = 'Range'" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "string", "'data'" ],
[ "text", " " ],
[ "punctuation.separator.key-value", "=>" ],
[ "text", " " ],
[ "paren.lparen", "[" ],
[ "text", " " ],
[ "identifier", "first" ],
[ "text", ", " ],
[ "identifier", "last" ],
[ "text", ", " ],
[ "identifier", "exclude_end" ],
[ "text", "? " ],
[ "paren.rparen", "]" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "paren.rparen", "}" ],
[ "text", "." ],
[ "identifier", "to_json" ],
[ "paren.lparen", "(" ],
[ "keyword.operator", "*" ],
[ "identifier", "a" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "end" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "end" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "paren.lparen", "{" ],
[ "constant.other.symbol.ruby", ":id" ],
[ "text", " " ],
[ "punctuation.separator.key-value", "=>" ],
[ "text", " " ],
[ "constant.numeric", "34" ],
[ "text", ", " ],
[ "constant.other.symbol.ruby", ":sdfasdfasdf" ],
[ "text", " " ],
[ "punctuation.separator.key-value", "=>" ],
[ "text", " " ],
[ "string", "\"asdasdads\"" ],
[ "paren.rparen", "}" ]
]
}
]
[[
"start",
["comment","#!/usr/bin/ruby"]
],[
"start"
],[
"start",
["comment","# Program to find the factorial of a number"]
],[
"start",
["keyword","def"],
["text"," "],
["identifier","fact"],
["paren.lparen","("],
["identifier","n"],
["paren.rparen",")"]
],[
"start",
["text"," "],
["keyword","if"],
["text"," "],
["identifier","n"],
["text"," "],
["keyword.operator","=="],
["text"," "],
["constant.numeric","0"]
],[
"start",
["text"," "],
["constant.numeric","1"]
],[
"start",
["text"," "],
["keyword","else"]
],[
"start",
["text"," "],
["identifier","n"],
["text"," "],
["keyword.operator","*"],
["text"," "],
["identifier","fact"],
["paren.lparen","("],
["identifier","n"],
["constant.numeric","-1"],
["paren.rparen",")"]
],[
"start",
["text"," "],
["keyword","end"]
],[
"start",
["keyword","end"]
],[
"start"
],[
"start",
["support.function","puts"],
["text"," "],
["identifier","fact"],
["paren.lparen","("],
["support.class","ARGV"],
["paren.lparen","["],
["constant.numeric","0"],
["paren.rparen","]"],
["text","."],
["identifier","to_i"],
["paren.rparen",")"]
],[
"start"
],[
"start",
["keyword","class"],
["text"," "],
["support.class","Range"]
],[
"start",
["text"," "],
["keyword","def"],
["text"," "],
["identifier","to_json"],
["paren.lparen","("],
["keyword.operator","*"],
["identifier","a"],
["paren.rparen",")"]
],[
"start",
["text"," "],
["paren.lparen","{"]
],[
"start",
["text"," "],
["string","'json_class'"],
["text"," "],
["punctuation.separator.key-value","=>"],
["text"," "],
["variable.language","self"],
["text","."],
["keyword","class"],
["text","."],
["identifier","name"],
["text",", "],
["comment","# = 'Range'"]
],[
"start",
["text"," "],
["string","'data'"],
["text"," "],
["punctuation.separator.key-value","=>"],
["text"," "],
["paren.lparen","["],
["text"," "],
["identifier","first"],
["text",", "],
["identifier","last"],
["text",", "],
["identifier","exclude_end"],
["text","? "],
["paren.rparen","]"]
],[
"start",
["text"," "],
["paren.rparen","}"],
["text","."],
["identifier","to_json"],
["paren.lparen","("],
["keyword.operator","*"],
["identifier","a"],
["paren.rparen",")"]
],[
"start",
["text"," "],
["keyword","end"]
],[
"start",
["keyword","end"]
],[
"start"
],[
"start",
["paren.lparen","{"],
["constant.other.symbol.ruby",":id"],
["text"," "],
["punctuation.separator.key-value","=>"],
["text"," "],
["constant.numeric","34"],
["text",", "],
["constant.other.symbol.ruby",":sdfasdfasdf"],
["text"," "],
["punctuation.separator.key-value","=>"],
["text"," "],
["string","\"asdasdads\""],
["paren.rparen","}"]
]]

View file

@ -1,256 +1,194 @@
[
{
"state": "start",
"data": [
[ "comment", "// ace can highlight scad!" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "module" ],
[ "text", " " ],
[ "identifier", "Element" ],
[ "paren.lparen", "(" ],
[ "identifier", "xpos" ],
[ "text", ", " ],
[ "identifier", "ypos" ],
[ "text", ", " ],
[ "identifier", "zpos" ],
[ "paren.rparen", ")" ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "identifier", "translate" ],
[ "paren.lparen", "([" ],
[ "identifier", "xpos" ],
[ "text", "," ],
[ "identifier", "ypos" ],
[ "text", "," ],
[ "identifier", "zpos" ],
[ "paren.rparen", "])" ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t\t" ],
[ "identifier", "union" ],
[ "paren.lparen", "(" ],
[ "paren.rparen", ")" ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t\t\t" ],
[ "identifier", "cube" ],
[ "paren.lparen", "([" ],
[ "constant.numeric", "10" ],
[ "text", "," ],
[ "constant.numeric", "10" ],
[ "text", "," ],
[ "constant.numeric", "4" ],
[ "paren.rparen", "]" ],
[ "text", "," ],
[ "identifier", "true" ],
[ "paren.rparen", ")" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t\t\t" ],
[ "identifier", "cylinder" ],
[ "paren.lparen", "(" ],
[ "constant.numeric", "10" ],
[ "text", "," ],
[ "constant.numeric", "15" ],
[ "text", "," ],
[ "constant.numeric", "5" ],
[ "paren.rparen", ")" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t\t\t" ],
[ "identifier", "translate" ],
[ "paren.lparen", "([" ],
[ "constant.numeric", "0" ],
[ "text", "," ],
[ "constant.numeric", "0" ],
[ "text", "," ],
[ "constant.numeric", "10" ],
[ "paren.rparen", "])" ],
[ "identifier", "sphere" ],
[ "paren.lparen", "(" ],
[ "constant.numeric", "5" ],
[ "paren.rparen", ")" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t\t" ],
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "identifier", "union" ],
[ "paren.lparen", "(" ],
[ "paren.rparen", ")" ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "keyword", "for" ],
[ "paren.lparen", "(" ],
[ "identifier", "i" ],
[ "keyword.operator", "=" ],
[ "paren.lparen", "[" ],
[ "constant.numeric", "0" ],
[ "text", ":" ],
[ "constant.numeric", "30" ],
[ "paren.rparen", "])" ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t\t# " ],
[ "identifier", "Element" ],
[ "paren.lparen", "(" ],
[ "constant.numeric", "0" ],
[ "text", "," ],
[ "constant.numeric", "0" ],
[ "text", "," ],
[ "constant.numeric", "0" ],
[ "paren.rparen", ")" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t\t" ],
[ "identifier", "Element" ],
[ "paren.lparen", "(" ],
[ "constant.numeric", "15" ],
[ "keyword.operator", "*" ],
[ "identifier", "i" ],
[ "text", "," ],
[ "constant.numeric", "0" ],
[ "text", "," ],
[ "constant.numeric", "0" ],
[ "paren.rparen", ")" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "for" ],
[ "text", " " ],
[ "paren.lparen", "(" ],
[ "identifier", "i" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "paren.lparen", "[" ],
[ "constant.numeric", "3" ],
[ "text", ", " ],
[ "constant.numeric", "5" ],
[ "text", ", " ],
[ "constant.numeric", "7" ],
[ "text", ", " ],
[ "constant.numeric", "11" ],
[ "paren.rparen", "])" ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "identifier", "rotate" ],
[ "paren.lparen", "([" ],
[ "identifier", "i" ],
[ "keyword.operator", "*" ],
[ "constant.numeric", "10" ],
[ "text", "," ],
[ "constant.numeric", "0" ],
[ "text", "," ],
[ "constant.numeric", "0" ],
[ "paren.rparen", "])" ],
[ "identifier", "scale" ],
[ "paren.lparen", "([" ],
[ "constant.numeric", "1" ],
[ "text", "," ],
[ "constant.numeric", "1" ],
[ "text", "," ],
[ "identifier", "i" ],
[ "paren.rparen", "])" ],
[ "identifier", "cube" ],
[ "paren.lparen", "(" ],
[ "constant.numeric", "10" ],
[ "paren.rparen", ")" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
}
]
[[
"start",
["comment","// ace can highlight scad!"]
],[
"start",
["keyword","module"],
["text"," "],
["identifier","Element"],
["paren.lparen","("],
["identifier","xpos"],
["text",", "],
["identifier","ypos"],
["text",", "],
["identifier","zpos"],
["paren.rparen",")"],
["paren.lparen","{"]
],[
"start",
["text","\t"],
["identifier","translate"],
["paren.lparen","(["],
["identifier","xpos"],
["text",","],
["identifier","ypos"],
["text",","],
["identifier","zpos"],
["paren.rparen","])"],
["paren.lparen","{"]
],[
"start",
["text","\t\t"],
["identifier","union"],
["paren.lparen","("],
["paren.rparen",")"],
["paren.lparen","{"]
],[
"start",
["text","\t\t\t"],
["identifier","cube"],
["paren.lparen","(["],
["constant.numeric","10"],
["text",","],
["constant.numeric","10"],
["text",","],
["constant.numeric","4"],
["paren.rparen","]"],
["text",","],
["identifier","true"],
["paren.rparen",")"],
["text",";"]
],[
"start",
["text","\t\t\t"],
["identifier","cylinder"],
["paren.lparen","("],
["constant.numeric","10"],
["text",","],
["constant.numeric","15"],
["text",","],
["constant.numeric","5"],
["paren.rparen",")"],
["text",";"]
],[
"start",
["text","\t\t\t"],
["identifier","translate"],
["paren.lparen","(["],
["constant.numeric","0"],
["text",","],
["constant.numeric","0"],
["text",","],
["constant.numeric","10"],
["paren.rparen","])"],
["identifier","sphere"],
["paren.lparen","("],
["constant.numeric","5"],
["paren.rparen",")"],
["text",";"]
],[
"start",
["text","\t\t"],
["paren.rparen","}"]
],[
"start",
["text","\t"],
["paren.rparen","}"]
],[
"start",
["paren.rparen","}"]
],[
"start"
],[
"start",
["identifier","union"],
["paren.lparen","("],
["paren.rparen",")"],
["paren.lparen","{"]
],[
"start",
["text","\t"],
["keyword","for"],
["paren.lparen","("],
["identifier","i"],
["keyword.operator","="],
["paren.lparen","["],
["constant.numeric","0"],
["text",":"],
["constant.numeric","30"],
["paren.rparen","])"],
["paren.lparen","{"]
],[
"start",
["text","\t\t# "],
["identifier","Element"],
["paren.lparen","("],
["constant.numeric","0"],
["text",","],
["constant.numeric","0"],
["text",","],
["constant.numeric","0"],
["paren.rparen",")"],
["text",";"]
],[
"start",
["text","\t\t"],
["identifier","Element"],
["paren.lparen","("],
["constant.numeric","15"],
["keyword.operator","*"],
["identifier","i"],
["text",","],
["constant.numeric","0"],
["text",","],
["constant.numeric","0"],
["paren.rparen",")"],
["text",";"]
],[
"start",
["text","\t"],
["paren.rparen","}"]
],[
"start",
["paren.rparen","}"]
],[
"start"
],[
"start",
["keyword","for"],
["text"," "],
["paren.lparen","("],
["identifier","i"],
["text"," "],
["keyword.operator","="],
["text"," "],
["paren.lparen","["],
["constant.numeric","3"],
["text",", "],
["constant.numeric","5"],
["text",", "],
["constant.numeric","7"],
["text",", "],
["constant.numeric","11"],
["paren.rparen","])"],
["paren.lparen","{"]
],[
"start",
["text","\t"],
["identifier","rotate"],
["paren.lparen","(["],
["identifier","i"],
["keyword.operator","*"],
["constant.numeric","10"],
["text",","],
["constant.numeric","0"],
["text",","],
["constant.numeric","0"],
["paren.rparen","])"],
["identifier","scale"],
["paren.lparen","(["],
["constant.numeric","1"],
["text",","],
["constant.numeric","1"],
["text",","],
["identifier","i"],
["paren.rparen","])"],
["identifier","cube"],
["paren.lparen","("],
["constant.numeric","10"],
["paren.rparen",")"],
["text",";"]
],[
"start",
["paren.rparen","}"]
]]

File diff suppressed because it is too large Load diff

View file

@ -1,180 +1,123 @@
[
{
"state": "start",
"data": [
[ "comment", "/* style.scss */" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "variable.language", "#navbar" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "variable", "$navbar-width" ],
[ "text", ": " ],
[ "constant.numeric", "800px" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "variable", "$items" ],
[ "text", ": " ],
[ "constant.numeric", "5" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "variable", "$navbar-color" ],
[ "text", ": " ],
[ "constant.numeric", "#ce4dd6" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "width" ],
[ "text", ": " ],
[ "variable", "$navbar-width" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "border-bottom" ],
[ "text", ": " ],
[ "constant.numeric", "2px" ],
[ "text", " " ],
[ "constant.language", "solid" ],
[ "text", " " ],
[ "variable", "$navbar-color" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "variable.language", "li" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "float" ],
[ "text", ": " ],
[ "support.type", "left" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "width" ],
[ "text", ": " ],
[ "variable", "$navbar-width" ],
[ "text", "/" ],
[ "variable", "$items" ],
[ "text", " " ],
[ "constant", "-" ],
[ "text", " " ],
[ "constant.numeric", "10px" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "background-color" ],
[ "text", ": " ],
[ "support.function", "lighten" ],
[ "paren.lparen", "(" ],
[ "variable", "$navbar-color" ],
[ "text", ", " ],
[ "constant.numeric", "20%" ],
[ "paren.rparen", ")" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " &" ],
[ "variable.language", ":hover" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "background-color" ],
[ "text", ": " ],
[ "support.function", "lighten" ],
[ "paren.lparen", "(" ],
[ "variable", "$navbar-color" ],
[ "text", ", " ],
[ "constant.numeric", "10%" ],
[ "paren.rparen", ")" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
}
]
[[
"start",
["comment","/* style.scss */"]
],[
"start"
],[
"start",
["variable.language","#navbar"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text"," "],
["variable","$navbar-width"],
["text",": "],
["constant.numeric","800px"],
["text",";"]
],[
"start",
["text"," "],
["variable","$items"],
["text",": "],
["constant.numeric","5"],
["text",";"]
],[
"start",
["text"," "],
["variable","$navbar-color"],
["text",": "],
["constant.numeric","#ce4dd6"],
["text",";"]
],[
"start"
],[
"start",
["text"," "],
["support.type","width"],
["text",": "],
["variable","$navbar-width"],
["text",";"]
],[
"start",
["text"," "],
["support.type","border-bottom"],
["text",": "],
["constant.numeric","2px"],
["text"," "],
["constant.language","solid"],
["text"," "],
["variable","$navbar-color"],
["text",";"]
],[
"start"
],[
"start",
["text"," "],
["variable.language","li"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text"," "],
["support.type","float"],
["text",": "],
["support.type","left"],
["text",";"]
],[
"start",
["text"," "],
["support.type","width"],
["text",": "],
["variable","$navbar-width"],
["text","/"],
["variable","$items"],
["text"," "],
["constant","-"],
["text"," "],
["constant.numeric","10px"],
["text",";"]
],[
"start"
],[
"start",
["text"," "],
["support.type","background-color"],
["text",": "],
["support.function","lighten"],
["paren.lparen","("],
["variable","$navbar-color"],
["text",", "],
["constant.numeric","20%"],
["paren.rparen",")"],
["text",";"]
],[
"start",
["text"," &"],
["variable.language",":hover"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text"," "],
["support.type","background-color"],
["text",": "],
["support.function","lighten"],
["paren.lparen","("],
["variable","$navbar-color"],
["text",", "],
["constant.numeric","10%"],
["paren.rparen",")"],
["text",";"]
],[
"start",
["text"," "],
["paren.rparen","}"]
],[
"start",
["text"," "],
["paren.rparen","}"]
],[
"start",
["paren.rparen","}"]
]]

View file

@ -1,432 +1,320 @@
[
{
"state": "start",
"data": [
[ "comment", "#!/bin/sh" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "comment", "# Script to open a browser to current branch" ]
]
},
{
"state": "start",
"data": [
[ "comment", "# Repo formats:" ]
]
},
{
"state": "start",
"data": [
[ "comment", "# ssh git@github.com:richoH/gh_pr.git" ]
]
},
{
"state": "start",
"data": [
[ "comment", "# http https://richoH@github.com/richoH/gh_pr.git" ]
]
},
{
"state": "start",
"data": [
[ "comment", "# git git://github.com/richoH/gh_pr.git" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "variable", "username=" ],
[ "text", "`" ],
[ "identifier", "git" ],
[ "text", " " ],
[ "identifier", "config" ],
[ "text", " " ],
[ "keyword.operator", "--" ],
[ "identifier", "get" ],
[ "text", " " ],
[ "identifier", "github" ],
[ "text", "." ],
[ "identifier", "user" ],
[ "text", "`" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "support.function", "get_repo()" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "identifier", "git" ],
[ "text", " " ],
[ "identifier", "remote" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "identifier", "v" ],
[ "text", " | " ],
[ "identifier", "grep" ],
[ "text", " $" ],
[ "paren.lparen", "{" ],
[ "text", "@:" ],
[ "keyword.operator", "-" ],
[ "variable", "$username" ],
[ "paren.rparen", "}" ],
[ "text", " | " ],
[ "keyword", "while" ],
[ "text", " " ],
[ "keyword", "read" ],
[ "text", " " ],
[ "identifier", "remote" ],
[ "text", "; " ],
[ "keyword", "do" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "if" ],
[ "text", " " ],
[ "variable", "repo=" ],
[ "text", "`" ],
[ "support.function.builtin", "echo" ],
[ "text", " " ],
[ "variable", "$remote" ],
[ "text", " | " ],
[ "identifier", "grep" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "identifier", "E" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "identifier", "o" ],
[ "text", " " ],
[ "string", "\"git@github.com:[^ ]*\"" ],
[ "text", "`; " ],
[ "keyword", "then" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.function.builtin", "echo" ],
[ "text", " " ],
[ "variable", "$repo" ],
[ "text", " | " ],
[ "identifier", "sed" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "identifier", "e" ],
[ "text", " " ],
[ "string", "\"s/^git@github\\.com://\"" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "identifier", "e" ],
[ "text", " " ],
[ "string", "\"s/\\.git$//\"" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.function.builtin", "exit" ],
[ "text", " " ],
[ "constant.numeric", "1" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "fi" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "if" ],
[ "text", " " ],
[ "variable", "repo=" ],
[ "text", "`" ],
[ "support.function.builtin", "echo" ],
[ "text", " " ],
[ "variable", "$remote" ],
[ "text", " | " ],
[ "identifier", "grep" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "identifier", "E" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "identifier", "o" ],
[ "text", " " ],
[ "string", "\"https?://([^@]*@)?github.com/[^ ]*\\.git\"" ],
[ "text", "`; " ],
[ "keyword", "then" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.function.builtin", "echo" ],
[ "text", " " ],
[ "variable", "$repo" ],
[ "text", " | " ],
[ "identifier", "sed" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "identifier", "e" ],
[ "text", " " ],
[ "string", "\"s|^https?://||\"" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "identifier", "e" ],
[ "text", " " ],
[ "string", "\"s/^.*github\\.com\\///\"" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "identifier", "e" ],
[ "text", " " ],
[ "string", "\"s/\\.git$//\"" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.function.builtin", "exit" ],
[ "text", " " ],
[ "constant.numeric", "1" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "fi" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "if" ],
[ "text", " " ],
[ "variable", "repo=" ],
[ "text", "`" ],
[ "support.function.builtin", "echo" ],
[ "text", " " ],
[ "variable", "$remote" ],
[ "text", " | " ],
[ "identifier", "grep" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "identifier", "E" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "identifier", "o" ],
[ "text", " " ],
[ "string", "\"git://github.com/[^ ]*\\.git\"" ],
[ "text", "`; " ],
[ "keyword", "then" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.function.builtin", "echo" ],
[ "text", " " ],
[ "variable", "$repo" ],
[ "text", " | " ],
[ "identifier", "sed" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "identifier", "e" ],
[ "text", " " ],
[ "string", "\"s|^git://github.com/||\"" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "identifier", "e" ],
[ "text", " " ],
[ "string", "\"s/\\.git$//\"" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.function.builtin", "exit" ],
[ "text", " " ],
[ "constant.numeric", "1" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "fi" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "done" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "if" ],
[ "text", " " ],
[ "paren.lparen", "[" ],
[ "text", " " ],
[ "variable.language", "$?" ],
[ "text", " " ],
[ "keyword.operator", "-" ],
[ "identifier", "eq" ],
[ "text", " " ],
[ "constant.numeric", "0" ],
[ "text", " " ],
[ "paren.rparen", "]" ],
[ "text", "; " ],
[ "keyword", "then" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.function.builtin", "echo" ],
[ "text", " " ],
[ "string", "\"Couldn't find a valid remote\"" ],
[ "text", " " ],
[ "keyword.operator", ">" ],
[ "support.function", "&2" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.function.builtin", "exit" ],
[ "text", " " ],
[ "constant.numeric", "1" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "fi" ]
]
},
{
"state": "start",
"data": [
[ "paren.rparen", "}" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "if" ],
[ "text", " " ],
[ "variable", "repo=" ],
[ "text", "`" ],
[ "identifier", "get_repo" ],
[ "text", " $@`; " ],
[ "keyword", "then" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "variable", "branch=" ],
[ "text", "`" ],
[ "identifier", "git" ],
[ "text", " " ],
[ "identifier", "symbolic" ],
[ "keyword.operator", "-" ],
[ "identifier", "ref" ],
[ "text", " " ],
[ "identifier", "HEAD" ],
[ "text", " " ],
[ "constant.numeric", "2" ],
[ "keyword.operator", ">/" ],
[ "identifier", "dev" ],
[ "keyword.operator", "/" ],
[ "identifier", "null" ],
[ "text", "`" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.function.builtin", "echo" ],
[ "text", " " ],
[ "string", "\"http://github.com/$repo/pull/new/${branch##refs/heads/}\"" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "else" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.function.builtin", "exit" ],
[ "text", " " ],
[ "constant.numeric", "1" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "fi" ]
]
},
{
"state": "start",
"data": []
}
]
[[
"start",
["comment","#!/bin/sh"]
],[
"start"
],[
"start",
["comment","# Script to open a browser to current branch"]
],[
"start",
["comment","# Repo formats:"]
],[
"start",
["comment","# ssh git@github.com:richoH/gh_pr.git"]
],[
"start",
["comment","# http https://richoH@github.com/richoH/gh_pr.git"]
],[
"start",
["comment","# git git://github.com/richoH/gh_pr.git"]
],[
"start"
],[
"start",
["variable","username="],
["text","`"],
["identifier","git"],
["text"," "],
["identifier","config"],
["text"," "],
["keyword.operator","--"],
["identifier","get"],
["text"," "],
["identifier","github"],
["text","."],
["identifier","user"],
["text","`"]
],[
"start"
],[
"start",
["support.function","get_repo()"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text"," "],
["identifier","git"],
["text"," "],
["identifier","remote"],
["text"," "],
["keyword.operator","-"],
["identifier","v"],
["text"," | "],
["identifier","grep"],
["text"," $"],
["paren.lparen","{"],
["text","@:"],
["keyword.operator","-"],
["variable","$username"],
["paren.rparen","}"],
["text"," | "],
["keyword","while"],
["text"," "],
["keyword","read"],
["text"," "],
["identifier","remote"],
["text","; "],
["keyword","do"]
],[
"start",
["text"," "],
["keyword","if"],
["text"," "],
["variable","repo="],
["text","`"],
["support.function.builtin","echo"],
["text"," "],
["variable","$remote"],
["text"," | "],
["identifier","grep"],
["text"," "],
["keyword.operator","-"],
["identifier","E"],
["text"," "],
["keyword.operator","-"],
["identifier","o"],
["text"," "],
["string","\"git@github.com:[^ ]*\""],
["text","`; "],
["keyword","then"]
],[
"start",
["text"," "],
["support.function.builtin","echo"],
["text"," "],
["variable","$repo"],
["text"," | "],
["identifier","sed"],
["text"," "],
["keyword.operator","-"],
["identifier","e"],
["text"," "],
["string","\"s/^git@github\\.com://\""],
["text"," "],
["keyword.operator","-"],
["identifier","e"],
["text"," "],
["string","\"s/\\.git$//\""]
],[
"start",
["text"," "],
["support.function.builtin","exit"],
["text"," "],
["constant.numeric","1"]
],[
"start",
["text"," "],
["keyword","fi"]
],[
"start",
["text"," "],
["keyword","if"],
["text"," "],
["variable","repo="],
["text","`"],
["support.function.builtin","echo"],
["text"," "],
["variable","$remote"],
["text"," | "],
["identifier","grep"],
["text"," "],
["keyword.operator","-"],
["identifier","E"],
["text"," "],
["keyword.operator","-"],
["identifier","o"],
["text"," "],
["string","\"https?://([^@]*@)?github.com/[^ ]*\\.git\""],
["text","`; "],
["keyword","then"]
],[
"start",
["text"," "],
["support.function.builtin","echo"],
["text"," "],
["variable","$repo"],
["text"," | "],
["identifier","sed"],
["text"," "],
["keyword.operator","-"],
["identifier","e"],
["text"," "],
["string","\"s|^https?://||\""],
["text"," "],
["keyword.operator","-"],
["identifier","e"],
["text"," "],
["string","\"s/^.*github\\.com\\///\""],
["text"," "],
["keyword.operator","-"],
["identifier","e"],
["text"," "],
["string","\"s/\\.git$//\""]
],[
"start",
["text"," "],
["support.function.builtin","exit"],
["text"," "],
["constant.numeric","1"]
],[
"start",
["text"," "],
["keyword","fi"]
],[
"start",
["text"," "],
["keyword","if"],
["text"," "],
["variable","repo="],
["text","`"],
["support.function.builtin","echo"],
["text"," "],
["variable","$remote"],
["text"," | "],
["identifier","grep"],
["text"," "],
["keyword.operator","-"],
["identifier","E"],
["text"," "],
["keyword.operator","-"],
["identifier","o"],
["text"," "],
["string","\"git://github.com/[^ ]*\\.git\""],
["text","`; "],
["keyword","then"]
],[
"start",
["text"," "],
["support.function.builtin","echo"],
["text"," "],
["variable","$repo"],
["text"," | "],
["identifier","sed"],
["text"," "],
["keyword.operator","-"],
["identifier","e"],
["text"," "],
["string","\"s|^git://github.com/||\""],
["text"," "],
["keyword.operator","-"],
["identifier","e"],
["text"," "],
["string","\"s/\\.git$//\""]
],[
"start",
["text"," "],
["support.function.builtin","exit"],
["text"," "],
["constant.numeric","1"]
],[
"start",
["text"," "],
["keyword","fi"]
],[
"start",
["text"," "],
["keyword","done"]
],[
"start"
],[
"start",
["text"," "],
["keyword","if"],
["text"," "],
["paren.lparen","["],
["text"," "],
["variable.language","$?"],
["text"," "],
["keyword.operator","-"],
["identifier","eq"],
["text"," "],
["constant.numeric","0"],
["text"," "],
["paren.rparen","]"],
["text","; "],
["keyword","then"]
],[
"start",
["text"," "],
["support.function.builtin","echo"],
["text"," "],
["string","\"Couldn't find a valid remote\""],
["text"," "],
["keyword.operator",">"],
["support.function","&2"]
],[
"start",
["text"," "],
["support.function.builtin","exit"],
["text"," "],
["constant.numeric","1"]
],[
"start",
["text"," "],
["keyword","fi"]
],[
"start",
["paren.rparen","}"]
],[
"start"
],[
"start",
["keyword","if"],
["text"," "],
["variable","repo="],
["text","`"],
["identifier","get_repo"],
["text"," $@`; "],
["keyword","then"]
],[
"start",
["text"," "],
["variable","branch="],
["text","`"],
["identifier","git"],
["text"," "],
["identifier","symbolic"],
["keyword.operator","-"],
["identifier","ref"],
["text"," "],
["identifier","HEAD"],
["text"," "],
["constant.numeric","2"],
["keyword.operator",">/"],
["identifier","dev"],
["keyword.operator","/"],
["identifier","null"],
["text","`"]
],[
"start",
["text"," "],
["support.function.builtin","echo"],
["text"," "],
["string","\"http://github.com/$repo/pull/new/${branch##refs/heads/}\""]
],[
"start",
["keyword","else"]
],[
"start",
["text"," "],
["support.function.builtin","exit"],
["text"," "],
["constant.numeric","1"]
],[
"start",
["keyword","fi"]
],[
"start"
]]

View file

@ -1,73 +1,54 @@
[
{
"state": "start",
"data": [
[ "keyword", "SELECT" ],
[ "text", " " ],
[ "identifier", "city" ],
[ "text", ", " ],
[ "support.function", "COUNT" ],
[ "paren.lparen", "(" ],
[ "identifier", "id" ],
[ "paren.rparen", ")" ],
[ "text", " " ],
[ "keyword", "AS" ],
[ "text", " " ],
[ "identifier", "users_count" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "FROM" ],
[ "text", " " ],
[ "identifier", "users" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "WHERE" ],
[ "text", " " ],
[ "identifier", "group_name" ],
[ "text", " " ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "string", "'salesman'" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "AND" ],
[ "text", " " ],
[ "identifier", "created" ],
[ "text", " " ],
[ "keyword.operator", ">" ],
[ "text", " " ],
[ "string", "'2011-05-21'" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "GROUP" ],
[ "text", " " ],
[ "keyword", "BY" ],
[ "text", " " ],
[ "constant.numeric", "1" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "ORDER" ],
[ "text", " " ],
[ "keyword", "BY" ],
[ "text", " " ],
[ "constant.numeric", "2" ],
[ "text", " " ],
[ "keyword", "DESC" ]
]
}
]
[[
"start",
["keyword","SELECT"],
["text"," "],
["identifier","city"],
["text",", "],
["support.function","COUNT"],
["paren.lparen","("],
["identifier","id"],
["paren.rparen",")"],
["text"," "],
["keyword","AS"],
["text"," "],
["identifier","users_count"]
],[
"start",
["keyword","FROM"],
["text"," "],
["identifier","users"]
],[
"start",
["keyword","WHERE"],
["text"," "],
["identifier","group_name"],
["text"," "],
["keyword.operator","="],
["text"," "],
["string","'salesman'"]
],[
"start",
["keyword","AND"],
["text"," "],
["identifier","created"],
["text"," "],
["keyword.operator",">"],
["text"," "],
["string","'2011-05-21'"]
],[
"start",
["keyword","GROUP"],
["text"," "],
["keyword","BY"],
["text"," "],
["constant.numeric","1"]
],[
"start",
["keyword","ORDER"],
["text"," "],
["keyword","BY"],
["text"," "],
["constant.numeric","2"],
["text"," "],
["keyword","DESC"]
]]

View file

@ -1,425 +1,270 @@
[
{
"state": "start",
"data": [
[ "comment", "// I'm a comment!" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "comment",
"data": [
[ "comment", "/*" ]
]
},
{
"state": "comment",
"data": [
[ "comment", " * Adds the given numbers together." ]
]
},
{
"state": "start",
"data": [
[ "comment", " */" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": []
},
{
"state": "comment",
"data": [
[ "comment", "/*!" ]
]
},
{
"state": "comment",
"data": [
[ "comment", " * Adds the given numbers together." ]
]
},
{
"state": "start",
"data": [
[ "comment", " */" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "entity.name.function.stylus", "asdasdasdad" ],
[ "text", "(df, ad" ],
[ "keyword.operator.stylus", "=" ],
[ "constant.numeric", "23" ],
[ "text", ")" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "entity.name.function.stylus", "add" ],
[ "text", "(" ],
[ "entity.name.tag.stylus", "a" ],
[ "text", ", " ],
[ "entity.name.tag.stylus", "b" ],
[ "text", " " ],
[ "keyword.operator.stylus", "=" ],
[ "text", " " ],
[ "entity.name.tag.stylus", "a" ],
[ "text", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "entity.name.tag.stylus", "a" ],
[ "text", " " ],
[ "keyword.operator.stylus", "+" ],
[ "text", " " ],
[ "entity.name.tag.stylus", "b" ]
]
},
{
"state": "start",
"data": [
[ "entity.name.function.stylus", "green" ],
[ "text", "(" ],
[ "constant.numeric", "#0c0" ],
[ "text", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " add(" ],
[ "constant.numeric", "10" ],
[ "text", ", " ],
[ "constant.numeric", "5" ],
[ "text", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "// => 15" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", " add(" ],
[ "constant.numeric", "10" ],
[ "text", ")" ]
]
},
{
"state": "start",
"data": [
[ "text", " add(" ],
[ "entity.name.tag.stylus", "a" ],
[ "text", ", " ],
[ "entity.name.tag.stylus", "b" ],
[ "text", ")" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "entity.language.stylus", " &" ],
[ "text", "asdasd" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", " (" ],
[ "variable.language.stylus", "arguments" ],
[ "text", ")" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword.stylus", "@sdfsdf" ]
]
},
{
"state": "start",
"data": [
[ "entity.other.attribute-name.class.stylus", ".signatures" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "background-color" ],
[ "text", " " ],
[ "constant.numeric", "#e0e8e0" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "border" ],
[ "text", " " ],
[ "constant.numeric", "1" ],
[ "keyword", "px" ],
[ "text", " " ],
[ "support.constant", "solid" ],
[ "text", " grayLighter" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "box-shadow" ],
[ "text", " " ],
[ "constant.numeric", "0" ],
[ "text", " " ],
[ "constant.numeric", "0" ],
[ "text", " " ],
[ "constant.numeric", "3" ],
[ "keyword", "px" ],
[ "text", " grayLightest" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "border-radius" ],
[ "text", " " ],
[ "constant.numeric", "3" ],
[ "keyword", "px" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "padding" ],
[ "text", " " ],
[ "constant.numeric", "3" ],
[ "keyword", "px" ],
[ "text", " " ],
[ "constant.numeric", "5" ],
[ "keyword", "px" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "string", "\"adsads\"" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "margin-left" ],
[ "text", " " ],
[ "constant.numeric", "0" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "list-style" ],
[ "text", " " ],
[ "support.constant", "none" ]
]
},
{
"state": "start",
"data": [
[ "entity.other.attribute-name.class.stylus", ".signature" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "list-style" ],
[ "text", " " ],
[ "support.constant", "none" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "display" ],
[ "text", ": " ],
[ "support.constant", "inline" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "margin-left" ],
[ "text", " " ],
[ "constant.numeric", "0" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword.operator.stylus", ">" ],
[ "text", " " ],
[ "entity.name.tag.stylus", "li" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "display" ],
[ "text", " " ],
[ "support.constant", "inline" ]
]
},
{
"state": "start",
"data": [
[ "keyword.operator.stylus", "is" ],
[ "text", " " ],
[ "keyword.operator.stylus", "not" ]
]
},
{
"state": "start",
"data": [
[ "entity.other.attribute-name.class.stylus", ".signature-values" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "list-style" ],
[ "text", " " ],
[ "support.constant", "none" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "display" ],
[ "text", " " ],
[ "support.constant", "inline" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "margin-left" ],
[ "text", " " ],
[ "constant.numeric", "0" ]
]
},
{
"state": "start",
"data": [
[ "entity.language.stylus", " &" ],
[ "punctuation", ":" ],
[ "entity.other.attribute-name.pseudo-element.css", "before" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "content" ],
[ "text", " " ],
[ "string", "'→'" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "support.type", "margin" ],
[ "text", " " ],
[ "constant.numeric", "0" ],
[ "text", " " ],
[ "constant.numeric", "5" ],
[ "keyword", "px" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword.operator.stylus", ">" ],
[ "text", " " ],
[ "entity.name.tag.stylus", "li" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword.control.stylus", "!important" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword.control.stylus", "unless" ]
]
}
]
[[
"start",
["comment","// I'm a comment!"]
],[
"start"
],[
"comment",
["comment","/*"]
],[
"comment",
["comment"," * Adds the given numbers together."]
],[
"start",
["comment"," */"]
],[
"start"
],[
"start"
],[
"comment",
["comment","/*!"]
],[
"comment",
["comment"," * Adds the given numbers together."]
],[
"start",
["comment"," */"]
],[
"start"
],[
"start"
],[
"start",
["entity.name.function.stylus","asdasdasdad"],
["text","(df, ad"],
["keyword.operator.stylus","="],
["constant.numeric","23"],
["text",")"]
],[
"start"
],[
"start",
["entity.name.function.stylus","add"],
["text","("],
["entity.name.tag.stylus","a"],
["text",", "],
["entity.name.tag.stylus","b"],
["text"," "],
["keyword.operator.stylus","="],
["text"," "],
["entity.name.tag.stylus","a"],
["text",")"]
],[
"start",
["text"," "],
["entity.name.tag.stylus","a"],
["text"," "],
["keyword.operator.stylus","+"],
["text"," "],
["entity.name.tag.stylus","b"]
],[
"start",
["entity.name.function.stylus","green"],
["text","("],
["constant.numeric","#0c0"],
["text",")"]
],[
"start",
["text"," add("],
["constant.numeric","10"],
["text",", "],
["constant.numeric","5"],
["text",")"]
],[
"start",
["text"," "],
["comment","// => 15"]
],[
"start"
],[
"start",
["text"," add("],
["constant.numeric","10"],
["text",")"]
],[
"start",
["text"," add("],
["entity.name.tag.stylus","a"],
["text",", "],
["entity.name.tag.stylus","b"],
["text",")"]
],[
"start"
],[
"start",
["entity.language.stylus"," &"],
["text","asdasd"]
],[
"start"
],[
"start",
["text"," ("],
["variable.language.stylus","arguments"],
["text",")"]
],[
"start"
],[
"start",
["text"," "],
["keyword.stylus","@sdfsdf"]
],[
"start",
["entity.other.attribute-name.class.stylus",".signatures"]
],[
"start",
["text"," "],
["support.type","background-color"],
["text"," "],
["constant.numeric","#e0e8e0"]
],[
"start",
["text"," "],
["support.type","border"],
["text"," "],
["constant.numeric","1"],
["keyword","px"],
["text"," "],
["support.constant","solid"],
["text"," grayLighter"]
],[
"start",
["text"," "],
["support.type","box-shadow"],
["text"," "],
["constant.numeric","0"],
["text"," "],
["constant.numeric","0"],
["text"," "],
["constant.numeric","3"],
["keyword","px"],
["text"," grayLightest"]
],[
"start",
["text"," "],
["support.type","border-radius"],
["text"," "],
["constant.numeric","3"],
["keyword","px"]
],[
"start",
["text"," "],
["support.type","padding"],
["text"," "],
["constant.numeric","3"],
["keyword","px"],
["text"," "],
["constant.numeric","5"],
["keyword","px"]
],[
"start",
["text"," "],
["string","\"adsads\""]
],[
"start",
["text"," "],
["support.type","margin-left"],
["text"," "],
["constant.numeric","0"]
],[
"start",
["text"," "],
["support.type","list-style"],
["text"," "],
["support.constant","none"]
],[
"start",
["entity.other.attribute-name.class.stylus",".signature"]
],[
"start",
["text"," "],
["support.type","list-style"],
["text"," "],
["support.constant","none"]
],[
"start",
["text"," "],
["support.type","display"],
["text",": "],
["support.constant","inline"]
],[
"start",
["text"," "],
["support.type","margin-left"],
["text"," "],
["constant.numeric","0"]
],[
"start",
["text"," "],
["keyword.operator.stylus",">"],
["text"," "],
["entity.name.tag.stylus","li"]
],[
"start",
["text"," "],
["support.type","display"],
["text"," "],
["support.constant","inline"]
],[
"start",
["keyword.operator.stylus","is"],
["text"," "],
["keyword.operator.stylus","not"]
],[
"start",
["entity.other.attribute-name.class.stylus",".signature-values"]
],[
"start",
["text"," "],
["support.type","list-style"],
["text"," "],
["support.constant","none"]
],[
"start",
["text"," "],
["support.type","display"],
["text"," "],
["support.constant","inline"]
],[
"start",
["text"," "],
["support.type","margin-left"],
["text"," "],
["constant.numeric","0"]
],[
"start",
["entity.language.stylus"," &"],
["punctuation",":"],
["entity.other.attribute-name.pseudo-element.css","before"]
],[
"start",
["text"," "],
["support.type","content"],
["text"," "],
["string","'→'"]
],[
"start",
["text"," "],
["support.type","margin"],
["text"," "],
["constant.numeric","0"],
["text"," "],
["constant.numeric","5"],
["keyword","px"]
],[
"start",
["text"," "],
["keyword.operator.stylus",">"],
["text"," "],
["entity.name.tag.stylus","li"]
],[
"start",
["text"," "],
["keyword.control.stylus","!important"]
],[
"start"
],[
"start",
["text"," "],
["keyword.control.stylus","unless"]
]]

File diff suppressed because it is too large Load diff

View file

@ -1,530 +1,410 @@
[
{
"state": "commandItem",
"data": []
},
{
"state": "commandItem",
"data": [
[ "keyword", "proc" ],
[ "text", " " ],
[ "identifier", "dijkstra" ],
[ "text", " " ],
[ "paren.lparen", "{" ],
[ "keyword", "graph" ],
[ "text", " " ],
[ "identifier", "origin" ],
[ "paren.rparen", "}" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "# Initialize" ]
]
},
{
"state": "commandItem",
"data": [
[ "text", " " ],
[ "keyword", "dict" ],
[ "text", " " ],
[ "identifier", "for" ],
[ "text", " " ],
[ "paren.lparen", "{" ],
[ "keyword", "vertex" ],
[ "text", " " ],
[ "identifier", "distmap" ],
[ "paren.rparen", "}" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "graph" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "keyword", "dict" ],
[ "text", " " ],
[ "identifier", "set" ],
[ "text", " " ],
[ "identifier", "dist" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "vertex" ],
[ "text", " " ],
[ "identifier", "Inf" ]
]
},
{
"state": "commandItem",
"data": [
[ "text", "\t" ],
[ "keyword", "dict" ],
[ "text", " " ],
[ "identifier", "set" ],
[ "text", " " ],
[ "identifier", "path" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "vertex" ],
[ "text", " " ],
[ "paren.lparen", "{" ],
[ "text", "}" ]
]
},
{
"state": "commandItem",
"data": [
[ "text", " }" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "dict" ],
[ "text", " " ],
[ "identifier", "set" ],
[ "text", " " ],
[ "identifier", "dist" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "origin" ],
[ "text", " 0" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "dict" ],
[ "text", " " ],
[ "identifier", "set" ],
[ "text", " " ],
[ "identifier", "path" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "origin" ],
[ "text", " " ],
[ "paren.lparen", "[" ],
[ "keyword", "list" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "origin" ],
[ "paren.rparen", "]" ]
]
},
{
"state": "commandItem",
"data": [
[ "text", " " ]
]
},
{
"state": "commandItem",
"data": [
[ "text", " " ],
[ "keyword", "while" ],
[ "text", " " ],
[ "paren.lparen", "{" ],
[ "text", "[" ],
[ "keyword", "dict" ],
[ "text", " " ],
[ "identifier", "size" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "graph" ],
[ "paren.rparen", "]}" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "comment", "# Find unhandled node with least weight" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "keyword", "set" ],
[ "text", " " ],
[ "identifier", "d" ],
[ "text", " " ],
[ "identifier", "Inf" ]
]
},
{
"state": "commandItem",
"data": [
[ "text", "\t" ],
[ "keyword", "dict" ],
[ "text", " " ],
[ "identifier", "for" ],
[ "text", " " ],
[ "paren.lparen", "{" ],
[ "keyword", "uu" ],
[ "text", " " ],
[ "support.function", "-" ],
[ "paren.rparen", "}" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "graph" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "commandItem",
"data": [
[ "text", "\t " ],
[ "keyword", "if" ],
[ "text", " " ],
[ "paren.lparen", "{" ],
[ "variable.instancce", "$" ],
[ "variable.instance", "d" ],
[ "text", " " ],
[ "support.function", ">" ],
[ "text", " " ],
[ "paren.lparen", "[" ],
[ "keyword", "set" ],
[ "text", " " ],
[ "identifier", "dd" ],
[ "text", " " ],
[ "paren.lparen", "[" ],
[ "keyword", "dict" ],
[ "text", " " ],
[ "identifier", "get" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "dist" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "uu" ],
[ "paren.rparen", "]]}" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t\t" ],
[ "keyword", "set" ],
[ "text", " " ],
[ "identifier", "u" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "uu" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t\t" ],
[ "keyword", "set" ],
[ "text", " " ],
[ "identifier", "d" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "dd" ]
]
},
{
"state": "commandItem",
"data": [
[ "text", "\t }" ]
]
},
{
"state": "commandItem",
"data": [
[ "text", "\t}" ]
]
},
{
"state": "commandItem",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "comment", "# No such node; graph must be disconnected" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "keyword", "if" ],
[ "text", " " ],
[ "paren.lparen", "{" ],
[ "variable.instancce", "$" ],
[ "variable.instance", "d" ],
[ "text", " " ],
[ "support.function", "==" ],
[ "text", " " ],
[ "identifier", "Inf" ],
[ "paren.rparen", "}" ],
[ "text", " " ],
[ "identifier", "break" ]
]
},
{
"state": "commandItem",
"data": [
[ "text", " " ]
]
},
{
"state": "commentfollow",
"data": [
[ "text", "\t" ],
[ "comment", "# Update the weights for nodes\\" ]
]
},
{
"state": "start",
"data": [
[ "comment", "\t lead to by the node we've picked" ]
]
},
{
"state": "commandItem",
"data": [
[ "text", "\t" ],
[ "keyword", "dict" ],
[ "text", " " ],
[ "identifier", "for" ],
[ "text", " " ],
[ "paren.lparen", "{" ],
[ "keyword", "v" ],
[ "text", " " ],
[ "identifier", "dd" ],
[ "paren.rparen", "}" ],
[ "text", " " ],
[ "paren.lparen", "[" ],
[ "keyword", "dict" ],
[ "text", " " ],
[ "identifier", "get" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "graph" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "u" ],
[ "paren.rparen", "]" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "commandItem",
"data": [
[ "text", "\t " ],
[ "keyword", "if" ],
[ "text", " " ],
[ "paren.lparen", "{" ],
[ "text", "[" ],
[ "keyword", "dict" ],
[ "text", " " ],
[ "identifier", "exists" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "graph" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "v" ],
[ "paren.rparen", "]}" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t\t" ],
[ "keyword", "set" ],
[ "text", " " ],
[ "identifier", "alt" ],
[ "text", " " ],
[ "paren.lparen", "[" ],
[ "keyword", "expr" ],
[ "text", " " ],
[ "paren.lparen", "{" ],
[ "variable.instancce", "$" ],
[ "variable.instance", "d" ],
[ "text", " " ],
[ "support.function", "+" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "dd" ],
[ "paren.rparen", "}]" ]
]
},
{
"state": "commandItem",
"data": [
[ "text", "\t\t" ],
[ "keyword", "if" ],
[ "text", " " ],
[ "paren.lparen", "{" ],
[ "variable.instancce", "$" ],
[ "variable.instance", "alt" ],
[ "text", " " ],
[ "support.function", "<" ],
[ "text", " " ],
[ "paren.lparen", "[" ],
[ "keyword", "dict" ],
[ "text", " " ],
[ "identifier", "get" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "dist" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "v" ],
[ "paren.rparen", "]}" ],
[ "text", " " ],
[ "paren.lparen", "{" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t\t " ],
[ "keyword", "dict" ],
[ "text", " " ],
[ "identifier", "set" ],
[ "text", " " ],
[ "identifier", "dist" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "v" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "alt" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t\t " ],
[ "keyword", "dict" ],
[ "text", " " ],
[ "identifier", "set" ],
[ "text", " " ],
[ "identifier", "path" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "v" ],
[ "text", " " ],
[ "paren.lparen", "[" ],
[ "keyword", "list" ],
[ "text", " " ],
[ "support.function", "{*}" ],
[ "paren.lparen", "[" ],
[ "keyword", "dict" ],
[ "text", " " ],
[ "identifier", "get" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "path" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "u" ],
[ "paren.rparen", "]" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "v" ],
[ "paren.rparen", "]" ]
]
},
{
"state": "commandItem",
"data": [
[ "text", "\t\t}" ]
]
},
{
"state": "commandItem",
"data": [
[ "text", "\t }" ]
]
},
{
"state": "commandItem",
"data": [
[ "text", "\t}" ]
]
},
{
"state": "commandItem",
"data": [
[ "text", " " ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "comment", "# Remove chosen node from graph still to be handled" ]
]
},
{
"state": "start",
"data": [
[ "text", "\t" ],
[ "keyword", "dict" ],
[ "text", " " ],
[ "identifier", "unset" ],
[ "text", " " ],
[ "identifier", "graph" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "u" ]
]
},
{
"state": "commandItem",
"data": [
[ "text", " }" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "return" ],
[ "text", " " ],
[ "paren.lparen", "[" ],
[ "keyword", "list" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "dist" ],
[ "text", " " ],
[ "variable.instancce", "$" ],
[ "variable.instance", "path" ],
[ "paren.rparen", "]" ]
]
},
{
"state": "commandItem",
"data": [
[ "text", "}" ]
]
}
]
[[
"commandItem"
],[
"commandItem",
["keyword","proc"],
["text"," "],
["identifier","dijkstra"],
["text"," "],
["paren.lparen","{"],
["keyword","graph"],
["text"," "],
["identifier","origin"],
["paren.rparen","}"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text"," "],
["comment","# Initialize"]
],[
"commandItem",
["text"," "],
["keyword","dict"],
["text"," "],
["identifier","for"],
["text"," "],
["paren.lparen","{"],
["keyword","vertex"],
["text"," "],
["identifier","distmap"],
["paren.rparen","}"],
["text"," "],
["variable.instancce","$"],
["variable.instance","graph"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text","\t"],
["keyword","dict"],
["text"," "],
["identifier","set"],
["text"," "],
["identifier","dist"],
["text"," "],
["variable.instancce","$"],
["variable.instance","vertex"],
["text"," "],
["identifier","Inf"]
],[
"commandItem",
["text","\t"],
["keyword","dict"],
["text"," "],
["identifier","set"],
["text"," "],
["identifier","path"],
["text"," "],
["variable.instancce","$"],
["variable.instance","vertex"],
["text"," "],
["paren.lparen","{"],
["text","}"]
],[
"commandItem",
["text"," }"]
],[
"start",
["text"," "],
["keyword","dict"],
["text"," "],
["identifier","set"],
["text"," "],
["identifier","dist"],
["text"," "],
["variable.instancce","$"],
["variable.instance","origin"],
["text"," 0"]
],[
"start",
["text"," "],
["keyword","dict"],
["text"," "],
["identifier","set"],
["text"," "],
["identifier","path"],
["text"," "],
["variable.instancce","$"],
["variable.instance","origin"],
["text"," "],
["paren.lparen","["],
["keyword","list"],
["text"," "],
["variable.instancce","$"],
["variable.instance","origin"],
["paren.rparen","]"]
],[
"commandItem",
["text"," "]
],[
"commandItem",
["text"," "],
["keyword","while"],
["text"," "],
["paren.lparen","{"],
["text","["],
["keyword","dict"],
["text"," "],
["identifier","size"],
["text"," "],
["variable.instancce","$"],
["variable.instance","graph"],
["paren.rparen","]}"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text","\t"],
["comment","# Find unhandled node with least weight"]
],[
"start",
["text","\t"],
["keyword","set"],
["text"," "],
["identifier","d"],
["text"," "],
["identifier","Inf"]
],[
"commandItem",
["text","\t"],
["keyword","dict"],
["text"," "],
["identifier","for"],
["text"," "],
["paren.lparen","{"],
["keyword","uu"],
["text"," "],
["support.function","-"],
["paren.rparen","}"],
["text"," "],
["variable.instancce","$"],
["variable.instance","graph"],
["text"," "],
["paren.lparen","{"]
],[
"commandItem",
["text","\t "],
["keyword","if"],
["text"," "],
["paren.lparen","{"],
["variable.instancce","$"],
["variable.instance","d"],
["text"," "],
["support.function",">"],
["text"," "],
["paren.lparen","["],
["keyword","set"],
["text"," "],
["identifier","dd"],
["text"," "],
["paren.lparen","["],
["keyword","dict"],
["text"," "],
["identifier","get"],
["text"," "],
["variable.instancce","$"],
["variable.instance","dist"],
["text"," "],
["variable.instancce","$"],
["variable.instance","uu"],
["paren.rparen","]]}"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text","\t\t"],
["keyword","set"],
["text"," "],
["identifier","u"],
["text"," "],
["variable.instancce","$"],
["variable.instance","uu"]
],[
"start",
["text","\t\t"],
["keyword","set"],
["text"," "],
["identifier","d"],
["text"," "],
["variable.instancce","$"],
["variable.instance","dd"]
],[
"commandItem",
["text","\t }"]
],[
"commandItem",
["text","\t}"]
],[
"commandItem",
["text"," "]
],[
"start",
["text","\t"],
["comment","# No such node; graph must be disconnected"]
],[
"start",
["text","\t"],
["keyword","if"],
["text"," "],
["paren.lparen","{"],
["variable.instancce","$"],
["variable.instance","d"],
["text"," "],
["support.function","=="],
["text"," "],
["identifier","Inf"],
["paren.rparen","}"],
["text"," "],
["identifier","break"]
],[
"commandItem",
["text"," "]
],[
"commentfollow",
["text","\t"],
["comment","# Update the weights for nodes\\"]
],[
"start",
["comment","\t lead to by the node we've picked"]
],[
"commandItem",
["text","\t"],
["keyword","dict"],
["text"," "],
["identifier","for"],
["text"," "],
["paren.lparen","{"],
["keyword","v"],
["text"," "],
["identifier","dd"],
["paren.rparen","}"],
["text"," "],
["paren.lparen","["],
["keyword","dict"],
["text"," "],
["identifier","get"],
["text"," "],
["variable.instancce","$"],
["variable.instance","graph"],
["text"," "],
["variable.instancce","$"],
["variable.instance","u"],
["paren.rparen","]"],
["text"," "],
["paren.lparen","{"]
],[
"commandItem",
["text","\t "],
["keyword","if"],
["text"," "],
["paren.lparen","{"],
["text","["],
["keyword","dict"],
["text"," "],
["identifier","exists"],
["text"," "],
["variable.instancce","$"],
["variable.instance","graph"],
["text"," "],
["variable.instancce","$"],
["variable.instance","v"],
["paren.rparen","]}"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text","\t\t"],
["keyword","set"],
["text"," "],
["identifier","alt"],
["text"," "],
["paren.lparen","["],
["keyword","expr"],
["text"," "],
["paren.lparen","{"],
["variable.instancce","$"],
["variable.instance","d"],
["text"," "],
["support.function","+"],
["text"," "],
["variable.instancce","$"],
["variable.instance","dd"],
["paren.rparen","}]"]
],[
"commandItem",
["text","\t\t"],
["keyword","if"],
["text"," "],
["paren.lparen","{"],
["variable.instancce","$"],
["variable.instance","alt"],
["text"," "],
["support.function","<"],
["text"," "],
["paren.lparen","["],
["keyword","dict"],
["text"," "],
["identifier","get"],
["text"," "],
["variable.instancce","$"],
["variable.instance","dist"],
["text"," "],
["variable.instancce","$"],
["variable.instance","v"],
["paren.rparen","]}"],
["text"," "],
["paren.lparen","{"]
],[
"start",
["text","\t\t "],
["keyword","dict"],
["text"," "],
["identifier","set"],
["text"," "],
["identifier","dist"],
["text"," "],
["variable.instancce","$"],
["variable.instance","v"],
["text"," "],
["variable.instancce","$"],
["variable.instance","alt"]
],[
"start",
["text","\t\t "],
["keyword","dict"],
["text"," "],
["identifier","set"],
["text"," "],
["identifier","path"],
["text"," "],
["variable.instancce","$"],
["variable.instance","v"],
["text"," "],
["paren.lparen","["],
["keyword","list"],
["text"," "],
["support.function","{*}"],
["paren.lparen","["],
["keyword","dict"],
["text"," "],
["identifier","get"],
["text"," "],
["variable.instancce","$"],
["variable.instance","path"],
["text"," "],
["variable.instancce","$"],
["variable.instance","u"],
["paren.rparen","]"],
["text"," "],
["variable.instancce","$"],
["variable.instance","v"],
["paren.rparen","]"]
],[
"commandItem",
["text","\t\t}"]
],[
"commandItem",
["text","\t }"]
],[
"commandItem",
["text","\t}"]
],[
"commandItem",
["text"," "]
],[
"start",
["text","\t"],
["comment","# Remove chosen node from graph still to be handled"]
],[
"start",
["text","\t"],
["keyword","dict"],
["text"," "],
["identifier","unset"],
["text"," "],
["identifier","graph"],
["text"," "],
["variable.instancce","$"],
["variable.instance","u"]
],[
"commandItem",
["text"," }"]
],[
"start",
["text"," "],
["keyword","return"],
["text"," "],
["paren.lparen","["],
["keyword","list"],
["text"," "],
["variable.instancce","$"],
["variable.instance","dist"],
["text"," "],
["variable.instancce","$"],
["variable.instance","path"],
["paren.rparen","]"]
],[
"commandItem",
["text","}"]
]]

View file

@ -1,189 +1,130 @@
[
{
"state": "start",
"data": [
[ "text", "The quadratic formula is $$-b " ],
[ "keyword", "\\pm" ],
[ "text", " " ],
[ "keyword", "\\sqrt" ],
[ "paren.keyword.operator", "{" ],
[ "text", "b^2 - 4ac" ],
[ "paren.keyword.operator", "}" ],
[ "text", " " ],
[ "keyword", "\\over" ],
[ "text", " 2a$$" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "\\bye" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "\\makeatletter" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "\\newcommand" ],
[ "paren.keyword.operator", "{" ],
[ "keyword", "\\be" ],
[ "paren.keyword.operator", "}{" ],
[ "comment", "%" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "\\begingroup" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "comment", "% \\setlength{\\arraycolsep}{2pt}" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "\\eqnarray" ],
[ "comment", "%" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "\\@" ],
[ "text", "ifstar" ],
[ "paren.keyword.operator", "{" ],
[ "keyword", "\\nonumber" ],
[ "paren.keyword.operator", "}{}" ],
[ "comment", "%" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "paren.keyword.operator", "}" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "\\newcommand" ],
[ "paren.keyword.operator", "{" ],
[ "keyword", "\\ee" ],
[ "paren.keyword.operator", "}{" ],
[ "keyword", "\\endeqnarray\\endgroup" ],
[ "paren.keyword.operator", "}" ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "\\makeatother" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "\\begin" ],
[ "paren.keyword.operator", "{" ],
[ "nospell.text", "equation" ],
[ "paren.keyword.operator", "}" ]
]
},
{
"state": "start",
"data": [
[ "text", " x=" ],
[ "keyword", "\\left\\" ],
[ "paren.keyword.operator", "{" ],
[ "text", " " ],
[ "keyword", "\\begin" ],
[ "paren.keyword.operator", "{" ],
[ "nospell.text", "array" ],
[ "paren.keyword.operator", "}{" ],
[ "text", "cl" ],
[ "paren.keyword.operator", "}" ]
]
},
{
"state": "start",
"data": [
[ "text", " 0 & " ],
[ "keyword", "\\textrm" ],
[ "paren.keyword.operator", "{" ],
[ "text", "if " ],
[ "paren.keyword.operator", "}" ],
[ "text", "A=" ],
[ "keyword", "\\ldots\\\\" ]
]
},
{
"state": "start",
"data": [
[ "text", " 1 & " ],
[ "keyword", "\\textrm" ],
[ "paren.keyword.operator", "{" ],
[ "text", "if " ],
[ "paren.keyword.operator", "}" ],
[ "text", "B=" ],
[ "keyword", "\\ldots\\\\" ]
]
},
{
"state": "start",
"data": [
[ "text", " x & " ],
[ "keyword", "\\textrm" ],
[ "paren.keyword.operator", "{" ],
[ "text", "this runs with as much text as you like, but without an raggeright text" ]
]
},
{
"state": "start",
"data": [
[ "text", "." ],
[ "paren.keyword.operator", "}" ],
[ "keyword", "\\end" ],
[ "paren.keyword.operator", "{" ],
[ "nospell.text", "array" ],
[ "paren.keyword.operator", "}" ],
[ "keyword", "\\right" ],
[ "text", "." ]
]
},
{
"state": "start",
"data": [
[ "text", " " ],
[ "keyword", "\\end" ],
[ "paren.keyword.operator", "{" ],
[ "nospell.text", "equation" ],
[ "paren.keyword.operator", "}" ]
]
}
]
[[
"start",
["text","The quadratic formula is $$-b "],
["keyword","\\pm"],
["text"," "],
["keyword","\\sqrt"],
["paren.keyword.operator","{"],
["text","b^2 - 4ac"],
["paren.keyword.operator","}"],
["text"," "],
["keyword","\\over"],
["text"," 2a$$"]
],[
"start",
["keyword","\\bye"]
],[
"start"
],[
"start",
["keyword","\\makeatletter"]
],[
"start",
["text"," "],
["keyword","\\newcommand"],
["paren.keyword.operator","{"],
["keyword","\\be"],
["paren.keyword.operator","}{"],
["comment","%"]
],[
"start",
["text"," "],
["keyword","\\begingroup"]
],[
"start",
["text"," "],
["comment","% \\setlength{\\arraycolsep}{2pt}"]
],[
"start",
["text"," "],
["keyword","\\eqnarray"],
["comment","%"]
],[
"start",
["text"," "],
["keyword","\\@"],
["text","ifstar"],
["paren.keyword.operator","{"],
["keyword","\\nonumber"],
["paren.keyword.operator","}{}"],
["comment","%"]
],[
"start",
["text"," "],
["paren.keyword.operator","}"]
],[
"start",
["text"," "],
["keyword","\\newcommand"],
["paren.keyword.operator","{"],
["keyword","\\ee"],
["paren.keyword.operator","}{"],
["keyword","\\endeqnarray\\endgroup"],
["paren.keyword.operator","}"]
],[
"start",
["text"," "],
["keyword","\\makeatother"]
],[
"start"
],[
"start",
["text"," "],
["keyword","\\begin"],
["paren.keyword.operator","{"],
["nospell.text","equation"],
["paren.keyword.operator","}"]
],[
"start",
["text"," x="],
["keyword","\\left\\"],
["paren.keyword.operator","{"],
["text"," "],
["keyword","\\begin"],
["paren.keyword.operator","{"],
["nospell.text","array"],
["paren.keyword.operator","}{"],
["text","cl"],
["paren.keyword.operator","}"]
],[
"start",
["text"," 0 & "],
["keyword","\\textrm"],
["paren.keyword.operator","{"],
["text","if "],
["paren.keyword.operator","}"],
["text","A="],
["keyword","\\ldots\\\\"]
],[
"start",
["text"," 1 & "],
["keyword","\\textrm"],
["paren.keyword.operator","{"],
["text","if "],
["paren.keyword.operator","}"],
["text","B="],
["keyword","\\ldots\\\\"]
],[
"start",
["text"," x & "],
["keyword","\\textrm"],
["paren.keyword.operator","{"],
["text","this runs with as much text as you like, but without an raggeright text"]
],[
"start",
["text","."],
["paren.keyword.operator","}"],
["keyword","\\end"],
["paren.keyword.operator","{"],
["nospell.text","array"],
["paren.keyword.operator","}"],
["keyword","\\right"],
["text","."]
],[
"start",
["text"," "],
["keyword","\\end"],
["paren.keyword.operator","{"],
["nospell.text","equation"],
["paren.keyword.operator","}"]
]]

View file

@ -1,58 +1,29 @@
[
{
"state": "start",
"data": [
[ "text", "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." ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", "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." ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", "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." ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", "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." ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", "Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis." ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", "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" ]
]
}
]
[[
"start",
["text","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."]
],[
"start"
],[
"start",
["text","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."]
],[
"start"
],[
"start",
["text","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."]
],[
"start"
],[
"start",
["text","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."]
],[
"start"
],[
"start",
["text","Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis."]
],[
"start"
],[
"start",
["text","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"]
]]

View file

@ -1,191 +1,113 @@
[
{
"state": "start",
"data": [
[ "markup.heading.1", "h1" ],
[ "keyword", ". " ],
[ "text", "Textile document" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "markup.heading.2", "h2" ],
[ "keyword", ". " ],
[ "text", "Heading Two" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "markup.heading.3", "h3" ],
[ "keyword", ". " ],
[ "text", "A two-line" ]
]
},
{
"state": "start",
"data": [
[ "text", " header" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "markup.heading.2", "h2" ],
[ "keyword", ". " ],
[ "text", "Another two-line" ]
]
},
{
"state": "start",
"data": [
[ "text", "header" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", "Paragraph:" ]
]
},
{
"state": "start",
"data": [
[ "text", "one, two," ]
]
},
{
"state": "start",
"data": [
[ "text", "thee lines!" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "markup.heading", "p" ],
[ "keyword", "(" ],
[ "string", "classone" ],
[ "text", " " ],
[ "string", "two" ],
[ "text", " " ],
[ "string", "three" ],
[ "keyword", "). " ],
[ "text", "This is a paragraph with classes" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "markup.heading", "p" ],
[ "keyword", "(#" ],
[ "string", "id" ],
[ "keyword", "). " ],
[ "text", "(one with an id)" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "markup.heading", "p" ],
[ "keyword", "(" ],
[ "string", "one" ],
[ "text", " " ],
[ "string", "two" ],
[ "text", " " ],
[ "string", "three" ],
[ "keyword", "#" ],
[ "string", "my_id" ],
[ "keyword", "). " ],
[ "text", "..classes + id" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "*" ],
[ "text", " Unordered list" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "**" ],
[ "text", " sublist" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "*" ],
[ "text", " back again!" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "**" ],
[ "text", " sublist again.." ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "#" ],
[ "text", " ordered" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "text", "bg. Blockquote!" ]
]
},
{
"state": "start",
"data": [
[ "text", " This is a two-list blockquote..!" ]
]
}
]
[[
"start",
["markup.heading.1","h1"],
["keyword",". "],
["text","Textile document"]
],[
"start"
],[
"start",
["markup.heading.2","h2"],
["keyword",". "],
["text","Heading Two"]
],[
"start"
],[
"start",
["markup.heading.3","h3"],
["keyword",". "],
["text","A two-line"]
],[
"start",
["text"," header"]
],[
"start"
],[
"start",
["markup.heading.2","h2"],
["keyword",". "],
["text","Another two-line"]
],[
"start",
["text","header"]
],[
"start"
],[
"start",
["text","Paragraph:"]
],[
"start",
["text","one, two,"]
],[
"start",
["text","thee lines!"]
],[
"start"
],[
"start",
["markup.heading","p"],
["keyword","("],
["string","classone"],
["text"," "],
["string","two"],
["text"," "],
["string","three"],
["keyword","). "],
["text","This is a paragraph with classes"]
],[
"start"
],[
"start",
["markup.heading","p"],
["keyword","(#"],
["string","id"],
["keyword","). "],
["text","(one with an id)"]
],[
"start"
],[
"start",
["markup.heading","p"],
["keyword","("],
["string","one"],
["text"," "],
["string","two"],
["text"," "],
["string","three"],
["keyword","#"],
["string","my_id"],
["keyword","). "],
["text","..classes + id"]
],[
"start"
],[
"start",
["keyword","*"],
["text"," Unordered list"]
],[
"start",
["keyword","**"],
["text"," sublist"]
],[
"start",
["keyword","*"],
["text"," back again!"]
],[
"start",
["keyword","**"],
["text"," sublist again.."]
],[
"start"
],[
"start",
["keyword","#"],
["text"," ordered"]
],[
"start"
],[
"start",
["text","bg. Blockquote!"]
],[
"start",
["text"," This is a two-list blockquote..!"]
]]

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,249 @@
[[
"start",
["text","myfilename "],
["keyword.operator.asp","="],
["text"," "],
["punctuation.definition.string.begin.asp","\""],
["string.quoted.double.asp","C:\\Wikipedia - VBScript - Example - Hello World.txt\""]
],[
"start"
],[
"start",
["text","MakeHelloWorldFile myfilename"]
],[
"start"
],[
"state_4",
["meta.leading-space"," "]
],[
"state_4"
],[
"start",
["storage.type.function.asp","Sub"],
["text"," "],
["entity.name.function.asp","MakeHelloWorldFile"],
["text"," "],
["punctuation.definition.parameters.asp","("],
["variable.parameter.function.asp","FileName"],
["punctuation.definition.parameters.asp",")"]
],[
"start"
],[
"start",
["punctuation.definition.comment.asp","'"],
["comment.line.apostrophe.asp","Create a new file in C: drive or overwrite existing file"]
],[
"start"
],[
"start",
["meta.odd-tab.spaces"," "],
["meta.leading-space"," "],
["storage.type.asp","Set"],
["text"," FSO "],
["keyword.operator.asp","="],
["text"," "],
["support.function.asp","CreateObject"],
["text","("],
["punctuation.definition.string.begin.asp","\""],
["string.quoted.double.asp","Scripting.FileSystemObject\""],
["text",")"]
],[
"start"
],[
"start",
["meta.odd-tab.spaces"," "],
["meta.leading-space"," "],
["keyword.control.asp","If"],
["text"," FSO."],
["entity.name.function.asp","FileExists"],
["text","(FileName) "],
["keyword.control.asp","Then"],
["text"," "]
],[
"start"
],[
"start",
["meta.odd-tab.spaces"," "],
["meta.even-tab.spaces"," "],
["meta.odd-tab.spaces"," "],
["text","Answer "],
["keyword.operator.asp","="],
["text"," "],
["support.function.vb.asp","MsgBox"],
["text"," ("],
["punctuation.definition.string.begin.asp","\""],
["string.quoted.double.asp","File \""],
["text"," "],
["keyword.operator.asp","&"],
["text"," FileName "],
["keyword.operator.asp","&"],
["text"," "],
["punctuation.definition.string.begin.asp","\""],
["string.quoted.double.asp"," exists ... OK to overwrite?\""],
["text",", vbOKCancel)"]
],[
"start"
],[
"start",
["meta.odd-tab.spaces"," "],
["meta.even-tab.spaces"," "],
["meta.odd-tab.spaces"," "],
["punctuation.definition.comment.asp","'"],
["comment.line.apostrophe.asp","If button selected is not OK, then quit now"]
],[
"start"
],[
"start",
["meta.odd-tab.spaces"," "],
["meta.even-tab.spaces"," "],
["meta.odd-tab.spaces"," "],
["punctuation.definition.comment.asp","'"],
["comment.line.apostrophe.asp","vbOK is a language constant"]
],[
"start"
],[
"start",
["meta.odd-tab.spaces"," "],
["meta.even-tab.spaces"," "],
["meta.odd-tab.spaces"," "],
["keyword.control.asp","If"],
["text"," Answer "],
["keyword.operator.asp","<>"],
["text"," vbOK "],
["keyword.control.asp","Then"],
["text"," "],
["keyword.control.asp","Exit Sub"]
],[
"start"
],[
"start",
["meta.odd-tab.spaces"," "],
["meta.leading-space"," "],
["keyword.control.asp","Else"]
],[
"start"
],[
"start",
["meta.odd-tab.spaces"," "],
["meta.even-tab.spaces"," "],
["meta.odd-tab.spaces"," "],
["punctuation.definition.comment.asp","'"],
["comment.line.apostrophe.asp","Confirm OK to create"]
],[
"start"
],[
"start",
["meta.odd-tab.spaces"," "],
["meta.even-tab.spaces"," "],
["meta.odd-tab.spaces"," "],
["text","Answer "],
["keyword.operator.asp","="],
["text"," "],
["support.function.vb.asp","MsgBox"],
["text"," ("],
["punctuation.definition.string.begin.asp","\""],
["string.quoted.double.asp","File \""],
["text"," "],
["keyword.operator.asp","&"],
["text"," FileName "],
["keyword.operator.asp","&"],
["text"," "],
["punctuation.definition.string.begin.asp","\""],
["string.quoted.double.asp"," ... OK to create?\""],
["text",", vbOKCancel)"]
],[
"start"
],[
"start",
["meta.odd-tab.spaces"," "],
["meta.even-tab.spaces"," "],
["meta.odd-tab.spaces"," "],
["keyword.control.asp","If"],
["text"," Answer "],
["keyword.operator.asp","<>"],
["text"," vbOK "],
["keyword.control.asp","Then"],
["text"," "],
["keyword.control.asp","Exit Sub"]
],[
"start"
],[
"start",
["meta.odd-tab.spaces"," "],
["meta.leading-space"," "],
["keyword.control.asp","End If"]
],[
"start"
],[
"start",
["meta.odd-tab.spaces"," "],
["meta.leading-space"," "],
["punctuation.definition.comment.asp","'"],
["comment.line.apostrophe.asp","Create new file (or replace an existing file)"]
],[
"start"
],[
"start",
["meta.odd-tab.spaces"," "],
["meta.leading-space"," "],
["storage.type.asp","Set"],
["text"," FileObject "],
["keyword.operator.asp","="],
["text"," FSO.CreateTextFile (FileName)"]
],[
"start"
],[
"start",
["meta.odd-tab.spaces"," "],
["meta.leading-space"," "],
["text","FileObject.WriteLine "],
["punctuation.definition.string.begin.asp","\""],
["string.quoted.double.asp","Time ... \""],
["text"," "],
["keyword.operator.asp","&"],
["text"," "],
["support.function.vb.asp","Now"],
["text","()"]
],[
"start"
],[
"start",
["meta.odd-tab.spaces"," "],
["meta.leading-space"," "],
["text","FileObject.WriteLine "],
["punctuation.definition.string.begin.asp","\""],
["string.quoted.double.asp","Hello World\""]
],[
"start"
],[
"start",
["meta.odd-tab.spaces"," "],
["meta.leading-space"," "],
["text","FileObject."],
["entity.name.function.asp","Close"],
["text","()"]
],[
"start"
],[
"start",
["meta.odd-tab.spaces"," "],
["meta.leading-space"," "],
["support.function.vb.asp","MsgBox"],
["text"," "],
["punctuation.definition.string.begin.asp","\""],
["string.quoted.double.asp","File \""],
["text"," "],
["keyword.operator.asp","&"],
["text"," FileName "],
["keyword.operator.asp","&"],
["text"," "],
["punctuation.definition.string.begin.asp","\""],
["string.quoted.double.asp"," ... updated.\""]
],[
"start"
],[
"start",
["support.function.asp","End"],
["text"," "],
["storage.type.asp","Sub"]
]]

File diff suppressed because it is too large Load diff

View file

@ -1,64 +1,44 @@
[
{
"state": "start",
"data": [
[ "keyword", "xquery" ],
[ "text", " " ],
[ "keyword", "version" ],
[ "text", " " ],
[ "string", "\"1.0\"" ],
[ "text", ";" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "keyword", "let" ],
[ "text", " " ],
[ "variable", "$message" ],
[ "text", " :" ],
[ "keyword.operator", "=" ],
[ "text", " " ],
[ "string", "\"Hello World!\"" ]
]
},
{
"state": "start",
"data": [
[ "keyword", "return" ],
[ "text", " <" ],
[ "meta.tag", "results" ],
[ "text", ">" ]
]
},
{
"state": "start",
"data": [
[ "text", " <" ],
[ "meta.tag", "message" ],
[ "text", ">" ],
[ "lparen", "{" ],
[ "variable", "$message" ],
[ "rparen", "}" ],
[ "text", "</" ],
[ "meta.tag", "message" ],
[ "text", ">" ]
]
},
{
"state": "start",
"data": [
[ "text", "</" ],
[ "meta.tag", "results" ],
[ "text", ">" ]
]
},
{
"state": "start",
"data": []
}
]
[[
"start",
["keyword","xquery"],
["text"," "],
["keyword","version"],
["text"," "],
["string","\"1.0\""],
["text",";"]
],[
"start"
],[
"start",
["keyword","let"],
["text"," "],
["variable","$message"],
["text"," "],
["keyword.operator",":="],
["text"," "],
["string","\"Hello World!\""]
],[
"start",
["keyword","return"],
["text"," <"],
["meta.tag","results"],
["text",">"]
],[
"start",
["text"," <"],
["meta.tag","message"],
["text",">"],
["lparen","{"],
["variable","$message"],
["rparen","}"],
["text","</"],
["meta.tag","message"],
["text",">"]
],[
"start",
["text","</"],
["meta.tag","results"],
["text",">"]
],[
"start"
]]

View file

@ -1,253 +1,150 @@
[
{
"state": "start",
"data": [
[ "comment", "# This sample document was taken from wikipedia:" ]
]
},
{
"state": "start",
"data": [
[ "comment", "# http://en.wikipedia.org/wiki/YAML#Sample_document" ]
]
},
{
"state": "start",
"data": [
[ "list.markup", "---" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag", "receipt" ],
[ "keyword", ": " ],
[ "text", "Oz-Ware Purchase Invoice" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag", "date" ],
[ "keyword", ": " ],
[ "constant.numeric", "2007-08-06" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag", "customer" ],
[ "keyword", ":" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag", " given" ],
[ "keyword", ": " ],
[ "text", "Dorothy" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag", " family" ],
[ "keyword", ": " ],
[ "text", "Gale" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "meta.tag", "items" ],
[ "keyword", ":" ]
]
},
{
"state": "start",
"data": [
[ "list.markup", " - " ],
[ "meta.tag", "part_no" ],
[ "keyword", ": " ],
[ "string", "'A4786'" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag", " descrip" ],
[ "keyword", ": " ],
[ "text", "Water Bucket " ],
[ "paren.lparen", "(" ],
[ "text", "Filled" ],
[ "paren.rparen", ")" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag", " price" ],
[ "keyword", ": " ],
[ "constant.numeric", "1.47" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag", " quantity" ],
[ "keyword", ": " ],
[ "constant.numeric", "4" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "list.markup", " - " ],
[ "meta.tag", "part_no" ],
[ "keyword", ": " ],
[ "string", "'E1628'" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag", " descrip" ],
[ "keyword", ": " ],
[ "text", "High Heeled " ],
[ "string", "\"Ruby\"" ],
[ "text", " Slippers" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag", " size" ],
[ "keyword", ": " ],
[ "constant.numeric", "8" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag", " price" ],
[ "keyword", ": " ],
[ "constant.numeric", "100.27" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag", " quantity" ],
[ "keyword", ": " ],
[ "constant.numeric", "1" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "meta.tag", "bill-to" ],
[ "keyword", ": " ],
[ "constant.language", "&id001" ]
]
},
{
"state": "qqstring",
"data": [
[ "meta.tag", " street" ],
[ "keyword", ": " ],
[ "string", "|" ]
]
},
{
"state": "qqstring",
"data": [
[ "string", " 123 Tornado Alley" ]
]
},
{
"state": "qqstring",
"data": [
[ "string", " Suite 16" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag", " city" ],
[ "keyword", ": " ],
[ "text", "East Centerville" ]
]
},
{
"state": "start",
"data": [
[ "meta.tag", " state" ],
[ "keyword", ": " ],
[ "text", "KS" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "start",
"data": [
[ "meta.tag", "ship-to" ],
[ "keyword", ": " ],
[ "constant.language", "*id001" ]
]
},
{
"state": "start",
"data": []
},
{
"state": "qqstring",
"data": [
[ "meta.tag", "specialDelivery" ],
[ "keyword", ": " ],
[ "string", ">" ]
]
},
{
"state": "qqstring",
"data": [
[ "string", " Follow the Yellow Brick" ]
]
},
{
"state": "qqstring",
"data": [
[ "string", " Road to the Emerald City." ]
]
},
{
"state": "qqstring",
"data": [
[ "string", " Pay no attention to the" ]
]
},
{
"state": "qqstring",
"data": [
[ "string", " man behind the curtain." ]
]
},
{
"state": "qqstring",
"data": []
}
]
[[
"start",
["comment","# This sample document was taken from wikipedia:"]
],[
"start",
["comment","# http://en.wikipedia.org/wiki/YAML#Sample_document"]
],[
"start",
["list.markup","---"]
],[
"start",
["meta.tag","receipt"],
["keyword",": "],
["text","Oz-Ware Purchase Invoice"]
],[
"start",
["meta.tag","date"],
["keyword",": "],
["constant.numeric","2007-08-06"]
],[
"start",
["meta.tag","customer"],
["keyword",":"]
],[
"start",
["meta.tag"," given"],
["keyword",": "],
["text","Dorothy"]
],[
"start",
["meta.tag"," family"],
["keyword",": "],
["text","Gale"]
],[
"start"
],[
"start",
["meta.tag","items"],
["keyword",":"]
],[
"start",
["list.markup"," - "],
["meta.tag","part_no"],
["keyword",": "],
["string","'A4786'"]
],[
"start",
["meta.tag"," descrip"],
["keyword",": "],
["text","Water Bucket "],
["paren.lparen","("],
["text","Filled"],
["paren.rparen",")"]
],[
"start",
["meta.tag"," price"],
["keyword",": "],
["constant.numeric","1.47"]
],[
"start",
["meta.tag"," quantity"],
["keyword",": "],
["constant.numeric","4"]
],[
"start"
],[
"start",
["list.markup"," - "],
["meta.tag","part_no"],
["keyword",": "],
["string","'E1628'"]
],[
"start",
["meta.tag"," descrip"],
["keyword",": "],
["text","High Heeled "],
["string","\"Ruby\""],
["text"," Slippers"]
],[
"start",
["meta.tag"," size"],
["keyword",": "],
["constant.numeric","8"]
],[
"start",
["meta.tag"," price"],
["keyword",": "],
["constant.numeric","100.27"]
],[
"start",
["meta.tag"," quantity"],
["keyword",": "],
["constant.numeric","1"]
],[
"start"
],[
"start",
["meta.tag","bill-to"],
["keyword",": "],
["constant.language","&id001"]
],[
"qqstring",
["meta.tag"," street"],
["keyword",": "],
["string","|"]
],[
"qqstring",
["string"," 123 Tornado Alley"]
],[
"qqstring",
["string"," Suite 16"]
],[
"start",
["meta.tag"," city"],
["keyword",": "],
["text","East Centerville"]
],[
"start",
["meta.tag"," state"],
["keyword",": "],
["text","KS"]
],[
"start"
],[
"start",
["meta.tag","ship-to"],
["keyword",": "],
["constant.language","*id001"]
],[
"start"
],[
"qqstring",
["meta.tag","specialDelivery"],
["keyword",": "],
["string",">"]
],[
"qqstring",
["string"," Follow the Yellow Brick"]
],[
"qqstring",
["string"," Road to the Emerald City."]
],[
"qqstring",
["string"," Pay no attention to the"]
],[
"qqstring",
["string"," man behind the curtain."]
],[
"qqstring"
]]

View file

@ -1,266 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** END LICENSE BLOCK ***** */
if (typeof process !== "undefined") {
require("amd-loader");
}
define(function(require, exports, module) {
"use strict";
var Mode = require("./coffee").Mode;
var assert = require("../test/assertions");
module.exports = {
setUp : function() {
this.tokenizer = new Mode().getTokenizer();
this.testTokens = function(tokens, correct) {
assert.equal(tokens.length, correct.length);
correct.forEach(function(type, i) {
assert.equal(tokens[i].type, type);
});
};
},
"test: tokenize keyword": function() {
var tokens = this.tokenizer.getLineTokens("for", "start").tokens;
assert.equal(tokens.length, 1);
assert.equal(tokens[0].type, "keyword");
},
"test: tokenize regexp": function() {
var tokens = this.tokenizer.getLineTokens('/"[a]/', "start").tokens;
assert.equal(tokens.length, 1);
assert.equal(tokens[0].type, "string.regex");
},
"test: tokenize function: 'foo = ({args}) ->'": function() {
var tokens = this.tokenizer.getLineTokens("foo = ({args}) ->", "start").tokens;
var correct = [
"entity.name.function", "text", "keyword.operator", "text",
"paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"
];
this.testTokens(tokens, correct);
tokens = this.tokenizer.getLineTokens("foo = ({a1, a2}) ->", "start").tokens;
this.testTokens(tokens, correct);
tokens = this.tokenizer.getLineTokens("foo = ({@a1, a2}) ->", "start").tokens;
this.testTokens(tokens, correct);
},
"test: tokenize function: 'foo : ({args}) ->'": function() {
var tokens = this.tokenizer.getLineTokens("foo : ({args}) ->", "start").tokens;
var correct = [
"entity.name.function", "text", "punctuation.operator", "text",
"paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"
];
this.testTokens(tokens, correct);
},
"test: tokenize function: invalid case: 'foo = ({args}) ->'": function() {
var tokens = this.tokenizer.getLineTokens("foo = ({0abc}) ->", "start").tokens;
assert.notEqual(tokens[0].type, "entity.name.function");
tokens = this.tokenizer.getLineTokens("foo = ({/abc}) ->", "start").tokens;
assert.notEqual(tokens[0].type, "entity.name.function");
tokens = this.tokenizer.getLineTokens("foo = ({abc/}) ->", "start").tokens;
assert.notEqual(tokens[0].type, "entity.name.function");
tokens = this.tokenizer.getLineTokens("foo = ({#abc}) ->", "start").tokens;
assert.notEqual(tokens[0].type, "entity.name.function");
tokens = this.tokenizer.getLineTokens("foo = ({abc#}) ->", "start").tokens;
assert.notEqual(tokens[0].type, "entity.name.function");
tokens = this.tokenizer.getLineTokens("foo = ({)abc}) ->", "start").tokens;
assert.notEqual(tokens[0].type, "entity.name.function");
tokens = this.tokenizer.getLineTokens("foo = ({abc)}) ->", "start").tokens;
assert.notEqual(tokens[0].type, "entity.name.function");
tokens = this.tokenizer.getLineTokens("foo = ({a{bc}) ->", "start").tokens;
assert.notEqual(tokens[0].type, "entity.name.function");
},
"test: tokenize function: 'foo = ({}) ->'": function() {
var tokens = this.tokenizer.getLineTokens("foo = ({}) ->", "start").tokens;
var correct = [
"entity.name.function", "text", "keyword.operator", "text",
"paren.lparen", "paren.rparen", "text", "storage.type"
];
this.testTokens(tokens, correct);
tokens = this.tokenizer.getLineTokens("foo = ({ }) ->", "start").tokens;
correct = [
"entity.name.function", "text", "keyword.operator", "text",
"paren.lparen", "text", "paren.rparen", "text", "storage.type"
];
assert.equal(tokens.length, 9);
this.testTokens(tokens, correct);
},
"test: tokenize function: 'foo : ({}) ->'": function() {
var tokens = this.tokenizer.getLineTokens("foo : ({}) ->", "start").tokens;
var correct = [
"entity.name.function", "text", "punctuation.operator", "text",
"paren.lparen", "paren.rparen", "text", "storage.type"
];
this.testTokens(tokens, correct);
},
"test: tokenize function: 'foo = (args) ->'": function() {
var tokens = this.tokenizer.getLineTokens("foo = (args) ->", "start").tokens;
var correct = [
"entity.name.function", "text", "keyword.operator", "text",
"paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"
];
this.testTokens(tokens, correct);
tokens = this.tokenizer.getLineTokens("foo = (arg1, arg2) ->", "start").tokens;
this.testTokens(tokens, correct);
tokens = this.tokenizer.getLineTokens("foo = (arg1 = 1, arg2 = 'name') ->", "start").tokens;
this.testTokens(tokens, correct);
tokens = this.tokenizer.getLineTokens("foo = (@arg1 = /abc/, arg2 = 'name') ->", "start").tokens;
this.testTokens(tokens, correct);
},
"test: tokenize function: invalid case: 'foo=(args) ->'": function() {
var tokens = this.tokenizer.getLineTokens("foo=(/args) ->", "start").tokens;
assert.notEqual(tokens[0].type, "entity.name.function");
},
"test: tokenize function: 'foo = () ->'": function() {
var tokens = this.tokenizer.getLineTokens("foo = () ->", "start").tokens;
var correct = [
"entity.name.function", "text", "keyword.operator", "text",
"paren.lparen", "paren.rparen", "text", "storage.type"
];
this.testTokens(tokens, correct);
tokens = this.tokenizer.getLineTokens("foo = ( ) ->", "start").tokens;
correct = [
"entity.name.function", "text", "keyword.operator", "text",
"paren.lparen", "text", "paren.rparen", "text", "storage.type"
];
this.testTokens(tokens, correct);
},
"test: tokenize function: 'foo : () ->'": function() {
var tokens = this.tokenizer.getLineTokens("foo : () ->", "start").tokens;
var correct = [
"entity.name.function", "text", "punctuation.operator", "text",
"paren.lparen", "paren.rparen", "text", "storage.type"
];
this.testTokens(tokens, correct);
tokens = this.tokenizer.getLineTokens("foo : ( ) ->", "start").tokens;
var correct = [
"entity.name.function", "text", "punctuation.operator", "text",
"paren.lparen", "text", "paren.rparen", "text", "storage.type"
];
this.testTokens(tokens, correct);
},
"test: tokenize function: 'window.foo = (args) ->'": function() {
var tokens = this.tokenizer.getLineTokens("window.foo = (args) ->", "start").tokens;
var correct = [
"variable.language", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text",
"paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"
];
this.testTokens(tokens, correct);
},
"test: tokenize function: 'foo = ->'": function() {
var tokens = this.tokenizer.getLineTokens("foo = ->", "start").tokens;
var correct = [
"entity.name.function", "text", "keyword.operator", "text", "storage.type"
];
this.testTokens(tokens, correct);
},
"test: tokenize function: 'foo : ->'": function() {
var tokens = this.tokenizer.getLineTokens("foo : ->", "start").tokens;
var correct = [
"entity.name.function", "text", "punctuation.operator", "text", "storage.type"
];
this.testTokens(tokens, correct);
},
"test: tokenize callback function: 'foo bar: 1, (args) ->'": function() {
var tokens = this.tokenizer.getLineTokens("foo bar: 1, (args) ->", "start").tokens;
var correct = [
"identifier", "text", "identifier", "punctuation.operator", "text", "constant.numeric", "punctuation.operator", "text",
"paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"
];
this.testTokens(tokens, correct);
},
"test: tokenize class: 'class Foo'": function() {
var tokens = this.tokenizer.getLineTokens("class Foo", "start").tokens;
var correct = [
"keyword", "text", "language.support.class"
];
this.testTokens(tokens, correct);
},
"test: tokenize class 'class Foo extends Bar'": function() {
var tokens = this.tokenizer.getLineTokens("class Foo extends Bar", "start").tokens;
var correct = [
"keyword", "text", "language.support.class", "text", "keyword", "text", "language.support.class"
];
this.testTokens(tokens, correct);
},
"test: tokenize illegal name property: 'foo.static.function'": function() {
var tokens = this.tokenizer.getLineTokens("foo.static.function", "start").tokens;
var correct = [
"identifier", "punctuation.operator", "identifier", "punctuation.operator", "identifier"
];
this.testTokens(tokens, correct);
},
// TODO: disable. not yet implemented
"!test tokenize string with interpolation": function() {
var tokens = this.tokenizer.getLineTokens('"#{ 22 / 7 } is a decent approximation of π"', "start").tokens;
console.log(tokens);
assert.equal(tokens.length, 12);
//assert.equal(tokens[0].type, "keyword");
}
};
});
if (typeof module !== "undefined" && module === require.main) {
require("asyncjs").test.testcase(module.exports).exec();
}

View file

@ -1,202 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** END LICENSE BLOCK ***** */
if (typeof process !== "undefined") {
require("amd-loader");
}
define(function(require, exports, module) {
"use strict";
var CurlyMode = require("./curly").Mode;
var assert = require("../test/assertions");
var testData = {
"test: tokenize Curly template" : [{
text: "{{test}}",
state: ["start", "start"],
tokens: [{
type: "variable",
value: "{{"
}, {
type: "text",
value: "test"
}, {
type: "variable",
value: "}}"
}]
}],
"test: tokenize embedded script" : [{
text: "<script a='a'>var</script>'123'",
state: ["start", "start"],
tokens: [{
type: "meta.tag",
value: "<"
}, {
type: "meta.tag.tag-name.script",
value: "script"
}, {
type: "text",
value: " "
}, {
type: "entity.other.attribute-name",
value: "a"
}, {
type: "keyword.operator",
value: "="
}, {
type: "string",
value: "'a'"
}, {
type: "meta.tag.r",
value: ">"
}, {
type: "storage.type",
value: "var"
}, {
type: "meta.tag",
value: "</"
}, {
type: "meta.tag.tag-name.script",
value: "script"
}, {
type: "meta.tag.r",
value: ">"
}, {
type: "text",
value: "'123'"
}]
}],
"test: tokenize multiline attribute value with double quotes": [{
text: "<a href=\"abc",
state: [ "start", "tag_qqstring"],
tokens: [{
type: "meta.tag",
value: "<"
}, {
type: "meta.tag.tag-name.anchor",
value: "a"
}, {
type: "text",
value: " "
}, {
type: "entity.other.attribute-name",
value: "href"
}, {
type: "keyword.operator",
value: "="
}, {
type: "string",
value: "\"abc"
}
]
}, {
text: "def\">",
state: [ "tag_qqstring", "start" ],
tokens: [ {
type: "string",
value: "def\""
}, {
type: "meta.tag.r",
value: ">"
}
]
}],
"test: tokenize multiline attribute value with single quotes": [{
text: "<a href='abc",
state: ["start", "tag_qstring"],
tokens: [{
type: "meta.tag",
value: "<"
}, {
type: "meta.tag.tag-name.anchor",
value: "a"
}, {
type: "text",
value: " "
}, {
type: "entity.other.attribute-name",
value: "href"
}, {
type: "keyword.operator",
value: "="
}, {
type: "string",
value: "'abc"
}
]
}, {
text: "def\"'>",
state: [ "tag_qstring", "start" ],
tokens: [ {
type: "string",
value: "def\"'"
}, {
type: "meta.tag.r",
value: ">"
}
]
}]
};
function generateTest(exampleData) {
return function testTokenizer() {
for (var i = 0; i < exampleData.length; i++) {
var s = exampleData[i];
var lineTokens = tokenizer.getLineTokens(s.text, s.state[0]);
assert.equal(
JSON.stringify(lineTokens, null, 4),
JSON.stringify({tokens:s.tokens, state: s.state[1]}, null, 4)
);
}
}
}
var tokenizer;
module.exports = {
setUp : function() {
tokenizer = new CurlyMode().getTokenizer();
}
}
for (var i in testData) {
module.exports[i] = generateTest(testData[i])
}
});
if (typeof module !== "undefined" && module === require.main) {
require("asyncjs").test.testcase(module.exports).exec();
}

View file

@ -1,215 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** END LICENSE BLOCK ***** */
if (typeof process !== "undefined") {
require("amd-loader");
}
define(function(require, exports, module) {
"use strict";
var JavaScriptMode = require("./javascript").Mode;
var assert = require("../test/assertions");
module.exports = {
name: "JavaScript Tokenizer",
setUp : function() {
this.tokenizer = new JavaScriptMode().getTokenizer();
},
"test: tokenize1" : function() {
var line = "foo = function";
var tokens = this.tokenizer.getLineTokens(line, "start").tokens;
assert.equal(5, tokens.length);
assert.equal("identifier", tokens[0].type);
assert.equal("text", tokens[1].type);
assert.equal("keyword.operator", tokens[2].type);
assert.equal("text", tokens[3].type);
assert.equal("storage.type", tokens[4].type);
},
"test: tokenize 'standard' functions" : function() {
var line = "string.charCodeAt(23); document.getElementById('test'); console.log('Here it is');";
var tokens = this.tokenizer.getLineTokens(line, "start").tokens;
assert.equal(23, tokens.length);
assert.equal("support.function", tokens[2].type); // charCodeAt
assert.equal("support.function.dom", tokens[10].type); // getElementById
assert.equal("support.function.firebug", tokens[18].type); // log
},
"test: tokenize doc comment" : function() {
var line = "abc /** de */ fg";
var tokens = this.tokenizer.getLineTokens(line, "start").tokens;
assert.equal(5, tokens.length);
assert.equal("identifier", tokens[0].type);
assert.equal("text", tokens[1].type);
assert.equal("comment.doc", tokens[2].type);
assert.equal("text", tokens[3].type);
assert.equal("identifier", tokens[4].type);
},
"test: tokenize doc comment with tag" : function() {
var line = "/** @param {} */";
var tokens = this.tokenizer.getLineTokens(line, "start").tokens;
assert.equal(3, tokens.length);
assert.equal("comment.doc", tokens[0].type);
assert.equal("comment.doc.tag", tokens[1].type);
assert.equal("comment.doc", tokens[2].type);
},
"test: tokenize parens" : function() {
var line = "[{( )}]";
var tokens = this.tokenizer.getLineTokens(line, "start").tokens;
// TODO is it useful to keep parens in separate tokens?
assert.equal(3, tokens.length);
assert.equal("paren.lparen", tokens[0].type);
assert.equal("text", tokens[1].type);
assert.equal("paren.rparen", tokens[2].type);
},
"test for last rule in ruleset to catch capturing group bugs" : function() {
var tokens = this.tokenizer.getLineTokens("}", "start").tokens;
assert.equal(1, tokens.length);
assert.equal("paren.rparen", tokens[0].type);
},
"test tokenize arithmetic expression which looks like a regexp": function() {
var tokens = this.tokenizer.getLineTokens("a/b/c", "start").tokens;
assert.equal(5, tokens.length);
var tokens = this.tokenizer.getLineTokens("a/=b/c", "start").tokens;
assert.equal(5, tokens.length);
},
"test tokenize reg exps" : function() {
var tokens = this.tokenizer.getLineTokens("a=/b/g", "start").tokens;
assert.equal(3, tokens.length);
assert.equal("string.regexp", tokens[2].type);
var tokens = this.tokenizer.getLineTokens("a+/b/g", "start").tokens;
assert.equal(3, tokens.length);
assert.equal("string.regexp", tokens[2].type);
var tokens = this.tokenizer.getLineTokens("a = 1 + /2 + 1/b", "start").tokens;
assert.equal(11, tokens.length);
assert.equal("string.regexp", tokens[8].type);
var tokens = this.tokenizer.getLineTokens("a=/a/ / /a/", "start").tokens;
assert.equal(7, tokens.length);
assert.equal("string.regexp", tokens[2].type);
assert.equal("string.regexp", tokens[6].type);
var tokens = this.tokenizer.getLineTokens("case /a/.test(c)", "start").tokens;
assert.equal(8, tokens.length);
assert.equal("string.regexp", tokens[2].type);
},
"test tokenize multi-line comment containing a single line comment" : function() {
var tokens = this.tokenizer.getLineTokens("/* foo // bar */", "start").tokens;
assert.equal(1, tokens.length);
assert.equal("comment", tokens[0].type);
var tokens = this.tokenizer.getLineTokens("/* foo // bar */", "regex_allowed").tokens;
assert.equal(1, tokens.length);
assert.equal("comment", tokens[0].type);
},
"test tokenize identifier with umlauts": function() {
var tokens = this.tokenizer.getLineTokens("füße", "start").tokens;
assert.equal(1, tokens.length);
},
"test // is not a regexp": function() {
var tokens = this.tokenizer.getLineTokens("{ // 123", "start").tokens;
assert.equal(3, tokens.length);
assert.equal("paren.lparen", tokens[0].type);
assert.equal("text", tokens[1].type);
assert.equal("comment", tokens[2].type);
},
"test skipping escaped chars": function() {
var line = "console.log('Meh\\nNeh');"
var tokens = this.tokenizer.getLineTokens(line, "start").tokens;
assert.equal(9, tokens.length);
assert.equal("constant.language.escape", tokens[5].type);
line = "console.log('\\u1232Feh');";
tokens = this.tokenizer.getLineTokens(line, "start").tokens;
assert.equal(9, tokens.length);
assert.equal("constant.language.escape", tokens[5].type);
},
"test multiline strings": function() {
var line = "console.log('Meh\\"
var data = this.tokenizer.getLineTokens(line, "start")
assert.equal(5, data.tokens.length);
assert.equal(data.state, "qstring");
line = "console.log('Meh\\ "
data = this.tokenizer.getLineTokens(line, "start")
assert.equal(6, data.tokens.length);
assert.equal(data.state, "start");
line = 'console.log("\\'
data = this.tokenizer.getLineTokens(line, "start")
assert.equal(5, data.tokens.length);
assert.equal(data.state, "qqstring");
line = 'a="'
data = this.tokenizer.getLineTokens(line, "start")
assert.equal(3, data.tokens.length);
assert.equal(data.state, "start");
}
};
});
if (typeof module !== "undefined" && module === require.main) {
require("asyncjs").test.testcase(module.exports).exec()
}

View file

@ -1,99 +0,0 @@
if (typeof process !== "undefined") {
require("amd-loader");
}
define(function(require, exports, module) {
"use strict";
var LuceneMode = require("./lucene").Mode;
var assert = require("../test/assertions");
module.exports = {
name: "Lucene Tokenizer",
setUp : function() {
this.tokenizer = new LuceneMode().getTokenizer();
},
"test: recognises AND as keyword" : function() {
var tokens = this.tokenizer.getLineTokens("AND", "start").tokens;
assert.equal("keyword.operator", tokens[0].type);
},
"test: recognises OR as keyword" : function() {
var tokens = this.tokenizer.getLineTokens("OR", "start").tokens;
assert.equal("keyword.operator", tokens[0].type);
},
"test: recognises NOT as keyword" : function() {
var tokens = this.tokenizer.getLineTokens("NOT", "start").tokens;
assert.equal("keyword.operator", tokens[0].type);
},
'test: recognises "hello this is dog" as string' : function() {
var tokens = this.tokenizer.getLineTokens('"hello this is dog"', "start").tokens;
assert.equal("string", tokens[0].type);
},
'test: recognises -"hello this is dog" as negation with string' : function() {
var tokens = this.tokenizer.getLineTokens('-"hello this is dog"', "start").tokens;
assert.equal("constant.character.negation", tokens[0].type);
assert.equal("string", tokens[1].type);
},
'test: recognises ~100 as text with proximity' : function() {
var tokens = this.tokenizer.getLineTokens('~100', "start").tokens;
assert.equal("constant.character.proximity", tokens[0].type);
},
'test: recognises "hello this is dog"~100 as string with proximity' : function() {
var tokens = this.tokenizer.getLineTokens('"hello this is dog"~100', "start").tokens;
assert.equal("string", tokens[0].type);
assert.equal("constant.character.proximity", tokens[1].type);
},
'test: recognises raw:"hello this is dog" as keyword' : function() {
var tokens = this.tokenizer.getLineTokens('raw:"hello this is dog"', "start").tokens;
assert.equal("keyword", tokens[0].type);
},
'test: recognises raw:foo as"keyword' : function() {
var tokens = this.tokenizer.getLineTokens('raw:foo', "start").tokens;
assert.equal("keyword", tokens[0].type);
},
'test: recognises "(" as opening parenthesis' : function() {
var tokens = this.tokenizer.getLineTokens('(', "start").tokens;
assert.equal("paren.lparen", tokens[0].type);
},
'test: recognises ")" as closing parenthesis' : function() {
var tokens = this.tokenizer.getLineTokens(')', "start").tokens;
assert.equal("paren.rparen", tokens[0].type);
},
'test: recognises foo* as text with asterisk' : function() {
var tokens = this.tokenizer.getLineTokens('foo*', "start").tokens;
assert.equal("text", tokens[0].type);
assert.equal("constant.character.asterisk", tokens[1].type);
},
'test: recognises foo? as text with interro' : function() {
var tokens = this.tokenizer.getLineTokens('foo?', "start").tokens;
assert.equal("text", tokens[0].type);
assert.equal("constant.character.interro", tokens[1].type);
},
'test: recognises single word as text' : function() {
var tokens = this.tokenizer.getLineTokens(' foo', "start").tokens;
assert.equal("text", tokens[0].type);
}
};
});
if (typeof module !== "undefined" && module === require.main) {
require("asyncjs").test.testcase(module.exports).exec();
}

View file

@ -1,100 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2012, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* Contributor(s):
*
* quexer <quexer AT gmail DOT com>
*
* ***** END LICENSE BLOCK ***** */
if (typeof process !== "undefined") {
require("amd-loader");
}
define(function(require, exports, module) {
"use strict";
var Mode = require("./markdown").Mode;
var assert = require("../test/assertions");
module.exports = {
setUp : function() {
this.tokenizer = new Mode().getTokenizer();
},
"test: header 1 ": function() {
var tokens = this.tokenizer.getLineTokens("#f", "start").tokens;
assert.equal(tokens.length, 1);
assert.equal(tokens[0].type, 'markup.heading.1');
},
"test: header 2": function() {
var tokens = this.tokenizer.getLineTokens("## foo", "start").tokens;
assert.equal(tokens.length, 1);
assert.equal(tokens[0].type, 'markup.heading.2');
},
"test: header ends with ' #'": function() {
var tokens = this.tokenizer.getLineTokens("# # # ", "start").tokens;
assert.equal(tokens.length, 1);
assert.equal(tokens[0].type, 'markup.heading.1');
},
"test: header ends with '#'": function() {
var tokens = this.tokenizer.getLineTokens("#foo# ", "start").tokens;
assert.equal(tokens.length, 1);
assert.equal(tokens[0].type, 'markup.heading.1');
},
"test: 6+ #s is not a valid header": function() {
var tokens = this.tokenizer.getLineTokens("####### foo", "start").tokens;
assert.equal(tokens.length, 1);
assert.equal(tokens[0].type, 'text');
},
"test: # followed be only space is not a valid header": function() {
var tokens = this.tokenizer.getLineTokens("# ", "start").tokens;
assert.equal(tokens.length, 1);
assert.equal(tokens[0].type, 'text');
},
"test: only space between #s is not a valid header": function() {
var tokens = this.tokenizer.getLineTokens("# #", "start").tokens;
assert.equal(tokens.length, 1);
assert.equal(tokens[0].type, 'text');
}
};
});
if (typeof module !== "undefined" && module === require.main) {
require("asyncjs").test.testcase(module.exports).exec();
}

View file

@ -1,108 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** END LICENSE BLOCK ***** */
if (typeof process !== "undefined") {
require("amd-loader");
}
define(function(require, exports, module) {
"use strict";
var RubyMode = require("./ruby").Mode;
var assert = require("../test/assertions");
module.exports = {
name: "Ruby Tokenizer",
setUp : function() {
this.tokenizer = new RubyMode().getTokenizer();
},
"test: symbol tokenizer" : function() {
// https://gist.github.com/1072693
assertValidTokens(this.tokenizer, "constant.other.symbol.ruby",
[":@thing", ":$thing", ":_thing", ":thing", ":Thing", ":thing1", ":thing_a",
":THING", ":thing!", ":thing=", ":thing?", ":t?"]);
assertInvalidTokens(this.tokenizer, "constant.other.symbol.ruby",
[":", ":@", ":$", ":1", ":1thing", ":th?ing", ":thi=ng", ":1thing",
":th!ing", ":thing#"]);
},
"test: namespaces aren't symbols" : function() {
var line = "Namespaced::Class";
var tokens = this.tokenizer.getLineTokens(line, "start").tokens;
assert.equal(3, tokens.length);
assert.equal("support.class", tokens[0].type);
assert.equal("text", tokens[1].type);
assert.equal("support.class", tokens[2].type);
},
"test: hex tokenizer" : function() {
assertValidTokens(this.tokenizer, "constant.numeric",
["0x9a", "0XA1", "0x9_a"]);
assertInvalidTokens(this.tokenizer, "constant.numeric",
["0x", "0x_9a", "0x9a_"]);
},
"test: float tokenizer" : function() {
assertValidTokens(this.tokenizer, "constant.numeric",
["1", "+1", "-1", "12_345", "0.000_1"]);
assertInvalidTokens(this.tokenizer, "constant.numeric",
["_", "_1", "1_", "1_.0", "0._1"]);
}
};
function assertValidTokens(tokenizer, tokenType, validTokens) {
for (var i = 0, length = validTokens.length; i < length; i++) {
var validToken = validTokens[i],
tokens = tokenizer.getLineTokens(validToken, "start").tokens;
assert.equal(tokens[0].value, validToken,
'"' + validToken + '" should be one token');
assert.equal(tokens[0].type, tokenType,
'"' + validToken + '" should be a "' + tokenType + '" token');
}
}
function assertInvalidTokens(tokenizer, tokenType, invalidTokens) {
for (var i = 0, length = invalidTokens.length; i < length; i++) {
var invalidToken = invalidTokens[i],
tokens = tokenizer.getLineTokens(invalidToken, "start").tokens;
assert.ok(tokens[0].type !== tokenType || tokens[0].value !== invalidToken,
'"' + invalidToken + '" is not a valid "' + tokenType + '"');
}
}
});
if (typeof module !== "undefined" && module === require.main) {
require("asyncjs").test.testcase(module.exports).exec()
}

View file

@ -1,208 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** END LICENSE BLOCK ***** */
if (typeof process !== "undefined") {
require("amd-loader");
}
define(function(require, exports, module) {
"use strict";
var XmlMode = require("./xml").Mode;
var assert = require("../test/assertions");
var testData = {
"test: tokenize1" : [{
text: "<Juhu>//Juhu Kinners</Kinners>",
state: ["start", "start"],
tokens: [
{
type: "meta.tag",
value: "<"
},
{
type: "meta.tag.tag-name",
value: "Juhu"
},
{
type: "meta.tag.r",
value: ">"
},
{
type: "text",
value: "//Juhu Kinners"
},
{
type: "meta.tag",
value: "</"
},
{
type: "meta.tag.tag-name",
value: "Kinners"
},
{
type: "meta.tag.r",
value: ">"
}
]
}],
"test: two tags in the same lines should be in separate tokens": [{
text: "<Juhu><Kinners>",
state: [ "start", "start"],
tokens: [
{
type: "meta.tag",
value: "<"
},
{
type: "meta.tag.tag-name",
value: "Juhu"
},
{
type: "meta.tag.r",
value: ">"
},
{
type: "meta.tag",
value: "<"
},
{
type: "meta.tag.tag-name",
value: "Kinners"
},
{
type: "meta.tag.r",
value: ">"
}
]
}],
"test: multiline attributes": [{
text: "<copy set=\"{",
state: ["start", "tag_qqstring"],
tokens: [
{
type: "meta.tag",
value: "<"
},
{
type: "meta.tag.tag-name",
value: "copy"
},
{
type: "text",
value: " "
},
{
type: "entity.other.attribute-name",
value: "set"
},
{
type: "keyword.operator",
value: "="
},
{
type: "string",
value: "\"{"
}
]
}, {
text: "}\" undo=\"{",
state: [ "tag_qqstring", "tag_qqstring"],
tokens: [
{
type: "string",
value: "}\""
},
{
type: "text",
value: " "
},
{
type: "entity.other.attribute-name",
value: "undo"
},
{
type: "keyword.operator",
value: "="
},
{
type: "string",
value: "\"{"
}
]
}, {
text: "}\"/>",
state: ["tag_qqstring", "start"],
tokens: [
{
type: "string",
value: "}\""
},
{
type: "meta.tag.r",
value: "/>"
}
]
}]
};
function generateTest(exampleData) {
return function testTokenizer() {
for (var i = 0; i < exampleData.length; i++) {
var s = exampleData[i];
var lineTokens = tokenizer.getLineTokens(s.text, s.state[0]);
assert.equal(
JSON.stringify(lineTokens, null, 4),
JSON.stringify({tokens:s.tokens, state: s.state[1]}, null, 4)
);
}
}
}
var tokenizer;
module.exports = {
name: "XML Tokenizer",
setUp : function() {
tokenizer = new XmlMode().getTokenizer();
}
}
for (var i in testData) {
module.exports[i] = generateTest(testData[i])
}
});
if (typeof module !== "undefined" && module === require.main) {
require("asyncjs").test.testcase(module.exports).exec();
}

View file

@ -23,23 +23,15 @@ var testNames = [
"ace/layer/text_test",
"ace/lib/event_emitter_test",
"ace/mode/coffee/parser_test",
"ace/mode/coffee_highlight_rules_test",
"ace/mode/coldfusion_test",
"ace/mode/css_test",
"ace/mode/css_highlight_rules_test",
"ace/mode/css_worker",
"ace/mode/html_test",
"ace/mode/html_highlight_rules_test",
"ace/mode/javascript_test",
"ace/mode/javascript_highlight_rules_test",
"ace/mode/javascript_worker_test",
"ace/mode/lucene_highlight_rules_test",
"ace/mode/liquid_highlight_rules_test",
"ace/mode/python_test",
"ace/mode/ruby_highlight_rules_test",
"ace/mode/text_test",
"ace/mode/xml_test",
"ace/mode/xml_highlight_rules_test",
"ace/mode/folding/cstyle_test",
"ace/mode/folding/html_test",
"ace/mode/folding/pythonic_test",