提交 c8e3ea48 编写于 作者: A Alex Dima

Do not generate brackets when tokenizing monarch modes

上级 448e178d
......@@ -354,11 +354,11 @@ export class MonarchLexer extends AbstractState {
monarchCommon.throwError(this.lexer, '@brackets token returned but no bracket defined as: ' + matched);
bracket = { token: '', bracketType: modes.Bracket.None };
}
return { type: monarchCommon.sanitize(bracket.token + rest), bracket: bracket.bracketType };
return { type: monarchCommon.sanitize(bracket.token + rest) };
}
else {
var token = (result === '' ? '' : result + this.lexer.tokenPostfix);
return { type: monarchCommon.sanitize(token), bracket: action.bracket };
return { type: monarchCommon.sanitize(token) };
}
}
}
......
......@@ -8,11 +8,6 @@
import {language} from 'vs/editor/standalone-languages/cpp';
import {testOnEnter, testTokenization} from 'vs/editor/standalone-languages/test/testUtil';
var Bracket = {
Open: 1,
Close: -1
};
testOnEnter('cpp', language, (assertOnEnter) => {
assertOnEnter.nothing('', ' a', '');
assertOnEnter.indents('', ' <', '');
......@@ -30,7 +25,7 @@ testTokenization('cpp', language, [
{ startIndex: 0, type: 'keyword.int.cpp' },
{ startIndex: 3, type: '' },
{ startIndex: 4, type: 'identifier.cpp' },
{ startIndex: 10, type: 'delimiter.parenthesis.cpp', bracket: Bracket.Open },
{ startIndex: 10, type: 'delimiter.parenthesis.cpp' },
{ startIndex: 11, type: 'keyword.int.cpp' },
{ startIndex: 14, type: '' },
{ startIndex: 15, type: 'identifier.cpp' },
......@@ -40,9 +35,8 @@ testTokenization('cpp', language, [
{ startIndex: 27, type: 'delimiter.cpp' },
{ startIndex: 28, type: '' },
{ startIndex: 29, type: 'identifier.cpp' },
{ startIndex: 33, type: 'delimiter.square.cpp', bracket: Bracket.Open },
{ startIndex: 34, type: 'delimiter.square.cpp', bracket: Bracket.Close },
{ startIndex: 35, type: 'delimiter.parenthesis.cpp', bracket: Bracket.Close }
{ startIndex: 33, type: 'delimiter.square.cpp' }
{ startIndex: 35, type: 'delimiter.parenthesis.cpp' }
]}],
// Comments - single line
......@@ -541,7 +535,6 @@ testTokenization('cpp', language, [
{ startIndex: 5, type: '' },
{ startIndex: 6, type: 'identifier.cpp' },
{ startIndex: 12, type: 'delimiter.parenthesis.cpp' },
{ startIndex: 13, type: 'delimiter.parenthesis.cpp' },
{ startIndex: 14, type: '' },
{ startIndex: 15, type: 'keyword.const.cpp' },
{ startIndex: 20, type: '' },
......@@ -565,7 +558,6 @@ testTokenization('cpp', language, [
{ startIndex: 15, type: '' },
{ startIndex: 16, type: 'identifier.cpp' },
{ startIndex: 19, type: 'delimiter.parenthesis.cpp' },
{ startIndex: 20, type: 'delimiter.parenthesis.cpp' },
{ startIndex: 21, type: 'delimiter.cpp' }
]}, {
line: ' ',
......
......@@ -8,11 +8,6 @@
import {language} from 'vs/editor/standalone-languages/csharp';
import {testTokenization} from 'vs/editor/standalone-languages/test/testUtil';
var Bracket = {
Open: 1,
Close: -1
};
testTokenization('csharp', language, [
// Generated from sample
......@@ -85,7 +80,7 @@ testTokenization('csharp', language, [
]}, {
line: '{',
tokens: [
{ startIndex: 0, type: 'delimiter.curly.cs', bracket: Bracket.Open }
{ startIndex: 0, type: 'delimiter.curly.cs' }
]}, {
line: ' class Program',
tokens: [
......@@ -97,7 +92,7 @@ testTokenization('csharp', language, [
line: ' {',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 1, type: 'delimiter.curly.cs', bracket: Bracket.Open }
{ startIndex: 1, type: 'delimiter.curly.cs' }
]}, {
line: ' static void Main(string[] args)',
tokens: [
......@@ -107,18 +102,17 @@ testTokenization('csharp', language, [
{ startIndex: 9, type: 'keyword.void.cs' },
{ startIndex: 13, type: '' },
{ startIndex: 14, type: 'identifier.cs' },
{ startIndex: 18, type: 'delimiter.parenthesis.cs', bracket: Bracket.Open },
{ startIndex: 18, type: 'delimiter.parenthesis.cs' },
{ startIndex: 19, type: 'keyword.string.cs' },
{ startIndex: 25, type: 'delimiter.square.cs', bracket: Bracket.Open },
{ startIndex: 26, type: 'delimiter.square.cs', bracket: Bracket.Close },
{ startIndex: 25, type: 'delimiter.square.cs' },
{ startIndex: 27, type: '' },
{ startIndex: 28, type: 'identifier.cs' },
{ startIndex: 32, type: 'delimiter.parenthesis.cs', bracket: Bracket.Close }
{ startIndex: 32, type: 'delimiter.parenthesis.cs' }
]}, {
line: ' {',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 2, type: 'delimiter.curly.cs', bracket: Bracket.Open }
{ startIndex: 2, type: 'delimiter.curly.cs' }
]}, {
line: ' ProcessStartInfo si = new ProcessStartInfo();',
tokens: [
......@@ -132,8 +126,7 @@ testTokenization('csharp', language, [
{ startIndex: 25, type: 'keyword.new.cs' },
{ startIndex: 28, type: '' },
{ startIndex: 29, type: 'identifier.cs' },
{ startIndex: 45, type: 'delimiter.parenthesis.cs', bracket: Bracket.Open },
{ startIndex: 46, type: 'delimiter.parenthesis.cs', bracket: Bracket.Close },
{ startIndex: 45, type: 'delimiter.parenthesis.cs' },
{ startIndex: 47, type: 'delimiter.cs' }
]}, {
line: ' float load= 3.2e02f;',
......@@ -160,9 +153,9 @@ testTokenization('csharp', language, [
{ startIndex: 14, type: '' },
{ startIndex: 15, type: 'delimiter.cs' },
{ startIndex: 16, type: '' },
{ startIndex: 17, type: 'string.quote.cs', bracket: Bracket.Open },
{ startIndex: 17, type: 'string.quote.cs' },
{ startIndex: 19, type: 'string.cs' },
{ startIndex: 34, type: 'string.quote.cs', bracket: Bracket.Close },
{ startIndex: 34, type: 'string.quote.cs' },
{ startIndex: 35, type: 'delimiter.cs' }
]}, {
line: ' si.Arguments = "tools\\\\simpl3server.js";',
......@@ -174,11 +167,11 @@ testTokenization('csharp', language, [
{ startIndex: 15, type: '' },
{ startIndex: 16, type: 'delimiter.cs' },
{ startIndex: 17, type: '' },
{ startIndex: 18, type: 'string.quote.cs', bracket: Bracket.Open },
{ startIndex: 18, type: 'string.quote.cs' },
{ startIndex: 19, type: 'string.cs' },
{ startIndex: 24, type: 'string.escape.cs' },
{ startIndex: 26, type: 'string.cs' },
{ startIndex: 41, type: 'string.quote.cs', bracket: Bracket.Close },
{ startIndex: 41, type: 'string.quote.cs' },
{ startIndex: 42, type: 'delimiter.cs' }
]}, {
line: ' ',
......@@ -194,17 +187,17 @@ testTokenization('csharp', language, [
{ startIndex: 20, type: '' },
{ startIndex: 21, type: 'delimiter.cs' },
{ startIndex: 22, type: '' },
{ startIndex: 23, type: 'string.quote.cs', bracket: Bracket.Open },
{ startIndex: 23, type: 'string.quote.cs' },
{ startIndex: 25, type: 'string.cs' },
{ startIndex: 30, type: 'string.quote.cs', bracket: Bracket.Open },
{ startIndex: 30, type: 'string.quote.cs' },
{ startIndex: 31, type: 'identifier.cs' },
{ startIndex: 38, type: 'delimiter.cs' },
{ startIndex: 39, type: 'identifier.cs' },
{ startIndex: 47, type: 'string.quote.cs', bracket: Bracket.Close },
{ startIndex: 47, type: 'string.quote.cs' },
{ startIndex: 48, type: 'string.cs' },
{ startIndex: 65, type: 'string.escape.cs' },
{ startIndex: 67, type: 'string.cs' },
{ startIndex: 75, type: 'string.quote.cs', bracket: Bracket.Close },
{ startIndex: 75, type: 'string.quote.cs' },
{ startIndex: 76, type: 'delimiter.cs' }
]}, {
line: ' var @string = 5;',
......@@ -228,25 +221,25 @@ testTokenization('csharp', language, [
{ startIndex: 0, type: '' },
{ startIndex: 3, type: 'keyword.if.cs' },
{ startIndex: 5, type: '' },
{ startIndex: 6, type: 'delimiter.parenthesis.cs', bracket: Bracket.Open },
{ startIndex: 6, type: 'delimiter.parenthesis.cs' },
{ startIndex: 7, type: 'identifier.cs' },
{ startIndex: 8, type: '' },
{ startIndex: 9, type: 'delimiter.cs' },
{ startIndex: 11, type: '' },
{ startIndex: 12, type: 'number.cs' },
{ startIndex: 13, type: 'delimiter.parenthesis.cs', bracket: Bracket.Close }
{ startIndex: 13, type: 'delimiter.parenthesis.cs' }
]}, {
line: ' {',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 3, type: 'delimiter.curly.cs', bracket: Bracket.Open }
{ startIndex: 3, type: 'delimiter.curly.cs' }
]}, {
line: ' for (int i = 4; i<10; i++)',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 4, type: 'keyword.for.cs' },
{ startIndex: 7, type: '' },
{ startIndex: 8, type: 'delimiter.parenthesis.cs', bracket: Bracket.Open },
{ startIndex: 8, type: 'delimiter.parenthesis.cs' },
{ startIndex: 9, type: 'keyword.int.cs' },
{ startIndex: 12, type: '' },
{ startIndex: 13, type: 'identifier.cs' },
......@@ -257,18 +250,18 @@ testTokenization('csharp', language, [
{ startIndex: 18, type: 'delimiter.cs' },
{ startIndex: 19, type: '' },
{ startIndex: 20, type: 'identifier.cs' },
{ startIndex: 21, type: 'delimiter.angle.cs', bracket: Bracket.Open },
{ startIndex: 21, type: 'delimiter.angle.cs' },
{ startIndex: 22, type: 'number.cs' },
{ startIndex: 24, type: 'delimiter.cs' },
{ startIndex: 25, type: '' },
{ startIndex: 26, type: 'identifier.cs' },
{ startIndex: 27, type: 'delimiter.cs' },
{ startIndex: 29, type: 'delimiter.parenthesis.cs', bracket: Bracket.Close }
{ startIndex: 29, type: 'delimiter.parenthesis.cs' }
]}, {
line: ' {',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 4, type: 'delimiter.curly.cs', bracket: Bracket.Open }
{ startIndex: 4, type: 'delimiter.curly.cs' }
]}, {
line: ' var d = i;',
tokens: [
......@@ -285,12 +278,12 @@ testTokenization('csharp', language, [
line: ' }',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 4, type: 'delimiter.curly.cs', bracket: Bracket.Close }
{ startIndex: 4, type: 'delimiter.curly.cs' }
]}, {
line: ' }',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 3, type: 'delimiter.curly.cs', bracket: Bracket.Close }
{ startIndex: 3, type: 'delimiter.curly.cs' }
]}, {
line: ' else',
tokens: [
......@@ -300,7 +293,7 @@ testTokenization('csharp', language, [
line: ' {',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 3, type: 'delimiter.curly.cs', bracket: Bracket.Open }
{ startIndex: 3, type: 'delimiter.curly.cs' }
]}, {
line: ' return;',
tokens: [
......@@ -311,7 +304,7 @@ testTokenization('csharp', language, [
line: ' }',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 3, type: 'delimiter.curly.cs', bracket: Bracket.Close }
{ startIndex: 3, type: 'delimiter.curly.cs' }
]}, {
line: ' ',
tokens: [
......@@ -327,24 +320,24 @@ testTokenization('csharp', language, [
{ startIndex: 3, type: 'identifier.cs' },
{ startIndex: 10, type: 'delimiter.cs' },
{ startIndex: 11, type: 'identifier.cs' },
{ startIndex: 16, type: 'delimiter.parenthesis.cs', bracket: Bracket.Open },
{ startIndex: 16, type: 'delimiter.parenthesis.cs' },
{ startIndex: 17, type: 'identifier.cs' },
{ startIndex: 19, type: 'delimiter.parenthesis.cs', bracket: Bracket.Close },
{ startIndex: 19, type: 'delimiter.parenthesis.cs' },
{ startIndex: 20, type: 'delimiter.cs' }
]}, {
line: ' }',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 2, type: 'delimiter.curly.cs', bracket: Bracket.Close }
{ startIndex: 2, type: 'delimiter.curly.cs' }
]}, {
line: ' }',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 1, type: 'delimiter.curly.cs', bracket: Bracket.Close }
{ startIndex: 1, type: 'delimiter.curly.cs' }
]}, {
line: '}',
tokens: [
{ startIndex: 0, type: 'delimiter.curly.cs', bracket: Bracket.Close }
{ startIndex: 0, type: 'delimiter.curly.cs' }
]}, {
line: '',
tokens: [
......@@ -360,8 +353,7 @@ testTokenization('csharp', language, [
{ startIndex: 9, type: '' },
{ startIndex: 10, type: 'namespace.cs' },
{ startIndex: 29, type: '' },
{ startIndex: 30, type: 'delimiter.curly.cs', bracket: Bracket.Open },
{ startIndex: 31, type: 'delimiter.curly.cs', bracket: Bracket.Close }
{ startIndex: 30, type: 'delimiter.curly.cs' }
]}, {
line: '#pragma endregion Region_1',
tokens: [
......@@ -392,13 +384,11 @@ testTokenization('csharp', language, [
{ startIndex: 47, type: 'delimiter.parenthesis.cs' },
{ startIndex: 48, type: 'keyword.string.cs' },
{ startIndex: 54, type: 'delimiter.square.cs' },
{ startIndex: 55, type: 'delimiter.square.cs' },
{ startIndex: 56, type: '' },
{ startIndex: 57, type: 'identifier.cs' },
{ startIndex: 61, type: 'delimiter.parenthesis.cs' },
{ startIndex: 62, type: '' },
{ startIndex: 63, type: 'delimiter.curly.cs' },
{ startIndex: 64, type: 'delimiter.curly.cs' },
{ startIndex: 65, type: '' },
{ startIndex: 66, type: 'delimiter.curly.cs' },
{ startIndex: 67, type: '' },
......
......@@ -8,11 +8,6 @@
import {language} from 'vs/editor/standalone-languages/go';
import {testTokenization} from 'vs/editor/standalone-languages/test/testUtil';
var Bracket = {
Open: 1,
Close: -1
};
testTokenization('go', language, [
// Tests
[{
......@@ -46,7 +41,7 @@ testTokenization('go', language, [
tokens: [
{ startIndex: 0, type: 'keyword.import.go' },
{ startIndex: 6, type: '' },
{ startIndex: 7, type: 'delimiter.curly.go', bracket: Bracket.Open }
{ startIndex: 7, type: 'delimiter.curly.go' }
]}],
[{
......@@ -59,7 +54,7 @@ testTokenization('go', language, [
[{
line: '}',
tokens: [
{ startIndex: 0, type: 'delimiter.curly.go', bracket: Bracket.Close }
{ startIndex: 0, type: 'delimiter.curly.go' }
]}],
[{
......@@ -77,7 +72,7 @@ testTokenization('go', language, [
{ startIndex: 9, type: '' },
{ startIndex: 10, type: 'keyword.struct.go' },
{ startIndex: 16, type: '' },
{ startIndex: 17, type: 'delimiter.curly.go', bracket: Bracket.Open }
{ startIndex: 17, type: 'delimiter.curly.go' }
]}],
[{
......@@ -101,7 +96,7 @@ testTokenization('go', language, [
[{
line: '}',
tokens: [
{ startIndex: 0, type: 'delimiter.curly.go', bracket: Bracket.Close }
{ startIndex: 0, type: 'delimiter.curly.go' }
]}],
[{
......@@ -116,10 +111,9 @@ testTokenization('go', language, [
{ startIndex: 0, type: 'keyword.func.go' },
{ startIndex: 4, type: '' },
{ startIndex: 5, type: 'identifier.go' },
{ startIndex: 14, type: 'delimiter.parenthesis.go', bracket: Bracket.Open },
{ startIndex: 15, type: 'delimiter.parenthesis.go', bracket: Bracket.Close },
{ startIndex: 14, type: 'delimiter.parenthesis.go' },
{ startIndex: 16, type: '' },
{ startIndex: 17, type: 'delimiter.curly.go', bracket: Bracket.Open }
{ startIndex: 17, type: 'delimiter.curly.go' }
]}],
[{
......@@ -305,7 +299,7 @@ testTokenization('go', language, [
[{
line: '}',
tokens: [
{ startIndex: 0, type: 'delimiter.curly.go', bracket: Bracket.Close }
{ startIndex: 0, type: 'delimiter.curly.go' }
]}],
[{
......@@ -320,10 +314,9 @@ testTokenization('go', language, [
{ startIndex: 0, type: 'keyword.func.go' },
{ startIndex: 4, type: '' },
{ startIndex: 5, type: 'identifier.go' },
{ startIndex: 18, type: 'delimiter.parenthesis.go', bracket: Bracket.Open },
{ startIndex: 19, type: 'delimiter.parenthesis.go', bracket: Bracket.Close },
{ startIndex: 18, type: 'delimiter.parenthesis.go' },
{ startIndex: 20, type: '' },
{ startIndex: 21, type: 'delimiter.curly.go', bracket: Bracket.Open }
{ startIndex: 21, type: 'delimiter.curly.go' }
]}],
[{
......@@ -692,7 +685,7 @@ testTokenization('go', language, [
{ startIndex: 0, type: '' },
{ startIndex: 2, type: 'identifier.go' },
{ startIndex: 3, type: '' },
{ startIndex: 4, type: 'delimiter.angle.go', bracket: Bracket.Open },
{ startIndex: 4, type: 'delimiter.angle.go' },
{ startIndex: 5, type: '' },
{ startIndex: 6, type: 'identifier.go' },
{ startIndex: 7, type: 'delimiter.go' }
......@@ -704,7 +697,7 @@ testTokenization('go', language, [
{ startIndex: 0, type: '' },
{ startIndex: 2, type: 'identifier.go' },
{ startIndex: 3, type: '' },
{ startIndex: 4, type: 'delimiter.angle.go', bracket: Bracket.Close },
{ startIndex: 4, type: 'delimiter.angle.go' },
{ startIndex: 5, type: '' },
{ startIndex: 6, type: 'identifier.go' },
{ startIndex: 7, type: 'delimiter.go' }
......@@ -792,18 +785,18 @@ testTokenization('go', language, [
line: ' (a)',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 2, type: 'delimiter.parenthesis.go', bracket: Bracket.Open },
{ startIndex: 2, type: 'delimiter.parenthesis.go' },
{ startIndex: 3, type: 'identifier.go' },
{ startIndex: 4, type: 'delimiter.parenthesis.go', bracket: Bracket.Close }
{ startIndex: 4, type: 'delimiter.parenthesis.go' }
]}],
[{
line: ' [a]',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 2, type: 'delimiter.square.go', bracket: Bracket.Open },
{ startIndex: 2, type: 'delimiter.square.go' },
{ startIndex: 3, type: 'identifier.go' },
{ startIndex: 4, type: 'delimiter.square.go', bracket: Bracket.Close }
{ startIndex: 4, type: 'delimiter.square.go' }
]}],
[{
......@@ -843,7 +836,7 @@ testTokenization('go', language, [
[{
line: '}',
tokens: [
{ startIndex: 0, type: 'delimiter.curly.go', bracket: Bracket.Close }
{ startIndex: 0, type: 'delimiter.curly.go' }
]}],
[{
......@@ -858,10 +851,9 @@ testTokenization('go', language, [
{ startIndex: 0, type: 'keyword.func.go' },
{ startIndex: 4, type: '' },
{ startIndex: 5, type: 'identifier.go' },
{ startIndex: 13, type: 'delimiter.parenthesis.go', bracket: Bracket.Open },
{ startIndex: 14, type: 'delimiter.parenthesis.go', bracket: Bracket.Close },
{ startIndex: 13, type: 'delimiter.parenthesis.go' },
{ startIndex: 15, type: '' },
{ startIndex: 16, type: 'delimiter.curly.go', bracket: Bracket.Open }
{ startIndex: 16, type: 'delimiter.curly.go' }
]}],
[{
......@@ -893,11 +885,11 @@ testTokenization('go', language, [
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 2, type: 'keyword.switch.go' },
{ startIndex: 8, type: 'delimiter.parenthesis.go', bracket: Bracket.Open },
{ startIndex: 8, type: 'delimiter.parenthesis.go' },
{ startIndex: 9, type: 'identifier.go' },
{ startIndex: 10, type: 'delimiter.parenthesis.go', bracket: Bracket.Close },
{ startIndex: 10, type: 'delimiter.parenthesis.go' },
{ startIndex: 11, type: '' },
{ startIndex: 12, type: 'delimiter.curly.go', bracket: Bracket.Open }
{ startIndex: 12, type: 'delimiter.curly.go' }
]}],
[{
......@@ -938,7 +930,7 @@ testTokenization('go', language, [
line: ' }',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 2, type: 'delimiter.curly.go', bracket: Bracket.Close }
{ startIndex: 2, type: 'delimiter.curly.go' }
]}],
[{
......@@ -985,9 +977,9 @@ testTokenization('go', language, [
{ startIndex: 0, type: '' },
{ startIndex: 2, type: 'keyword.if.go' },
{ startIndex: 4, type: '' },
{ startIndex: 5, type: 'delimiter.parenthesis.go', bracket: Bracket.Open },
{ startIndex: 5, type: 'delimiter.parenthesis.go' },
{ startIndex: 6, type: 'identifier.go' },
{ startIndex: 7, type: 'delimiter.parenthesis.go', bracket: Bracket.Close }
{ startIndex: 7, type: 'delimiter.parenthesis.go' }
]}],
[{
......@@ -1019,7 +1011,7 @@ testTokenization('go', language, [
{ startIndex: 0, type: '' },
{ startIndex: 3, type: 'keyword.for.go' },
{ startIndex: 6, type: '' },
{ startIndex: 7, type: 'delimiter.parenthesis.go', bracket: Bracket.Open },
{ startIndex: 7, type: 'delimiter.parenthesis.go' },
{ startIndex: 8, type: 'identifier.go' },
{ startIndex: 9, type: '' },
{ startIndex: 10, type: 'delimiter.go' },
......@@ -1029,14 +1021,14 @@ testTokenization('go', language, [
{ startIndex: 14, type: '' },
{ startIndex: 15, type: 'identifier.go' },
{ startIndex: 16, type: '' },
{ startIndex: 17, type: 'delimiter.angle.go', bracket: Bracket.Open },
{ startIndex: 17, type: 'delimiter.angle.go' },
{ startIndex: 18, type: '' },
{ startIndex: 19, type: 'number.go' },
{ startIndex: 21, type: 'delimiter.go' },
{ startIndex: 22, type: '' },
{ startIndex: 23, type: 'identifier.go' },
{ startIndex: 24, type: 'delimiter.go' },
{ startIndex: 26, type: 'delimiter.parenthesis.go', bracket: Bracket.Close },
{ startIndex: 26, type: 'delimiter.parenthesis.go' },
{ startIndex: 27, type: 'delimiter.go' }
]}],
......@@ -1171,6 +1163,6 @@ testTokenization('go', language, [
[{
line: '}',
tokens: [
{ startIndex: 0, type: 'delimiter.curly.go', bracket: Bracket.Close }
{ startIndex: 0, type: 'delimiter.curly.go' }
]}]
]);
......@@ -8,11 +8,6 @@
import {language} from 'vs/editor/standalone-languages/jade';
import {testTokenization} from 'vs/editor/standalone-languages/test/testUtil';
var Bracket = {
Open: 1,
Close: -1
};
testTokenization('jade', language, [
// Tags [Jade]
[{
......@@ -64,11 +59,11 @@ testTokenization('jade', language, [
line: 'input(type="checkbox")',
tokens: [
{ startIndex: 0, type: 'tag.jade' },
{ startIndex: 5, type: 'delimiter.parenthesis.jade', bracket: Bracket.Open },
{ startIndex: 5, type: 'delimiter.parenthesis.jade' },
{ startIndex: 6, type: 'attribute.name.jade' },
{ startIndex: 10, type: 'delimiter.jade' },
{ startIndex: 11, type: 'attribute.value.jade' },
{ startIndex: 21, type: 'delimiter.parenthesis.jade', bracket: Bracket.Close }
{ startIndex: 21, type: 'delimiter.parenthesis.jade' }
]}],
[{
......@@ -82,7 +77,7 @@ testTokenization('jade', language, [
line: 'input(type="checkbox",name="agreement",checked)',
tokens: [
{ startIndex: 0, type: 'tag.jade' },
{ startIndex: 5, type: 'delimiter.parenthesis.jade', bracket: Bracket.Open },
{ startIndex: 5, type: 'delimiter.parenthesis.jade' },
{ startIndex: 6, type: 'attribute.name.jade' },
{ startIndex: 10, type: 'delimiter.jade' },
{ startIndex: 11, type: 'attribute.value.jade' },
......@@ -92,14 +87,14 @@ testTokenization('jade', language, [
{ startIndex: 27, type: 'attribute.value.jade' },
{ startIndex: 38, type: 'attribute.delimiter.jade' },
{ startIndex: 39, type: 'attribute.name.jade' },
{ startIndex: 46, type: 'delimiter.parenthesis.jade', bracket: Bracket.Close }
{ startIndex: 46, type: 'delimiter.parenthesis.jade' }
]}],
[{
line: 'input(type="checkbox"',
tokens: [
{ startIndex: 0, type: 'tag.jade' },
{ startIndex: 5, type: 'delimiter.parenthesis.jade', bracket: Bracket.Open },
{ startIndex: 5, type: 'delimiter.parenthesis.jade' },
{ startIndex: 6, type: 'attribute.name.jade' },
{ startIndex: 10, type: 'delimiter.jade' },
{ startIndex: 11, type: 'attribute.value.jade' }
......@@ -125,7 +120,7 @@ testTokenization('jade', language, [
line: 'input(type="checkbox"',
tokens: [
{ startIndex: 0, type: 'tag.jade' },
{ startIndex: 5, type: 'delimiter.parenthesis.jade', bracket: Bracket.Open },
{ startIndex: 5, type: 'delimiter.parenthesis.jade' },
{ startIndex: 6, type: 'attribute.name.jade' },
{ startIndex: 10, type: 'delimiter.jade' },
{ startIndex: 11, type: 'attribute.value.jade' }
......@@ -167,17 +162,16 @@ testTokenization('jade', language, [
{ startIndex: 17, type: '' }
]}],
// Bracket Matching [Jade]
[{
line: '{ key: 123 }',
tokens: [
{ startIndex: 0, type: 'delimiter.curly.jade', bracket: Bracket.Open },
{ startIndex: 0, type: 'delimiter.curly.jade' },
{ startIndex: 1, type: '' },
{ startIndex: 5, type: 'delimiter.jade' },
{ startIndex: 6, type: '' },
{ startIndex: 7, type: 'number.jade' },
{ startIndex: 10, type: '' },
{ startIndex: 11, type: 'delimiter.curly.jade', bracket: Bracket.Close }
{ startIndex: 11, type: 'delimiter.curly.jade' }
]}],
// Comments - Single Line [Jade]
......@@ -257,11 +251,11 @@ testTokenization('jade', language, [
line: 'html(lang="en")',
tokens: [
{ startIndex: 0, type: 'tag.jade' },
{ startIndex: 4, type: 'delimiter.parenthesis.jade', bracket: Bracket.Open },
{ startIndex: 4, type: 'delimiter.parenthesis.jade' },
{ startIndex: 5, type: 'attribute.name.jade' },
{ startIndex: 9, type: 'delimiter.jade' },
{ startIndex: 10, type: 'attribute.value.jade' },
{ startIndex: 14, type: 'delimiter.parenthesis.jade', bracket: Bracket.Close }
{ startIndex: 14, type: 'delimiter.parenthesis.jade' }
]}, {
line: ' head',
tokens: [
......@@ -278,33 +272,32 @@ testTokenization('jade', language, [
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 8, type: 'tag.jade' },
{ startIndex: 14, type: 'delimiter.parenthesis.jade', bracket: Bracket.Open },
{ startIndex: 14, type: 'delimiter.parenthesis.jade' },
{ startIndex: 15, type: 'attribute.name.jade' },
{ startIndex: 19, type: 'delimiter.jade' },
{ startIndex: 20, type: 'attribute.value.jade' },
{ startIndex: 37, type: 'delimiter.parenthesis.jade', bracket: Bracket.Close }
{ startIndex: 37, type: 'delimiter.parenthesis.jade' }
]}, {
line: ' if (foo) {',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 12, type: 'keyword.if.jade' },
{ startIndex: 14, type: '' },
{ startIndex: 15, type: 'delimiter.parenthesis.jade', bracket: Bracket.Open },
{ startIndex: 15, type: 'delimiter.parenthesis.jade' },
{ startIndex: 16, type: '' },
{ startIndex: 19, type: 'delimiter.parenthesis.jade', bracket: Bracket.Close },
{ startIndex: 19, type: 'delimiter.parenthesis.jade' },
{ startIndex: 20, type: '' },
{ startIndex: 21, type: 'delimiter.curly.jade', bracket: Bracket.Open }
{ startIndex: 21, type: 'delimiter.curly.jade' }
]}, {
line: ' bar()',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 19, type: 'delimiter.parenthesis.jade', bracket: Bracket.Open },
{ startIndex: 20, type: 'delimiter.parenthesis.jade', bracket: Bracket.Close }
{ startIndex: 19, type: 'delimiter.parenthesis.jade' }
]}, {
line: ' }',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 12, type: 'delimiter.curly.jade', bracket: Bracket.Close }
{ startIndex: 12, type: 'delimiter.curly.jade' }
]}, {
line: ' body',
tokens: [
......
......@@ -9,11 +9,6 @@ import * as assert from 'assert';
import {language} from 'vs/editor/standalone-languages/java';
import {testTokenization} from 'vs/editor/standalone-languages/test/testUtil';
var Bracket = {
Open: 1,
Close: -1
};
testTokenization('java', language, [
// Comments - single line
[{
......@@ -222,17 +217,15 @@ testTokenization('java', language, [
{ startIndex: 46, type: 'delimiter.parenthesis.java' },
{ startIndex: 47, type: 'identifier.java' },
{ startIndex: 53, type: 'delimiter.square.java' },
{ startIndex: 54, type: 'delimiter.square.java' },
{ startIndex: 55, type: '' },
{ startIndex: 56, type: 'identifier.java' },
{ startIndex: 60, type: 'delimiter.parenthesis.java' },
{ startIndex: 61, type: '' },
{ startIndex: 62, type: 'delimiter.curly.java', bracket: Bracket.Open },
{ startIndex: 63, type: 'delimiter.curly.java', bracket: Bracket.Close },
{ startIndex: 62, type: 'delimiter.curly.java' },
{ startIndex: 64, type: '' },
{ startIndex: 65, type: 'delimiter.curly.java', bracket: Bracket.Close },
{ startIndex: 65, type: 'delimiter.curly.java' },
{ startIndex: 66, type: '' },
{ startIndex: 67, type: 'delimiter.curly.java', bracket: Bracket.Close }
{ startIndex: 67, type: 'delimiter.curly.java' }
]}],
// Numbers
......
......@@ -9,11 +9,6 @@ import * as assert from 'assert';
import {language} from 'vs/editor/standalone-languages/powershell';
import {testTokenization} from 'vs/editor/standalone-languages/test/testUtil';
var Bracket = {
Open: 1,
Close: -1
};
testTokenization('powershell', language, [
// Comments - single line
[{
......@@ -162,23 +157,23 @@ testTokenization('powershell', language, [
line: 'foreach($i in $b) {if (7) continue}',
tokens: [
{ startIndex: 0, type: 'keyword.foreach.ps1' },
{ startIndex: 7, type: 'delimiter.parenthesis.ps1', bracket: Bracket.Open },
{ startIndex: 7, type: 'delimiter.parenthesis.ps1' },
{ startIndex: 8, type: 'variable.ps1' },
{ startIndex: 10, type: '' },
{ startIndex: 11, type: 'keyword.in.ps1' },
{ startIndex: 13, type: '' },
{ startIndex: 14, type: 'variable.ps1' },
{ startIndex: 16, type: 'delimiter.parenthesis.ps1', bracket: Bracket.Close },
{ startIndex: 16, type: 'delimiter.parenthesis.ps1' },
{ startIndex: 17, type: '' },
{ startIndex: 18, type: 'delimiter.curly.ps1', bracket: Bracket.Open },
{ startIndex: 18, type: 'delimiter.curly.ps1' },
{ startIndex: 19, type: 'keyword.if.ps1' },
{ startIndex: 21, type: '' },
{ startIndex: 22, type: 'delimiter.parenthesis.ps1', bracket: Bracket.Open },
{ startIndex: 22, type: 'delimiter.parenthesis.ps1' },
{ startIndex: 23, type: 'number.ps1' },
{ startIndex: 24, type: 'delimiter.parenthesis.ps1', bracket: Bracket.Close },
{ startIndex: 24, type: 'delimiter.parenthesis.ps1' },
{ startIndex: 25, type: '' },
{ startIndex: 26, type: 'keyword.continue.ps1' },
{ startIndex: 34, type: 'delimiter.curly.ps1', bracket: Bracket.Close }
{ startIndex: 34, type: 'delimiter.curly.ps1' }
]}],
// Redirect operand
......@@ -390,8 +385,7 @@ testTokenization('powershell', language, [
{ startIndex: 0, type: 'variable.ps1' },
{ startIndex: 20, type: 'delimiter.ps1' },
{ startIndex: 21, type: '' },
{ startIndex: 22, type: 'delimiter.parenthesis.ps1', bracket: Bracket.Open },
{ startIndex: 23, type: 'delimiter.parenthesis.ps1', bracket: Bracket.Close },
{ startIndex: 22, type: 'delimiter.parenthesis.ps1' },
{ startIndex: 24, type: 'delimiter.ps1' }
]}, {
line: '$XenCenterNodeSelected = 0;',
......@@ -410,38 +404,38 @@ testTokenization('powershell', language, [
line: 'foreach($parameterSet in $ObjInfoArray)',
tokens: [
{ startIndex: 0, type: 'keyword.foreach.ps1' },
{ startIndex: 7, type: 'delimiter.parenthesis.ps1', bracket: Bracket.Open },
{ startIndex: 7, type: 'delimiter.parenthesis.ps1' },
{ startIndex: 8, type: 'variable.ps1' },
{ startIndex: 21, type: '' },
{ startIndex: 22, type: 'keyword.in.ps1' },
{ startIndex: 24, type: '' },
{ startIndex: 25, type: 'variable.ps1' },
{ startIndex: 38, type: 'delimiter.parenthesis.ps1', bracket: Bracket.Close }
{ startIndex: 38, type: 'delimiter.parenthesis.ps1' }
]}, {
line: '{',
tokens: [
{ startIndex: 0, type: 'delimiter.curly.ps1', bracket: Bracket.Open }
{ startIndex: 0, type: 'delimiter.curly.ps1' }
]}, {
line: ' if ($parameterSet["class"] -eq "blank")',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 1, type: 'keyword.if.ps1' },
{ startIndex: 3, type: '' },
{ startIndex: 4, type: 'delimiter.parenthesis.ps1', bracket: Bracket.Open },
{ startIndex: 4, type: 'delimiter.parenthesis.ps1' },
{ startIndex: 5, type: 'variable.ps1' },
{ startIndex: 18, type: 'delimiter.square.ps1', bracket: Bracket.Open },
{ startIndex: 18, type: 'delimiter.square.ps1' },
{ startIndex: 19, type: 'string.ps1' },
{ startIndex: 26, type: 'delimiter.square.ps1', bracket: Bracket.Close },
{ startIndex: 26, type: 'delimiter.square.ps1' },
{ startIndex: 27, type: '' },
{ startIndex: 28, type: 'delimiter.ps1' },
{ startIndex: 29, type: '' },
{ startIndex: 32, type: 'string.ps1' },
{ startIndex: 39, type: 'delimiter.parenthesis.ps1', bracket: Bracket.Close }
{ startIndex: 39, type: 'delimiter.parenthesis.ps1' }
]}, {
line: ' {',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 1, type: 'delimiter.curly.ps1', bracket: Bracket.Open }
{ startIndex: 1, type: 'delimiter.curly.ps1' }
]}, {
line: ' #When the XenCenter node is selected a parameter set is created for each of your connected servers with the class and objUuid keys marked as blank',
tokens: [
......@@ -453,14 +447,14 @@ testTokenization('powershell', language, [
{ startIndex: 0, type: '' },
{ startIndex: 2, type: 'keyword.if.ps1' },
{ startIndex: 4, type: '' },
{ startIndex: 5, type: 'delimiter.parenthesis.ps1', bracket: Bracket.Open },
{ startIndex: 5, type: 'delimiter.parenthesis.ps1' },
{ startIndex: 6, type: 'variable.ps1' },
{ startIndex: 28, type: 'delimiter.parenthesis.ps1', bracket: Bracket.Close }
{ startIndex: 28, type: 'delimiter.parenthesis.ps1' }
]}, {
line: ' {',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 2, type: 'delimiter.curly.ps1', bracket: Bracket.Open }
{ startIndex: 2, type: 'delimiter.curly.ps1' }
]}, {
line: ' continue',
tokens: [
......@@ -470,7 +464,7 @@ testTokenization('powershell', language, [
line: ' }',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 2, type: 'delimiter.curly.ps1', bracket: Bracket.Close }
{ startIndex: 2, type: 'delimiter.curly.ps1' }
]}, {
line: ' $XenCenterNodeSelected = 1;',
tokens: [
......@@ -494,28 +488,28 @@ testTokenization('powershell', language, [
line: ' }',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 1, type: 'delimiter.curly.ps1', bracket: Bracket.Close }
{ startIndex: 1, type: 'delimiter.curly.ps1' }
]}, {
line: ' elseif ($parameterSet["sessionRef"] -eq "null")',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 1, type: 'keyword.elseif.ps1' },
{ startIndex: 7, type: '' },
{ startIndex: 8, type: 'delimiter.parenthesis.ps1', bracket: Bracket.Open },
{ startIndex: 8, type: 'delimiter.parenthesis.ps1' },
{ startIndex: 9, type: 'variable.ps1' },
{ startIndex: 22, type: 'delimiter.square.ps1', bracket: Bracket.Open },
{ startIndex: 22, type: 'delimiter.square.ps1' },
{ startIndex: 23, type: 'string.ps1' },
{ startIndex: 35, type: 'delimiter.square.ps1', bracket: Bracket.Close },
{ startIndex: 35, type: 'delimiter.square.ps1' },
{ startIndex: 36, type: '' },
{ startIndex: 37, type: 'delimiter.ps1' },
{ startIndex: 38, type: '' },
{ startIndex: 41, type: 'string.ps1' },
{ startIndex: 47, type: 'delimiter.parenthesis.ps1', bracket: Bracket.Close }
{ startIndex: 47, type: 'delimiter.parenthesis.ps1' }
]}, {
line: ' {',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 1, type: 'delimiter.curly.ps1', bracket: Bracket.Open }
{ startIndex: 1, type: 'delimiter.curly.ps1' }
]}, {
line: ' #When a disconnected server is selected there is no session information, we get null for everything except class',
tokens: [
......@@ -525,7 +519,7 @@ testTokenization('powershell', language, [
line: ' }',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 1, type: 'delimiter.curly.ps1', bracket: Bracket.Close }
{ startIndex: 1, type: 'delimiter.curly.ps1' }
]}, {
line: ' $SelectedObjectNames += "a disconnected server"',
tokens: [
......@@ -544,7 +538,7 @@ testTokenization('powershell', language, [
line: ' {',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 1, type: 'delimiter.curly.ps1', bracket: Bracket.Open }
{ startIndex: 1, type: 'delimiter.curly.ps1' }
]}, {
line: ' Connect-XenServer -url $parameterSet["url"] -opaqueref $parameterSet["sessionRef"]',
tokens: [
......@@ -552,16 +546,16 @@ testTokenization('powershell', language, [
{ startIndex: 20, type: 'delimiter.ps1' },
{ startIndex: 21, type: '' },
{ startIndex: 25, type: 'variable.ps1' },
{ startIndex: 38, type: 'delimiter.square.ps1', bracket: Bracket.Open },
{ startIndex: 38, type: 'delimiter.square.ps1' },
{ startIndex: 39, type: 'string.ps1' },
{ startIndex: 44, type: 'delimiter.square.ps1', bracket: Bracket.Close },
{ startIndex: 44, type: 'delimiter.square.ps1' },
{ startIndex: 45, type: '' },
{ startIndex: 46, type: 'delimiter.ps1' },
{ startIndex: 47, type: '' },
{ startIndex: 57, type: 'variable.ps1' },
{ startIndex: 70, type: 'delimiter.square.ps1', bracket: Bracket.Open },
{ startIndex: 70, type: 'delimiter.square.ps1' },
{ startIndex: 71, type: 'string.ps1' },
{ startIndex: 83, type: 'delimiter.square.ps1', bracket: Bracket.Close }
{ startIndex: 83, type: 'delimiter.square.ps1' }
]}, {
line: ' #Use $class to determine which server objects to get',
tokens: [
......@@ -585,15 +579,15 @@ testTokenization('powershell', language, [
{ startIndex: 57, type: 'delimiter.ps1' },
{ startIndex: 58, type: '' },
{ startIndex: 60, type: 'variable.ps1' },
{ startIndex: 73, type: 'delimiter.square.ps1', bracket: Bracket.Open },
{ startIndex: 73, type: 'delimiter.square.ps1' },
{ startIndex: 74, type: 'string.ps1' },
{ startIndex: 81, type: 'delimiter.square.ps1', bracket: Bracket.Close },
{ startIndex: 81, type: 'delimiter.square.ps1' },
{ startIndex: 82, type: 'delimiter.ps1' },
{ startIndex: 83, type: '' },
{ startIndex: 84, type: 'variable.ps1' },
{ startIndex: 97, type: 'delimiter.square.ps1', bracket: Bracket.Open },
{ startIndex: 97, type: 'delimiter.square.ps1' },
{ startIndex: 98, type: 'string.ps1' },
{ startIndex: 107, type: 'delimiter.square.ps1', bracket: Bracket.Close }
{ startIndex: 107, type: 'delimiter.square.ps1' }
]}, {
line: ' $obj = Invoke-Expression $exp',
tokens: [
......@@ -619,12 +613,12 @@ testTokenization('powershell', language, [
line: ' } ',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 1, type: 'delimiter.curly.ps1', bracket: Bracket.Close },
{ startIndex: 1, type: 'delimiter.curly.ps1' },
{ startIndex: 2, type: '' }
]}, {
line: '}',
tokens: [
{ startIndex: 0, type: 'delimiter.curly.ps1', bracket: Bracket.Close }
{ startIndex: 0, type: 'delimiter.curly.ps1' }
]}, {
line: '',
tokens: [
......
......@@ -17,7 +17,6 @@ testTokenization('python', language, [
{ startIndex: 3, type: 'white.python' },
{ startIndex: 4, type: 'identifier.python' },
{ startIndex: 8, type: 'delimiter.parenthesis.python' },
{ startIndex: 9, type: 'delimiter.parenthesis.python' },
{ startIndex: 10, type: 'delimiter.python' }
]}],
......
......@@ -8,11 +8,6 @@
import {language} from 'vs/editor/standalone-languages/ruby';
import {testTokenization} from 'vs/editor/standalone-languages/test/testUtil';
var Bracket = {
Open: 1,
Close: -1
};
testTokenization('ruby', language, [
// Keywords
[{
......@@ -26,7 +21,6 @@ testTokenization('ruby', language, [
{ startIndex: 15, type: '' },
{ startIndex: 16, type: 'identifier.ruby' },
{ startIndex: 20, type: 'delimiter.parenthesis.ruby' },
{ startIndex: 21, type: 'delimiter.parenthesis.ruby' },
{ startIndex: 22, type: '' },
{ startIndex: 23, type: 'keyword.def.ruby' }
]}],
......@@ -62,16 +56,16 @@ testTokenization('ruby', language, [
{ startIndex: 0, type: 'identifier.ruby' },
{ startIndex: 4, type: '' },
{ startIndex: 5, type: 'identifier.ruby' },
{ startIndex: 9, type: 'delimiter.parenthesis.ruby', bracket: Bracket.Open },
{ startIndex: 10, type: 'regexp.delim.ruby', bracket: Bracket.Open },
{ startIndex: 9, type: 'delimiter.parenthesis.ruby' },
{ startIndex: 10, type: 'regexp.delim.ruby' },
{ startIndex: 11, type: 'regexp.ruby' },
{ startIndex: 15, type: 'regexp.delim.ruby', bracket: Bracket.Close },
{ startIndex: 15, type: 'regexp.delim.ruby' },
{ startIndex: 16, type: 'delimiter.ruby' },
{ startIndex: 17, type: '' },
{ startIndex: 18, type: 'string.d.delim.ruby', bracket: Bracket.Open },
{ startIndex: 18, type: 'string.d.delim.ruby' },
{ startIndex: 19, type: 'string.$S2.ruby' },
{ startIndex: 23, type: 'string.d.delim.ruby', bracket: Bracket.Close },
{ startIndex: 24, type: 'delimiter.parenthesis.ruby', bracket: Bracket.Close }
{ startIndex: 23, type: 'string.d.delim.ruby' },
{ startIndex: 24, type: 'delimiter.parenthesis.ruby' }
]}],
// make sure that division does not match regex
......@@ -89,7 +83,7 @@ testTokenization('ruby', language, [
[{
line: '<<HERE',
tokens: [
{ startIndex: 0, type: 'string.heredoc.delimiter.ruby', bracket: Bracket.Open }
{ startIndex: 0, type: 'string.heredoc.delimiter.ruby' }
]}, {
line: 'do some string',
tokens: [
......@@ -97,14 +91,14 @@ testTokenization('ruby', language, [
]}, {
line: 'HERE',
tokens: [
{ startIndex: 0, type: 'string.heredoc.delimiter.ruby', bracket: Bracket.Close }
{ startIndex: 0, type: 'string.heredoc.delimiter.ruby' }
]}],
[{
line: 'x <<HERE',
tokens: [
{ startIndex: 0, type: 'identifier.ruby' },
{ startIndex: 1, type: 'string.heredoc.delimiter.ruby', bracket: Bracket.Open }
{ startIndex: 1, type: 'string.heredoc.delimiter.ruby' }
]}, {
line: 'do some string',
tokens: [
......@@ -112,7 +106,7 @@ testTokenization('ruby', language, [
]}, {
line: 'HERE',
tokens: [
{ startIndex: 0, type: 'string.heredoc.delimiter.ruby', bracket: Bracket.Close }
{ startIndex: 0, type: 'string.heredoc.delimiter.ruby' }
]}],
[{
......
......@@ -8,11 +8,6 @@
import {language} from 'vs/editor/standalone-languages/sql';
import {testTokenization} from 'vs/editor/standalone-languages/test/testUtil';
var Bracket = {
Open: 1,
Close: -1
};
testTokenization('sql', language, [
// Comments
[{
......@@ -41,9 +36,9 @@ testTokenization('sql', language, [
[{
line: '/* a full line comment */',
tokens: [
{ startIndex: 0, type: 'comment.quote.sql', bracket: Bracket.Open },
{ startIndex: 0, type: 'comment.quote.sql' },
{ startIndex: 2, type: 'comment.sql' },
{ startIndex: 23, type: 'comment.quote.sql', bracket: Bracket.Close }
{ startIndex: 23, type: 'comment.quote.sql' }
]}],
[{
......@@ -80,9 +75,9 @@ testTokenization('sql', language, [
tokens: [
{ startIndex: 0, type: 'identifier.sql' },
{ startIndex: 2, type: 'operator.sql' },
{ startIndex: 3, type: 'comment.quote.sql', bracket: Bracket.Open },
{ startIndex: 3, type: 'comment.quote.sql' },
{ startIndex: 5, type: 'comment.sql' },
{ startIndex: 28, type: 'comment.quote.sql', bracket: Bracket.Close },
{ startIndex: 28, type: 'comment.quote.sql' },
{ startIndex: 30, type: 'delimiter.sql' }
]}],
......@@ -358,9 +353,9 @@ testTokenization('sql', language, [
tokens: [
{ startIndex: 0, type: 'keyword.sql' },
{ startIndex: 7, type: 'white.sql' },
{ startIndex: 8, type: 'identifier.quote.sql', bracket: Bracket.Open },
{ startIndex: 8, type: 'identifier.quote.sql' },
{ startIndex: 9, type: 'identifier.sql' },
{ startIndex: 16, type: 'identifier.quote.sql', bracket: Bracket.Close },
{ startIndex: 16, type: 'identifier.quote.sql' },
{ startIndex: 17, type: 'delimiter.sql' }
]}],
......@@ -384,9 +379,9 @@ testTokenization('sql', language, [
tokens: [
{ startIndex: 0, type: 'keyword.sql' },
{ startIndex: 7, type: 'white.sql' },
{ startIndex: 8, type: 'identifier.quote.sql', bracket: Bracket.Open },
{ startIndex: 8, type: 'identifier.quote.sql' },
{ startIndex: 9, type: 'identifier.sql' },
{ startIndex: 16, type: 'identifier.quote.sql', bracket: Bracket.Close },
{ startIndex: 16, type: 'identifier.quote.sql' },
{ startIndex: 17, type: 'delimiter.sql' }
]}],
......@@ -427,9 +422,9 @@ testTokenization('sql', language, [
{ startIndex: 7, type: 'white.sql' },
{ startIndex: 8, type: 'identifier.sql' },
{ startIndex: 10, type: 'operator.sql' },
{ startIndex: 11, type: 'string.quote.sql', bracket: Bracket.Open },
{ startIndex: 11, type: 'string.quote.sql' },
{ startIndex: 12, type: 'string.sql' },
{ startIndex: 20, type: 'string.quote.sql', bracket: Bracket.Close },
{ startIndex: 20, type: 'string.quote.sql' },
{ startIndex: 21, type: 'delimiter.sql' }
]}],
......@@ -460,9 +455,9 @@ testTokenization('sql', language, [
[{
line: 'N\'a unicode string\'',
tokens: [
{ startIndex: 0, type: 'string.quote.sql', bracket: Bracket.Open },
{ startIndex: 0, type: 'string.quote.sql' },
{ startIndex: 2, type: 'string.sql' },
{ startIndex: 18, type: 'string.quote.sql', bracket: Bracket.Close }
{ startIndex: 18, type: 'string.quote.sql' }
]}],
[{
......@@ -538,12 +533,11 @@ testTokenization('sql', language, [
line: 'WHILE() BEGIN END',
tokens: [
{ startIndex: 0, type: 'keyword.sql' },
{ startIndex: 5, type: 'delimiter.parenthesis.sql', bracket: Bracket.Open },
{ startIndex: 6, type: 'delimiter.parenthesis.sql', bracket: Bracket.Close },
{ startIndex: 5, type: 'delimiter.parenthesis.sql' },
{ startIndex: 7, type: 'white.sql' },
{ startIndex: 8, type: 'keyword.block.sql', bracket: Bracket.Open },
{ startIndex: 8, type: 'keyword.block.sql' },
{ startIndex: 13, type: 'white.sql' },
{ startIndex: 14, type: 'keyword.block.sql', bracket: Bracket.Close }
{ startIndex: 14, type: 'keyword.block.sql' }
]}],
[{
......@@ -551,7 +545,7 @@ testTokenization('sql', language, [
tokens: [
{ startIndex: 0, type: 'keyword.sql' },
{ startIndex: 10, type: 'white.sql' },
{ startIndex: 11, type: 'keyword.try.sql', bracket: Bracket.Open },
{ startIndex: 11, type: 'keyword.try.sql' },
{ startIndex: 20, type: 'white.sql' },
{ startIndex: 21, type: 'keyword.sql' },
{ startIndex: 27, type: 'white.sql' },
......@@ -559,13 +553,13 @@ testTokenization('sql', language, [
{ startIndex: 29, type: 'white.sql' },
{ startIndex: 30, type: 'keyword.sql' },
{ startIndex: 36, type: 'white.sql' },
{ startIndex: 37, type: 'keyword.try.sql', bracket: Bracket.Close },
{ startIndex: 37, type: 'keyword.try.sql' },
{ startIndex: 44, type: 'white.sql' },
{ startIndex: 45, type: 'keyword.catch.sql', bracket: Bracket.Open },
{ startIndex: 45, type: 'keyword.catch.sql' },
{ startIndex: 56, type: 'white.sql' },
{ startIndex: 57, type: 'keyword.sql' },
{ startIndex: 65, type: 'white.sql' },
{ startIndex: 66, type: 'keyword.catch.sql', bracket: Bracket.Close }
{ startIndex: 66, type: 'keyword.catch.sql' }
]}],
[{
......@@ -573,15 +567,15 @@ testTokenization('sql', language, [
tokens: [
{ startIndex: 0, type: 'keyword.sql' },
{ startIndex: 6, type: 'white.sql' },
{ startIndex: 7, type: 'keyword.block.sql', bracket: Bracket.Open },
{ startIndex: 7, type: 'keyword.block.sql' },
{ startIndex: 11, type: 'white.sql' },
{ startIndex: 12, type: 'number.sql' },
{ startIndex: 13, type: 'white.sql' },
{ startIndex: 14, type: 'keyword.choice.sql', bracket: Bracket.Open },
{ startIndex: 14, type: 'keyword.choice.sql' },
{ startIndex: 18, type: 'white.sql' },
{ startIndex: 19, type: 'number.sql' },
{ startIndex: 20, type: 'white.sql' },
{ startIndex: 21, type: 'keyword.choice.sql', bracket: Bracket.Close },
{ startIndex: 21, type: 'keyword.choice.sql' },
{ startIndex: 25, type: 'white.sql' },
{ startIndex: 26, type: 'number.sql' },
{ startIndex: 27, type: 'white.sql' },
......@@ -589,6 +583,6 @@ testTokenization('sql', language, [
{ startIndex: 32, type: 'white.sql' },
{ startIndex: 33, type: 'number.sql' },
{ startIndex: 34, type: 'white.sql' },
{ startIndex: 35, type: 'keyword.block.sql', bracket: Bracket.Close }
{ startIndex: 35, type: 'keyword.block.sql' }
]}]
]);
......@@ -14,169 +14,169 @@ testTokenization('swift', language, [
[{
line: '@noescape',
tokens: [
{ startIndex: 0, type: 'keyword.control.swift', bracket: 0 } /* '@noescape' */
{ startIndex: 0, type: 'keyword.control.swift' } /* '@noescape' */
]}],
//Keyword and Type Identifier
[{
line: 'class App: UI, UIApp, UIView {',
tokens: [
{ startIndex: 0, type: 'keyword.swift', bracket: 0 } /* 'class' */,
{ startIndex: 5, type: '', bracket: 0 },
{ startIndex: 6, type: 'type.identifier.swift', bracket: 0 } /* 'App' */,
{ startIndex: 9, type: 'keyword.operator.swift', bracket: 0 } /* ':' */,
{ startIndex: 10, type: '', bracket: 0 },
{ startIndex: 11, type: 'type.identifier.swift', bracket: 0 } /* 'UI' */,
{ startIndex: 13, type: 'keyword.operator.swift', bracket: 0 } /* ',' */,
{ startIndex: 14, type: '', bracket: 0 },
{ startIndex: 15, type: 'type.identifier.swift', bracket: 0 } /* 'UIApp' */,
{ startIndex: 20, type: 'keyword.operator.swift', bracket: 0 } /* ',' */,
{ startIndex: 21, type: '', bracket: 0 },
{ startIndex: 22, type: 'type.identifier.swift', bracket: 0 } /* 'UIView' */,
{ startIndex: 28, type: '', bracket: 0 },
{ startIndex: 29, type: 'delimiter.curly.swift', bracket: 1 } /* '{' */
{ startIndex: 0, type: 'keyword.swift' } /* 'class' */,
{ startIndex: 5, type: '' },
{ startIndex: 6, type: 'type.identifier.swift' } /* 'App' */,
{ startIndex: 9, type: 'keyword.operator.swift' } /* ':' */,
{ startIndex: 10, type: '' },
{ startIndex: 11, type: 'type.identifier.swift' } /* 'UI' */,
{ startIndex: 13, type: 'keyword.operator.swift' } /* ',' */,
{ startIndex: 14, type: '' },
{ startIndex: 15, type: 'type.identifier.swift' } /* 'UIApp' */,
{ startIndex: 20, type: 'keyword.operator.swift' } /* ',' */,
{ startIndex: 21, type: '' },
{ startIndex: 22, type: 'type.identifier.swift' } /* 'UIView' */,
{ startIndex: 28, type: '' },
{ startIndex: 29, type: 'delimiter.curly.swift' } /* '{' */
]}],
// Keyword, Identifier, and Type Identifier
[{
line: ' var window: UIWindow?',
tokens: [
{ startIndex: 0, type: '', bracket: 0 },
{ startIndex: 4, type: 'keyword.swift', bracket: 0 } /* 'var' */,
{ startIndex: 7, type: '', bracket: 0 },
{ startIndex: 8, type: 'identifier.swift', bracket: 0 } /* 'window' */,
{ startIndex: 14, type: 'keyword.operator.swift', bracket: 0 } /* ':' */,
{ startIndex: 15, type: '', bracket: 0 },
{ startIndex: 16, type: 'type.identifier.swift', bracket: 0 } /* 'UIWindow' */,
{ startIndex: 24, type: 'keyword.operator.swift', bracket: 0 } /* '?' */
{ startIndex: 0, type: '' },
{ startIndex: 4, type: 'keyword.swift' } /* 'var' */,
{ startIndex: 7, type: '' },
{ startIndex: 8, type: 'identifier.swift' } /* 'window' */,
{ startIndex: 14, type: 'keyword.operator.swift' } /* ':' */,
{ startIndex: 15, type: '' },
{ startIndex: 16, type: 'type.identifier.swift' } /* 'UIWindow' */,
{ startIndex: 24, type: 'keyword.operator.swift' } /* '?' */
]}],
//Comment
[{
line: ' // Comment',
tokens: [
{ startIndex: 0, type: '', bracket: 0 },
{ startIndex: 4, type: 'comment.swift', bracket: 0 } /* '// Comment' */
{ startIndex: 0, type: '' },
{ startIndex: 4, type: 'comment.swift' } /* '// Comment' */
]}],
//Block Comment with Embedded Comment followed by code
[{
line: ' /* Comment //Embedded */ var y = 0b10',
tokens: [
{ startIndex: 0, type: '', bracket: 0 },
{ startIndex: 4, type: 'comment.swift', bracket: 0 }, // /* '/* Comment //Embedded */' */,
{ startIndex: 28, type: '', bracket: 0 },
{ startIndex: 29, type: 'keyword.swift', bracket: 0 } /* 'var' */,
{ startIndex: 32, type: '', bracket: 0 },
{ startIndex: 33, type: 'identifier.swift', bracket: 0 } /* 'y' */,
{ startIndex: 34, type: '', bracket: 0 },
{ startIndex: 35, type: 'keyword.operator.swift', bracket: 0 } /* '=' */,
{ startIndex: 36, type: '', bracket: 0 },
{ startIndex: 37, type: 'number.binary.swift', bracket: 0 } /* '0b10' */
{ startIndex: 0, type: '' },
{ startIndex: 4, type: 'comment.swift' }, // /* '/* Comment //Embedded */' */,
{ startIndex: 28, type: '' },
{ startIndex: 29, type: 'keyword.swift' } /* 'var' */,
{ startIndex: 32, type: '' },
{ startIndex: 33, type: 'identifier.swift' } /* 'y' */,
{ startIndex: 34, type: '' },
{ startIndex: 35, type: 'keyword.operator.swift' } /* '=' */,
{ startIndex: 36, type: '' },
{ startIndex: 37, type: 'number.binary.swift' } /* '0b10' */
]}],
// Method signature (broken on two lines)
[{
line: ' public func app(app: App, opts:',
tokens:[
{ startIndex: 0, type: '', bracket: 0 },
{ startIndex: 4, type: 'keyword.swift', bracket: 0 } /* 'public' */,
{ startIndex: 10, type: '', bracket: 0 },
{ startIndex: 11, type: 'keyword.swift', bracket: 0 } /* 'func' */,
{ startIndex: 15, type: '', bracket: 0 },
{ startIndex: 16, type: 'identifier.swift', bracket: 0 } /* 'app' */,
{ startIndex: 19, type: 'delimiter.parenthesis.swift', bracket: 1 } /* '(' */,
{ startIndex: 20, type: 'identifier.swift', bracket: 0 }/* 'app' */,
{ startIndex: 23, type: 'keyword.operator.swift', bracket: 0 } /* ':' */,
{ startIndex: 24, type: '', bracket: 0 },
{ startIndex: 25, type: 'type.identifier.swift', bracket: 0 } /* 'App' */,
{ startIndex: 28, type: 'keyword.operator.swift', bracket: 0 } /* ',' */,
{ startIndex: 29, type: '', bracket: 0 },
{ startIndex: 30, type: 'identifier.swift', bracket: 0 } /* 'opts' */,
{ startIndex: 34, type: 'keyword.operator.swift', bracket: 0 } /* ':' */,
{ startIndex: 0, type: '' },
{ startIndex: 4, type: 'keyword.swift' } /* 'public' */,
{ startIndex: 10, type: '' },
{ startIndex: 11, type: 'keyword.swift' } /* 'func' */,
{ startIndex: 15, type: '' },
{ startIndex: 16, type: 'identifier.swift' } /* 'app' */,
{ startIndex: 19, type: 'delimiter.parenthesis.swift' } /* '(' */,
{ startIndex: 20, type: 'identifier.swift' }/* 'app' */,
{ startIndex: 23, type: 'keyword.operator.swift' } /* ':' */,
{ startIndex: 24, type: '' },
{ startIndex: 25, type: 'type.identifier.swift' } /* 'App' */,
{ startIndex: 28, type: 'keyword.operator.swift' } /* ',' */,
{ startIndex: 29, type: '' },
{ startIndex: 30, type: 'identifier.swift' } /* 'opts' */,
{ startIndex: 34, type: 'keyword.operator.swift' } /* ':' */,
]}],
// Method signature Continued
[{
line: ' [NSObject: AnyObject]?) -> Bool {',
tokens: [
{ startIndex: 0, type: '', bracket: 0 },
{ startIndex: 8, type: 'delimiter.square.swift', bracket: 1 } /* '[' */,
{ startIndex: 9, type: 'type.identifier.swift', bracket: 0 } /* 'NSObject' */,
{ startIndex: 17, type: 'keyword.operator.swift', bracket: 0 } /* ':' */,
{ startIndex: 18, type: '', bracket: 0 },
{ startIndex: 19, type: 'type.identifier.swift', bracket: 0 } /* 'AnyObject' */,
{ startIndex: 28, type: 'delimiter.square.swift', bracket: -1 } /* ']' */,
{ startIndex: 29, type: 'keyword.operator.swift', bracket: 0 } /* '?' */,
{ startIndex: 30, type: 'delimiter.parenthesis.swift', bracket: -1 } /* ')' */,
{ startIndex: 31, type: '', bracket: 0 },
{ startIndex: 32, type: 'keyword.operator.swift', bracket: 0 } /* '->' */,
{ startIndex: 34, type: '', bracket: 0 },
{ startIndex: 35, type: 'type.identifier.swift', bracket: 0 } /* 'Bool' */,
{ startIndex: 39, type: '', bracket: 0 },
{ startIndex: 40, type: 'delimiter.curly.swift', bracket: 1 } /* '{' */
{ startIndex: 0, type: '' },
{ startIndex: 8, type: 'delimiter.square.swift' } /* '[' */,
{ startIndex: 9, type: 'type.identifier.swift' } /* 'NSObject' */,
{ startIndex: 17, type: 'keyword.operator.swift' } /* ':' */,
{ startIndex: 18, type: '' },
{ startIndex: 19, type: 'type.identifier.swift' } /* 'AnyObject' */,
{ startIndex: 28, type: 'delimiter.square.swift' } /* ']' */,
{ startIndex: 29, type: 'keyword.operator.swift' } /* '?' */,
{ startIndex: 30, type: 'delimiter.parenthesis.swift' } /* ')' */,
{ startIndex: 31, type: '' },
{ startIndex: 32, type: 'keyword.operator.swift' } /* '->' */,
{ startIndex: 34, type: '' },
{ startIndex: 35, type: 'type.identifier.swift' } /* 'Bool' */,
{ startIndex: 39, type: '' },
{ startIndex: 40, type: 'delimiter.curly.swift' } /* '{' */
]}],
// String with escapes
[{
line: ' var `String` = "String w/ \\"escape\\""',
tokens: [
{ startIndex: 0, type: '', bracket: 0 },
{ startIndex: 8, type: 'keyword.swift', bracket: 0 } /* 'var' */,
{ startIndex: 11, type: '', bracket: 0 },
{ startIndex: 12, type: 'keyword.operator.swift', bracket: 1 } /* '`' */,
{ startIndex: 13, type: 'identifier.swift', bracket: 0 } /* 'String' */,
{ startIndex: 19, type: 'keyword.operator.swift', bracket: -1 } /* '`' */,
{ startIndex: 20, type: '', bracket: 0 },
{ startIndex: 21, type: 'keyword.operator.swift', bracket: 0 } /* '=' */,
{ startIndex: 22, type: '', bracket: 0 },
{ startIndex: 23, type: 'string.quote.swift', bracket: 1 } /* '"' */,
{ startIndex: 24, type: 'string.swift', bracket: 0 } /* 'String w/ \\"escape\\""' */,
{ startIndex: 44, type: 'string.quote.swift', bracket: -1 } /* '"' */,
{ startIndex: 0, type: '' },
{ startIndex: 8, type: 'keyword.swift' } /* 'var' */,
{ startIndex: 11, type: '' },
{ startIndex: 12, type: 'keyword.operator.swift' } /* '`' */,
{ startIndex: 13, type: 'identifier.swift' } /* 'String' */,
{ startIndex: 19, type: 'keyword.operator.swift' } /* '`' */,
{ startIndex: 20, type: '' },
{ startIndex: 21, type: 'keyword.operator.swift' } /* '=' */,
{ startIndex: 22, type: '' },
{ startIndex: 23, type: 'string.quote.swift' } /* '"' */,
{ startIndex: 24, type: 'string.swift' } /* 'String w/ \\"escape\\""' */,
{ startIndex: 44, type: 'string.quote.swift' } /* '"' */,
]}],
// String with interpolated expression
[{
line: ' let message = "\\(y) times 2.5 is \\(Double(25) * 2.5)"',
tokens: [
{ startIndex: 0, type: '', bracket: 0 },
{ startIndex: 8, type: 'keyword.swift', bracket: 0 } /* 'let' */,
{ startIndex: 11, type: '', bracket: 0 },
{ startIndex: 12, type: 'identifier.swift', bracket: 0 } /* 'message' */,
{ startIndex: 19, type: '', bracket: 0 },
{ startIndex: 20, type: 'keyword.operator.swift', bracket: 0 } /* '=' */,
{ startIndex: 21, type: '', bracket: 0 },
{ startIndex: 22, type: 'string.quote.swift', bracket: 1 } /* '"' */,
{ startIndex: 23, type: 'keyword.operator.swift', bracket: 1 } /* '\(' */,
{ startIndex: 25, type: 'identifier.swift', bracket: 0 },
{ startIndex: 26, type: 'keyword.operator.swift', bracket: -1 } /* ')' */,
{ startIndex: 27, type: 'string.swift', bracket: 0 } /* ' times 2.5 is ' */,
{ startIndex: 41, type: 'keyword.operator.swift', bracket: 1 } /* '\(' */,
{ startIndex: 43, type: 'type.identifier.swift', bracket: 0 } /* 'Double' */,
{ startIndex: 49, type: 'keyword.operator.swift', bracket: 1 } /* '(' */,
{ startIndex: 50, type: 'number.swift', bracket: 0 } /* '25' */,
{ startIndex: 52, type: 'keyword.operator.swift', bracket: -1 } /* ')' */,
{ startIndex: 53, type: '', bracket: 0 },
{ startIndex: 54, type: 'keyword.operator.swift', bracket: 0 } /* '*' */,
{ startIndex: 55, type: '', bracket: 0 },
{ startIndex: 56, type: 'number.float.swift', bracket: 0 } /* '2.5' */,
{ startIndex: 59, type: 'keyword.operator.swift', bracket: -1 } /* ')' */,
{ startIndex: 60, type: 'string.quote.swift', bracket: -1 } /* '"' */
{ startIndex: 0, type: '' },
{ startIndex: 8, type: 'keyword.swift' } /* 'let' */,
{ startIndex: 11, type: '' },
{ startIndex: 12, type: 'identifier.swift' } /* 'message' */,
{ startIndex: 19, type: '' },
{ startIndex: 20, type: 'keyword.operator.swift' } /* '=' */,
{ startIndex: 21, type: '' },
{ startIndex: 22, type: 'string.quote.swift' } /* '"' */,
{ startIndex: 23, type: 'keyword.operator.swift' } /* '\(' */,
{ startIndex: 25, type: 'identifier.swift' },
{ startIndex: 26, type: 'keyword.operator.swift' } /* ')' */,
{ startIndex: 27, type: 'string.swift' } /* ' times 2.5 is ' */,
{ startIndex: 41, type: 'keyword.operator.swift' } /* '\(' */,
{ startIndex: 43, type: 'type.identifier.swift' } /* 'Double' */,
{ startIndex: 49, type: 'keyword.operator.swift' } /* '(' */,
{ startIndex: 50, type: 'number.swift' } /* '25' */,
{ startIndex: 52, type: 'keyword.operator.swift' } /* ')' */,
{ startIndex: 53, type: '' },
{ startIndex: 54, type: 'keyword.operator.swift' } /* '*' */,
{ startIndex: 55, type: '' },
{ startIndex: 56, type: 'number.float.swift' } /* '2.5' */,
{ startIndex: 59, type: 'keyword.operator.swift' } /* ')' */,
{ startIndex: 60, type: 'string.quote.swift' } /* '"' */
]}],
// Method invocation/property accessor.
[{
line: ' let view = self.window!.contr as! UIView',
tokens: [
{ startIndex: 0, type: '', bracket: 0 },
{ startIndex: 8, type: 'keyword.swift', bracket: 0 } /* 'let' */,
{ startIndex: 11, type: '', bracket: 0 },
{ startIndex: 12, type: 'identifier.swift', bracket: 0 } /* 'view' */,
{ startIndex: 16, type: '', bracket: 0 },
{ startIndex: 17, type: 'keyword.operator.swift', bracket: 0 } /* '=' */,
{ startIndex: 18, type: '', bracket: 0 },
{ startIndex: 19, type: 'keyword.swift', bracket: 0 } /* 'self' */,
{ startIndex: 23, type: 'delimeter.swift', bracket: 0 } /* '.' */,
{ startIndex: 24, type: 'type.identifier.swift', bracket: 0 } /* 'window' */,
{ startIndex: 30, type: 'keyword.operator.swift', bracket: 0 } /* '!' */,
{ startIndex: 31, type: 'delimeter.swift', bracket: 0 } /* '.' */,
{ startIndex: 32, type: 'type.identifier.swift', bracket: 0 } /* 'contr' */,
{ startIndex: 37, type: '', bracket: 0 },
{ startIndex: 38, type: 'keyword.swift', bracket: 0 } /* 'as' */,
{ startIndex: 40, type: 'keyword.operator.swift', bracket: 0 } /* '!' */,
{ startIndex: 41, type: '', bracket: 0 },
{ startIndex: 42, type: 'type.identifier.swift', bracket: 0 } /* 'UIView' */
{ startIndex: 0, type: '' },
{ startIndex: 8, type: 'keyword.swift' } /* 'let' */,
{ startIndex: 11, type: '' },
{ startIndex: 12, type: 'identifier.swift' } /* 'view' */,
{ startIndex: 16, type: '' },
{ startIndex: 17, type: 'keyword.operator.swift' } /* '=' */,
{ startIndex: 18, type: '' },
{ startIndex: 19, type: 'keyword.swift' } /* 'self' */,
{ startIndex: 23, type: 'delimeter.swift' } /* '.' */,
{ startIndex: 24, type: 'type.identifier.swift' } /* 'window' */,
{ startIndex: 30, type: 'keyword.operator.swift' } /* '!' */,
{ startIndex: 31, type: 'delimeter.swift' } /* '.' */,
{ startIndex: 32, type: 'type.identifier.swift' } /* 'contr' */,
{ startIndex: 37, type: '' },
{ startIndex: 38, type: 'keyword.swift' } /* 'as' */,
{ startIndex: 40, type: 'keyword.operator.swift' } /* '!' */,
{ startIndex: 41, type: '' },
{ startIndex: 42, type: 'type.identifier.swift' } /* 'UIView' */
]}]
]);
......@@ -11,16 +11,9 @@ import {RichEditSupport} from 'vs/editor/common/modes/supports/richEditSupport';
import {createOnEnterAsserter, executeMonarchTokenizationTests} from 'vs/editor/test/common/modesUtil';
import {ILanguage} from '../types';
export enum Bracket {
None = 0,
Open = 1,
Close = -1
}
export interface IRelaxedToken {
startIndex: number;
type: string;
bracket?: Bracket;
}
export interface ITestItem {
line: string;
......
......@@ -249,22 +249,22 @@ suite('LESS-tokenization', () => {
[{
line: '[1,2,3]',
tokens: [
{ startIndex:0, type: 'punctuation.bracket.less', bracket: Modes.Bracket.Open },
{ startIndex:0, type: 'punctuation.bracket.less' },
{ startIndex:1, type: lessTokenTypes.TOKEN_VALUE + '.numeric.less' },
{ startIndex:2, type: 'punctuation.less' },
{ startIndex:3, type: lessTokenTypes.TOKEN_VALUE + '.numeric.less' },
{ startIndex:4, type: 'punctuation.less' },
{ startIndex:5, type: lessTokenTypes.TOKEN_VALUE + '.numeric.less' },
{ startIndex:6, type: 'punctuation.bracket.less', bracket: Modes.Bracket.Close }
{ startIndex:6, type: 'punctuation.bracket.less' }
]}],
[{
line: 'foo(123);',
tokens: [
{ startIndex:0, type: lessTokenTypes.TOKEN_SELECTOR_TAG + '.less' },
{ startIndex:3, type: 'punctuation.parenthesis.less', bracket: Modes.Bracket.Open },
{ startIndex:3, type: 'punctuation.parenthesis.less' },
{ startIndex:4, type: lessTokenTypes.TOKEN_VALUE + '.numeric.less' },
{ startIndex:7, type: 'punctuation.parenthesis.less', bracket: Modes.Bracket.Close },
{ startIndex:7, type: 'punctuation.parenthesis.less' },
{ startIndex:8, type: 'punctuation.less' }
]}],
......@@ -337,7 +337,6 @@ suite('LESS-tokenization', () => {
{ startIndex:39, type: 'punctuation.parenthesis.less' },
{ startIndex:40, type: 'variable.less' },
{ startIndex:46, type: 'punctuation.parenthesis.less' },
{ startIndex:47, type: 'punctuation.parenthesis.less' },
{ startIndex:48, type: '' },
{ startIndex:49, type: 'punctuation.curly.less' },
{ startIndex:50, type: '' },
......@@ -583,7 +582,6 @@ suite('LESS-tokenization', () => {
{ startIndex:33, type: 'punctuation.parenthesis.less' },
{ startIndex:34, type: 'variable.less' },
{ startIndex:36, type: 'punctuation.parenthesis.less' },
{ startIndex:37, type: 'punctuation.parenthesis.less' },
{ startIndex:38, type: '' },
{ startIndex:39, type: 'punctuation.curly.less' },
{ startIndex:40, type: '' },
......@@ -612,7 +610,6 @@ suite('LESS-tokenization', () => {
{ startIndex:36, type: 'punctuation.parenthesis.less' },
{ startIndex:37, type: 'variable.less' },
{ startIndex:39, type: 'punctuation.parenthesis.less' },
{ startIndex:40, type: 'punctuation.parenthesis.less' },
{ startIndex:41, type: '' },
{ startIndex:42, type: 'punctuation.curly.less' },
{ startIndex:43, type: '' },
......@@ -681,7 +678,6 @@ suite('LESS-tokenization', () => {
{ startIndex:69, type: 'punctuation.less' },
{ startIndex:70, type: lessTokenTypes.TOKEN_VALUE + '.numeric.less' },
{ startIndex:72, type: 'punctuation.parenthesis.less' },
{ startIndex:73, type: 'punctuation.parenthesis.less' },
{ startIndex:74, type: 'punctuation.less' }
]}],
......@@ -909,7 +905,6 @@ suite('LESS-tokenization', () => {
{ startIndex:115, type: 'punctuation.less' },
{ startIndex:116, type: 'variable.less' },
{ startIndex:122, type: 'punctuation.parenthesis.less' },
{ startIndex:123, type: 'punctuation.parenthesis.less' },
{ startIndex:124, type: 'punctuation.less' },
{ startIndex:125, type: '' },
{ startIndex:126, type: lessTokenTypes.TOKEN_VALUE + '.less' },
......@@ -925,8 +920,6 @@ suite('LESS-tokenization', () => {
{ startIndex:155, type: 'punctuation.less' },
{ startIndex:156, type: 'variable.less' },
{ startIndex:161, type: 'punctuation.parenthesis.less' },
{ startIndex:162, type: 'punctuation.parenthesis.less' },
{ startIndex:163, type: 'punctuation.parenthesis.less' },
{ startIndex:164, type: 'punctuation.less' },
{ startIndex:165, type: '' },
{ startIndex:166, type: 'punctuation.curly.less' }
......@@ -954,7 +947,7 @@ suite('LESS-tokenization', () => {
tokens: [
{ startIndex:0, type: lessTokenTypes.TOKEN_SELECTOR_TAG + '.less' },
{ startIndex:4, type: '' },
{ startIndex:5, type: 'punctuation.curly.less', bracket: Modes.Bracket.Open }
{ startIndex:5, type: 'punctuation.curly.less' }
]}, {
line: ' margin: 0;',
tokens: [
......@@ -1016,7 +1009,7 @@ suite('LESS-tokenization', () => {
line: ' }',
tokens: [
{ startIndex:0, type: '' },
{ startIndex:2, type: 'punctuation.curly.less', bracket: Modes.Bracket.Close }
{ startIndex:2, type: 'punctuation.curly.less' }
]}],
// CSS units and numbers
......@@ -1056,7 +1049,7 @@ suite('LESS-tokenization', () => {
{ startIndex:14, type: '' },
{ startIndex:15, type: lessTokenTypes.TOKEN_SELECTOR_TAG + '.less' },
{ startIndex:16, type: '' },
{ startIndex:17, type: 'punctuation.curly.less', bracket: Modes.Bracket.Open }
{ startIndex:17, type: 'punctuation.curly.less' }
]}],
// CSS multi line comment
......@@ -1086,7 +1079,7 @@ suite('LESS-tokenization', () => {
tokens: [
{ startIndex:0, type: lessTokenTypes.TOKEN_SELECTOR + '.id.less' },
{ startIndex:5, type: '' },
{ startIndex:6, type: 'punctuation.curly.less', bracket: Modes.Bracket.Open }
{ startIndex:6, type: 'punctuation.curly.less' }
]}],
// CSS Class rules
......@@ -1097,7 +1090,7 @@ suite('LESS-tokenization', () => {
tokens: [
{ startIndex:0, type: lessTokenTypes.TOKEN_SELECTOR + '.class.less' },
{ startIndex:5, type: '' },
{ startIndex:6, type: 'punctuation.curly.less', bracket: Modes.Bracket.Open }
{ startIndex:6, type: 'punctuation.curly.less' }
]}],
// CSS @import etc
......@@ -1107,11 +1100,11 @@ suite('LESS-tokenization', () => {
tokens: [
{ startIndex:0, type: 'keyword.less' },
{ startIndex:7, type: '' },
{ startIndex:8, type: 'function.less', bracket: Modes.Bracket.Open },
{ startIndex:12, type: 'string.punctuation.less', bracket: Modes.Bracket.Open },
{ startIndex:8, type: 'function.less' },
{ startIndex:12, type: 'string.punctuation.less' },
{ startIndex:13, type: 'string.less' },
{ startIndex:27, type: 'string.punctuation.less', bracket: Modes.Bracket.Close },
{ startIndex:28, type: 'punctuation.parenthesis.less', bracket: Modes.Bracket.Close },
{ startIndex:27, type: 'string.punctuation.less' },
{ startIndex:28, type: 'punctuation.parenthesis.less' },
{ startIndex:29, type: 'punctuation.less' }
]}],
......@@ -1128,13 +1121,13 @@ suite('LESS-tokenization', () => {
{ startIndex:2, type: lessTokenTypes.TOKEN_PROPERTY + '.less' },
{ startIndex:9, type: 'punctuation.less' },
{ startIndex:10, type: '' },
{ startIndex:11, type: 'string.punctuation.less', bracket: Modes.Bracket.Open },
{ startIndex:11, type: 'string.punctuation.less' },
{ startIndex:12, type: 'string.less' }
]}, {
line: 'tent";',
tokens: [
{ startIndex:0, type: 'string.less' },
{ startIndex:4, type: 'string.punctuation.less', bracket: Modes.Bracket.Close },
{ startIndex:4, type: 'string.punctuation.less' },
{ startIndex:5, type: 'punctuation.less' }
]}],
......@@ -1150,8 +1143,7 @@ suite('LESS-tokenization', () => {
{ startIndex:2, type: lessTokenTypes.TOKEN_PROPERTY + '.less' },
{ startIndex:9, type: 'punctuation.less' },
{ startIndex:10, type: '' },
{ startIndex:11, type: 'string.punctuation.less', bracket: Modes.Bracket.Open },
{ startIndex:12, type: 'string.punctuation.less', bracket: Modes.Bracket.Close },
{ startIndex:11, type: 'string.punctuation.less' },
{ startIndex:13, type: 'punctuation.less' }
]}],
......@@ -1165,8 +1157,7 @@ suite('LESS-tokenization', () => {
{ startIndex:2, type: lessTokenTypes.TOKEN_PROPERTY + '.less' },
{ startIndex:10, type: 'punctuation.less' },
{ startIndex:11, type: '' },
{ startIndex:12, type: 'string.punctuation.less', bracket: Modes.Bracket.Open },
{ startIndex:13, type: 'string.punctuation.less', bracket: Modes.Bracket.Close },
{ startIndex:12, type: 'string.punctuation.less' },
{ startIndex:14, type: 'punctuation.less' }
]}],
......@@ -1179,7 +1170,7 @@ suite('LESS-tokenization', () => {
tokens: [
{ startIndex:0, type: 'variable.less' },
{ startIndex:10, type: '' },
{ startIndex:11, type: 'punctuation.curly.less', bracket: Modes.Bracket.Open }
{ startIndex:11, type: 'punctuation.curly.less' }
]}, {
line: ' font-family: "Opificio";',
tokens: [
......@@ -1187,9 +1178,9 @@ suite('LESS-tokenization', () => {
{ startIndex:2, type: lessTokenTypes.TOKEN_PROPERTY + '.less' },
{ startIndex:13, type: 'punctuation.less' },
{ startIndex:14, type: '' },
{ startIndex:15, type: 'string.punctuation.less', bracket: Modes.Bracket.Open },
{ startIndex:15, type: 'string.punctuation.less' },
{ startIndex:16, type: 'string.less' },
{ startIndex:24, type: 'string.punctuation.less', bracket: Modes.Bracket.Close },
{ startIndex:24, type: 'string.punctuation.less' },
{ startIndex:25, type: 'punctuation.less' }
]}],
......@@ -1198,7 +1189,7 @@ suite('LESS-tokenization', () => {
[{
line: '"s\\"tr\\"sadsad',
tokens: [
{ startIndex:0, type: 'string.punctuation.less', bracket: Modes.Bracket.Open },
{ startIndex:0, type: 'string.punctuation.less' },
{ startIndex:1, type: 'string.less' }
]}],
......@@ -1207,19 +1198,16 @@ suite('LESS-tokenization', () => {
line: 'p{}',
tokens: [
{ startIndex:0, type: lessTokenTypes.TOKEN_SELECTOR_TAG + '.less' },
{ startIndex:1, type: 'punctuation.curly.less', bracket: Modes.Bracket.Open },
{ startIndex:2, type: 'punctuation.curly.less', bracket: Modes.Bracket.Close }
{ startIndex:1, type: 'punctuation.curly.less' }
]}],
[{
line: 'p:nth() {}',
tokens: [
{ startIndex:0, type: lessTokenTypes.TOKEN_SELECTOR_TAG + '.less' },
{ startIndex:5, type: 'punctuation.parenthesis.less', bracket: Modes.Bracket.Open },
{ startIndex:6, type: 'punctuation.parenthesis.less', bracket: Modes.Bracket.Close },
{ startIndex:5, type: 'punctuation.parenthesis.less' },
{ startIndex:7, type: '' },
{ startIndex:8, type: 'punctuation.curly.less', bracket: Modes.Bracket.Open },
{ startIndex:9, type: 'punctuation.curly.less', bracket: Modes.Bracket.Close }
{ startIndex:8, type: 'punctuation.curly.less' }
]}],
// EG: import statement - bug #10308
......@@ -1229,19 +1217,19 @@ suite('LESS-tokenization', () => {
tokens: [
{ startIndex:0, type: 'keyword.less' },
{ startIndex:7, type: '' },
{ startIndex:8, type: 'function.less', bracket: Modes.Bracket.Open },
{ startIndex:12, type: 'string.punctuation.less', bracket: Modes.Bracket.Open },
{ startIndex:8, type: 'function.less' },
{ startIndex:12, type: 'string.punctuation.less' },
{ startIndex:13, type: 'string.less' },
{ startIndex:26, type: 'string.punctuation.less', bracket: Modes.Bracket.Close },
{ startIndex:27, type: 'punctuation.parenthesis.less', bracket: Modes.Bracket.Close },
{ startIndex:26, type: 'string.punctuation.less' },
{ startIndex:27, type: 'punctuation.parenthesis.less' },
{ startIndex:28, type: 'punctuation.less' },
{ startIndex:29, type: 'keyword.less' },
{ startIndex:36, type: '' },
{ startIndex:37, type: 'function.less', bracket: Modes.Bracket.Open },
{ startIndex:37, type: 'function.less' },
{ startIndex:41, type: 'string.punctuation.less' },
{ startIndex:42, type: 'string.less' },
{ startIndex:55, type: 'string.punctuation.less' },
{ startIndex:56, type: 'punctuation.parenthesis.less', bracket: Modes.Bracket.Close },
{ startIndex:56, type: 'punctuation.parenthesis.less' },
{ startIndex:57, type: 'punctuation.less' }
]}],
......@@ -1249,10 +1237,7 @@ suite('LESS-tokenization', () => {
[{
line: '""""',
tokens: [
{ startIndex:0, type: 'string.punctuation.less' },
{ startIndex:1, type: 'string.punctuation.less' },
{ startIndex:2, type: 'string.punctuation.less' },
{ startIndex:3, type: 'string.punctuation.less' }
{ startIndex:0, type: 'string.punctuation.less' }
]}],
// EG: CSS @import related coloring bug 9553
......@@ -1261,24 +1246,22 @@ suite('LESS-tokenization', () => {
tokens: [
{ startIndex:0, type: 'keyword.less' },
{ startIndex:7, type: '' },
{ startIndex:8, type: 'function.less', bracket: Modes.Bracket.Open },
{ startIndex:8, type: 'function.less' },
{ startIndex:12, type: 'string.punctuation.less' },
{ startIndex:13, type: 'string.less' },
{ startIndex:26, type: 'string.punctuation.less' },
{ startIndex:27, type: 'punctuation.parenthesis.less', bracket: Modes.Bracket.Close },
{ startIndex:27, type: 'punctuation.parenthesis.less' },
{ startIndex:28, type: 'punctuation.less' }
]}, {
line: '.rule1{}',
tokens: [
{ startIndex:0, type: lessTokenTypes.TOKEN_SELECTOR + '.class.less' },
{ startIndex:6, type: 'punctuation.curly.less', bracket: Modes.Bracket.Open },
{ startIndex:7, type: 'punctuation.curly.less', bracket: Modes.Bracket.Close }
{ startIndex:6, type: 'punctuation.curly.less' }
]}, {
line: '.rule2{}',
tokens: [
{ startIndex:0, type: lessTokenTypes.TOKEN_SELECTOR + '.class.less' },
{ startIndex:6, type: 'punctuation.curly.less', bracket: Modes.Bracket.Open },
{ startIndex:7, type: 'punctuation.curly.less', bracket: Modes.Bracket.Close }
{ startIndex:6, type: 'punctuation.curly.less' }
]}],
// EG: CSS key frame animation syntax
......@@ -1289,7 +1272,7 @@ suite('LESS-tokenization', () => {
{ startIndex:18, type: '' },
{ startIndex:19, type: lessTokenTypes.TOKEN_SELECTOR_TAG + '.less' },
{ startIndex:36, type: '' },
{ startIndex:37, type: 'punctuation.curly.less', bracket: Modes.Bracket.Open }
{ startIndex:37, type: 'punctuation.curly.less' }
]}, {
line: ' from {',
tokens: [
......
......@@ -1185,7 +1185,6 @@ suite('Sass Colorizer', () => {
{ startIndex: 103, type: '' },
{ startIndex: 104, type: 'constant.numeric.sass' },
{ startIndex: 105, type: 'punctuation.parenthesis.sass' },
{ startIndex: 106, type: 'punctuation.parenthesis.sass' },
{ startIndex: 107, type: '' },
{ startIndex: 108, type: 'punctuation.curly.sass' },
{ startIndex: 109, type: '' },
......@@ -1817,7 +1816,6 @@ suite('Sass Colorizer', () => {
{ startIndex: 2, type: sassTokenTypes.TOKEN_PROPERTY + '.sass' },
{ startIndex: 11, type: '' },
{ startIndex: 12, type: 'string.punctuation.sass' },
{ startIndex: 13, type: 'string.punctuation.sass' },
{ startIndex: 14, type: 'punctuation.sass' }
]}]
]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册