Update XQuery syntax highlighting test case.

This commit is contained in:
William Candillon 2013-01-25 14:31:57 +01:00 • committed by nightwing
commit ee592b121a
2 changed files with 238 additions and 2 deletions

View file

@ -1,3 +1,4 @@
<<<<<<< .mine
[[
"start",
["keyword","xquery"],
@ -43,4 +44,238 @@
["text",">"]
],[
"start"
]]
]]
=======
[
[
"[\"start\"]",
[
"keyword",
"xquery"
],
[
"text",
" "
],
[
"keyword",
"version"
],
[
"text",
" "
],
[
"string",
"\""
],
[
"string",
"1.0"
],
[
"string",
"\""
],
[
"text",
";"
]
],
[
"[\"start\"]"
],
[
"[\"start\"]",
[
"keyword",
"let"
],
[
"text",
" "
],
[
"variable",
"$message"
],
[
"text",
" "
],
[
"keyword.operator",
":="
],
[
"text",
" "
],
[
"string",
"\""
],
[
"string",
"Hello World!"
],
[
"string",
"\""
]
],
[
"[\"start\",\"StartTag\",\"TagContent\"]",
[
"keyword",
"return"
],
[
"text",
" "
],
[
"meta.tag",
"<results"
],
[
"meta.tag",
">"
]
],
[
"[\"start\",\"StartTag\",\"TagContent\"]",
[
"text",
" "
],
[
"meta.tag",
"<message"
],
[
"meta.tag",
">"
],
[
"text",
"{"
],
[
"variable",
"$message"
],
[
"text",
"}"
],
[
"meta.tag",
"</message>"
]
],
[
"[\"start\"]",
[
"meta.tag",
"</results>"
]
],
[
"[\"start\"]"
]
]
>>>>>>> .theirs

View file

@ -199,7 +199,8 @@ exports.XQueryLexer = function() {
this.tokens = [];
this.getLineTokens = function(line, state, row) {
var stack = JSON.parse(state || '["start"]');
state = (state === "start" || !state) ? '["start"]' : state;
var stack = JSON.parse(state);
var h = new TokenHandler(line);
var tokenizer = new XQueryTokenizer(line, h);
var tokens = [];