diff --git a/.vscode/settings.json b/.vscode/settings.json index e8b571ed..f945f18d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,12 +1,13 @@ // Place your settings in this file to overwrite default and user settings. { - "files.trimTrailingWhitespace": true, "search.exclude": { "**/node_modules": true, "**/release": true, "**/out": true }, + "files.trimTrailingWhitespace": true, + "files.insertFinalNewline": true, "editor.tabSize": 4, "editor.insertSpaces": false, "typescript.tsdk": "./node_modules/typescript/lib" -} \ No newline at end of file +} diff --git a/src/bat.ts b/src/bat.ts index 38c4a022..5961b001 100644 --- a/src/bat.ts +++ b/src/bat.ts @@ -8,14 +8,14 @@ import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import ILanguage = monaco.languages.IMonarchLanguage; -export var conf:IRichLanguageConfiguration = { +export var conf: IRichLanguageConfiguration = { comments: { lineComment: 'REM' }, brackets: [ - ['{','}'], - ['[',']'], - ['(',')'] + ['{', '}'], + ['[', ']'], + ['(', ')'] ], autoClosingPairs: [ { open: '{', close: '}' }, @@ -30,7 +30,7 @@ export var conf:IRichLanguageConfiguration = { ] }; -export var language = { +export var language = { defaultToken: '', ignoreCase: true, tokenPostfix: '.bat', @@ -44,23 +44,23 @@ export var language = { keywords: /call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/, // we include these common regular expressions - symbols: /[=> { [/[;,.]/, 'delimiter'], // strings: - [/"/, 'string', '@string."' ], + [/"/, 'string', '@string."'], [/'/, 'string', '@string.\''], ], string: [ - [/[^\\"'%]+/, { cases: { '@eos': {token:'string', next:'@popall'}, '@default': 'string' }}], + [/[^\\"'%]+/, { + cases: { + '@eos': { token: 'string', next: '@popall' }, + '@default': 'string' + } + }], [/@escapes/, 'string.escape'], [/\\./, 'string.escape.invalid'], [/%[\w ]+%/, 'variable'], [/%%[\w]+(?!\w)/, 'variable'], - [/["']/, { cases: { '$#==$S2' : { token: 'string', next: '@pop' }, - '@default': 'string' }} ], + [/["']/, { + cases: { + '$#==$S2': { token: 'string', next: '@pop' }, + '@default': 'string' + } + }], [/$/, 'string', '@popall'] ], diff --git a/src/coffee.ts b/src/coffee.ts index 0a1c79f7..30eb2925 100644 --- a/src/coffee.ts +++ b/src/coffee.ts @@ -8,16 +8,16 @@ import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import ILanguage = monaco.languages.IMonarchLanguage; -export var conf:IRichLanguageConfiguration = { +export var conf: IRichLanguageConfiguration = { wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, comments: { blockComment: ['###', '###'], lineComment: '#' }, brackets: [ - ['{','}'], - ['[',']'], - ['(',')'] + ['{', '}'], + ['[', ']'], + ['(', ')'] ], autoClosingPairs: [ { open: '{', close: '}' }, @@ -33,22 +33,17 @@ export var conf:IRichLanguageConfiguration = { { open: '"', close: '"' }, { open: '\'', close: '\'' }, ] - // enhancedBrackets: [ - // { open: /for$/ }, { open: /while$/ }, { open: /loop$/ }, { open: /if$/ }, { open: /unless$/ }, - // { open: /else$/ }, { open: /switch$/ }, { open: /try$/ }, { open: /catch$/ }, { open: /finally$/ }, - // { open: /class$/ }, { open: /->$/ } - // ], }; -export var language = { +export var language = { defaultToken: '', ignoreCase: true, tokenPostfix: '.coffee', brackets: [ - { open:'{', close:'}', token:'delimiter.curly'}, - { open:'[', close:']', token:'delimiter.square'}, - { open:'(', close:')', token:'delimiter.parenthesis'} + { open: '{', close: '}', token: 'delimiter.curly' }, + { open: '[', close: ']', token: 'delimiter.square' }, + { open: '(', close: ')', token: 'delimiter.parenthesis' } ], regEx: /\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/, @@ -61,11 +56,11 @@ export var language = { 'if', 'else', 'switch', 'for', 'while', 'do', 'try', 'catch', 'finally', 'class', 'extends', 'super', 'undefined', 'then', 'unless', 'until', 'loop', 'of', 'by', 'when' - ], + ], // we include these common regular expressions - symbols: /[=> { // identifiers and keywords [/\@[a-zA-Z_]\w*/, 'variable.predefined'], - [/[a-zA-Z_]\w*/, { cases: { - 'this': 'variable.predefined', - '@keywords': { token: 'keyword.$0' }, - '@default': '' + [/[a-zA-Z_]\w*/, { + cases: { + 'this': 'variable.predefined', + '@keywords': { token: 'keyword.$0' }, + '@default': '' } }], @@ -105,9 +101,12 @@ export var language = { // delimiters - [/}/, { cases: { - '$S2==interpolatedstring' : { token: 'string', next: '@pop' } - , '@default' : '@brackets' } }], + [/}/, { + cases: { + '$S2==interpolatedstring': { token: 'string', next: '@pop' }, + '@default': '@brackets' + } + }], [/[{}()\[\]]/, '@brackets'], [/@symbols/, 'delimiter'], @@ -123,9 +122,19 @@ export var language = { // strings: [/"""/, 'string', '@herestring."""'], - [/'''/, 'string', '@herestring.\'\'\''], - [/"/, { cases: { '@eos': 'string', '@default': {token:'string', next:'@string."'} }} ], - [/'/, { cases: { '@eos': 'string', '@default': {token:'string', next:'@string.\''} }} ], + [/'''/, 'string', '@herestring.\'\'\''], + [/"/, { + cases: { + '@eos': 'string', + '@default': { token: 'string', next: '@string."' } + } + }], + [/'/, { + cases: { + '@eos': 'string', + '@default': { token: 'string', next: '@string.\'' } + } + }], ], string: [ @@ -134,27 +143,42 @@ export var language = { [/\./, 'string.escape.invalid'], [/\./, 'string.escape.invalid'], - [/#{/, { cases: { '$S2=="': { token: 'string', next: 'root.interpolatedstring' }, '@default': 'string' }}], + [/#{/, { + cases: { + '$S2=="': { token: 'string', next: 'root.interpolatedstring' }, + '@default': 'string' + } + }], - [/["']/, { cases: { '$#==$S2' : { token: 'string', next: '@pop' }, '@default': 'string' }} ], + [/["']/, { + cases: { + '$#==$S2': { token: 'string', next: '@pop' }, + '@default': 'string' + } + }], [/#/, 'string'] ], herestring: [ - [/("""|''')/, { cases: { '$1==$S2': { token: 'string', next: '@pop' }, '@default': 'string' } }], - [/[^#\\'"]+/,'string' ], - [/['"]+/,'string' ], + [/("""|''')/, { + cases: { + '$1==$S2': { token: 'string', next: '@pop' }, + '@default': 'string' + } + }], + [/[^#\\'"]+/, 'string'], + [/['"]+/, 'string'], [/@escapes/, 'string.escape'], [/\./, 'string.escape.invalid'], - [/#{/, { token: 'string.quote', next: 'root.interpolatedstring' } ], + [/#{/, { token: 'string.quote', next: 'root.interpolatedstring' }], [/#/, 'string'] ], comment: [ - [/[^#]+/, 'comment', ], + [/[^#]+/, 'comment',], [/###/, 'comment', '@pop'], - [/#/, 'comment' ], + [/#/, 'comment'], ], hereregexp: [ @@ -165,4 +189,4 @@ export var language = { [/\//, 'regexp'], ], }, -}; \ No newline at end of file +}; diff --git a/src/cpp.ts b/src/cpp.ts index 81689046..8de851c6 100644 --- a/src/cpp.ts +++ b/src/cpp.ts @@ -8,15 +8,15 @@ import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import ILanguage = monaco.languages.IMonarchLanguage; -export var conf:IRichLanguageConfiguration = { +export var conf: IRichLanguageConfiguration = { comments: { lineComment: '//', blockComment: ['/*', '*/'], }, brackets: [ - ['{','}'], - ['[',']'], - ['(',')'] + ['{', '}'], + ['[', ']'], + ['(', ')'] ], autoClosingPairs: [ { open: '[', close: ']' }, @@ -34,7 +34,7 @@ export var conf:IRichLanguageConfiguration = { ] }; -export var language = { +export var language = { defaultToken: '', tokenPostfix: '.cpp', @@ -236,8 +236,8 @@ export var language = { ], // we include these common regular expressions - symbols: /[=> { tokenizer: { root: [ // identifiers and keywords - [/[a-zA-Z_]\w*/, { cases: { '@keywords': {token:'keyword.$0'}, - '@default': 'identifier' } }], + [/[a-zA-Z_]\w*/, { + cases: { + '@keywords': { token: 'keyword.$0' }, + '@default': 'identifier' + } + }], // whitespace { include: '@whitespace' }, @@ -260,8 +264,12 @@ export var language = { // delimiters and operators [/[{}()\[\]]/, '@brackets'], [/[<>](?!@symbols)/, '@brackets'], - [/@symbols/, { cases: { '@operators': 'delimiter', - '@default' : '' } } ], + [/@symbols/, { + cases: { + '@operators': 'delimiter', + '@default': '' + } + }], // numbers [/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/, 'number.float'], @@ -276,39 +284,39 @@ export var language = { [/[;,.]/, 'delimiter'], // strings - [/"([^"\\]|\\.)*$/, 'string.invalid' ], // non-teminated string - [/"/, 'string', '@string' ], + [/"([^"\\]|\\.)*$/, 'string.invalid'], // non-teminated string + [/"/, 'string', '@string'], // characters [/'[^\\']'/, 'string'], - [/(')(@escapes)(')/, ['string','string.escape','string']], + [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], [/'/, 'string.invalid'] ], whitespace: [ [/[ \t\r\n]+/, ''], - [/\/\*\*(?!\/)/, 'comment.doc', '@doccomment' ], - [/\/\*/, 'comment', '@comment' ], - [/\/\/.*$/, 'comment'], + [/\/\*\*(?!\/)/, 'comment.doc', '@doccomment'], + [/\/\*/, 'comment', '@comment'], + [/\/\/.*$/, 'comment'], ], comment: [ - [/[^\/*]+/, 'comment' ], - [/\*\//, 'comment', '@pop' ], - [/[\/*]/, 'comment' ] + [/[^\/*]+/, 'comment'], + [/\*\//, 'comment', '@pop'], + [/[\/*]/, 'comment'] ], //Identical copy of comment above, except for the addition of .doc doccomment: [ - [/[^\/*]+/, 'comment.doc' ], - [/\*\//, 'comment.doc', '@pop' ], - [/[\/*]/, 'comment.doc' ] + [/[^\/*]+/, 'comment.doc'], + [/\*\//, 'comment.doc', '@pop'], + [/[\/*]/, 'comment.doc'] ], string: [ - [/[^\\"]+/, 'string'], + [/[^\\"]+/, 'string'], [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"/, 'string', '@pop' ] + [/\\./, 'string.escape.invalid'], + [/"/, 'string', '@pop'] ], }, -}; \ No newline at end of file +}; diff --git a/src/csharp.ts b/src/csharp.ts index 62252bcc..404d8feb 100644 --- a/src/csharp.ts +++ b/src/csharp.ts @@ -8,16 +8,16 @@ import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import ILanguage = monaco.languages.IMonarchLanguage; -export var conf:IRichLanguageConfiguration = { +export var conf: IRichLanguageConfiguration = { wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, comments: { lineComment: '//', blockComment: ['/*', '*/'], }, brackets: [ - ['{','}'], - ['[',']'], - ['(',')'], + ['{', '}'], + ['[', ']'], + ['(', ')'], ], autoClosingPairs: [ { open: '{', close: '}' }, @@ -36,7 +36,7 @@ export var conf:IRichLanguageConfiguration = { ] }; -export var language = { +export var language = { defaultToken: '', tokenPostfix: '.cs', @@ -61,9 +61,9 @@ export var language = { 'internal', 'private', 'abstract', 'sealed', 'static', 'struct', 'readonly', 'volatile', 'virtual', 'override', 'params', 'get', 'set', 'add', 'remove', 'operator', 'true', 'false', 'implicit', 'explicit', 'interface', 'enum', - 'null', 'async', 'await','fixed','sizeof','stackalloc','unsafe', 'nameof', + 'null', 'async', 'await', 'fixed', 'sizeof', 'stackalloc', 'unsafe', 'nameof', 'when' - ], + ], namespaceFollows: [ 'namespace', 'using', @@ -75,11 +75,11 @@ export var language = { operators: [ '=', '??', '||', '&&', '|', '^', '&', '==', '!=', '<=', '>=', '<<', - '+', '-', '*', '/', '%', '!', '~', '++', '--','+=', + '+', '-', '*', '/', '%', '!', '~', '++', '--', '+=', '-=', '*=', '/=', '%=', '&=', '|=', '^=', '<<=', '>>=', '>>', '=>' ], - symbols: /[=> { root: [ // identifiers and keywords - [/\@?[a-zA-Z_]\w*/, { cases: { - '@namespaceFollows': { token: 'keyword.$0', next: '@namespace' }, - '@keywords': { token: 'keyword.$0', next: '@qualified' }, - '@default': { token: 'identifier', next: '@qualified' } + [/\@?[a-zA-Z_]\w*/, { + cases: { + '@namespaceFollows': { token: 'keyword.$0', next: '@namespace' }, + '@keywords': { token: 'keyword.$0', next: '@qualified' }, + '@default': { token: 'identifier', next: '@qualified' } } }], @@ -100,13 +101,21 @@ export var language = { { include: '@whitespace' }, // delimiters and operators - [/}/, { cases: { - '$S2==interpolatedstring' : { token: 'string.quote', next: '@pop' } - , '$S2==litinterpstring' : { token: 'string.quote', next: '@pop' } - , '@default' : '@brackets' } }], + [/}/, { + cases: { + '$S2==interpolatedstring': { token: 'string.quote', next: '@pop' }, + '$S2==litinterpstring': { token: 'string.quote', next: '@pop' }, + '@default': '@brackets' + } + }], [/[{}()\[\]]/, '@brackets'], [/[<>](?!@symbols)/, '@brackets'], - [/@symbols/, { cases: { '@operators': 'delimiter', '@default' : '' } } ], + [/@symbols/, { + cases: { + '@operators': 'delimiter', + '@default': '' + } + }], // numbers @@ -119,79 +128,81 @@ export var language = { [/[;,.]/, 'delimiter'], // strings - [/"([^"\\]|\\.)*$/, 'string.invalid' ], // non-teminated string - [/"/, { token: 'string.quote', next: '@string' } ], - [/\$\@"/, { token: 'string.quote', next: '@litinterpstring' } ], - [/\@"/, { token: 'string.quote', next: '@litstring' } ], - [/\$"/, { token: 'string.quote', next: '@interpolatedstring' } ], + [/"([^"\\]|\\.)*$/, 'string.invalid'], // non-teminated string + [/"/, { token: 'string.quote', next: '@string' }], + [/\$\@"/, { token: 'string.quote', next: '@litinterpstring' }], + [/\@"/, { token: 'string.quote', next: '@litstring' }], + [/\$"/, { token: 'string.quote', next: '@interpolatedstring' }], // characters [/'[^\\']'/, 'string'], - [/(')(@escapes)(')/, ['string','string.escape','string']], + [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], [/'/, 'string.invalid'] ], qualified: [ - [/[a-zA-Z_][\w]*/, { cases: - { '@keywords': {token:'keyword.$0'}, - '@default': 'identifier' } + [/[a-zA-Z_][\w]*/, { + cases: { + '@keywords': { token: 'keyword.$0' }, + '@default': 'identifier' + } }], [/\./, 'delimiter'], - ['','','@pop'], + ['', '', '@pop'], ], namespace: [ { include: '@whitespace' }, [/[A-Z]\w*/, 'namespace'], [/[\.=]/, 'delimiter'], - ['','','@pop'], + ['', '', '@pop'], ], comment: [ - [/[^\/*]+/, 'comment' ], + [/[^\/*]+/, 'comment'], // [/\/\*/, 'comment', '@push' ], // no nested comments :-( - ['\\*/', 'comment', '@pop' ], - [/[\/*]/, 'comment' ] + ['\\*/', 'comment', '@pop'], + [/[\/*]/, 'comment'] ], string: [ - [/[^\\"]+/, 'string'], + [/[^\\"]+/, 'string'], [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"/, { token: 'string.quote', next: '@pop' } ] + [/\\./, 'string.escape.invalid'], + [/"/, { token: 'string.quote', next: '@pop' }] ], litstring: [ - [/[^"]+/, 'string'], - [/""/, 'string.escape'], - [/"/, { token: 'string.quote', next: '@pop' } ] + [/[^"]+/, 'string'], + [/""/, 'string.escape'], + [/"/, { token: 'string.quote', next: '@pop' }] ], litinterpstring: [ - [/[^"{]+/, 'string'], - [/""/, 'string.escape'], - [/{{/, 'string.escape'], - [/}}/, 'string.escape'], - [/{/, { token: 'string.quote', next: 'root.litinterpstring' } ], - [/"/, { token: 'string.quote', next: '@pop' } ] + [/[^"{]+/, 'string'], + [/""/, 'string.escape'], + [/{{/, 'string.escape'], + [/}}/, 'string.escape'], + [/{/, { token: 'string.quote', next: 'root.litinterpstring' }], + [/"/, { token: 'string.quote', next: '@pop' }] ], interpolatedstring: [ [/[^\\"{]+/, 'string'], [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/{{/, 'string.escape'], - [/}}/, 'string.escape'], - [/{/, { token: 'string.quote', next: 'root.interpolatedstring' } ], - [/"/, { token: 'string.quote', next: '@pop' } ] + [/\\./, 'string.escape.invalid'], + [/{{/, 'string.escape'], + [/}}/, 'string.escape'], + [/{/, { token: 'string.quote', next: 'root.interpolatedstring' }], + [/"/, { token: 'string.quote', next: '@pop' }] ], whitespace: [ - [/^[ \t\v\f]*#((r)|(load))(?=\s)/, 'directive.csx' ], - [/^[ \t\v\f]*#\w.*$/, 'namespace.cpp' ], + [/^[ \t\v\f]*#((r)|(load))(?=\s)/, 'directive.csx'], + [/^[ \t\v\f]*#\w.*$/, 'namespace.cpp'], [/[ \t\v\f\r\n]+/, ''], - [/\/\*/, 'comment', '@comment' ], - [/\/\/.*$/, 'comment'], + [/\/\*/, 'comment', '@comment'], + [/\/\/.*$/, 'comment'], ], }, }; diff --git a/src/css.ts b/src/css.ts index bd140cc1..f3365636 100644 --- a/src/css.ts +++ b/src/css.ts @@ -8,7 +8,7 @@ import LanguageConfiguration = monaco.languages.LanguageConfiguration; import IMonarchLanguage = monaco.languages.IMonarchLanguage; -export var conf:LanguageConfiguration = { +export var conf: LanguageConfiguration = { wordPattern: /(#?-?\d*\.\d\w*%?)|((::|[@#.!:])?[\w-?]+%?)|::|[@#.!:]/g, comments: { @@ -44,7 +44,7 @@ const TOKEN_PROPERTY = 'attribute.name'; const TOKEN_VALUE = 'attribute.value'; const TOKEN_AT_KEYWORD = 'keyword'; -export var language = { +export var language = { defaultToken: '', tokenPostfix: '.css', @@ -70,8 +70,8 @@ export var language = { ['[@](keyframes|-webkit-keyframes|-moz-keyframes|-o-keyframes)', { token: TOKEN_AT_KEYWORD, next: '@keyframedeclaration' }], ['[@](page|content|font-face|-moz-document)', { token: TOKEN_AT_KEYWORD }], ['[@](charset|namespace)', { token: TOKEN_AT_KEYWORD, next: '@declarationbody' }], - ['(url-prefix)(\\()', ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }] ], - ['(url)(\\()', ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }] ], + ['(url-prefix)(\\()', ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }]], + ['(url)(\\()', ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }]], { include: '@selectorname' }, ['[\\*]', TOKEN_SELECTOR_TAG], // selector symbols ['[>\\+,]', 'delimiter'], // selector operators @@ -96,8 +96,8 @@ export var language = { term: [ { include: '@comments' }, - ['(url-prefix)(\\()', ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }] ], - ['(url)(\\()', ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }] ], + ['(url-prefix)(\\()', ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }]], + ['(url)(\\()', ['attribute.value', { token: 'delimiter.parenthesis', next: '@urldeclaration' }]], { include: '@functioninvocation' }, { include: '@numbers' }, { include: '@name' }, @@ -204,4 +204,4 @@ export var language = { ['.', 'string'] ] } -}; \ No newline at end of file +}; diff --git a/src/dockerfile.ts b/src/dockerfile.ts index 5edfc81f..c94a77c7 100644 --- a/src/dockerfile.ts +++ b/src/dockerfile.ts @@ -8,11 +8,11 @@ import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import ILanguage = monaco.languages.IMonarchLanguage; -export var conf:IRichLanguageConfiguration = { +export var conf: IRichLanguageConfiguration = { brackets: [ - ['{','}'], - ['[',']'], - ['(',')'] + ['{', '}'], + ['[', ']'], + ['(', ')'] ], autoClosingPairs: [ { open: '{', close: '}' }, @@ -40,68 +40,98 @@ export var language = { variableAfter: /ENV/, - variable:/\${?[\w]+}?/, + variable: /\${?[\w]+}?/, tokenizer: { - root: [ + root: [ { include: '@whitespace' }, { include: '@comment' }, [/(@instructionAfter)(\s+)/, ['keyword', { token: '', next: '@instructions' }]], ['', 'keyword', '@instructions'] - ], + ], - instructions: [ - [/(@variableAfter)(\s+)([\w]+)/, ['keyword', '',{token:'variable', next:'@arguments'}]], + instructions: [ + [/(@variableAfter)(\s+)([\w]+)/, ['keyword', '', { token: 'variable', next: '@arguments' }]], [/(@instructions)/, 'keyword', '@arguments'] - ], + ], - arguments: [ + arguments: [ { include: '@whitespace' }, { include: '@strings' }, - [/(@variable)/, { cases: { '@eos': {token:'variable', next:'@popall'}, '@default': 'variable' }} ], - [/\\/, { cases: { '@eos': '', '@default': '' }}], - [/./, { cases: { '@eos': {token:'', next:'@popall'}, '@default': '' } }], - ], + [/(@variable)/, { + cases: { + '@eos': { token: 'variable', next: '@popall' }, + '@default': 'variable' + } + }], + [/\\/, { + cases: { + '@eos': '', + '@default': '' + } + }], + [/./, { + cases: { + '@eos': { token: '', next: '@popall' }, + '@default': '' + } + }], + ], - // Deal with white space, including comments - whitespace: [ - [/\s+/, { cases: { '@eos': {token:'', next:'@popall'}, '@default': '' }}], - ], + // Deal with white space, including comments + whitespace: [ + [/\s+/, { + cases: { + '@eos': { token: '', next: '@popall' }, + '@default': '' + } + }], + ], - comment: [ - [/(^#.*$)/, 'comment', '@popall'] - ], + comment: [ + [/(^#.*$)/, 'comment', '@popall'] + ], - // Recognize strings, including those broken across lines with \ (but not without) - strings: [ - [/'$/, 'string', '@popall'], - [/'/, 'string', '@stringBody'], - [/"$/, 'string', '@popall'], - [/"/, 'string', '@dblStringBody'] - ], - stringBody: [ - [/[^\\\$']/, { cases: { '@eos': {token:'string', next:'@popall'}, '@default': 'string' }}], + // Recognize strings, including those broken across lines with \ (but not without) + strings: [ + [/'$/, 'string', '@popall'], + [/'/, 'string', '@stringBody'], + [/"$/, 'string', '@popall'], + [/"/, 'string', '@dblStringBody'] + ], + stringBody: [ + [/[^\\\$']/, { + cases: { + '@eos': { token: 'string', next: '@popall' }, + '@default': 'string' + } + }], - [/\\./, 'string.escape'], - [/'$/, 'string', '@popall'], - [/'/, 'string', '@pop'], - [/(@variable)/, 'variable' ], + [/\\./, 'string.escape'], + [/'$/, 'string', '@popall'], + [/'/, 'string', '@pop'], + [/(@variable)/, 'variable'], - [/\\$/, 'string'], - [/$/, 'string', '@popall'] - ], - dblStringBody: [ - [/[^\\\$"]/, { cases: { '@eos': {token:'string', next:'@popall'}, '@default': 'string' }}], + [/\\$/, 'string'], + [/$/, 'string', '@popall'] + ], + dblStringBody: [ + [/[^\\\$"]/, { + cases: { + '@eos': { token: 'string', next: '@popall' }, + '@default': 'string' + } + }], - [/\\./, 'string.escape'], - [/"$/, 'string', '@popall'], - [/"/, 'string', '@pop'], - [/(@variable)/, 'variable' ], + [/\\./, 'string.escape'], + [/"$/, 'string', '@popall'], + [/"/, 'string', '@pop'], + [/(@variable)/, 'variable'], - [/\\$/, 'string'], - [/$/, 'string', '@popall'] - ] + [/\\$/, 'string'], + [/$/, 'string', '@popall'] + ] } -}; \ No newline at end of file +}; diff --git a/src/fsharp.ts b/src/fsharp.ts index c61d19a0..2114c4d3 100644 --- a/src/fsharp.ts +++ b/src/fsharp.ts @@ -8,15 +8,15 @@ import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import ILanguage = monaco.languages.IMonarchLanguage; -export var conf:IRichLanguageConfiguration = { +export var conf: IRichLanguageConfiguration = { comments: { lineComment: '//', blockComment: ['(*', '*)'], }, brackets: [ - ['{','}'], - ['[',']'], - ['(',')'] + ['{', '}'], + ['[', ']'], + ['(', ')'] ], autoClosingPairs: [ { open: '{', close: '}' }, @@ -33,7 +33,7 @@ export var conf:IRichLanguageConfiguration = { ] }; -export var language = { +export var language = { defaultToken: '', tokenPostfix: '.fs', @@ -43,15 +43,15 @@ export var language = { 'break', 'checked', 'component', 'const', 'constraint', 'constructor', 'continue', 'class', 'default', - 'delegate','do', 'done', 'downcast', + 'delegate', 'do', 'done', 'downcast', 'downto', 'elif', 'else', 'end', 'exception', 'eager', 'event', 'external', - 'extern', 'false', 'finally', 'for', - 'fun', 'function', 'fixed', 'functor', + 'extern', 'false', 'finally', 'for', + 'fun', 'function', 'fixed', 'functor', 'global', 'if', 'in', 'include', 'inherit', 'inline', 'interface', 'internal', 'land', - 'lor', 'lsl','lsr', 'lxor', 'lazy', 'let', - 'match', 'member','mod','module', 'mutable', + 'lor', 'lsl', 'lsr', 'lxor', 'lazy', 'let', + 'match', 'member', 'mod', 'module', 'mutable', 'namespace', 'method', 'mixin', 'new', 'not', 'null', 'of', 'open', 'or', 'object', 'override', 'private', 'parallel', 'process', @@ -60,12 +60,12 @@ export var language = { 'to', 'true', 'tailcall', 'trait', 'try', 'type', 'upcast', 'use', 'val', 'void', 'virtual', 'volatile', - 'when', 'while','with', 'yield' + 'when', 'while', 'with', 'yield' ], // we include these common regular expressions - symbols: /[=> { tokenizer: { root: [ // identifiers and keywords - [/[a-zA-Z_]\w*/, { cases: { '@keywords': {token:'keyword.$0'}, - '@default': 'identifier' } }], + [/[a-zA-Z_]\w*/, { + cases: { + '@keywords': { token: 'keyword.$0' }, + '@default': 'identifier' + } + }], // whitespace { include: '@whitespace' }, @@ -88,7 +92,7 @@ export var language = { // delimiters and operators [/[{}()\[\]]/, '@brackets'], [/[<>](?!@symbols)/, '@brackets'], - [/@symbols/, 'delimiter' ], + [/@symbols/, 'delimiter'], // numbers [/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/, 'number.float'], @@ -102,43 +106,47 @@ export var language = { [/[;,.]/, 'delimiter'], // strings - [/"([^"\\]|\\.)*$/, 'string.invalid' ], // non-teminated string + [/"([^"\\]|\\.)*$/, 'string.invalid'], // non-teminated string [/"""/, 'string', '@string."""'], - [/"/, 'string', '@string."' ], + [/"/, 'string', '@string."'], // literal string [/\@"/, { token: 'string.quote', next: '@litstring' }], // characters [/'[^\\']'B?/, 'string'], - [/(')(@escapes)(')/, ['string','string.escape','string']], + [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], [/'/, 'string.invalid'] ], whitespace: [ [/[ \t\r\n]+/, ''], - [/\(\*/, 'comment', '@comment' ], - [/\/\/.*$/, 'comment'], + [/\(\*/, 'comment', '@comment'], + [/\/\/.*$/, 'comment'], ], comment: [ - [/[^\*]+/, 'comment' ], - [/\*\)/, 'comment', '@pop' ], - [/\*/, 'comment' ] + [/[^\*]+/, 'comment'], + [/\*\)/, 'comment', '@pop'], + [/\*/, 'comment'] ], string: [ [/[^\\"]+/, 'string'], [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/("""|"B?)/, { cases: { '$#==$S2' : { token: 'string', next: '@pop' }, - '@default': 'string' }} ] + [/\\./, 'string.escape.invalid'], + [/("""|"B?)/, { + cases: { + '$#==$S2': { token: 'string', next: '@pop' }, + '@default': 'string' + } + }] ], litstring: [ - [/[^"]+/, 'string'], - [/""/, 'string.escape'], - [/"/, { token: 'string.quote', next: '@pop' } ] + [/[^"]+/, 'string'], + [/""/, 'string.escape'], + [/"/, { token: 'string.quote', next: '@pop' }] ], }, -}; \ No newline at end of file +}; diff --git a/src/go.ts b/src/go.ts index b651690d..50385a36 100644 --- a/src/go.ts +++ b/src/go.ts @@ -8,15 +8,15 @@ import IRichLanguageConfiguration = monaco.languages.LanguageConfiguration; import ILanguage = monaco.languages.IMonarchLanguage; -export var conf:IRichLanguageConfiguration = { +export var conf: IRichLanguageConfiguration = { comments: { lineComment: '//', blockComment: ['/*', '*/'], }, brackets: [ - ['{','}'], - ['[',']'], - ['(',')'] + ['{', '}'], + ['[', ']'], + ['(', ')'] ], autoClosingPairs: [ { open: '{', close: '}' }, @@ -36,7 +36,7 @@ export var conf:IRichLanguageConfiguration = { ] }; -export var language = { +export var language = { defaultToken: '', tokenPostfix: '.go', @@ -99,16 +99,20 @@ export var language = { ], // we include these common regular expressions - symbols: /[=> { // delimiters and operators [/[{}()\[\]]/, '@brackets'], [/[<>](?!@symbols)/, '@brackets'], - [/@symbols/, { cases: { '@operators': 'delimiter', - '@default' : '' } } ], + [/@symbols/, { + cases: { + '@operators': 'delimiter', + '@default': '' + } + }], // numbers [/\d*\d+[eE]([\-+]?\d+)?/, 'number.float'], @@ -138,44 +146,44 @@ export var language = { [/[;,.]/, 'delimiter'], // strings - [/"([^"\\]|\\.)*$/, 'string.invalid' ], // non-teminated string - [/"/, 'string', '@string' ], + [/"([^"\\]|\\.)*$/, 'string.invalid'], // non-teminated string + [/"/, 'string', '@string'], [/`/, "string", "@rawstring"], // characters [/'[^\\']'/, 'string'], - [/(')(@escapes)(')/, ['string','string.escape','string']], + [/(')(@escapes)(')/, ['string', 'string.escape', 'string']], [/'/, 'string.invalid'] ], whitespace: [ [/[ \t\r\n]+/, ''], - [/\/\*\*(?!\/)/, 'comment.doc', '@doccomment' ], - [/\/\*/, 'comment', '@comment' ], - [/\/\/.*$/, 'comment'], + [/\/\*\*(?!\/)/, 'comment.doc', '@doccomment'], + [/\/\*/, 'comment', '@comment'], + [/\/\/.*$/, 'comment'], ], comment: [ - [/[^\/*]+/, 'comment' ], + [/[^\/*]+/, 'comment'], // [/\/\*/, 'comment', '@push' ], // nested comment not allowed :-( // [/\/\*/, 'comment.invalid' ], // this breaks block comments in the shape of /* //*/ - [/\*\//, 'comment', '@pop' ], - [/[\/*]/, 'comment' ] + [/\*\//, 'comment', '@pop'], + [/[\/*]/, 'comment'] ], //Identical copy of comment above, except for the addition of .doc doccomment: [ - [/[^\/*]+/, 'comment.doc' ], + [/[^\/*]+/, 'comment.doc'], // [/\/\*/, 'comment.doc', '@push' ], // nested comment not allowed :-( - [/\/\*/, 'comment.doc.invalid' ], - [/\*\//, 'comment.doc', '@pop' ], - [/[\/*]/, 'comment.doc' ] + [/\/\*/, 'comment.doc.invalid'], + [/\*\//, 'comment.doc', '@pop'], + [/[\/*]/, 'comment.doc'] ], string: [ - [/[^\\"]+/, 'string'], + [/[^\\"]+/, 'string'], [/@escapes/, 'string.escape'], - [/\\./, 'string.escape.invalid'], - [/"/, 'string', '@pop' ] + [/\\./, 'string.escape.invalid'], + [/"/, 'string', '@pop'] ], rawstring: [ @@ -183,4 +191,4 @@ export var language = { [/`/, "string", "@pop"] ], }, -}; \ No newline at end of file +}; diff --git a/src/handlebars.ts b/src/handlebars.ts index a568c25a..f0b4a80c 100644 --- a/src/handlebars.ts +++ b/src/handlebars.ts @@ -11,9 +11,9 @@ import ILanguage = monaco.languages.IMonarchLanguage; // Allow for running under nodejs/requirejs in tests var _monaco: typeof monaco = (typeof monaco === 'undefined' ? (self).monaco : monaco); -const EMPTY_ELEMENTS:string[] = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr']; +const EMPTY_ELEMENTS: string[] = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'menuitem', 'meta', 'param', 'source', 'track', 'wbr']; -export var conf:IRichLanguageConfiguration = { +export var conf: IRichLanguageConfiguration = { wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g, comments: { @@ -65,7 +65,7 @@ export const htmlTokenTypes = { } }; -export var language = { +export var language = { defaultToken: '', tokenPostfix: '', // ignoreCase: true, @@ -77,9 +77,9 @@ export var language = { [/)/, [htmlTokenTypes.DELIM_START, 'tag.html', htmlTokenTypes.DELIM_END]], - [/(<)(script)/, [htmlTokenTypes.DELIM_START, { token: 'tag.html', next: '@script'} ]], - [/(<)(style)/, [htmlTokenTypes.DELIM_START, { token: 'tag.html', next: '@style'} ]], - [/(<)([:\w]+)/, [htmlTokenTypes.DELIM_START, { token: 'tag.html', next: '@otherTag'} ]], + [/(<)(script)/, [htmlTokenTypes.DELIM_START, { token: 'tag.html', next: '@script' }]], + [/(<)(style)/, [htmlTokenTypes.DELIM_START, { token: 'tag.html', next: '@style' }]], + [/(<)([:\w]+)/, [htmlTokenTypes.DELIM_START, { token: 'tag.html', next: '@otherTag' }]], [/(<\/)(\w+)/, [htmlTokenTypes.DELIM_START, { token: 'tag.html', next: '@otherTag' }]], [/ { doctype: [ [/\{\{/, { token: '@rematch', switchTo: '@handlebarsInSimpleState.comment' }], - [/[^>]+/, 'metatag.content.html' ], - [/>/, 'metatag.html', '@pop' ], + [/[^>]+/, 'metatag.content.html'], + [/>/, 'metatag.html', '@pop'], ], comment: [ @@ -119,15 +119,15 @@ export var language = { [/'([^']*)'/, 'attribute.value'], [/[\w\-]+/, 'attribute.name'], [/=/, 'delimiter'], - [/>/, { token: htmlTokenTypes.DELIM_END, next: '@scriptEmbedded.text/javascript', nextEmbedded: 'text/javascript'} ], + [/>/, { token: htmlTokenTypes.DELIM_END, next: '@scriptEmbedded.text/javascript', nextEmbedded: 'text/javascript' }], [/[ \t\r\n]+/], // whitespace - [/(<\/)(script\s*)(>)/, [ htmlTokenTypes.DELIM_START, 'tag.html', { token: htmlTokenTypes.DELIM_END, next: '@pop' } ]] + [/(<\/)(script\s*)(>)/, [htmlTokenTypes.DELIM_START, 'tag.html', { token: htmlTokenTypes.DELIM_END, next: '@pop' }]] ], // After "', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 2, type: 'keyword.var.jade' }, - { startIndex: 5, type: '' }, - { startIndex: 11, type: 'delimiter.jade' }, - { startIndex: 12, type: '' }, - { startIndex: 13, type: 'string.jade' } - ]}], + line: '- var html = ""', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 2, type: 'keyword.var.jade' }, + { startIndex: 5, type: '' }, + { startIndex: 11, type: 'delimiter.jade' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'string.jade' } + ] + }], // Generated from sample [{ - line: 'doctype 5', - tokens: [ - { startIndex: 0, type: 'keyword.doctype.jade' }, - { startIndex: 7, type: '' }, - { startIndex: 8, type: 'number.jade' } - ]}, { - line: 'html(lang="en")', - tokens: [ - { startIndex: 0, type: 'tag.jade' }, - { 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' } - ]}, { - line: ' head', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 4, type: 'tag.jade' } - ]}, { - line: ' title= pageTitle', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 8, type: 'tag.jade' }, - { startIndex: 13, type: '' } - ]}, { - line: ' script(type=\'text/javascript\')', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 8, type: 'tag.jade' }, - { 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' } - ]}, { - line: ' if (foo) {', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 12, type: 'keyword.if.jade' }, - { startIndex: 14, type: '' }, - { startIndex: 15, type: 'delimiter.parenthesis.jade' }, - { startIndex: 16, type: '' }, - { startIndex: 19, type: 'delimiter.parenthesis.jade' }, - { startIndex: 20, type: '' }, - { startIndex: 21, type: 'delimiter.curly.jade' } - ]}, { - line: ' bar()', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 19, type: 'delimiter.parenthesis.jade' } - ]}, { - line: ' }', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 12, type: 'delimiter.curly.jade' } - ]}, { - line: ' body', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 4, type: 'tag.jade' } - ]}, { - line: ' // Disclaimer: You will need to turn insertSpaces to true in order for the', - tokens: [ - { startIndex: 0, type: 'comment.jade' } - ]}, { - line: ' syntax highlighting to kick in properly (especially for comments)', - tokens: [ - { startIndex: 0, type: 'comment.jade' } - ]}, { - line: ' Enjoy :)', - tokens: [ - { startIndex: 0, type: 'comment.jade' } - ]}, { - line: ' h1 Jade - node template engine if in', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 8, type: 'tag.jade' }, - { startIndex: 10, type: '' } - ]}, { - line: ' p.', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 8, type: 'tag.jade' }, - { startIndex: 9, type: 'delimiter.jade' } - ]}, { - line: ' text ', - tokens: [ - { startIndex: 0, type: '' } - ]}, { - line: ' text', - tokens: [ - { startIndex: 0, type: '' } - ]}, { - line: ' #container', - tokens: [ - { startIndex: 0, type: '' } - ]}, { - line: ' #container', - tokens: [ - { startIndex: 0, type: '' } - ]}, { - line: ' #container', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 8, type: 'tag.id.jade' } - ]}, { - line: ' if youAreUsingJade', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 10, type: 'keyword.if.jade' }, - { startIndex: 12, type: '' } - ]}, { - line: ' p You are amazing', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 12, type: 'tag.jade' }, - { startIndex: 13, type: '' } - ]}, { - line: ' else', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 10, type: 'keyword.else.jade' } - ]}, { - line: ' p Get on it!', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 12, type: 'tag.jade' }, - { startIndex: 13, type: '' } - ]}, { - line: ' p Text can be included in a number of different ways.', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 5, type: 'tag.jade' }, - { startIndex: 6, type: '' } - ]}] + line: 'doctype 5', + tokens: [ + { startIndex: 0, type: 'keyword.doctype.jade' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'number.jade' } + ] + }, { + line: 'html(lang="en")', + tokens: [ + { startIndex: 0, type: 'tag.jade' }, + { 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' } + ] + }, { + line: ' head', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 4, type: 'tag.jade' } + ] + }, { + line: ' title= pageTitle', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 8, type: 'tag.jade' }, + { startIndex: 13, type: '' } + ] + }, { + line: ' script(type=\'text/javascript\')', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 8, type: 'tag.jade' }, + { 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' } + ] + }, { + line: ' if (foo) {', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 12, type: 'keyword.if.jade' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'delimiter.parenthesis.jade' }, + { startIndex: 16, type: '' }, + { startIndex: 19, type: 'delimiter.parenthesis.jade' }, + { startIndex: 20, type: '' }, + { startIndex: 21, type: 'delimiter.curly.jade' } + ] + }, { + line: ' bar()', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 19, type: 'delimiter.parenthesis.jade' } + ] + }, { + line: ' }', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 12, type: 'delimiter.curly.jade' } + ] + }, { + line: ' body', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 4, type: 'tag.jade' } + ] + }, { + line: ' // Disclaimer: You will need to turn insertSpaces to true in order for the', + tokens: [ + { startIndex: 0, type: 'comment.jade' } + ] + }, { + line: ' syntax highlighting to kick in properly (especially for comments)', + tokens: [ + { startIndex: 0, type: 'comment.jade' } + ] + }, { + line: ' Enjoy :)', + tokens: [ + { startIndex: 0, type: 'comment.jade' } + ] + }, { + line: ' h1 Jade - node template engine if in', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 8, type: 'tag.jade' }, + { startIndex: 10, type: '' } + ] + }, { + line: ' p.', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 8, type: 'tag.jade' }, + { startIndex: 9, type: 'delimiter.jade' } + ] + }, { + line: ' text ', + tokens: [ + { startIndex: 0, type: '' } + ] + }, { + line: ' text', + tokens: [ + { startIndex: 0, type: '' } + ] + }, { + line: ' #container', + tokens: [ + { startIndex: 0, type: '' } + ] + }, { + line: ' #container', + tokens: [ + { startIndex: 0, type: '' } + ] + }, { + line: ' #container', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 8, type: 'tag.id.jade' } + ] + }, { + line: ' if youAreUsingJade', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 10, type: 'keyword.if.jade' }, + { startIndex: 12, type: '' } + ] + }, { + line: ' p You are amazing', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 12, type: 'tag.jade' }, + { startIndex: 13, type: '' } + ] + }, { + line: ' else', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 10, type: 'keyword.else.jade' } + ] + }, { + line: ' p Get on it!', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 12, type: 'tag.jade' }, + { startIndex: 13, type: '' } + ] + }, { + line: ' p Text can be included in a number of different ways.', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 5, type: 'tag.jade' }, + { startIndex: 6, type: '' } + ] + }] ]); diff --git a/test/java.test.ts b/test/java.test.ts index 41ad12b5..498571aa 100644 --- a/test/java.test.ts +++ b/test/java.test.ts @@ -5,601 +5,677 @@ 'use strict'; -import {testTokenization} from './testRunner'; +import { testTokenization } from './testRunner'; testTokenization('java', [ // Comments - single line [{ - line: '//', - tokens: [ - { startIndex: 0, type: 'comment.java' } - ]}], + line: '//', + tokens: [ + { startIndex: 0, type: 'comment.java' } + ] + }], [{ - line: ' // a comment', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 4, type: 'comment.java' } - ]}], + line: ' // a comment', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 4, type: 'comment.java' } + ] + }], // Broken nested tokens due to invalid comment tokenization [{ - line: '/* //*/ a', - tokens: [ - { startIndex: 0, type: 'comment.java' }, - { startIndex: 7, type: '' }, - { startIndex: 8, type: 'identifier.java' } - ]}], + line: '/* //*/ a', + tokens: [ + { startIndex: 0, type: 'comment.java' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'identifier.java' } + ] + }], [{ - line: '// a comment', - tokens: [ - { startIndex: 0, type: 'comment.java' } - ]}], + line: '// a comment', + tokens: [ + { startIndex: 0, type: 'comment.java' } + ] + }], [{ - line: '//sticky comment', - tokens: [ - { startIndex: 0, type: 'comment.java' } - ]}], + line: '//sticky comment', + tokens: [ + { startIndex: 0, type: 'comment.java' } + ] + }], [{ - line: '/almost a comment', - tokens: [ - { startIndex: 0, type: 'delimiter.java' }, - { startIndex: 1, type: 'identifier.java' }, - { startIndex: 7, type: '' }, - { startIndex: 8, type: 'identifier.java' }, - { startIndex: 9, type: '' }, - { startIndex: 10, type: 'identifier.java' } - ]}], + line: '/almost a comment', + tokens: [ + { startIndex: 0, type: 'delimiter.java' }, + { startIndex: 1, type: 'identifier.java' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'identifier.java' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'identifier.java' } + ] + }], [{ - line: '1 / 2; /* comment', - tokens: [ - { startIndex: 0, type: 'number.java' }, - { startIndex: 1, type: '' }, - { startIndex: 2, type: 'delimiter.java' }, - { startIndex: 3, type: '' }, - { startIndex: 4, type: 'number.java' }, - { startIndex: 5, type: 'delimiter.java' }, - { startIndex: 6, type: '' }, - { startIndex: 7, type: 'comment.java' } - ]}], + line: '1 / 2; /* comment', + tokens: [ + { startIndex: 0, type: 'number.java' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.java' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'number.java' }, + { startIndex: 5, type: 'delimiter.java' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'comment.java' } + ] + }], [{ - line: 'int x = 1; // my comment // is a nice one', - tokens: [ - { startIndex: 0, type: 'keyword.int.java' }, - { startIndex: 3, type: '' }, - { startIndex: 4, type: 'identifier.java' }, - { startIndex: 5, type: '' }, - { startIndex: 6, type: 'delimiter.java' }, - { startIndex: 7, type: '' }, - { startIndex: 8, type: 'number.java' }, - { startIndex: 9, type: 'delimiter.java' }, - { startIndex: 10, type: '' }, - { startIndex: 11, type: 'comment.java' } - ]}], + line: 'int x = 1; // my comment // is a nice one', + tokens: [ + { startIndex: 0, type: 'keyword.int.java' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.java' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.java' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'number.java' }, + { startIndex: 9, type: 'delimiter.java' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'comment.java' } + ] + }], // Comments - range comment, single line [{ - line: '/* a simple comment */', - tokens: [ - { startIndex: 0, type: 'comment.java' } - ]}], + line: '/* a simple comment */', + tokens: [ + { startIndex: 0, type: 'comment.java' } + ] + }], [{ - line: 'int x = /* a simple comment */ 1;', - tokens: [ - { startIndex: 0, type: 'keyword.int.java' }, - { startIndex: 3, type: '' }, - { startIndex: 4, type: 'identifier.java' }, - { startIndex: 5, type: '' }, - { startIndex: 6, type: 'delimiter.java' }, - { startIndex: 7, type: '' }, - { startIndex: 8, type: 'comment.java' }, - { startIndex: 30, type: '' }, - { startIndex: 31, type: 'number.java' }, - { startIndex: 32, type: 'delimiter.java' } - ]}], + line: 'int x = /* a simple comment */ 1;', + tokens: [ + { startIndex: 0, type: 'keyword.int.java' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.java' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.java' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'comment.java' }, + { startIndex: 30, type: '' }, + { startIndex: 31, type: 'number.java' }, + { startIndex: 32, type: 'delimiter.java' } + ] + }], [{ - line: 'int x = /* comment */ 1; */', - tokens: [ - { startIndex: 0, type: 'keyword.int.java' }, - { startIndex: 3, type: '' }, - { startIndex: 4, type: 'identifier.java' }, - { startIndex: 5, type: '' }, - { startIndex: 6, type: 'delimiter.java' }, - { startIndex: 7, type: '' }, - { startIndex: 8, type: 'comment.java' }, - { startIndex: 21, type: '' }, - { startIndex: 22, type: 'number.java' }, - { startIndex: 23, type: 'delimiter.java' }, - { startIndex: 24, type: '' } - ]}], + line: 'int x = /* comment */ 1; */', + tokens: [ + { startIndex: 0, type: 'keyword.int.java' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.java' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.java' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'comment.java' }, + { startIndex: 21, type: '' }, + { startIndex: 22, type: 'number.java' }, + { startIndex: 23, type: 'delimiter.java' }, + { startIndex: 24, type: '' } + ] + }], [{ - line: 'x = /**/;', - tokens: [ - { startIndex: 0, type: 'identifier.java' }, - { startIndex: 1, type: '' }, - { startIndex: 2, type: 'delimiter.java' }, - { startIndex: 3, type: '' }, - { startIndex: 4, type: 'comment.java' }, - { startIndex: 8, type: 'delimiter.java' } - ]}], + line: 'x = /**/;', + tokens: [ + { startIndex: 0, type: 'identifier.java' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.java' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'comment.java' }, + { startIndex: 8, type: 'delimiter.java' } + ] + }], [{ - line: 'x = /*/;', - tokens: [ - { startIndex: 0, type: 'identifier.java' }, - { startIndex: 1, type: '' }, - { startIndex: 2, type: 'delimiter.java' }, - { startIndex: 3, type: '' }, - { startIndex: 4, type: 'comment.java' } - ]}], + line: 'x = /*/;', + tokens: [ + { startIndex: 0, type: 'identifier.java' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.java' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'comment.java' } + ] + }], // Comments - range comment, multiple lines [{ - line: '/* start of multiline comment', - tokens: [ - { startIndex: 0, type: 'comment.java' } - ]}, { - line: 'a comment between without a star', - tokens: [ - { startIndex: 0, type: 'comment.java' } - ]}, { - line: 'end of multiline comment*/', - tokens: [ - { startIndex: 0, type: 'comment.java' } - ]}], + line: '/* start of multiline comment', + tokens: [ + { startIndex: 0, type: 'comment.java' } + ] + }, { + line: 'a comment between without a star', + tokens: [ + { startIndex: 0, type: 'comment.java' } + ] + }, { + line: 'end of multiline comment*/', + tokens: [ + { startIndex: 0, type: 'comment.java' } + ] + }], [{ - line: 'int x = /* start a comment', - tokens: [ - { startIndex: 0, type: 'keyword.int.java' }, - { startIndex: 3, type: '' }, - { startIndex: 4, type: 'identifier.java' }, - { startIndex: 5, type: '' }, - { startIndex: 6, type: 'delimiter.java' }, - { startIndex: 7, type: '' }, - { startIndex: 8, type: 'comment.java' } - ]}, { - line: ' a ', - tokens: [ - { startIndex: 0, type: 'comment.java' } - ]}, { - line: 'and end it */ 2;', - tokens: [ - { startIndex: 0, type: 'comment.java' }, - { startIndex: 13, type: '' }, - { startIndex: 14, type: 'number.java' }, - { startIndex: 15, type: 'delimiter.java' } - ]}], + line: 'int x = /* start a comment', + tokens: [ + { startIndex: 0, type: 'keyword.int.java' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'identifier.java' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.java' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'comment.java' } + ] + }, { + line: ' a ', + tokens: [ + { startIndex: 0, type: 'comment.java' } + ] + }, { + line: 'and end it */ 2;', + tokens: [ + { startIndex: 0, type: 'comment.java' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'number.java' }, + { startIndex: 15, type: 'delimiter.java' } + ] + }], // Java Doc, multiple lines [{ - line: '/** start of Java Doc', - tokens: [ - { startIndex: 0, type: 'comment.doc.java' } - ]}, { - line: 'a comment between without a star', - tokens: [ - { startIndex: 0, type: 'comment.doc.java' } - ]}, { - line: 'end of multiline comment*/', - tokens: [ - { startIndex: 0, type: 'comment.doc.java' } - ]}], + line: '/** start of Java Doc', + tokens: [ + { startIndex: 0, type: 'comment.doc.java' } + ] + }, { + line: 'a comment between without a star', + tokens: [ + { startIndex: 0, type: 'comment.doc.java' } + ] + }, { + line: 'end of multiline comment*/', + tokens: [ + { startIndex: 0, type: 'comment.doc.java' } + ] + }], // Keywords [{ - line: 'package test; class Program { static void main(String[] args) {} } }', - tokens: [ - { startIndex: 0, type: 'keyword.package.java' }, - { startIndex: 7, type: '' }, - { startIndex: 8, type: 'identifier.java' }, - { startIndex: 12, type: 'delimiter.java' }, - { startIndex: 13, type: '' }, - { startIndex: 14, type: 'keyword.class.java' }, - { startIndex: 19, type: '' }, - { startIndex: 20, type: 'identifier.java' }, - { startIndex: 27, type: '' }, - { startIndex: 28, type: 'delimiter.curly.java' }, - { startIndex: 29, type: '' }, - { startIndex: 30, type: 'keyword.static.java' }, - { startIndex: 36, type: '' }, - { startIndex: 37, type: 'keyword.void.java' }, - { startIndex: 41, type: '' }, - { startIndex: 42, type: 'identifier.java' }, - { startIndex: 46, type: 'delimiter.parenthesis.java' }, - { startIndex: 47, type: 'identifier.java' }, - { startIndex: 53, 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' }, - { startIndex: 64, type: '' }, - { startIndex: 65, type: 'delimiter.curly.java' }, - { startIndex: 66, type: '' }, - { startIndex: 67, type: 'delimiter.curly.java' } - ]}], + line: 'package test; class Program { static void main(String[] args) {} } }', + tokens: [ + { startIndex: 0, type: 'keyword.package.java' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'identifier.java' }, + { startIndex: 12, type: 'delimiter.java' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'keyword.class.java' }, + { startIndex: 19, type: '' }, + { startIndex: 20, type: 'identifier.java' }, + { startIndex: 27, type: '' }, + { startIndex: 28, type: 'delimiter.curly.java' }, + { startIndex: 29, type: '' }, + { startIndex: 30, type: 'keyword.static.java' }, + { startIndex: 36, type: '' }, + { startIndex: 37, type: 'keyword.void.java' }, + { startIndex: 41, type: '' }, + { startIndex: 42, type: 'identifier.java' }, + { startIndex: 46, type: 'delimiter.parenthesis.java' }, + { startIndex: 47, type: 'identifier.java' }, + { startIndex: 53, 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' }, + { startIndex: 64, type: '' }, + { startIndex: 65, type: 'delimiter.curly.java' }, + { startIndex: 66, type: '' }, + { startIndex: 67, type: 'delimiter.curly.java' } + ] + }], // Numbers [{ - line: '0', - tokens: [ - { startIndex: 0, type: 'number.java' } - ]}], + line: '0', + tokens: [ + { startIndex: 0, type: 'number.java' } + ] + }], [{ - line: '0.10', - tokens: [ - { startIndex: 0, type: 'number.float.java' } - ]}], + line: '0.10', + tokens: [ + { startIndex: 0, type: 'number.float.java' } + ] + }], [{ - line: '0x', - tokens: [ - { startIndex: 0, type: 'number.java' }, - { startIndex: 1, type: 'identifier.java' } - ]}], + line: '0x', + tokens: [ + { startIndex: 0, type: 'number.java' }, + { startIndex: 1, type: 'identifier.java' } + ] + }], [{ - line: '0x123', - tokens: [ - { startIndex: 0, type: 'number.hex.java' } - ]}], + line: '0x123', + tokens: [ + { startIndex: 0, type: 'number.hex.java' } + ] + }], [{ - line: '0x5_2', - tokens: [ - { startIndex: 0, type: 'number.hex.java' } - ]}], + line: '0x5_2', + tokens: [ + { startIndex: 0, type: 'number.hex.java' } + ] + }], [{ - line: '023L', - tokens: [ - { startIndex: 0, type: 'number.octal.java' } - ]}], + line: '023L', + tokens: [ + { startIndex: 0, type: 'number.octal.java' } + ] + }], [{ - line: '0123l', - tokens: [ - { startIndex: 0, type: 'number.octal.java' } - ]}], + line: '0123l', + tokens: [ + { startIndex: 0, type: 'number.octal.java' } + ] + }], [{ - line: '05_2', - tokens: [ - { startIndex: 0, type: 'number.octal.java' } - ]}], + line: '05_2', + tokens: [ + { startIndex: 0, type: 'number.octal.java' } + ] + }], [{ - line: '0b1010_0101', - tokens: [ - { startIndex: 0, type: 'number.binary.java' } - ]}], + line: '0b1010_0101', + tokens: [ + { startIndex: 0, type: 'number.binary.java' } + ] + }], [{ - line: '0B001', - tokens: [ - { startIndex: 0, type: 'number.binary.java' } - ]}], + line: '0B001', + tokens: [ + { startIndex: 0, type: 'number.binary.java' } + ] + }], [{ - line: '10e3', - tokens: [ - { startIndex: 0, type: 'number.float.java' } - ]}], + line: '10e3', + tokens: [ + { startIndex: 0, type: 'number.float.java' } + ] + }], [{ - line: '10f', - tokens: [ - { startIndex: 0, type: 'number.float.java' } - ]}], + line: '10f', + tokens: [ + { startIndex: 0, type: 'number.float.java' } + ] + }], [{ - line: '23.5', - tokens: [ - { startIndex: 0, type: 'number.float.java' } - ]}], + line: '23.5', + tokens: [ + { startIndex: 0, type: 'number.float.java' } + ] + }], [{ - line: '23.5e3', - tokens: [ - { startIndex: 0, type: 'number.float.java' } - ]}], + line: '23.5e3', + tokens: [ + { startIndex: 0, type: 'number.float.java' } + ] + }], [{ - line: '23.5e-3', - tokens: [ - { startIndex: 0, type: 'number.float.java' } - ]}], + line: '23.5e-3', + tokens: [ + { startIndex: 0, type: 'number.float.java' } + ] + }], [{ - line: '23.5E3', - tokens: [ - { startIndex: 0, type: 'number.float.java' } - ]}], + line: '23.5E3', + tokens: [ + { startIndex: 0, type: 'number.float.java' } + ] + }], [{ - line: '23.5E-3', - tokens: [ - { startIndex: 0, type: 'number.float.java' } - ]}], + line: '23.5E-3', + tokens: [ + { startIndex: 0, type: 'number.float.java' } + ] + }], [{ - line: '23.5F', - tokens: [ - { startIndex: 0, type: 'number.float.java' } - ]}], + line: '23.5F', + tokens: [ + { startIndex: 0, type: 'number.float.java' } + ] + }], [{ - line: '23.5f', - tokens: [ - { startIndex: 0, type: 'number.float.java' } - ]}], + line: '23.5f', + tokens: [ + { startIndex: 0, type: 'number.float.java' } + ] + }], [{ - line: '23.5D', - tokens: [ - { startIndex: 0, type: 'number.float.java' } - ]}], + line: '23.5D', + tokens: [ + { startIndex: 0, type: 'number.float.java' } + ] + }], [{ - line: '23.5d', - tokens: [ - { startIndex: 0, type: 'number.float.java' } - ]}], + line: '23.5d', + tokens: [ + { startIndex: 0, type: 'number.float.java' } + ] + }], [{ - line: '1.72E3D', - tokens: [ - { startIndex: 0, type: 'number.float.java' } - ]}], + line: '1.72E3D', + tokens: [ + { startIndex: 0, type: 'number.float.java' } + ] + }], [{ - line: '1.72E3d', - tokens: [ - { startIndex: 0, type: 'number.float.java' } - ]}], + line: '1.72E3d', + tokens: [ + { startIndex: 0, type: 'number.float.java' } + ] + }], [{ - line: '1.72E-3d', - tokens: [ - { startIndex: 0, type: 'number.float.java' } - ]}], + line: '1.72E-3d', + tokens: [ + { startIndex: 0, type: 'number.float.java' } + ] + }], [{ - line: '1.72e3D', - tokens: [ - { startIndex: 0, type: 'number.float.java' } - ]}], + line: '1.72e3D', + tokens: [ + { startIndex: 0, type: 'number.float.java' } + ] + }], [{ - line: '1.72e3d', - tokens: [ - { startIndex: 0, type: 'number.float.java' } - ]}], + line: '1.72e3d', + tokens: [ + { startIndex: 0, type: 'number.float.java' } + ] + }], [{ - line: '1.72e-3d', - tokens: [ - { startIndex: 0, type: 'number.float.java' } - ]}], + line: '1.72e-3d', + tokens: [ + { startIndex: 0, type: 'number.float.java' } + ] + }], [{ - line: '23L', - tokens: [ - { startIndex: 0, type: 'number.java' } - ]}], + line: '23L', + tokens: [ + { startIndex: 0, type: 'number.java' } + ] + }], [{ - line: '23l', - tokens: [ - { startIndex: 0, type: 'number.java' } - ]}], + line: '23l', + tokens: [ + { startIndex: 0, type: 'number.java' } + ] + }], [{ - line: '0_52', - tokens: [ - { startIndex: 0, type: 'number.java' } - ]}], + line: '0_52', + tokens: [ + { startIndex: 0, type: 'number.java' } + ] + }], [{ - line: '5_2', - tokens: [ - { startIndex: 0, type: 'number.java' } - ]}], + line: '5_2', + tokens: [ + { startIndex: 0, type: 'number.java' } + ] + }], [{ - line: '5_______2', - tokens: [ - { startIndex: 0, type: 'number.java' } - ]}], + line: '5_______2', + tokens: [ + { startIndex: 0, type: 'number.java' } + ] + }], [{ - line: '3_.1415F', - tokens: [ - { startIndex: 0, type: 'number.java' }, - { startIndex: 1, type: 'identifier.java' }, - { startIndex: 2, type: 'delimiter.java' }, - { startIndex: 3, type: 'number.float.java' } - ]}], + line: '3_.1415F', + tokens: [ + { startIndex: 0, type: 'number.java' }, + { startIndex: 1, type: 'identifier.java' }, + { startIndex: 2, type: 'delimiter.java' }, + { startIndex: 3, type: 'number.float.java' } + ] + }], [{ - line: '3._1415F', - tokens: [ - { startIndex: 0, type: 'number.java' }, - { startIndex: 1, type: 'delimiter.java' }, - { startIndex: 2, type: 'identifier.java' } - ]}], + line: '3._1415F', + tokens: [ + { startIndex: 0, type: 'number.java' }, + { startIndex: 1, type: 'delimiter.java' }, + { startIndex: 2, type: 'identifier.java' } + ] + }], [{ - line: '999_99_9999_L', - tokens: [ - { startIndex: 0, type: 'number.java' }, - { startIndex: 11, type: 'identifier.java' } - ]}], + line: '999_99_9999_L', + tokens: [ + { startIndex: 0, type: 'number.java' }, + { startIndex: 11, type: 'identifier.java' } + ] + }], [{ - line: '52_', - tokens: [ - { startIndex: 0, type: 'number.java' }, - { startIndex: 2, type: 'identifier.java' } - ]}], + line: '52_', + tokens: [ + { startIndex: 0, type: 'number.java' }, + { startIndex: 2, type: 'identifier.java' } + ] + }], [{ - line: '0_x52', - tokens: [ - { startIndex: 0, type: 'number.java' }, - { startIndex: 1, type: 'identifier.java' } - ]}], + line: '0_x52', + tokens: [ + { startIndex: 0, type: 'number.java' }, + { startIndex: 1, type: 'identifier.java' } + ] + }], [{ - line: '0x_52', - tokens: [ - { startIndex: 0, type: 'number.java' }, - { startIndex: 1, type: 'identifier.java' } - ]}], + line: '0x_52', + tokens: [ + { startIndex: 0, type: 'number.java' }, + { startIndex: 1, type: 'identifier.java' } + ] + }], [{ - line: '0x52_', - tokens: [ - { startIndex: 0, type: 'number.hex.java' }, - { startIndex: 4, type: 'identifier.java' } - ]}], + line: '0x52_', + tokens: [ + { startIndex: 0, type: 'number.hex.java' }, + { startIndex: 4, type: 'identifier.java' } + ] + }], [{ - line: '052_', - tokens: [ - { startIndex: 0, type: 'number.octal.java' }, - { startIndex: 3, type: 'identifier.java' } - ]}], + line: '052_', + tokens: [ + { startIndex: 0, type: 'number.octal.java' }, + { startIndex: 3, type: 'identifier.java' } + ] + }], [{ - line: '23.5L', - tokens: [ - { startIndex: 0, type: 'number.float.java' }, - { startIndex: 4, type: 'identifier.java' } - ]}], + line: '23.5L', + tokens: [ + { startIndex: 0, type: 'number.float.java' }, + { startIndex: 4, type: 'identifier.java' } + ] + }], [{ - line: '0+0', - tokens: [ - { startIndex: 0, type: 'number.java' }, - { startIndex: 1, type: 'delimiter.java' }, - { startIndex: 2, type: 'number.java' } - ]}], + line: '0+0', + tokens: [ + { startIndex: 0, type: 'number.java' }, + { startIndex: 1, type: 'delimiter.java' }, + { startIndex: 2, type: 'number.java' } + ] + }], [{ - line: '100+10', - tokens: [ - { startIndex: 0, type: 'number.java' }, - { startIndex: 3, type: 'delimiter.java' }, - { startIndex: 4, type: 'number.java' } - ]}], + line: '100+10', + tokens: [ + { startIndex: 0, type: 'number.java' }, + { startIndex: 3, type: 'delimiter.java' }, + { startIndex: 4, type: 'number.java' } + ] + }], [{ - line: '0 + 0', - tokens: [ - { startIndex: 0, type: 'number.java' }, - { startIndex: 1, type: '' }, - { startIndex: 2, type: 'delimiter.java' }, - { startIndex: 3, type: '' }, - { startIndex: 4, type: 'number.java' } - ]}], + line: '0 + 0', + tokens: [ + { startIndex: 0, type: 'number.java' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.java' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'number.java' } + ] + }], // single line Strings [{ - line: 'String s = "I\'m a Java String";', - tokens: [ - { startIndex: 0, type: 'identifier.java' }, - { startIndex: 6, type: '' }, - { startIndex: 7, type: 'identifier.java' }, - { startIndex: 8, type: '' }, - { startIndex: 9, type: 'delimiter.java' }, - { startIndex: 10, type: '' }, - { startIndex: 11, type: 'string.java' }, - { startIndex: 30, type: 'delimiter.java' } - ]}], + line: 'String s = "I\'m a Java String";', + tokens: [ + { startIndex: 0, type: 'identifier.java' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'identifier.java' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'delimiter.java' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'string.java' }, + { startIndex: 30, type: 'delimiter.java' } + ] + }], [{ - line: 'String s = "concatenated" + " String" ;', - tokens: [ - { startIndex: 0, type: 'identifier.java' }, - { startIndex: 6, type: '' }, - { startIndex: 7, type: 'identifier.java' }, - { startIndex: 8, type: '' }, - { startIndex: 9, type: 'delimiter.java' }, - { startIndex: 10, type: '' }, - { startIndex: 11, type: 'string.java' }, - { startIndex: 25, type: '' }, - { startIndex: 26, type: 'delimiter.java' }, - { startIndex: 27, type: '' }, - { startIndex: 28, type: 'string.java' }, - { startIndex: 37, type: '' }, - { startIndex: 38, type: 'delimiter.java' } - ]}], + line: 'String s = "concatenated" + " String" ;', + tokens: [ + { startIndex: 0, type: 'identifier.java' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'identifier.java' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'delimiter.java' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'string.java' }, + { startIndex: 25, type: '' }, + { startIndex: 26, type: 'delimiter.java' }, + { startIndex: 27, type: '' }, + { startIndex: 28, type: 'string.java' }, + { startIndex: 37, type: '' }, + { startIndex: 38, type: 'delimiter.java' } + ] + }], [{ - line: '"quote in a string"', - tokens: [ - { startIndex: 0, type: 'string.java' } - ]}], + line: '"quote in a string"', + tokens: [ + { startIndex: 0, type: 'string.java' } + ] + }], [{ - line: '"escaping \\"quotes\\" is cool"', - tokens: [ - { startIndex: 0, type: 'string.java' }, - { startIndex: 10, type: 'string.escape.java' }, - { startIndex: 12, type: 'string.java' }, - { startIndex: 18, type: 'string.escape.java' }, - { startIndex: 20, type: 'string.java' } - ]}], + line: '"escaping \\"quotes\\" is cool"', + tokens: [ + { startIndex: 0, type: 'string.java' }, + { startIndex: 10, type: 'string.escape.java' }, + { startIndex: 12, type: 'string.java' }, + { startIndex: 18, type: 'string.escape.java' }, + { startIndex: 20, type: 'string.java' } + ] + }], [{ - line: '"\\"', - tokens: [ - { startIndex: 0, type: 'string.invalid.java' } - ]}], + line: '"\\"', + tokens: [ + { startIndex: 0, type: 'string.invalid.java' } + ] + }], // Annotations [{ - line: '@', - tokens: [ - { startIndex: 0, type: '' } - ]}], + line: '@', + tokens: [ + { startIndex: 0, type: '' } + ] + }], [{ - line: '@Override', - tokens: [ - { startIndex: 0, type: 'annotation.java' } - ]}], + line: '@Override', + tokens: [ + { startIndex: 0, type: 'annotation.java' } + ] + }], [{ - line: '@SuppressWarnings(value = "aString")', - tokens: [ - { startIndex: 0, type: 'annotation.java' }, - { startIndex: 17, type: 'delimiter.parenthesis.java' }, - { startIndex: 18, type: 'identifier.java' }, - { startIndex: 23, type: '' }, - { startIndex: 24, type: 'delimiter.java' }, - { startIndex: 25, type: '' }, - { startIndex: 26, type: 'string.java' }, - { startIndex: 35, type: 'delimiter.parenthesis.java' } - ]}], + line: '@SuppressWarnings(value = "aString")', + tokens: [ + { startIndex: 0, type: 'annotation.java' }, + { startIndex: 17, type: 'delimiter.parenthesis.java' }, + { startIndex: 18, type: 'identifier.java' }, + { startIndex: 23, type: '' }, + { startIndex: 24, type: 'delimiter.java' }, + { startIndex: 25, type: '' }, + { startIndex: 26, type: 'string.java' }, + { startIndex: 35, type: 'delimiter.parenthesis.java' } + ] + }], [{ - line: '@ AnnotationWithKeywordAfter private', - tokens: [ - { startIndex: 0, type: 'annotation.java' }, - { startIndex: 28, type: '' }, - { startIndex: 29, type: 'keyword.private.java' } - ]}] + line: '@ AnnotationWithKeywordAfter private', + tokens: [ + { startIndex: 0, type: 'annotation.java' }, + { startIndex: 28, type: '' }, + { startIndex: 29, type: 'keyword.private.java' } + ] + }] ]); diff --git a/test/less.test.ts b/test/less.test.ts index e38476e7..6b9ceb6d 100644 --- a/test/less.test.ts +++ b/test/less.test.ts @@ -5,895 +5,965 @@ 'use strict'; -import {testTokenization} from './testRunner'; +import { testTokenization } from './testRunner'; testTokenization(['less'], [ // Keywords [{ - line: 'isnumber(10);', - tokens: [ - { startIndex: 0, type: 'keyword.less' }, - { startIndex: 8, type: 'delimiter.parenthesis.less' }, - { startIndex: 9, type: 'attribute.value.number.less' }, - { startIndex: 11, type: 'delimiter.parenthesis.less' }, - { startIndex: 12, type: 'delimiter.less' } - ]}], + line: 'isnumber(10);', + tokens: [ + { startIndex: 0, type: 'keyword.less' }, + { startIndex: 8, type: 'delimiter.parenthesis.less' }, + { startIndex: 9, type: 'attribute.value.number.less' }, + { startIndex: 11, type: 'delimiter.parenthesis.less' }, + { startIndex: 12, type: 'delimiter.less' } + ] + }], [{ - line: 'iskeyword(@test) ;mix', - tokens: [ - { startIndex: 0, type: 'keyword.less' }, - { startIndex: 9, type: 'delimiter.parenthesis.less'}, - { startIndex: 10, type: 'variable.less' }, - { startIndex: 15, type: 'delimiter.parenthesis.less' }, - { startIndex: 16, type: '' }, - { startIndex: 17, type: 'delimiter.less' }, - { startIndex: 18, type: 'keyword.less' } - ]}], + line: 'iskeyword(@test) ;mix', + tokens: [ + { startIndex: 0, type: 'keyword.less' }, + { startIndex: 9, type: 'delimiter.parenthesis.less' }, + { startIndex: 10, type: 'variable.less' }, + { startIndex: 15, type: 'delimiter.parenthesis.less' }, + { startIndex: 16, type: '' }, + { startIndex: 17, type: 'delimiter.less' }, + { startIndex: 18, type: 'keyword.less' } + ] + }], [{ - line: 'whenn', - tokens: [ - { startIndex: 0, type: 'tag.less' }, - ]}], + line: 'whenn', + tokens: [ + { startIndex: 0, type: 'tag.less' }, + ] + }], [{ - line: ' round ', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 4, type: 'keyword.less' }, - { startIndex: 9, type: '' } - ]}], + line: ' round ', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 4, type: 'keyword.less' }, + { startIndex: 9, type: '' } + ] + }], // Units [{ - line: 'isnumber(10px);', - tokens: [ - { startIndex: 0, type: 'keyword.less' }, - { startIndex: 8, type: 'delimiter.parenthesis.less' }, - { startIndex: 9, type: 'attribute.value.number.less' }, - { startIndex: 11, type: 'attribute.value.unit.less' }, - { startIndex: 13, type: 'delimiter.parenthesis.less' }, - { startIndex: 14, type: 'delimiter.less' } - ]}], + line: 'isnumber(10px);', + tokens: [ + { startIndex: 0, type: 'keyword.less' }, + { startIndex: 8, type: 'delimiter.parenthesis.less' }, + { startIndex: 9, type: 'attribute.value.number.less' }, + { startIndex: 11, type: 'attribute.value.unit.less' }, + { startIndex: 13, type: 'delimiter.parenthesis.less' }, + { startIndex: 14, type: 'delimiter.less' } + ] + }], [{ - line: 'pxx ', - tokens: [ - { startIndex: 0, type: 'tag.less' }, - { startIndex: 3, type: '' } - ]}], + line: 'pxx ', + tokens: [ + { startIndex: 0, type: 'tag.less' }, + { startIndex: 3, type: '' } + ] + }], // single line Strings [{ - line: '@test: "I\'m a LESS String\";', - tokens: [ - { startIndex:0, type: 'variable.less'}, - { startIndex:5, type: 'delimiter.less'}, - { startIndex:6, type: ''}, - { startIndex:7, type: 'string.delimiter.less'}, - { startIndex:8, type: 'string.less'}, - { startIndex:25, type: 'string.delimiter.less'}, - { startIndex:26, type: 'delimiter.less'} - ]}], + line: '@test: "I\'m a LESS String\";', + tokens: [ + { startIndex: 0, type: 'variable.less' }, + { startIndex: 5, type: 'delimiter.less' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'string.delimiter.less' }, + { startIndex: 8, type: 'string.less' }, + { startIndex: 25, type: 'string.delimiter.less' }, + { startIndex: 26, type: 'delimiter.less' } + ] + }], [{ - line: '@test: "concatenated" + "String";', - tokens: [ - { startIndex:0, type: 'variable.less'}, - { startIndex:5, type: 'delimiter.less'}, - { startIndex:6, type: ''}, - { startIndex:7, type: 'string.delimiter.less'}, - { startIndex:8, type: 'string.less'}, - { startIndex:20, type: 'string.delimiter.less'}, - { startIndex:21, type: ''}, - { startIndex:22, type: 'operator.less'}, - { startIndex:23, type: ''}, - { startIndex:24, type: 'string.delimiter.less'}, - { startIndex:25, type: 'string.less'}, - { startIndex:31, type: 'string.delimiter.less'}, - { startIndex:32, type: 'delimiter.less'} - ]}], + line: '@test: "concatenated" + "String";', + tokens: [ + { startIndex: 0, type: 'variable.less' }, + { startIndex: 5, type: 'delimiter.less' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'string.delimiter.less' }, + { startIndex: 8, type: 'string.less' }, + { startIndex: 20, type: 'string.delimiter.less' }, + { startIndex: 21, type: '' }, + { startIndex: 22, type: 'operator.less' }, + { startIndex: 23, type: '' }, + { startIndex: 24, type: 'string.delimiter.less' }, + { startIndex: 25, type: 'string.less' }, + { startIndex: 31, type: 'string.delimiter.less' }, + { startIndex: 32, type: 'delimiter.less' } + ] + }], [{ - line: '@test: "quote in\'adasdsa\\"asd\' a string"', - tokens: [ - { startIndex:0, type: 'variable.less' }, - { startIndex:5, type: 'delimiter.less'}, - { startIndex:6, type: ''}, - { startIndex:7, type: 'string.delimiter.less'}, - { startIndex:8, type: 'string.less'}, - { startIndex:39, type: 'string.delimiter.less'}, - ]}], + line: '@test: "quote in\'adasdsa\\"asd\' a string"', + tokens: [ + { startIndex: 0, type: 'variable.less' }, + { startIndex: 5, type: 'delimiter.less' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'string.delimiter.less' }, + { startIndex: 8, type: 'string.less' }, + { startIndex: 39, type: 'string.delimiter.less' }, + ] + }], [{ - line: '@test: \'doublequote in\"ada\\\'sds\\\'a\"asd a string\'', - tokens: [ - { startIndex:0, type: 'variable.less' }, - { startIndex:5, type: 'delimiter.less'}, - { startIndex:6, type: ''}, - { startIndex:7, type: 'string.delimiter.less'}, - { startIndex:8, type: 'string.less'}, - { startIndex:47, type: 'string.delimiter.less'} - ]}], + line: '@test: \'doublequote in\"ada\\\'sds\\\'a\"asd a string\'', + tokens: [ + { startIndex: 0, type: 'variable.less' }, + { startIndex: 5, type: 'delimiter.less' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'string.delimiter.less' }, + { startIndex: 8, type: 'string.less' }, + { startIndex: 47, type: 'string.delimiter.less' } + ] + }], // Comments - range comment, multiple lines [{ - line: '/* start of multiline comment', - tokens: [ - {startIndex:0, type: 'comment.less'} - ]},{ - line: 'a comment between without a star', - tokens: [ - {startIndex:0, type: 'comment.less'} - ]}, { - line: 'end of multiline comment*/', - tokens: [ - {startIndex:0, type: 'comment.less'} - ]}, { - line: 'when /* start a comment', - tokens: [ - { startIndex:0, type: 'keyword.less' }, - { startIndex:4, type: '' }, - { startIndex:5, type: 'comment.less' }, - ]}, { - line: ' a ', - tokens: [ - { startIndex:0, type: 'comment.less' } - ]}, { - line: 'and end it */ 2;', - tokens: [ - { startIndex:0, type: 'comment.less' }, - { startIndex:13, type: '' }, - { startIndex:14, type: 'attribute.value.number.less' }, - { startIndex:15, type: 'delimiter.less' } - ]}], + line: '/* start of multiline comment', + tokens: [ + { startIndex: 0, type: 'comment.less' } + ] + }, { + line: 'a comment between without a star', + tokens: [ + { startIndex: 0, type: 'comment.less' } + ] + }, { + line: 'end of multiline comment*/', + tokens: [ + { startIndex: 0, type: 'comment.less' } + ] + }, { + line: 'when /* start a comment', + tokens: [ + { startIndex: 0, type: 'keyword.less' }, + { startIndex: 4, type: '' }, + { startIndex: 5, type: 'comment.less' }, + ] + }, { + line: ' a ', + tokens: [ + { startIndex: 0, type: 'comment.less' } + ] + }, { + line: 'and end it */ 2;', + tokens: [ + { startIndex: 0, type: 'comment.less' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'attribute.value.number.less' }, + { startIndex: 15, type: 'delimiter.less' } + ] + }], // Numbers [{ - line: '0', - tokens: [ - { startIndex:0, type: 'attribute.value.number.less' } - ]}], + line: '0', + tokens: [ + { startIndex: 0, type: 'attribute.value.number.less' } + ] + }], [{ - line: ' 0', - tokens: [ - { startIndex:0, type: '' }, - { startIndex:1, type: 'attribute.value.number.less' } - ]}], + line: ' 0', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 1, type: 'attribute.value.number.less' } + ] + }], [{ - line: ' 0 ', - tokens: [ - { startIndex:0, type: '' }, - { startIndex:1, type: 'attribute.value.number.less' }, - { startIndex:2, type: '' } - ]}], + line: ' 0 ', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 1, type: 'attribute.value.number.less' }, + { startIndex: 2, type: '' } + ] + }], [{ - line: '0 ', - tokens: [ - { startIndex:0, type: 'attribute.value.number.less' }, - { startIndex:1, type: '' } - ]}], + line: '0 ', + tokens: [ + { startIndex: 0, type: 'attribute.value.number.less' }, + { startIndex: 1, type: '' } + ] + }], [{ - line: '@test: 0+0', - tokens: [ - { startIndex:0, type: 'variable.less' }, - { startIndex:5, type: 'delimiter.less' }, - { startIndex:6, type: '' }, - { startIndex:7, type: 'attribute.value.number.less' }, - { startIndex:8, type: 'operator.less' }, - { startIndex:9, type: 'attribute.value.number.less' } - ]}], + line: '@test: 0+0', + tokens: [ + { startIndex: 0, type: 'variable.less' }, + { startIndex: 5, type: 'delimiter.less' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'attribute.value.number.less' }, + { startIndex: 8, type: 'operator.less' }, + { startIndex: 9, type: 'attribute.value.number.less' } + ] + }], [{ - line: '@test: 100+10.00', - tokens: [ - { startIndex:0, type: 'variable.less' }, - { startIndex:5, type: 'delimiter.less' }, - { startIndex:6, type: '' }, - { startIndex:7, type: 'attribute.value.number.less' }, - { startIndex:10, type: 'operator.less' }, - { startIndex:11, type: 'attribute.value.number.less' } - ]}], + line: '@test: 100+10.00', + tokens: [ + { startIndex: 0, type: 'variable.less' }, + { startIndex: 5, type: 'delimiter.less' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'attribute.value.number.less' }, + { startIndex: 10, type: 'operator.less' }, + { startIndex: 11, type: 'attribute.value.number.less' } + ] + }], [{ - line: '@test: 0 + 0', - tokens: [ - { startIndex:0, type: 'variable.less' }, - { startIndex:5, type: 'delimiter.less' }, - { startIndex:6, type: '' }, - { startIndex:7, type: 'attribute.value.number.less' }, - { startIndex:8, type: '' }, - { startIndex:9, type: 'operator.less' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'attribute.value.number.less' } - ]}], + line: '@test: 0 + 0', + tokens: [ + { startIndex: 0, type: 'variable.less' }, + { startIndex: 5, type: 'delimiter.less' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'attribute.value.number.less' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'operator.less' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'attribute.value.number.less' } + ] + }], [{ - line: '0123', - tokens: [{ startIndex:0, type: 'attribute.value.number.less' }]}], + line: '0123', + tokens: [{ startIndex: 0, type: 'attribute.value.number.less' }] + }], [{ - line: '#012343', - tokens: [{ startIndex: 0, type: 'attribute.value.hex.less' }]}], + line: '#012343', + tokens: [{ startIndex: 0, type: 'attribute.value.hex.less' }] + }], // Bracket Matching [{ - line: '[1,2,3]', - tokens: [ - { startIndex:0, type: 'delimiter.bracket.less' }, - { startIndex:1, type: 'attribute.value.number.less' }, - { startIndex:2, type: 'delimiter.less' }, - { startIndex:3, type: 'attribute.value.number.less' }, - { startIndex:4, type: 'delimiter.less' }, - { startIndex:5, type: 'attribute.value.number.less' }, - { startIndex:6, type: 'delimiter.bracket.less' } - ]}], + line: '[1,2,3]', + tokens: [ + { startIndex: 0, type: 'delimiter.bracket.less' }, + { startIndex: 1, type: 'attribute.value.number.less' }, + { startIndex: 2, type: 'delimiter.less' }, + { startIndex: 3, type: 'attribute.value.number.less' }, + { startIndex: 4, type: 'delimiter.less' }, + { startIndex: 5, type: 'attribute.value.number.less' }, + { startIndex: 6, type: 'delimiter.bracket.less' } + ] + }], [{ - line: 'foo(123);', - tokens: [ - { startIndex:0, type: 'tag.less' }, - { startIndex:3, type: 'delimiter.parenthesis.less' }, - { startIndex:4, type: 'attribute.value.number.less' }, - { startIndex:7, type: 'delimiter.parenthesis.less' }, - { startIndex:8, type: 'delimiter.less' } - ]}], + line: 'foo(123);', + tokens: [ + { startIndex: 0, type: 'tag.less' }, + { startIndex: 3, type: 'delimiter.parenthesis.less' }, + { startIndex: 4, type: 'attribute.value.number.less' }, + { startIndex: 7, type: 'delimiter.parenthesis.less' }, + { startIndex: 8, type: 'delimiter.less' } + ] + }], // No Bracket Matching inside strings [{ - line: '@test: \'[{()}]\'', - tokens: [ - { startIndex:0, type: 'variable.less' }, - { startIndex:5, type: 'delimiter.less' }, - { startIndex:6, type: '' }, - { startIndex:7, type: 'string.delimiter.less' }, - { startIndex:8, type: 'string.less' }, - { startIndex:14, type: 'string.delimiter.less' } - ]}], + line: '@test: \'[{()}]\'', + tokens: [ + { startIndex: 0, type: 'variable.less' }, + { startIndex: 5, type: 'delimiter.less' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'string.delimiter.less' }, + { startIndex: 8, type: 'string.less' }, + { startIndex: 14, type: 'string.delimiter.less' } + ] + }], // Singleline Comments [{ - line: '//', - tokens: [{ startIndex:0, type: 'comment.less' }]}], + line: '//', + tokens: [{ startIndex: 0, type: 'comment.less' }] + }], [{ - line: ' // a comment', - tokens: [ - { startIndex:0, type: '' }, - { startIndex:4, type: 'comment.less' } - ]}], + line: ' // a comment', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 4, type: 'comment.less' } + ] + }], [{ - line: '// a comment', - tokens: [{ startIndex:0, type: 'comment.less' }]}], + line: '// a comment', + tokens: [{ startIndex: 0, type: 'comment.less' }] + }], [{ - line: '//sticky comment', - tokens: [{ startIndex:0, type: 'comment.less' }]}], + line: '//sticky comment', + tokens: [{ startIndex: 0, type: 'comment.less' }] + }], [{ - line: '@something : 2; // my comment // this is a nice one', - tokens: [ - { startIndex:0, type: 'variable.less'}, - { startIndex:10, type: ''}, - { startIndex:11, type: 'delimiter.less'}, - { startIndex:12, type: ''}, - { startIndex:13, type: 'attribute.value.number.less'}, - { startIndex:14, type: 'delimiter.less'}, - { startIndex:15, type: ''}, - { startIndex:16, type: 'comment.less'} - ]}], + line: '@something : 2; // my comment // this is a nice one', + tokens: [ + { startIndex: 0, type: 'variable.less' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'delimiter.less' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'attribute.value.number.less' }, + { startIndex: 14, type: 'delimiter.less' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'comment.less' } + ] + }], [{ - line: '.something(@some, @other) when (iscolor(@other)) { aname// my commen', - tokens: [ - { startIndex:0, type: 'tag.class.less'}, - { startIndex:10, type: 'delimiter.parenthesis.less'}, - { startIndex:11, type: 'variable.less'}, - { startIndex:16, type: 'delimiter.less'}, - { startIndex:17, type: ''}, - { startIndex:18, type: 'variable.less'}, - { startIndex:24, type: 'delimiter.parenthesis.less'}, - { startIndex:25, type: ''}, - { startIndex:26, type: 'keyword.less'}, - { startIndex:30, type: ''}, - { startIndex:31, type: 'delimiter.parenthesis.less'}, - { startIndex:32, type: 'keyword.less'}, - { startIndex:39, type: 'delimiter.parenthesis.less'}, - { startIndex:40, type: 'variable.less'}, - { startIndex:46, type: 'delimiter.parenthesis.less'}, - { startIndex:48, type: ''}, - { startIndex:49, type: 'delimiter.curly.less'}, - { startIndex:50, type: ''}, - { startIndex:51, type: 'tag.less'}, - { startIndex:56, type: 'comment.less'} - ]}], + line: '.something(@some, @other) when (iscolor(@other)) { aname// my commen', + tokens: [ + { startIndex: 0, type: 'tag.class.less' }, + { startIndex: 10, type: 'delimiter.parenthesis.less' }, + { startIndex: 11, type: 'variable.less' }, + { startIndex: 16, type: 'delimiter.less' }, + { startIndex: 17, type: '' }, + { startIndex: 18, type: 'variable.less' }, + { startIndex: 24, type: 'delimiter.parenthesis.less' }, + { startIndex: 25, type: '' }, + { startIndex: 26, type: 'keyword.less' }, + { startIndex: 30, type: '' }, + { startIndex: 31, type: 'delimiter.parenthesis.less' }, + { startIndex: 32, type: 'keyword.less' }, + { startIndex: 39, type: 'delimiter.parenthesis.less' }, + { startIndex: 40, type: 'variable.less' }, + { startIndex: 46, type: 'delimiter.parenthesis.less' }, + { startIndex: 48, type: '' }, + { startIndex: 49, type: 'delimiter.curly.less' }, + { startIndex: 50, type: '' }, + { startIndex: 51, type: 'tag.less' }, + { startIndex: 56, type: 'comment.less' } + ] + }], [{ - line: '.something(@some//mycomment', - tokens: [ - { startIndex:0, type: 'tag.class.less'}, - { startIndex:10, type: 'delimiter.parenthesis.less'}, - { startIndex:11, type: 'variable.less'}, - { startIndex:16, type: 'comment.less'} - ]}], + line: '.something(@some//mycomment', + tokens: [ + { startIndex: 0, type: 'tag.class.less' }, + { startIndex: 10, type: 'delimiter.parenthesis.less' }, + { startIndex: 11, type: 'variable.less' }, + { startIndex: 16, type: 'comment.less' } + ] + }], [{ - line: '@something : #2;', - tokens: [ - { startIndex:0, type: 'variable.less'}, - { startIndex:10, type: ''}, - { startIndex:11, type: 'delimiter.less'}, - { startIndex:12, type: ''}, - { startIndex:13, type: 'attribute.value.hex.less'}, - { startIndex:15, type: 'delimiter.less'} - ]}], + line: '@something : #2;', + tokens: [ + { startIndex: 0, type: 'variable.less' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'delimiter.less' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'attribute.value.hex.less' }, + { startIndex: 15, type: 'delimiter.less' } + ] + }], // Singleline Range-Comments [{ - line: '/*slcomment*/', - tokens: [{ startIndex:0, type: 'comment.less' }]}], + line: '/*slcomment*/', + tokens: [{ startIndex: 0, type: 'comment.less' }] + }], [{ - line: '/* slcomment */', - tokens: [{ startIndex: 0, type: 'comment.less' }]}], + line: '/* slcomment */', + tokens: [{ startIndex: 0, type: 'comment.less' }] + }], [{ - line: '/*sl/com* ment*/', - tokens: [{ startIndex: 0, type: 'comment.less' }]}], + line: '/*sl/com* ment*/', + tokens: [{ startIndex: 0, type: 'comment.less' }] + }], [{ - line: '/**/', - tokens: [{ startIndex: 0, type: 'comment.less' }]}], + line: '/**/', + tokens: [{ startIndex: 0, type: 'comment.less' }] + }], [{ - line: '@something: /*comm/* * /ent*/2;', - tokens: [ - { startIndex:0, type: 'variable.less' }, - { startIndex:10, type: 'delimiter.less' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'comment.less' }, - { startIndex:29, type: 'attribute.value.number.less' }, - { startIndex:30, type: 'delimiter.less' } - ]}], + line: '@something: /*comm/* * /ent*/2;', + tokens: [ + { startIndex: 0, type: 'variable.less' }, + { startIndex: 10, type: 'delimiter.less' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'comment.less' }, + { startIndex: 29, type: 'attribute.value.number.less' }, + { startIndex: 30, type: 'delimiter.less' } + ] + }], [{ - line: '@something: /*comment*/ 2;', - tokens: [ - { startIndex:0, type: 'variable.less' }, - { startIndex:10, type: 'delimiter.less' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'comment.less' }, - { startIndex:23, type: '' }, - { startIndex:24, type: 'attribute.value.number.less' }, - { startIndex:25, type: 'delimiter.less' } - ]}], + line: '@something: /*comment*/ 2;', + tokens: [ + { startIndex: 0, type: 'variable.less' }, + { startIndex: 10, type: 'delimiter.less' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'comment.less' }, + { startIndex: 23, type: '' }, + { startIndex: 24, type: 'attribute.value.number.less' }, + { startIndex: 25, type: 'delimiter.less' } + ] + }], // Comments - range comment, multi lines [{ - line: '/* a multiline comment', - tokens: [ - { startIndex:0, type: 'comment.less' } - ]}, { - line: 'can actually span', - tokens: [ - { startIndex:0, type: 'comment.less' } - ]}, { - line: 'multiple lines */', - tokens: [ - { startIndex:0, type: 'comment.less' } - ]}], + line: '/* a multiline comment', + tokens: [ + { startIndex: 0, type: 'comment.less' } + ] + }, { + line: 'can actually span', + tokens: [ + { startIndex: 0, type: 'comment.less' } + ] + }, { + line: 'multiple lines */', + tokens: [ + { startIndex: 0, type: 'comment.less' } + ] + }], [{ - line: '@some /* start a comment here', - tokens: [ - { startIndex:0, type: 'variable.less' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'comment.less' } - ]}, { - line: ' span over this line and ', - tokens: [ - { startIndex:0, type: 'comment.less' } - ]}, { - line: 'end it there */ : 2;', - tokens: [ - { startIndex:0, type: 'comment.less' }, - { startIndex:15, type: '' }, - { startIndex:16, type: 'delimiter.less' }, - { startIndex:17, type: '' }, - { startIndex:18, type: 'attribute.value.number.less' }, - { startIndex:19, type: 'delimiter.less' } - ]}], + line: '@some /* start a comment here', + tokens: [ + { startIndex: 0, type: 'variable.less' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'comment.less' } + ] + }, { + line: ' span over this line and ', + tokens: [ + { startIndex: 0, type: 'comment.less' } + ] + }, { + line: 'end it there */ : 2;', + tokens: [ + { startIndex: 0, type: 'comment.less' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'delimiter.less' }, + { startIndex: 17, type: '' }, + { startIndex: 18, type: 'attribute.value.number.less' }, + { startIndex: 19, type: 'delimiter.less' } + ] + }], // Escape Strings [{ - line: '.class { filter: ~"ms:alwaysHasItsOwnSyntax.For.Stuff()";', - tokens: [ - { startIndex:0, type: 'tag.class.less' }, - { startIndex:6, type: '' }, - { startIndex:7, type: 'delimiter.curly.less' }, - { startIndex:8, type: '' }, - { startIndex:9, type: 'attribute.name.less' }, - { startIndex:15, type: 'delimiter.less' }, - { startIndex:16, type: '' }, - { startIndex:17, type: 'string.delimiter.less' }, - { startIndex:19, type: 'string.less' }, - { startIndex:55, type: 'string.delimiter.less' }, - { startIndex:56, type: 'delimiter.less' } - ]}], + line: '.class { filter: ~"ms:alwaysHasItsOwnSyntax.For.Stuff()";', + tokens: [ + { startIndex: 0, type: 'tag.class.less' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'delimiter.curly.less' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'attribute.name.less' }, + { startIndex: 15, type: 'delimiter.less' }, + { startIndex: 16, type: '' }, + { startIndex: 17, type: 'string.delimiter.less' }, + { startIndex: 19, type: 'string.less' }, + { startIndex: 55, type: 'string.delimiter.less' }, + { startIndex: 56, type: 'delimiter.less' } + ] + }], // Guards [{ - line: '.class {.mixin (@a) when (@a > 10), (@a < -10) { }', - tokens: [ - { startIndex:0, type: 'tag.class.less' }, - { startIndex:6, type: '' }, - { startIndex:7, type: 'delimiter.curly.less' }, - { startIndex:8, type: 'tag.class.less' }, - { startIndex:14, type: '' }, - { startIndex:15, type: 'delimiter.parenthesis.less' }, - { startIndex:16, type: 'variable.less' }, - { startIndex:18, type: 'delimiter.parenthesis.less' }, - { startIndex:19, type: '' }, - { startIndex:20, type: 'keyword.less' }, - { startIndex:24, type: '' }, - { startIndex:25, type: 'delimiter.parenthesis.less' }, - { startIndex:26, type: 'variable.less' }, - { startIndex:28, type: '' }, - { startIndex:29, type: 'operator.less' }, - { startIndex:30, type: '' }, - { startIndex:31, type: 'attribute.value.number.less' }, - { startIndex:33, type: 'delimiter.parenthesis.less' }, - { startIndex:34, type: 'delimiter.less' }, - { startIndex:35, type: '' }, - { startIndex:36, type: 'delimiter.parenthesis.less' }, - { startIndex:37, type: 'variable.less' }, - { startIndex:39, type: '' }, - { startIndex:40, type: 'operator.less' }, - { startIndex:41, type: '' }, - { startIndex:42, type: 'operator.less' }, - { startIndex:43, type: 'attribute.value.number.less' }, - { startIndex:45, type: 'delimiter.parenthesis.less' }, - { startIndex:46, type: '' }, - { startIndex:47, type: 'delimiter.curly.less' }, - { startIndex:48, type: '' }, - { startIndex:49, type: 'delimiter.curly.less' } - ]}], + line: '.class {.mixin (@a) when (@a > 10), (@a < -10) { }', + tokens: [ + { startIndex: 0, type: 'tag.class.less' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'delimiter.curly.less' }, + { startIndex: 8, type: 'tag.class.less' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'delimiter.parenthesis.less' }, + { startIndex: 16, type: 'variable.less' }, + { startIndex: 18, type: 'delimiter.parenthesis.less' }, + { startIndex: 19, type: '' }, + { startIndex: 20, type: 'keyword.less' }, + { startIndex: 24, type: '' }, + { startIndex: 25, type: 'delimiter.parenthesis.less' }, + { startIndex: 26, type: 'variable.less' }, + { startIndex: 28, type: '' }, + { startIndex: 29, type: 'operator.less' }, + { startIndex: 30, type: '' }, + { startIndex: 31, type: 'attribute.value.number.less' }, + { startIndex: 33, type: 'delimiter.parenthesis.less' }, + { startIndex: 34, type: 'delimiter.less' }, + { startIndex: 35, type: '' }, + { startIndex: 36, type: 'delimiter.parenthesis.less' }, + { startIndex: 37, type: 'variable.less' }, + { startIndex: 39, type: '' }, + { startIndex: 40, type: 'operator.less' }, + { startIndex: 41, type: '' }, + { startIndex: 42, type: 'operator.less' }, + { startIndex: 43, type: 'attribute.value.number.less' }, + { startIndex: 45, type: 'delimiter.parenthesis.less' }, + { startIndex: 46, type: '' }, + { startIndex: 47, type: 'delimiter.curly.less' }, + { startIndex: 48, type: '' }, + { startIndex: 49, type: 'delimiter.curly.less' } + ] + }], [{ - line: '.truth (@a) when (@a = true) { }', - tokens: [ - { startIndex:0, type: 'tag.class.less' }, - { startIndex:6, type: '' }, - { startIndex:7, type: 'delimiter.parenthesis.less' }, - { startIndex:8, type: 'variable.less' }, - { startIndex:10, type: 'delimiter.parenthesis.less' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'keyword.less' }, - { startIndex:16, type: '' }, - { startIndex:17, type: 'delimiter.parenthesis.less' }, - { startIndex:18, type: 'variable.less' }, - { startIndex:20, type: '' }, - { startIndex:21, type: 'operator.less' }, - { startIndex:22, type: '' }, - { startIndex:23, type: 'keyword.less' }, - { startIndex:27, type: 'delimiter.parenthesis.less' }, - { startIndex:28, type: '' }, - { startIndex:29, type: 'delimiter.curly.less' }, - { startIndex:30, type: '' }, - { startIndex:31, type: 'delimiter.curly.less' } - ]}], + line: '.truth (@a) when (@a = true) { }', + tokens: [ + { startIndex: 0, type: 'tag.class.less' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'delimiter.parenthesis.less' }, + { startIndex: 8, type: 'variable.less' }, + { startIndex: 10, type: 'delimiter.parenthesis.less' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'keyword.less' }, + { startIndex: 16, type: '' }, + { startIndex: 17, type: 'delimiter.parenthesis.less' }, + { startIndex: 18, type: 'variable.less' }, + { startIndex: 20, type: '' }, + { startIndex: 21, type: 'operator.less' }, + { startIndex: 22, type: '' }, + { startIndex: 23, type: 'keyword.less' }, + { startIndex: 27, type: 'delimiter.parenthesis.less' }, + { startIndex: 28, type: '' }, + { startIndex: 29, type: 'delimiter.curly.less' }, + { startIndex: 30, type: '' }, + { startIndex: 31, type: 'delimiter.curly.less' } + ] + }], [{ - line: '.max (@a, @b) when (@a > @b) { width: @a; }', - tokens: [ - { startIndex:0, type: 'tag.class.less' }, - { startIndex:4, type: '' }, - { startIndex:5, type: 'delimiter.parenthesis.less' }, - { startIndex:6, type: 'variable.less' }, - { startIndex:8, type: 'delimiter.less' }, - { startIndex:9, type: '' }, - { startIndex:10, type: 'variable.less' }, - { startIndex:12, type: 'delimiter.parenthesis.less' }, - { startIndex:13, type: '' }, - { startIndex:14, type: 'keyword.less' }, - { startIndex:18, type: '' }, - { startIndex:19, type: 'delimiter.parenthesis.less' }, - { startIndex:20, type: 'variable.less' }, - { startIndex:22, type: '' }, - { startIndex:23, type: 'operator.less' }, - { startIndex:24, type: '' }, - { startIndex:25, type: 'variable.less' }, - { startIndex:27, type: 'delimiter.parenthesis.less' }, - { startIndex:28, type: '' }, - { startIndex:29, type: 'delimiter.curly.less' }, - { startIndex:30, type: '' }, - { startIndex:31, type: 'attribute.name.less' }, - { startIndex:36, type: 'delimiter.less' }, - { startIndex:37, type: '' }, - { startIndex:38, type: 'variable.less' }, - { startIndex:40, type: 'delimiter.less' }, - { startIndex:41, type: '' }, - { startIndex:42, type: 'delimiter.curly.less' } - ]}], + line: '.max (@a, @b) when (@a > @b) { width: @a; }', + tokens: [ + { startIndex: 0, type: 'tag.class.less' }, + { startIndex: 4, type: '' }, + { startIndex: 5, type: 'delimiter.parenthesis.less' }, + { startIndex: 6, type: 'variable.less' }, + { startIndex: 8, type: 'delimiter.less' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'variable.less' }, + { startIndex: 12, type: 'delimiter.parenthesis.less' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'keyword.less' }, + { startIndex: 18, type: '' }, + { startIndex: 19, type: 'delimiter.parenthesis.less' }, + { startIndex: 20, type: 'variable.less' }, + { startIndex: 22, type: '' }, + { startIndex: 23, type: 'operator.less' }, + { startIndex: 24, type: '' }, + { startIndex: 25, type: 'variable.less' }, + { startIndex: 27, type: 'delimiter.parenthesis.less' }, + { startIndex: 28, type: '' }, + { startIndex: 29, type: 'delimiter.curly.less' }, + { startIndex: 30, type: '' }, + { startIndex: 31, type: 'attribute.name.less' }, + { startIndex: 36, type: 'delimiter.less' }, + { startIndex: 37, type: '' }, + { startIndex: 38, type: 'variable.less' }, + { startIndex: 40, type: 'delimiter.less' }, + { startIndex: 41, type: '' }, + { startIndex: 42, type: 'delimiter.curly.less' } + ] + }], [{ - line: '.mixin (@a, @b: 0) when (isnumber(@b)) { }', - tokens: [ - { startIndex:0, type: 'tag.class.less' }, - { startIndex:6, type: '' }, - { startIndex:7, type: 'delimiter.parenthesis.less' }, - { startIndex:8, type: 'variable.less' }, - { startIndex:10, type: 'delimiter.less' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'variable.less' }, - { startIndex:14, type: 'delimiter.less' }, - { startIndex:15, type: '' }, - { startIndex:16, type: 'attribute.value.number.less' }, - { startIndex:17, type: 'delimiter.parenthesis.less' }, - { startIndex:18, type: '' }, - { startIndex:19, type: 'keyword.less' }, - { startIndex:23, type: '' }, - { startIndex:24, type: 'delimiter.parenthesis.less' }, - { startIndex:25, type: 'keyword.less' }, - { startIndex:33, type: 'delimiter.parenthesis.less' }, - { startIndex:34, type: 'variable.less' }, - { startIndex:36, type: 'delimiter.parenthesis.less' }, - { startIndex:38, type: '' }, - { startIndex:39, type: 'delimiter.curly.less' }, - { startIndex:40, type: '' }, - { startIndex:41, type: 'delimiter.curly.less' } - ]}], + line: '.mixin (@a, @b: 0) when (isnumber(@b)) { }', + tokens: [ + { startIndex: 0, type: 'tag.class.less' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'delimiter.parenthesis.less' }, + { startIndex: 8, type: 'variable.less' }, + { startIndex: 10, type: 'delimiter.less' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'variable.less' }, + { startIndex: 14, type: 'delimiter.less' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'attribute.value.number.less' }, + { startIndex: 17, type: 'delimiter.parenthesis.less' }, + { startIndex: 18, type: '' }, + { startIndex: 19, type: 'keyword.less' }, + { startIndex: 23, type: '' }, + { startIndex: 24, type: 'delimiter.parenthesis.less' }, + { startIndex: 25, type: 'keyword.less' }, + { startIndex: 33, type: 'delimiter.parenthesis.less' }, + { startIndex: 34, type: 'variable.less' }, + { startIndex: 36, type: 'delimiter.parenthesis.less' }, + { startIndex: 38, type: '' }, + { startIndex: 39, type: 'delimiter.curly.less' }, + { startIndex: 40, type: '' }, + { startIndex: 41, type: 'delimiter.curly.less' } + ] + }], [{ - line: '.mixin (@a, @b: black) when (iscolor(@b)) { }', - tokens: [ - { startIndex:0, type: 'tag.class.less' }, - { startIndex:6, type: '' }, - { startIndex:7, type: 'delimiter.parenthesis.less' }, - { startIndex:8, type: 'variable.less' }, - { startIndex:10, type: 'delimiter.less' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'variable.less' }, - { startIndex:14, type: 'delimiter.less' }, - { startIndex:15, type: '' }, - { startIndex:16, type: 'attribute.value.less' }, - { startIndex:21, type: 'delimiter.parenthesis.less' }, - { startIndex:22, type: '' }, - { startIndex:23, type: 'keyword.less' }, - { startIndex:27, type: '' }, - { startIndex:28, type: 'delimiter.parenthesis.less' }, - { startIndex:29, type: 'keyword.less' }, - { startIndex:36, type: 'delimiter.parenthesis.less' }, - { startIndex:37, type: 'variable.less' }, - { startIndex:39, type: 'delimiter.parenthesis.less' }, - { startIndex:41, type: '' }, - { startIndex:42, type: 'delimiter.curly.less' }, - { startIndex:43, type: '' }, - { startIndex:44, type: 'delimiter.curly.less' } - ]}], + line: '.mixin (@a, @b: black) when (iscolor(@b)) { }', + tokens: [ + { startIndex: 0, type: 'tag.class.less' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'delimiter.parenthesis.less' }, + { startIndex: 8, type: 'variable.less' }, + { startIndex: 10, type: 'delimiter.less' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'variable.less' }, + { startIndex: 14, type: 'delimiter.less' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'attribute.value.less' }, + { startIndex: 21, type: 'delimiter.parenthesis.less' }, + { startIndex: 22, type: '' }, + { startIndex: 23, type: 'keyword.less' }, + { startIndex: 27, type: '' }, + { startIndex: 28, type: 'delimiter.parenthesis.less' }, + { startIndex: 29, type: 'keyword.less' }, + { startIndex: 36, type: 'delimiter.parenthesis.less' }, + { startIndex: 37, type: 'variable.less' }, + { startIndex: 39, type: 'delimiter.parenthesis.less' }, + { startIndex: 41, type: '' }, + { startIndex: 42, type: 'delimiter.curly.less' }, + { startIndex: 43, type: '' }, + { startIndex: 44, type: 'delimiter.curly.less' } + ] + }], // Nested JavaScript [{ - line: '@test: `function display()` //works well', - tokens: [ - { startIndex:0, type: 'variable.less' }, - { startIndex:5, type: 'delimiter.less' }, - { startIndex:6, type: '' }, - { startIndex:7, type: 'delimiter.backtick.less' }, - { startIndex:8, type: '' }, - { startIndex:26, type: 'delimiter.backtick.less' }, - { startIndex:27, type: '' }, - { startIndex:28, type: 'comment.less'} - ]}], + line: '@test: `function display()` //works well', + tokens: [ + { startIndex: 0, type: 'variable.less' }, + { startIndex: 5, type: 'delimiter.less' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'delimiter.backtick.less' }, + { startIndex: 8, type: '' }, + { startIndex: 26, type: 'delimiter.backtick.less' }, + { startIndex: 27, type: '' }, + { startIndex: 28, type: 'comment.less' } + ] + }], // Attribute in a .class(...) [{ - line: '.box-shadow(inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6));', - tokens: [ - { startIndex:0, type: 'tag.class.less' }, - { startIndex:11, type: 'delimiter.parenthesis.less' }, - { startIndex:12, type: 'attribute.value.less' }, - { startIndex:17, type: '' }, - { startIndex:18, type: 'attribute.value.number.less' }, - { startIndex:19, type: '' }, - { startIndex:20, type: 'attribute.value.number.less' }, - { startIndex:21, type: 'attribute.value.unit.less' }, - { startIndex:23, type: '' }, - { startIndex:24, type: 'attribute.value.number.less' }, - { startIndex:25, type: 'attribute.value.unit.less'}, - { startIndex:27, type: '' }, - { startIndex:28, type: 'attribute.value.less' }, - { startIndex:32, type: 'delimiter.parenthesis.less' }, - { startIndex:33, type: 'attribute.value.number.less' }, - { startIndex:34, type: 'delimiter.less' }, - { startIndex:35, type: 'attribute.value.number.less' }, - { startIndex:36, type: 'delimiter.less' }, - { startIndex:37, type: 'attribute.value.number.less' }, - { startIndex:38, type: 'delimiter.less' }, - { startIndex:39, type: 'attribute.value.number.less' }, - { startIndex:43, type: 'delimiter.parenthesis.less' }, - { startIndex:44, type: 'delimiter.less' }, - { startIndex:45, type: '' }, - { startIndex:46, type: 'attribute.value.number.less' }, - { startIndex:47, type: '' }, - { startIndex:48, type: 'attribute.value.number.less' }, - { startIndex:49, type: '' }, - { startIndex:50, type: 'attribute.value.number.less' }, - { startIndex:51, type: 'attribute.value.unit.less' }, - { startIndex:53, type: '' }, - { startIndex:54, type: 'attribute.value.less' }, - { startIndex:58, type: 'delimiter.parenthesis.less' }, - { startIndex:59, type: 'attribute.value.number.less' }, - { startIndex:61, type: 'delimiter.less' }, - { startIndex:62, type: 'attribute.value.number.less' }, - { startIndex:65, type: 'delimiter.less' }, - { startIndex:66, type: 'attribute.value.number.less' }, - { startIndex:69, type: 'delimiter.less' }, - { startIndex:70, type: 'attribute.value.number.less' }, - { startIndex:72, type: 'delimiter.parenthesis.less' }, - { startIndex:74, type: 'delimiter.less' } - ]}], + line: '.box-shadow(inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6));', + tokens: [ + { startIndex: 0, type: 'tag.class.less' }, + { startIndex: 11, type: 'delimiter.parenthesis.less' }, + { startIndex: 12, type: 'attribute.value.less' }, + { startIndex: 17, type: '' }, + { startIndex: 18, type: 'attribute.value.number.less' }, + { startIndex: 19, type: '' }, + { startIndex: 20, type: 'attribute.value.number.less' }, + { startIndex: 21, type: 'attribute.value.unit.less' }, + { startIndex: 23, type: '' }, + { startIndex: 24, type: 'attribute.value.number.less' }, + { startIndex: 25, type: 'attribute.value.unit.less' }, + { startIndex: 27, type: '' }, + { startIndex: 28, type: 'attribute.value.less' }, + { startIndex: 32, type: 'delimiter.parenthesis.less' }, + { startIndex: 33, type: 'attribute.value.number.less' }, + { startIndex: 34, type: 'delimiter.less' }, + { startIndex: 35, type: 'attribute.value.number.less' }, + { startIndex: 36, type: 'delimiter.less' }, + { startIndex: 37, type: 'attribute.value.number.less' }, + { startIndex: 38, type: 'delimiter.less' }, + { startIndex: 39, type: 'attribute.value.number.less' }, + { startIndex: 43, type: 'delimiter.parenthesis.less' }, + { startIndex: 44, type: 'delimiter.less' }, + { startIndex: 45, type: '' }, + { startIndex: 46, type: 'attribute.value.number.less' }, + { startIndex: 47, type: '' }, + { startIndex: 48, type: 'attribute.value.number.less' }, + { startIndex: 49, type: '' }, + { startIndex: 50, type: 'attribute.value.number.less' }, + { startIndex: 51, type: 'attribute.value.unit.less' }, + { startIndex: 53, type: '' }, + { startIndex: 54, type: 'attribute.value.less' }, + { startIndex: 58, type: 'delimiter.parenthesis.less' }, + { startIndex: 59, type: 'attribute.value.number.less' }, + { startIndex: 61, type: 'delimiter.less' }, + { startIndex: 62, type: 'attribute.value.number.less' }, + { startIndex: 65, type: 'delimiter.less' }, + { startIndex: 66, type: 'attribute.value.number.less' }, + { startIndex: 69, type: 'delimiter.less' }, + { startIndex: 70, type: 'attribute.value.number.less' }, + { startIndex: 72, type: 'delimiter.parenthesis.less' }, + { startIndex: 74, type: 'delimiter.less' } + ] + }], // Difficult little bugs... => String mismatches [{ - line: 'input[type="radio"]', - tokens: [ - { startIndex:0, type: 'tag.less' }, - { startIndex:5, type: 'delimiter.bracket.less' }, - { startIndex:6, type: 'tag.less' }, - { startIndex:10, type: 'operator.less' }, - { startIndex:11, type: 'string.delimiter.less' }, - { startIndex:12, type: 'string.less' }, - { startIndex:17, type: 'string.delimiter.less' }, - { startIndex:18, type: 'delimiter.bracket.less' } - ]}], + line: 'input[type="radio"]', + tokens: [ + { startIndex: 0, type: 'tag.less' }, + { startIndex: 5, type: 'delimiter.bracket.less' }, + { startIndex: 6, type: 'tag.less' }, + { startIndex: 10, type: 'operator.less' }, + { startIndex: 11, type: 'string.delimiter.less' }, + { startIndex: 12, type: 'string.less' }, + { startIndex: 17, type: 'string.delimiter.less' }, + { startIndex: 18, type: 'delimiter.bracket.less' } + ] + }], [{ - line: '~\'.offset@{index}\')', - tokens: [ - { startIndex:0, type: 'string.delimiter.less' }, - { startIndex:2, type: 'string.less' }, - { startIndex:17, type: 'string.delimiter.less' }, - { startIndex:18, type: 'delimiter.parenthesis.less' } - ]}], + line: '~\'.offset@{index}\')', + tokens: [ + { startIndex: 0, type: 'string.delimiter.less' }, + { startIndex: 2, type: 'string.less' }, + { startIndex: 17, type: 'string.delimiter.less' }, + { startIndex: 18, type: 'delimiter.parenthesis.less' } + ] + }], [{ - line: 'some("\\42");', - tokens: [ - { startIndex:0, type: 'tag.less' }, - { startIndex:4, type: 'delimiter.parenthesis.less' }, - { startIndex:5, type: 'string.delimiter.less' }, - { startIndex:6, type: 'string.less' }, - { startIndex:9, type: 'string.delimiter.less' }, - { startIndex:10, type: 'delimiter.parenthesis.less' }, - { startIndex:11, type: 'delimiter.less' } - ]}], + line: 'some("\\42");', + tokens: [ + { startIndex: 0, type: 'tag.less' }, + { startIndex: 4, type: 'delimiter.parenthesis.less' }, + { startIndex: 5, type: 'string.delimiter.less' }, + { startIndex: 6, type: 'string.less' }, + { startIndex: 9, type: 'string.delimiter.less' }, + { startIndex: 10, type: 'delimiter.parenthesis.less' }, + { startIndex: 11, type: 'delimiter.less' } + ] + }], [{ - line: ' ~ "icon-"', - tokens: [ - { startIndex:0, type: '' }, - { startIndex:1, type: 'operator.less' }, - { startIndex:2, type: '' }, - { startIndex:3, type: 'string.delimiter.less' }, - { startIndex:4, type: 'string.less' }, - { startIndex:9, type: 'string.delimiter.less' } - ]}], + line: ' ~ "icon-"', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 1, type: 'operator.less' }, + { startIndex: 2, type: '' }, + { startIndex: 3, type: 'string.delimiter.less' }, + { startIndex: 4, type: 'string.less' }, + { startIndex: 9, type: 'string.delimiter.less' } + ] + }], // Difficult little bugs... => Operator mismatches [{ - line: 'class^="icon-"', - tokens: [ - { startIndex:0, type: 'tag.less' }, - { startIndex:5, type: 'operator.less' }, - { startIndex:7, type: 'string.delimiter.less' }, - { startIndex:8, type: 'string.less' }, - { startIndex:13, type: 'string.delimiter.less' } - ]}], + line: 'class^="icon-"', + tokens: [ + { startIndex: 0, type: 'tag.less' }, + { startIndex: 5, type: 'operator.less' }, + { startIndex: 7, type: 'string.delimiter.less' }, + { startIndex: 8, type: 'string.less' }, + { startIndex: 13, type: 'string.delimiter.less' } + ] + }], [{ - line: 'class*="icon-"', - tokens: [ - { startIndex:0, type: 'tag.less' }, - { startIndex:5, type: 'operator.less' }, - { startIndex:7, type: 'string.delimiter.less' }, - { startIndex:8, type: 'string.less' }, - { startIndex:13, type: 'string.delimiter.less' } - ]}], + line: 'class*="icon-"', + tokens: [ + { startIndex: 0, type: 'tag.less' }, + { startIndex: 5, type: 'operator.less' }, + { startIndex: 7, type: 'string.delimiter.less' }, + { startIndex: 8, type: 'string.less' }, + { startIndex: 13, type: 'string.delimiter.less' } + ] + }], [{ - line: 'class~="icon-"', - tokens: [ - { startIndex:0, type: 'tag.less' }, - { startIndex:5, type: 'operator.less' }, - { startIndex:7, type: 'string.delimiter.less' }, - { startIndex:8, type: 'string.less' }, - { startIndex:13, type: 'string.delimiter.less' } - ]}], + line: 'class~="icon-"', + tokens: [ + { startIndex: 0, type: 'tag.less' }, + { startIndex: 5, type: 'operator.less' }, + { startIndex: 7, type: 'string.delimiter.less' }, + { startIndex: 8, type: 'string.less' }, + { startIndex: 13, type: 'string.delimiter.less' } + ] + }], [{ - line: 'class ~ = "icon-"', - tokens: [ - { startIndex:0, type: 'tag.less' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'operator.less' }, - { startIndex:7, type: '' }, - { startIndex:8, type: 'operator.less' }, - { startIndex:9, type: '' }, - { startIndex:10, type: 'string.delimiter.less' }, - { startIndex:11, type: 'string.less' }, - { startIndex:16, type: 'string.delimiter.less' } - ]}], + line: 'class ~ = "icon-"', + tokens: [ + { startIndex: 0, type: 'tag.less' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'operator.less' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'operator.less' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'string.delimiter.less' }, + { startIndex: 11, type: 'string.less' }, + { startIndex: 16, type: 'string.delimiter.less' } + ] + }], [{ - line: 'class|="icon-"', - tokens: [ - { startIndex:0, type: 'tag.less' }, - { startIndex:5, type: 'operator.less' }, - { startIndex:7, type: 'string.delimiter.less' }, - { startIndex:8, type: 'string.less' }, - { startIndex:13, type: 'string.delimiter.less' } - ]}], + line: 'class|="icon-"', + tokens: [ + { startIndex: 0, type: 'tag.less' }, + { startIndex: 5, type: 'operator.less' }, + { startIndex: 7, type: 'string.delimiter.less' }, + { startIndex: 8, type: 'string.less' }, + { startIndex: 13, type: 'string.delimiter.less' } + ] + }], [{ - line: '.hide-text { font: 0/0 a; }', - tokens: [ - { startIndex:0, type: 'tag.class.less' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'delimiter.curly.less' }, - { startIndex:12, type: '' }, - { startIndex:13, type: 'attribute.name.less' }, - { startIndex:17, type: 'delimiter.less' }, - { startIndex:18, type: '' }, - { startIndex:19, type: 'attribute.value.number.less' }, - { startIndex:20, type: 'operator.less' }, - { startIndex:21, type: 'attribute.value.number.less' }, - { startIndex:22, type: '' }, - { startIndex:23, type: 'attribute.value.less' }, - { startIndex:24, type: 'delimiter.less' }, - { startIndex:25, type: '' }, - { startIndex:26, type: 'delimiter.curly.less' } - ]}], + line: '.hide-text { font: 0/0 a; }', + tokens: [ + { startIndex: 0, type: 'tag.class.less' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'delimiter.curly.less' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'attribute.name.less' }, + { startIndex: 17, type: 'delimiter.less' }, + { startIndex: 18, type: '' }, + { startIndex: 19, type: 'attribute.value.number.less' }, + { startIndex: 20, type: 'operator.less' }, + { startIndex: 21, type: 'attribute.value.number.less' }, + { startIndex: 22, type: '' }, + { startIndex: 23, type: 'attribute.value.less' }, + { startIndex: 24, type: 'delimiter.less' }, + { startIndex: 25, type: '' }, + { startIndex: 26, type: 'delimiter.curly.less' } + ] + }], // Difficult little bugs... => Numbers in classes [{ - line: '.translate3d(@x, @y, @z) { -webkit-transform: translate3d(@x, @y, @z); }', - tokens: [ - { startIndex:0, type: 'tag.class.less' }, - { startIndex:12, type: 'delimiter.parenthesis.less' }, - { startIndex:13, type: 'variable.less' }, - { startIndex:15, type: 'delimiter.less' }, - { startIndex:16, type: '' }, - { startIndex:17, type: 'variable.less' }, - { startIndex:19, type: 'delimiter.less' }, - { startIndex:20, type: '' }, - { startIndex:21, type: 'variable.less' }, - { startIndex:23, type: 'delimiter.parenthesis.less' }, - { startIndex:24, type: '' }, - { startIndex:25, type: 'delimiter.curly.less' }, - { startIndex:26, type: '' }, - { startIndex:27, type: 'attribute.name.less' }, - { startIndex:44, type: 'delimiter.less' }, - { startIndex:45, type: '' }, - { startIndex:46, type: 'attribute.value.less' }, - { startIndex:57, type: 'delimiter.parenthesis.less' }, - { startIndex:58, type: 'variable.less' }, - { startIndex:60, type: 'delimiter.less' }, - { startIndex:61, type: '' }, - { startIndex:62, type: 'variable.less' }, - { startIndex:64, type: 'delimiter.less' }, - { startIndex:65, type: '' }, - { startIndex:66, type: 'variable.less' }, - { startIndex:68, type: 'delimiter.parenthesis.less' }, - { startIndex:69, type: 'delimiter.less' }, - { startIndex:70, type: '' }, - { startIndex:71, type: 'delimiter.curly.less' } - ]}], + line: '.translate3d(@x, @y, @z) { -webkit-transform: translate3d(@x, @y, @z); }', + tokens: [ + { startIndex: 0, type: 'tag.class.less' }, + { startIndex: 12, type: 'delimiter.parenthesis.less' }, + { startIndex: 13, type: 'variable.less' }, + { startIndex: 15, type: 'delimiter.less' }, + { startIndex: 16, type: '' }, + { startIndex: 17, type: 'variable.less' }, + { startIndex: 19, type: 'delimiter.less' }, + { startIndex: 20, type: '' }, + { startIndex: 21, type: 'variable.less' }, + { startIndex: 23, type: 'delimiter.parenthesis.less' }, + { startIndex: 24, type: '' }, + { startIndex: 25, type: 'delimiter.curly.less' }, + { startIndex: 26, type: '' }, + { startIndex: 27, type: 'attribute.name.less' }, + { startIndex: 44, type: 'delimiter.less' }, + { startIndex: 45, type: '' }, + { startIndex: 46, type: 'attribute.value.less' }, + { startIndex: 57, type: 'delimiter.parenthesis.less' }, + { startIndex: 58, type: 'variable.less' }, + { startIndex: 60, type: 'delimiter.less' }, + { startIndex: 61, type: '' }, + { startIndex: 62, type: 'variable.less' }, + { startIndex: 64, type: 'delimiter.less' }, + { startIndex: 65, type: '' }, + { startIndex: 66, type: 'variable.less' }, + { startIndex: 68, type: 'delimiter.parenthesis.less' }, + { startIndex: 69, type: 'delimiter.less' }, + { startIndex: 70, type: '' }, + { startIndex: 71, type: 'delimiter.curly.less' } + ] + }], // Difficult little bugs... => Generic mismatches, worst case... [{ - line: '.dropdown-menu > li > a:hover > [class=" icon-"]', - tokens: [ - { startIndex:0, type: 'tag.class.less' }, - { startIndex:14, type: '' }, - { startIndex:15, type: 'operator.less' }, - { startIndex:16, type: '' }, - { startIndex:17, type: 'tag.less' }, - { startIndex:19, type: '' }, - { startIndex:20, type: 'operator.less' }, - { startIndex:21, type: '' }, - { startIndex:22, type: 'tag.less' }, - { startIndex:29, type: '' }, - { startIndex:30, type: 'operator.less' }, - { startIndex:31, type: '' }, - { startIndex:32, type: 'delimiter.bracket.less' }, - { startIndex:33, type: 'tag.less' }, - { startIndex:38, type: 'operator.less' }, - { startIndex:39, type: 'string.delimiter.less' }, - { startIndex:40, type: 'string.less' }, - { startIndex:46, type: 'string.delimiter.less' }, - { startIndex:47, type: 'delimiter.bracket.less' } - ]}], + line: '.dropdown-menu > li > a:hover > [class=" icon-"]', + tokens: [ + { startIndex: 0, type: 'tag.class.less' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'operator.less' }, + { startIndex: 16, type: '' }, + { startIndex: 17, type: 'tag.less' }, + { startIndex: 19, type: '' }, + { startIndex: 20, type: 'operator.less' }, + { startIndex: 21, type: '' }, + { startIndex: 22, type: 'tag.less' }, + { startIndex: 29, type: '' }, + { startIndex: 30, type: 'operator.less' }, + { startIndex: 31, type: '' }, + { startIndex: 32, type: 'delimiter.bracket.less' }, + { startIndex: 33, type: 'tag.less' }, + { startIndex: 38, type: 'operator.less' }, + { startIndex: 39, type: 'string.delimiter.less' }, + { startIndex: 40, type: 'string.less' }, + { startIndex: 46, type: 'string.delimiter.less' }, + { startIndex: 47, type: 'delimiter.bracket.less' } + ] + }], [{ - line: '.bw-gradient(@color: #F5F5F5, @start: 0, @stop: 255) { background: -webkit-gradient(color-stop(0, rgb(@start,@start,@start)), color-stop(1, rgb(@stop,@stop,@stop))); }', - tokens: [ - { startIndex:0, type: 'tag.class.less' }, - { startIndex:12, type: 'delimiter.parenthesis.less' }, - { startIndex:13, type: 'variable.less' }, - { startIndex:19, type: 'delimiter.less' }, - { startIndex:20, type: '' }, - { startIndex:21, type: 'attribute.value.hex.less' }, - { startIndex:28, type: 'delimiter.less' }, - { startIndex:29, type: '' }, - { startIndex:30, type: 'variable.less' }, - { startIndex:36, type: 'delimiter.less' }, - { startIndex:37, type: '' }, - { startIndex:38, type: 'attribute.value.number.less' }, - { startIndex:39, type: 'delimiter.less' }, - { startIndex:40, type: '' }, - { startIndex:41, type: 'variable.less' }, - { startIndex:46, type: 'delimiter.less' }, - { startIndex:47, type: '' }, - { startIndex:48, type: 'attribute.value.number.less' }, - { startIndex:51, type: 'delimiter.parenthesis.less' }, - { startIndex:52, type: '' }, - { startIndex:53, type: 'delimiter.curly.less' }, - { startIndex:54, type: '' }, - { startIndex:55, type: 'attribute.name.less' }, - { startIndex:65, type: 'delimiter.less' }, - { startIndex:66, type: '' }, - { startIndex:67, type: 'attribute.value.less' }, - { startIndex:83, type: 'delimiter.parenthesis.less' }, - { startIndex:84, type: 'attribute.value.less' }, - { startIndex:94, type: 'delimiter.parenthesis.less' }, - { startIndex:95, type: 'attribute.value.number.less' }, - { startIndex:96, type: 'delimiter.less' }, - { startIndex:97, type: '' }, - { startIndex:98, type: 'attribute.value.less' }, - { startIndex:101, type: 'delimiter.parenthesis.less' }, - { startIndex:102, type: 'variable.less' }, - { startIndex:108, type: 'delimiter.less' }, - { startIndex:109, type: 'variable.less' }, - { startIndex:115, type: 'delimiter.less' }, - { startIndex:116, type: 'variable.less' }, - { startIndex:122, type: 'delimiter.parenthesis.less' }, - { startIndex:124, type: 'delimiter.less' }, - { startIndex:125, type: '' }, - { startIndex:126, type: 'attribute.value.less' }, - { startIndex:136, type: 'delimiter.parenthesis.less' }, - { startIndex:137, type: 'attribute.value.number.less' }, - { startIndex:138, type: 'delimiter.less' }, - { startIndex:139, type: '' }, - { startIndex:140, type: 'attribute.value.less' }, - { startIndex:143, type: 'delimiter.parenthesis.less' }, - { startIndex:144, type: 'variable.less' }, - { startIndex:149, type: 'delimiter.less' }, - { startIndex:150, type: 'variable.less' }, - { startIndex:155, type: 'delimiter.less' }, - { startIndex:156, type: 'variable.less' }, - { startIndex:161, type: 'delimiter.parenthesis.less' }, - { startIndex:164, type: 'delimiter.less' }, - { startIndex:165, type: '' }, - { startIndex:166, type: 'delimiter.curly.less' } - ]}], + line: '.bw-gradient(@color: #F5F5F5, @start: 0, @stop: 255) { background: -webkit-gradient(color-stop(0, rgb(@start,@start,@start)), color-stop(1, rgb(@stop,@stop,@stop))); }', + tokens: [ + { startIndex: 0, type: 'tag.class.less' }, + { startIndex: 12, type: 'delimiter.parenthesis.less' }, + { startIndex: 13, type: 'variable.less' }, + { startIndex: 19, type: 'delimiter.less' }, + { startIndex: 20, type: '' }, + { startIndex: 21, type: 'attribute.value.hex.less' }, + { startIndex: 28, type: 'delimiter.less' }, + { startIndex: 29, type: '' }, + { startIndex: 30, type: 'variable.less' }, + { startIndex: 36, type: 'delimiter.less' }, + { startIndex: 37, type: '' }, + { startIndex: 38, type: 'attribute.value.number.less' }, + { startIndex: 39, type: 'delimiter.less' }, + { startIndex: 40, type: '' }, + { startIndex: 41, type: 'variable.less' }, + { startIndex: 46, type: 'delimiter.less' }, + { startIndex: 47, type: '' }, + { startIndex: 48, type: 'attribute.value.number.less' }, + { startIndex: 51, type: 'delimiter.parenthesis.less' }, + { startIndex: 52, type: '' }, + { startIndex: 53, type: 'delimiter.curly.less' }, + { startIndex: 54, type: '' }, + { startIndex: 55, type: 'attribute.name.less' }, + { startIndex: 65, type: 'delimiter.less' }, + { startIndex: 66, type: '' }, + { startIndex: 67, type: 'attribute.value.less' }, + { startIndex: 83, type: 'delimiter.parenthesis.less' }, + { startIndex: 84, type: 'attribute.value.less' }, + { startIndex: 94, type: 'delimiter.parenthesis.less' }, + { startIndex: 95, type: 'attribute.value.number.less' }, + { startIndex: 96, type: 'delimiter.less' }, + { startIndex: 97, type: '' }, + { startIndex: 98, type: 'attribute.value.less' }, + { startIndex: 101, type: 'delimiter.parenthesis.less' }, + { startIndex: 102, type: 'variable.less' }, + { startIndex: 108, type: 'delimiter.less' }, + { startIndex: 109, type: 'variable.less' }, + { startIndex: 115, type: 'delimiter.less' }, + { startIndex: 116, type: 'variable.less' }, + { startIndex: 122, type: 'delimiter.parenthesis.less' }, + { startIndex: 124, type: 'delimiter.less' }, + { startIndex: 125, type: '' }, + { startIndex: 126, type: 'attribute.value.less' }, + { startIndex: 136, type: 'delimiter.parenthesis.less' }, + { startIndex: 137, type: 'attribute.value.number.less' }, + { startIndex: 138, type: 'delimiter.less' }, + { startIndex: 139, type: '' }, + { startIndex: 140, type: 'attribute.value.less' }, + { startIndex: 143, type: 'delimiter.parenthesis.less' }, + { startIndex: 144, type: 'variable.less' }, + { startIndex: 149, type: 'delimiter.less' }, + { startIndex: 150, type: 'variable.less' }, + { startIndex: 155, type: 'delimiter.less' }, + { startIndex: 156, type: 'variable.less' }, + { startIndex: 161, type: 'delimiter.parenthesis.less' }, + { startIndex: 164, type: 'delimiter.less' }, + { startIndex: 165, type: '' }, + { startIndex: 166, type: 'delimiter.curly.less' } + ] + }], // Here CSS Tests from CSS File // Skip whitespace [{ - line: ' body ', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 6, type: 'tag.less' }, - { startIndex: 10, type: '' } - ]}], + line: ' body ', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 6, type: 'tag.less' }, + { startIndex: 10, type: '' } + ] + }], // CSS rule // body { @@ -904,131 +974,142 @@ testTokenization(['less'], [ // color: #000 // } [{ - line: 'body {', - tokens: [ - { startIndex: 0, type: 'tag.less' }, - { startIndex: 4, type: '' }, - { startIndex: 5, type: 'delimiter.curly.less' } - ]}, { - line: ' margin: 0;', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 2, type: 'attribute.name.less' }, - { startIndex: 8, type: 'delimiter.less' }, - { startIndex: 9, type: '' }, - { startIndex: 10, type: 'attribute.value.number.less' }, - { startIndex: 11, type: 'delimiter.less' } - ]}, { - line: ' padding: 3em 6em;', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 2, type: 'attribute.name.less' }, - { startIndex: 9, type: 'delimiter.less' }, - { startIndex: 10, type: '' }, - { startIndex: 11, type: 'attribute.value.number.less' }, - { startIndex: 12, type: 'attribute.value.unit.less' }, - { startIndex: 14, type: '' }, - { startIndex: 15, type: 'attribute.value.number.less' }, - { startIndex: 16, type: 'attribute.value.unit.less' }, - { startIndex: 18, type: 'delimiter.less' } - ]}, { - line: ' font-family: tahoma, arial, sans-serif;', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 2, type: 'attribute.name.less' }, - { startIndex: 13, type: 'delimiter.less' }, - { startIndex: 14, type: '' }, - { startIndex: 15, type: 'attribute.value.less' }, - { startIndex: 21, type: 'delimiter.less' }, - { startIndex: 22, type: '' }, - { startIndex: 23, type: 'attribute.value.less' }, - { startIndex: 28, type: 'delimiter.less' }, - { startIndex: 29, type: '' }, - { startIndex: 30, type: 'attribute.value.less' }, - { startIndex: 40, type: 'delimiter.less' } - ]}, { - line: ' text-decoration: none !important;', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 2, type: 'attribute.name.less' }, - { startIndex: 17, type: 'delimiter.less' }, - { startIndex: 18, type: '' }, - { startIndex: 19, type: 'attribute.value.less' }, - { startIndex: 23, type: '' }, - { startIndex: 24, type: 'keyword.less' }, - { startIndex: 34, type: 'delimiter.less' } - ]}, { - line: ' color: #000;', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 2, type: 'attribute.name.less' }, - { startIndex: 7, type: 'delimiter.less' }, - { startIndex: 8, type: '' }, - { startIndex: 9, type: 'attribute.value.hex.less' }, - { startIndex: 13, type: 'delimiter.less' } - ]}, { - line: ' }', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 2, type: 'delimiter.curly.less' } - ]}], + line: 'body {', + tokens: [ + { startIndex: 0, type: 'tag.less' }, + { startIndex: 4, type: '' }, + { startIndex: 5, type: 'delimiter.curly.less' } + ] + }, { + line: ' margin: 0;', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 2, type: 'attribute.name.less' }, + { startIndex: 8, type: 'delimiter.less' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'attribute.value.number.less' }, + { startIndex: 11, type: 'delimiter.less' } + ] + }, { + line: ' padding: 3em 6em;', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 2, type: 'attribute.name.less' }, + { startIndex: 9, type: 'delimiter.less' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'attribute.value.number.less' }, + { startIndex: 12, type: 'attribute.value.unit.less' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'attribute.value.number.less' }, + { startIndex: 16, type: 'attribute.value.unit.less' }, + { startIndex: 18, type: 'delimiter.less' } + ] + }, { + line: ' font-family: tahoma, arial, sans-serif;', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 2, type: 'attribute.name.less' }, + { startIndex: 13, type: 'delimiter.less' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'attribute.value.less' }, + { startIndex: 21, type: 'delimiter.less' }, + { startIndex: 22, type: '' }, + { startIndex: 23, type: 'attribute.value.less' }, + { startIndex: 28, type: 'delimiter.less' }, + { startIndex: 29, type: '' }, + { startIndex: 30, type: 'attribute.value.less' }, + { startIndex: 40, type: 'delimiter.less' } + ] + }, { + line: ' text-decoration: none !important;', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 2, type: 'attribute.name.less' }, + { startIndex: 17, type: 'delimiter.less' }, + { startIndex: 18, type: '' }, + { startIndex: 19, type: 'attribute.value.less' }, + { startIndex: 23, type: '' }, + { startIndex: 24, type: 'keyword.less' }, + { startIndex: 34, type: 'delimiter.less' } + ] + }, { + line: ' color: #000;', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 2, type: 'attribute.name.less' }, + { startIndex: 7, type: 'delimiter.less' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'attribute.value.hex.less' }, + { startIndex: 13, type: 'delimiter.less' } + ] + }, { + line: ' }', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 2, type: 'delimiter.curly.less' } + ] + }], // CSS units and numbers [{ - line: '* { padding: 3em -9pt -0.5px; }', - tokens: [ - { startIndex: 0, type: 'operator.less' }, - { startIndex: 1, type: '' }, - { startIndex: 2, type: 'delimiter.curly.less' }, - { startIndex: 3, type: '' }, - { startIndex: 4, type: 'attribute.name.less' }, - { startIndex: 11, type: 'delimiter.less' }, - { startIndex: 12, type: '' }, - { startIndex: 13, type: 'attribute.value.number.less' }, - { startIndex: 14, type: 'attribute.value.unit.less' }, - { startIndex: 16, type: '' }, - { startIndex: 17, type: 'operator.less' }, - { startIndex: 18, type: 'attribute.value.number.less' }, - { startIndex: 19, type: 'attribute.value.unit.less' }, - { startIndex: 21, type: '' }, - { startIndex: 22, type: 'operator.less' }, - { startIndex: 23, type: 'attribute.value.number.less' }, - { startIndex: 26, type: 'attribute.value.unit.less' }, - { startIndex: 28, type: 'delimiter.less' }, - { startIndex: 29, type: '' }, - { startIndex: 30, type: 'delimiter.curly.less' } - ]}], + line: '* { padding: 3em -9pt -0.5px; }', + tokens: [ + { startIndex: 0, type: 'operator.less' }, + { startIndex: 1, type: '' }, + { startIndex: 2, type: 'delimiter.curly.less' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'attribute.name.less' }, + { startIndex: 11, type: 'delimiter.less' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'attribute.value.number.less' }, + { startIndex: 14, type: 'attribute.value.unit.less' }, + { startIndex: 16, type: '' }, + { startIndex: 17, type: 'operator.less' }, + { startIndex: 18, type: 'attribute.value.number.less' }, + { startIndex: 19, type: 'attribute.value.unit.less' }, + { startIndex: 21, type: '' }, + { startIndex: 22, type: 'operator.less' }, + { startIndex: 23, type: 'attribute.value.number.less' }, + { startIndex: 26, type: 'attribute.value.unit.less' }, + { startIndex: 28, type: 'delimiter.less' }, + { startIndex: 29, type: '' }, + { startIndex: 30, type: 'delimiter.curly.less' } + ] + }], // CSS single line comment // h1 /*comment*/ p { [{ - line: 'h1 /*comment*/ p {', - tokens: [ - { startIndex: 0, type: 'tag.less' }, - { startIndex: 2, type: '' }, - { startIndex: 3, type: 'comment.less' }, - { startIndex: 14, type: '' }, - { startIndex: 15, type: 'tag.less' }, - { startIndex: 16, type: '' }, - { startIndex: 17, type: 'delimiter.curly.less' } - ]}], + line: 'h1 /*comment*/ p {', + tokens: [ + { startIndex: 0, type: 'tag.less' }, + { startIndex: 2, type: '' }, + { startIndex: 3, type: 'comment.less' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'tag.less' }, + { startIndex: 16, type: '' }, + { startIndex: 17, type: 'delimiter.curly.less' } + ] + }], // CSS multi line comment // h1 /*com // ment*/ p { [{ - line: 'h1 /*com', - tokens: [ - { startIndex: 0, type: 'tag.less' }, - { startIndex: 2, type: '' }, - { startIndex: 3, type: 'comment.less' } - ]}, { - line: 'ment*/ p', - tokens: [ - { startIndex: 0, type: 'comment.less' }, - { startIndex: 6, type: '' }, - { startIndex: 7, type: 'tag.less' } - ]}], + line: 'h1 /*com', + tokens: [ + { startIndex: 0, type: 'tag.less' }, + { startIndex: 2, type: '' }, + { startIndex: 3, type: 'comment.less' } + ] + }, { + line: 'ment*/ p', + tokens: [ + { startIndex: 0, type: 'comment.less' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'tag.less' } + ] + }], // CSS ID rule // #myID { @@ -1036,85 +1117,93 @@ testTokenization(['less'], [ // content: 'contents'; // } [{ - line: '#myID {', - tokens: [ - { startIndex: 0, type: 'tag.id.less' }, - { startIndex: 5, type: '' }, - { startIndex: 6, type: 'delimiter.curly.less' } - ]}], + line: '#myID {', + tokens: [ + { startIndex: 0, type: 'tag.id.less' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.curly.less' } + ] + }], // CSS Class rules // .myID { // h1 > p { [{ - line: '.myID {', - tokens: [ - { startIndex: 0, type: 'tag.class.less' }, - { startIndex: 5, type: '' }, - { startIndex: 6, type: 'delimiter.curly.less' } - ]}], + line: '.myID {', + tokens: [ + { startIndex: 0, type: 'tag.class.less' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.curly.less' } + ] + }], // CSS @import etc // @import url('something.less'); { [{ - line: '@import url(\"something.less\");', - tokens: [ - { startIndex: 0, type: 'keyword.less' }, - { startIndex: 7, type: '' }, - { startIndex: 8, type: 'tag.less' }, - { startIndex: 12, type: 'string.delimiter.less' }, - { startIndex: 13, type: 'string.less' }, - { startIndex: 27, type: 'string.delimiter.less' }, - { startIndex: 28, type: 'delimiter.parenthesis.less' }, - { startIndex: 29, type: 'delimiter.less' } - ]}], + line: '@import url(\"something.less\");', + tokens: [ + { startIndex: 0, type: 'keyword.less' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'tag.less' }, + { startIndex: 12, type: 'string.delimiter.less' }, + { startIndex: 13, type: 'string.less' }, + { startIndex: 27, type: 'string.delimiter.less' }, + { startIndex: 28, type: 'delimiter.parenthesis.less' }, + { startIndex: 29, type: 'delimiter.less' } + ] + }], // CSS multi-line string with an escaped newline // body { // content: 'con\ // tent'; [{ - line: 'body {', - tokens: [ - { startIndex: 0, type: 'tag.less' }, - { startIndex: 4, type: '' }, - { startIndex: 5, type: 'delimiter.curly.less' }, - ]}, { - line: ' content: \"con\\', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 2, type: 'attribute.name.less' }, - { startIndex: 9, type: 'delimiter.less' }, - { startIndex: 10, type: '' }, - { startIndex: 11, type: 'string.delimiter.less' }, - { startIndex: 12, type: 'string.less' } - ]}, { - line: 'tent\";', - tokens: [ - { startIndex: 0, type: 'string.less' }, - { startIndex: 4, type: 'string.delimiter.less' }, - { startIndex: 5, type: 'delimiter.less' } - ]}], + line: 'body {', + tokens: [ + { startIndex: 0, type: 'tag.less' }, + { startIndex: 4, type: '' }, + { startIndex: 5, type: 'delimiter.curly.less' }, + ] + }, { + line: ' content: \"con\\', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 2, type: 'attribute.name.less' }, + { startIndex: 9, type: 'delimiter.less' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'string.delimiter.less' }, + { startIndex: 12, type: 'string.less' } + ] + }, { + line: 'tent\";', + tokens: [ + { startIndex: 0, type: 'string.less' }, + { startIndex: 4, type: 'string.delimiter.less' }, + { startIndex: 5, type: 'delimiter.less' } + ] + }], // CSS empty string value // body { // content: ''; [{ - line: 'body {', - tokens: [ - { startIndex: 0, type: 'tag.less' }, - { startIndex: 4, type: '' }, - { startIndex: 5, type: 'delimiter.curly.less' }, - ]}, { - line: ' content: \"\";', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 2, type: 'attribute.name.less' }, - { startIndex: 9, type: 'delimiter.less' }, - { startIndex: 10, type: '' }, - { startIndex: 11, type: 'string.delimiter.less' }, - { startIndex: 13, type: 'delimiter.less' } - ]}], + line: 'body {', + tokens: [ + { startIndex: 0, type: 'tag.less' }, + { startIndex: 4, type: '' }, + { startIndex: 5, type: 'delimiter.curly.less' }, + ] + }, { + line: ' content: \"\";', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 2, type: 'attribute.name.less' }, + { startIndex: 9, type: 'delimiter.less' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'string.delimiter.less' }, + { startIndex: 13, type: 'delimiter.less' } + ] + }], // CSS font face @@ -1122,169 +1211,187 @@ testTokenization(['less'], [ // font-family: 'Opificio'; // } [{ - line: '@font-face {', - tokens: [ - { startIndex: 0, type: 'variable.less' }, - { startIndex: 10, type: '' }, - { startIndex: 11, type: 'delimiter.curly.less' } - ]}, { - line: ' font-family: "Opificio";', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 2, type: 'attribute.name.less' }, - { startIndex: 13, type: 'delimiter.less' }, - { startIndex: 14, type: '' }, - { startIndex: 15, type: 'string.delimiter.less' }, - { startIndex: 16, type: 'string.less' }, - { startIndex: 24, type: 'string.delimiter.less' }, - { startIndex: 25, type: 'delimiter.less' } - ]}], + line: '@font-face {', + tokens: [ + { startIndex: 0, type: 'variable.less' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'delimiter.curly.less' } + ] + }, { + line: ' font-family: "Opificio";', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 2, type: 'attribute.name.less' }, + { startIndex: 13, type: 'delimiter.less' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'string.delimiter.less' }, + { startIndex: 16, type: 'string.less' }, + { startIndex: 24, type: 'string.delimiter.less' }, + { startIndex: 25, type: 'delimiter.less' } + ] + }], // CSS string with escaped quotes // 's\"tr' [{ - line: '"s\\"tr\\"sadsad', - tokens: [ - { startIndex: 0, type: 'string.delimiter.less' }, - { startIndex: 1, type: 'string.less' } - ]}], + line: '"s\\"tr\\"sadsad', + tokens: [ + { startIndex: 0, type: 'string.delimiter.less' }, + { startIndex: 1, type: 'string.less' } + ] + }], // EG: Bracket Matching [{ - line: 'p{}', - tokens: [ - { startIndex: 0, type: 'tag.less' }, - { startIndex: 1, type: 'delimiter.curly.less' }, - ]}], + line: 'p{}', + tokens: [ + { startIndex: 0, type: 'tag.less' }, + { startIndex: 1, type: 'delimiter.curly.less' }, + ] + }], [{ - line: 'p:nth() {}', - tokens: [ - { startIndex: 0, type: 'tag.less' }, - { startIndex: 5, type: 'delimiter.parenthesis.less' }, - { startIndex: 7, type: '' }, - { startIndex: 8, type: 'delimiter.curly.less' }, - ]}], + line: 'p:nth() {}', + tokens: [ + { startIndex: 0, type: 'tag.less' }, + { startIndex: 5, type: 'delimiter.parenthesis.less' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'delimiter.curly.less' }, + ] + }], // EG: import statement - bug #10308 // @import url('something.css');@import url('something.css'); [{ - line: '@import url(\"something.css\");@import url(\"something.css\");', - tokens: [ - { startIndex: 0, type: 'keyword.less' }, - { startIndex: 7, type: '' }, - { startIndex: 8, type: 'tag.less' }, - { startIndex: 12, type: 'string.delimiter.less' }, - { startIndex: 13, type: 'string.less' }, - { startIndex: 26, type: 'string.delimiter.less' }, - { startIndex: 27, type: 'delimiter.parenthesis.less' }, - { startIndex: 28, type: 'delimiter.less' }, - { startIndex: 29, type: 'keyword.less' }, - { startIndex: 36, type: '' }, - { startIndex: 37, type: 'tag.less' }, - { startIndex: 41, type: 'string.delimiter.less' }, - { startIndex: 42, type: 'string.less' }, - { startIndex: 55, type: 'string.delimiter.less' }, - { startIndex: 56, type: 'delimiter.parenthesis.less' }, - { startIndex: 57, type: 'delimiter.less' } - ]}], + line: '@import url(\"something.css\");@import url(\"something.css\");', + tokens: [ + { startIndex: 0, type: 'keyword.less' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'tag.less' }, + { startIndex: 12, type: 'string.delimiter.less' }, + { startIndex: 13, type: 'string.less' }, + { startIndex: 26, type: 'string.delimiter.less' }, + { startIndex: 27, type: 'delimiter.parenthesis.less' }, + { startIndex: 28, type: 'delimiter.less' }, + { startIndex: 29, type: 'keyword.less' }, + { startIndex: 36, type: '' }, + { startIndex: 37, type: 'tag.less' }, + { startIndex: 41, type: 'string.delimiter.less' }, + { startIndex: 42, type: 'string.less' }, + { startIndex: 55, type: 'string.delimiter.less' }, + { startIndex: 56, type: 'delimiter.parenthesis.less' }, + { startIndex: 57, type: 'delimiter.less' } + ] + }], // EG: Triple quotes - bug #9870 [{ - line: '""""', - tokens: [ - { startIndex: 0, type: 'string.delimiter.less' }, - ]}], + line: '""""', + tokens: [ + { startIndex: 0, type: 'string.delimiter.less' }, + ] + }], // EG: CSS @import related coloring bug 9553 // @import url('something.css'); // .rule1{} // .rule2{} [{ - line: '@import url("something.css");', - tokens: [ - { startIndex: 0, type: 'keyword.less' }, - { startIndex: 7, type: '' }, - { startIndex: 8, type: 'tag.less' }, - { startIndex: 12, type: 'string.delimiter.less' }, - { startIndex: 13, type: 'string.less' }, - { startIndex: 26, type: 'string.delimiter.less' }, - { startIndex: 27, type: 'delimiter.parenthesis.less' }, - { startIndex: 28, type: 'delimiter.less' } - ]}, { - line: '.rule1{}', - tokens: [ - { startIndex: 0, type: 'tag.class.less' }, - { startIndex: 6, type: 'delimiter.curly.less' }, - ]}, { - line: '.rule2{}', - tokens: [ - { startIndex: 0, type: 'tag.class.less' }, - { startIndex: 6, type: 'delimiter.curly.less' }, - ]}], + line: '@import url("something.css");', + tokens: [ + { startIndex: 0, type: 'keyword.less' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'tag.less' }, + { startIndex: 12, type: 'string.delimiter.less' }, + { startIndex: 13, type: 'string.less' }, + { startIndex: 26, type: 'string.delimiter.less' }, + { startIndex: 27, type: 'delimiter.parenthesis.less' }, + { startIndex: 28, type: 'delimiter.less' } + ] + }, { + line: '.rule1{}', + tokens: [ + { startIndex: 0, type: 'tag.class.less' }, + { startIndex: 6, type: 'delimiter.curly.less' }, + ] + }, { + line: '.rule2{}', + tokens: [ + { startIndex: 0, type: 'tag.class.less' }, + { startIndex: 6, type: 'delimiter.curly.less' }, + ] + }], // EG: CSS key frame animation syntax [{ - line: '@-webkit-keyframes infinite-spinning {', - tokens: [ - { startIndex: 0, type: 'variable.less' }, - { startIndex: 18, type: '' }, - { startIndex: 19, type: 'tag.less' }, - { startIndex: 36, type: '' }, - { startIndex: 37, type: 'delimiter.curly.less' } - ]}, { - line: ' from {', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 2, type: 'tag.less' }, - { startIndex: 6, type: '' }, - { startIndex: 7, type: 'delimiter.curly.less' } - ]}, { - line: ' -webkit-transform: rotate(0deg);', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 2, type: 'attribute.name.less' }, - { startIndex: 19, type: 'delimiter.less' }, - { startIndex: 20, type: '' }, - { startIndex: 21, type: 'attribute.value.less' }, - { startIndex: 27, type: 'delimiter.parenthesis.less' }, - { startIndex: 28, type: 'attribute.value.number.less' }, - { startIndex: 29, type: 'attribute.value.unit.less' }, - { startIndex: 32, type: 'delimiter.parenthesis.less' }, - { startIndex: 33, type: 'delimiter.less' } - ]}, { - line: ' }', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 2, type: 'delimiter.curly.less' } - ]}, { - line: ' to {', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 2, type: 'tag.less' }, - { startIndex: 4, type: '' }, - { startIndex: 5, type: 'delimiter.curly.less' } - ]}, { - line: ' -webkit-transform: rotate(360deg);', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 2, type: 'attribute.name.less' }, - { startIndex: 19, type: 'delimiter.less' }, - { startIndex: 20, type: '' }, - { startIndex: 21, type: 'attribute.value.less' }, - { startIndex: 27, type: 'delimiter.parenthesis.less' }, - { startIndex: 28, type: 'attribute.value.number.less' }, - { startIndex: 31, type: 'attribute.value.unit.less' }, - { startIndex: 34, type: 'delimiter.parenthesis.less' }, - { startIndex: 35, type: 'delimiter.less' } - ]}, { - line: ' }', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 2, type: 'delimiter.curly.less' } - ]}, { - line: '}', - tokens: [ - { startIndex: 0, type: 'delimiter.curly.less' } - ]}] + line: '@-webkit-keyframes infinite-spinning {', + tokens: [ + { startIndex: 0, type: 'variable.less' }, + { startIndex: 18, type: '' }, + { startIndex: 19, type: 'tag.less' }, + { startIndex: 36, type: '' }, + { startIndex: 37, type: 'delimiter.curly.less' } + ] + }, { + line: ' from {', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 2, type: 'tag.less' }, + { startIndex: 6, type: '' }, + { startIndex: 7, type: 'delimiter.curly.less' } + ] + }, { + line: ' -webkit-transform: rotate(0deg);', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 2, type: 'attribute.name.less' }, + { startIndex: 19, type: 'delimiter.less' }, + { startIndex: 20, type: '' }, + { startIndex: 21, type: 'attribute.value.less' }, + { startIndex: 27, type: 'delimiter.parenthesis.less' }, + { startIndex: 28, type: 'attribute.value.number.less' }, + { startIndex: 29, type: 'attribute.value.unit.less' }, + { startIndex: 32, type: 'delimiter.parenthesis.less' }, + { startIndex: 33, type: 'delimiter.less' } + ] + }, { + line: ' }', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 2, type: 'delimiter.curly.less' } + ] + }, { + line: ' to {', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 2, type: 'tag.less' }, + { startIndex: 4, type: '' }, + { startIndex: 5, type: 'delimiter.curly.less' } + ] + }, { + line: ' -webkit-transform: rotate(360deg);', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 2, type: 'attribute.name.less' }, + { startIndex: 19, type: 'delimiter.less' }, + { startIndex: 20, type: '' }, + { startIndex: 21, type: 'attribute.value.less' }, + { startIndex: 27, type: 'delimiter.parenthesis.less' }, + { startIndex: 28, type: 'attribute.value.number.less' }, + { startIndex: 31, type: 'attribute.value.unit.less' }, + { startIndex: 34, type: 'delimiter.parenthesis.less' }, + { startIndex: 35, type: 'delimiter.less' } + ] + }, { + line: ' }', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 2, type: 'delimiter.curly.less' } + ] + }, { + line: '}', + tokens: [ + { startIndex: 0, type: 'delimiter.curly.less' } + ] + }] ]); diff --git a/test/lua.test.ts b/test/lua.test.ts index 0fe42fde..eb57ab33 100644 --- a/test/lua.test.ts +++ b/test/lua.test.ts @@ -5,72 +5,77 @@ 'use strict'; -import {testTokenization} from './testRunner'; +import { testTokenization } from './testRunner'; testTokenization('lua', [ // Keywords [{ - line: 'local x, y = 1, 10', - tokens: [ - { startIndex: 0, type: 'keyword.local.lua' }, - { startIndex: 5, type: '' }, - { startIndex: 6, type: 'identifier.lua' }, - { startIndex: 7, type: 'delimiter.lua' }, - { startIndex: 8, type: '' }, - { startIndex: 9, type: 'identifier.lua' }, - { startIndex: 10, type: '' }, - { startIndex: 11, type: 'delimiter.lua' }, - { startIndex: 12, type: '' }, - { startIndex: 13, type: 'number.lua' }, - { startIndex: 14, type: 'delimiter.lua' }, - { startIndex: 15, type: '' }, - { startIndex: 16, type: 'number.lua' } - ]}], + line: 'local x, y = 1, 10', + tokens: [ + { startIndex: 0, type: 'keyword.local.lua' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'identifier.lua' }, + { startIndex: 7, type: 'delimiter.lua' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'identifier.lua' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'delimiter.lua' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'number.lua' }, + { startIndex: 14, type: 'delimiter.lua' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'number.lua' } + ] + }], [{ - line: 'foo = "Hello" .. "World"; local foo = foo', - tokens: [ - { startIndex: 0, type: 'identifier.lua' }, - { startIndex: 3, type: '' }, - { startIndex: 4, type: 'delimiter.lua' }, - { startIndex: 5, type: '' }, - { startIndex: 6, type: 'string.lua' }, - { startIndex: 13, type: '' }, - { startIndex: 14, type: 'delimiter.lua' }, - { startIndex: 16, type: '' }, - { startIndex: 17, type: 'string.lua' }, - { startIndex: 24, type: 'delimiter.lua' }, - { startIndex: 25, type: '' }, - { startIndex: 26, type: 'keyword.local.lua' }, - { startIndex: 31, type: '' }, - { startIndex: 32, type: 'identifier.lua' }, - { startIndex: 35, type: '' }, - { startIndex: 36, type: 'delimiter.lua' }, - { startIndex: 37, type: '' }, - { startIndex: 38, type: 'identifier.lua' } - ]}], + line: 'foo = "Hello" .. "World"; local foo = foo', + tokens: [ + { startIndex: 0, type: 'identifier.lua' }, + { startIndex: 3, type: '' }, + { startIndex: 4, type: 'delimiter.lua' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'string.lua' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'delimiter.lua' }, + { startIndex: 16, type: '' }, + { startIndex: 17, type: 'string.lua' }, + { startIndex: 24, type: 'delimiter.lua' }, + { startIndex: 25, type: '' }, + { startIndex: 26, type: 'keyword.local.lua' }, + { startIndex: 31, type: '' }, + { startIndex: 32, type: 'identifier.lua' }, + { startIndex: 35, type: '' }, + { startIndex: 36, type: 'delimiter.lua' }, + { startIndex: 37, type: '' }, + { startIndex: 38, type: 'identifier.lua' } + ] + }], // Comments [{ - line: '--[[ text ]] x', - tokens: [ - { startIndex: 0, type: 'comment.lua' }, - { startIndex: 12, type: '' }, - { startIndex: 13, type: 'identifier.lua' } - ]}], + line: '--[[ text ]] x', + tokens: [ + { startIndex: 0, type: 'comment.lua' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'identifier.lua' } + ] + }], [{ - line: '--[===[ text ]===] x', - tokens: [ - { startIndex: 0, type: 'comment.lua' }, - { startIndex: 18, type: '' }, - { startIndex: 19, type: 'identifier.lua' } - ]}], + line: '--[===[ text ]===] x', + tokens: [ + { startIndex: 0, type: 'comment.lua' }, + { startIndex: 18, type: '' }, + { startIndex: 19, type: 'identifier.lua' } + ] + }], [{ - line: '--[===[ text ]==] x', - tokens: [ - { startIndex: 0, type: 'comment.lua' } - ]}] + line: '--[===[ text ]==] x', + tokens: [ + { startIndex: 0, type: 'comment.lua' } + ] + }] ]); diff --git a/test/markdown.test.ts b/test/markdown.test.ts index 4a6f30be..cd1bba58 100644 --- a/test/markdown.test.ts +++ b/test/markdown.test.ts @@ -5,40 +5,40 @@ 'use strict'; -import {testTokenization} from './testRunner'; +import { testTokenization } from './testRunner'; testTokenization('markdown', [ - [{ - line: '# Some header', - tokens: [ - { startIndex: 0, type: 'keyword.md' } - ] - }], + [{ + line: '# Some header', + tokens: [ + { startIndex: 0, type: 'keyword.md' } + ] + }], - [{ - line: '* Some list item', - tokens: [ - { startIndex: 0, type: 'keyword.md' }, - { startIndex: 2, type: '' } - ] - }], + [{ + line: '* Some list item', + tokens: [ + { startIndex: 0, type: 'keyword.md' }, + { startIndex: 2, type: '' } + ] + }], - [{ - line: 'some `code`', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 5, type: 'variable.md' } - ] - }], + [{ + line: 'some `code`', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 5, type: 'variable.md' } + ] + }], - [{ - line: 'some ![link](http://link.com)', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 5, type: 'string.link.md' }, - { startIndex: 7, type: '' }, - { startIndex: 11, type: 'string.link.md' } - ] - }] -]); \ No newline at end of file + [{ + line: 'some ![link](http://link.com)', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 5, type: 'string.link.md' }, + { startIndex: 7, type: '' }, + { startIndex: 11, type: 'string.link.md' } + ] + }] +]); diff --git a/test/msdax.test.ts b/test/msdax.test.ts index b1e07a2f..68408305 100644 --- a/test/msdax.test.ts +++ b/test/msdax.test.ts @@ -5,366 +5,410 @@ 'use strict'; -import {testTokenization} from './testRunner'; +import { testTokenization } from './testRunner'; testTokenization('msdax', [ // Comments [{ - line: '// a comment', - tokens: [ - { startIndex: 0, type: 'comment.msdax' } - ]}], + line: '// a comment', + tokens: [ + { startIndex: 0, type: 'comment.msdax' } + ] + }], [{ - line: '-almost a comment', - tokens: [ - { startIndex: 0, type: 'operator.msdax' }, - { startIndex: 1, type: 'identifier.msdax' }, - { startIndex: 7, type: 'white.msdax' }, - { startIndex: 8, type: 'identifier.msdax' }, - { startIndex: 9, type: 'white.msdax' }, - { startIndex: 10, type: 'identifier.msdax' } - ]}], + line: '-almost a comment', + tokens: [ + { startIndex: 0, type: 'operator.msdax' }, + { startIndex: 1, type: 'identifier.msdax' }, + { startIndex: 7, type: 'white.msdax' }, + { startIndex: 8, type: 'identifier.msdax' }, + { startIndex: 9, type: 'white.msdax' }, + { startIndex: 10, type: 'identifier.msdax' } + ] + }], [{ - line: '/* a full line comment */', - tokens: [ - { startIndex: 0, type: 'comment.quote.msdax' }, - { startIndex: 2, type: 'comment.msdax' }, - { startIndex: 23, type: 'comment.quote.msdax' } - ]}], + line: '/* a full line comment */', + tokens: [ + { startIndex: 0, type: 'comment.quote.msdax' }, + { startIndex: 2, type: 'comment.msdax' }, + { startIndex: 23, type: 'comment.quote.msdax' } + ] + }], [{ - line: '/* /// *** /// */', - tokens: [ - { startIndex: 0, type: 'comment.quote.msdax' }, - { startIndex: 2, type: 'comment.msdax' }, - { startIndex: 15, type: 'comment.quote.msdax' } - ]}], + line: '/* /// *** /// */', + tokens: [ + { startIndex: 0, type: 'comment.quote.msdax' }, + { startIndex: 2, type: 'comment.msdax' }, + { startIndex: 15, type: 'comment.quote.msdax' } + ] + }], [{ - line: 'define measure x = /* a simple comment */ 1;', - tokens: [ - { startIndex: 0, type: 'keyword.msdax' }, - { startIndex: 6, type: 'white.msdax' }, - { startIndex: 7, type: 'keyword.msdax' }, - { startIndex: 14, type: 'white.msdax' }, - { startIndex: 15, type: 'identifier.msdax' }, - { startIndex: 16, type: 'white.msdax' }, - { startIndex: 17, type: 'operator.msdax' }, - { startIndex: 18, type: 'white.msdax' }, - { startIndex: 19, type: 'comment.quote.msdax' }, - { startIndex: 21, type: 'comment.msdax' }, - { startIndex: 39, type: 'comment.quote.msdax' }, - { startIndex: 41, type: 'white.msdax' }, - { startIndex: 42, type: 'number.msdax' }, - { startIndex: 43, type: 'delimiter.msdax' } - ]}], + line: 'define measure x = /* a simple comment */ 1;', + tokens: [ + { startIndex: 0, type: 'keyword.msdax' }, + { startIndex: 6, type: 'white.msdax' }, + { startIndex: 7, type: 'keyword.msdax' }, + { startIndex: 14, type: 'white.msdax' }, + { startIndex: 15, type: 'identifier.msdax' }, + { startIndex: 16, type: 'white.msdax' }, + { startIndex: 17, type: 'operator.msdax' }, + { startIndex: 18, type: 'white.msdax' }, + { startIndex: 19, type: 'comment.quote.msdax' }, + { startIndex: 21, type: 'comment.msdax' }, + { startIndex: 39, type: 'comment.quote.msdax' }, + { startIndex: 41, type: 'white.msdax' }, + { startIndex: 42, type: 'number.msdax' }, + { startIndex: 43, type: 'delimiter.msdax' } + ] + }], // Numbers [{ - line: '123', - tokens: [ - { startIndex: 0, type: 'number.msdax' } - ]}], + line: '123', + tokens: [ + { startIndex: 0, type: 'number.msdax' } + ] + }], [{ - line: '-123', - tokens: [ - { startIndex: 0, type: 'operator.msdax' }, - { startIndex: 1, type: 'number.msdax' } - ]}], + line: '-123', + tokens: [ + { startIndex: 0, type: 'operator.msdax' }, + { startIndex: 1, type: 'number.msdax' } + ] + }], [{ - line: '0xaBc123', - tokens: [ - { startIndex: 0, type: 'number.msdax' } - ]}], + line: '0xaBc123', + tokens: [ + { startIndex: 0, type: 'number.msdax' } + ] + }], [{ - line: '0XaBc123', - tokens: [ - { startIndex: 0, type: 'number.msdax' } - ]}], + line: '0XaBc123', + tokens: [ + { startIndex: 0, type: 'number.msdax' } + ] + }], [{ - line: '0x', - tokens: [ - { startIndex: 0, type: 'number.msdax' } - ]}], + line: '0x', + tokens: [ + { startIndex: 0, type: 'number.msdax' } + ] + }], [{ - line: '0x0', - tokens: [ - { startIndex: 0, type: 'number.msdax' } - ]}], + line: '0x0', + tokens: [ + { startIndex: 0, type: 'number.msdax' } + ] + }], [{ - line: '0xAB_CD', - tokens: [ - { startIndex: 0, type: 'number.msdax' }, - { startIndex: 4, type: 'identifier.msdax' } - ]}], + line: '0xAB_CD', + tokens: [ + { startIndex: 0, type: 'number.msdax' }, + { startIndex: 4, type: 'identifier.msdax' } + ] + }], [{ - line: '.', - tokens: [ - { startIndex: 0, type: 'delimiter.msdax' } - ]}], + line: '.', + tokens: [ + { startIndex: 0, type: 'delimiter.msdax' } + ] + }], [{ - line: '123', - tokens: [ - { startIndex: 0, type: 'number.msdax' } - ]}], + line: '123', + tokens: [ + { startIndex: 0, type: 'number.msdax' } + ] + }], [{ - line: '123.5678', - tokens: [ - { startIndex: 0, type: 'number.msdax' } - ]}], + line: '123.5678', + tokens: [ + { startIndex: 0, type: 'number.msdax' } + ] + }], [{ - line: '0.99', - tokens: [ - { startIndex: 0, type: 'number.msdax' } - ]}], + line: '0.99', + tokens: [ + { startIndex: 0, type: 'number.msdax' } + ] + }], [{ - line: '.99', - tokens: [ - { startIndex: 0, type: 'number.msdax' } - ]}], + line: '.99', + tokens: [ + { startIndex: 0, type: 'number.msdax' } + ] + }], [{ - line: '99.', - tokens: [ - { startIndex: 0, type: 'number.msdax' } - ]}], + line: '99.', + tokens: [ + { startIndex: 0, type: 'number.msdax' } + ] + }], [{ - line: '0.', - tokens: [ - { startIndex: 0, type: 'number.msdax' } - ]}], + line: '0.', + tokens: [ + { startIndex: 0, type: 'number.msdax' } + ] + }], [{ - line: '.0', - tokens: [ - { startIndex: 0, type: 'number.msdax' } - ]}], + line: '.0', + tokens: [ + { startIndex: 0, type: 'number.msdax' } + ] + }], [{ - line: '1E-2', - tokens: [ - { startIndex: 0, type: 'number.msdax' } - ]}], + line: '1E-2', + tokens: [ + { startIndex: 0, type: 'number.msdax' } + ] + }], [{ - line: '1E+2', - tokens: [ - { startIndex: 0, type: 'number.msdax' } - ]}], + line: '1E+2', + tokens: [ + { startIndex: 0, type: 'number.msdax' } + ] + }], [{ - line: '1E2', - tokens: [ - { startIndex: 0, type: 'number.msdax' } - ]}], + line: '1E2', + tokens: [ + { startIndex: 0, type: 'number.msdax' } + ] + }], [{ - line: '0.1E2', - tokens: [ - { startIndex: 0, type: 'number.msdax' } - ]}], + line: '0.1E2', + tokens: [ + { startIndex: 0, type: 'number.msdax' } + ] + }], [{ - line: '1.E2', - tokens: [ - { startIndex: 0, type: 'number.msdax' } - ]}], + line: '1.E2', + tokens: [ + { startIndex: 0, type: 'number.msdax' } + ] + }], [{ - line: '.1E2', - tokens: [ - { startIndex: 0, type: 'number.msdax' } - ]}], + line: '.1E2', + tokens: [ + { startIndex: 0, type: 'number.msdax' } + ] + }], // Identifiers [{ - line: '_abc01', - tokens: [ - { startIndex: 0, type: 'identifier.msdax' } - ]}], + line: '_abc01', + tokens: [ + { startIndex: 0, type: 'identifier.msdax' } + ] + }], [{ - line: 'abc01', - tokens: [ - { startIndex: 0, type: 'identifier.msdax' } - ]}], + line: 'abc01', + tokens: [ + { startIndex: 0, type: 'identifier.msdax' } + ] + }], [{ - line: 'evaluate filter', - tokens: [ - { startIndex: 0, type: 'keyword.msdax' }, - { startIndex: 8, type: 'white.msdax' }, - { startIndex: 9, type: 'keyword.msdax' } - ]}], + line: 'evaluate filter', + tokens: [ + { startIndex: 0, type: 'keyword.msdax' }, + { startIndex: 8, type: 'white.msdax' }, + { startIndex: 9, type: 'keyword.msdax' } + ] + }], [{ - line: '[abc[[ 321 ]] xyz]', - tokens: [ - { startIndex: 0, type: 'identifier.quote.msdax' }, - { startIndex: 1, type: 'identifier.msdax' }, - { startIndex: 17, type: 'identifier.quote.msdax' } - ]}], + line: '[abc[[ 321 ]] xyz]', + tokens: [ + { startIndex: 0, type: 'identifier.quote.msdax' }, + { startIndex: 1, type: 'identifier.msdax' }, + { startIndex: 17, type: 'identifier.quote.msdax' } + ] + }], [{ - line: '[abc', - tokens: [ - { startIndex: 0, type: 'identifier.quote.msdax' }, - { startIndex: 1, type: 'identifier.msdax' } - ]}], + line: '[abc', + tokens: [ + { startIndex: 0, type: 'identifier.quote.msdax' }, + { startIndex: 1, type: 'identifier.msdax' } + ] + }], [{ - line: 'define measure \'abc\'[def]', - tokens: [ - { startIndex: 0, type: 'keyword.msdax' }, - { startIndex: 6, type: 'white.msdax' }, - { startIndex: 7, type: 'keyword.msdax' }, - { startIndex: 14, type: 'white.msdax' }, - { startIndex: 15, type: 'identifier.quote.msdax' }, - { startIndex: 16, type: 'identifier.msdax' }, - { startIndex: 19, type: 'identifier.quote.msdax' }, - { startIndex: 21, type: 'identifier.msdax' }, - { startIndex: 24, type: 'identifier.quote.msdax' } - ]}], + line: 'define measure \'abc\'[def]', + tokens: [ + { startIndex: 0, type: 'keyword.msdax' }, + { startIndex: 6, type: 'white.msdax' }, + { startIndex: 7, type: 'keyword.msdax' }, + { startIndex: 14, type: 'white.msdax' }, + { startIndex: 15, type: 'identifier.quote.msdax' }, + { startIndex: 16, type: 'identifier.msdax' }, + { startIndex: 19, type: 'identifier.quote.msdax' }, + { startIndex: 21, type: 'identifier.msdax' }, + { startIndex: 24, type: 'identifier.quote.msdax' } + ] + }], [{ - line: 'int', - tokens: [ - { startIndex: 0, type: 'keyword.msdax' } - ]}], + line: 'int', + tokens: [ + { startIndex: 0, type: 'keyword.msdax' } + ] + }], [{ - line: '[int]', - tokens: [ - { startIndex: 0, type: 'identifier.quote.msdax' }, - { startIndex: 1, type: 'identifier.msdax' }, - { startIndex: 4, type: 'identifier.quote.msdax' } - ]}], + line: '[int]', + tokens: [ + { startIndex: 0, type: 'identifier.quote.msdax' }, + { startIndex: 1, type: 'identifier.msdax' }, + { startIndex: 4, type: 'identifier.quote.msdax' } + ] + }], // Strings [{ - line: '"abc"" 321 "" xyz"', - tokens: [ - { startIndex: 0, type: 'string.msdax' } - ]}], + line: '"abc"" 321 "" xyz"', + tokens: [ + { startIndex: 0, type: 'string.msdax' } + ] + }], [{ - line: 'define var x=\"a string\"', - tokens: [ - { startIndex: 0, type: 'keyword.msdax' }, - { startIndex: 6, type: 'white.msdax' }, - { startIndex: 7, type: 'keyword.msdax' }, - { startIndex: 10, type: 'white.msdax' }, - { startIndex: 11, type: 'identifier.msdax' }, - { startIndex: 12, type: 'operator.msdax' }, - { startIndex: 13, type: 'string.msdax' } - ]}], + line: 'define var x=\"a string\"', + tokens: [ + { startIndex: 0, type: 'keyword.msdax' }, + { startIndex: 6, type: 'white.msdax' }, + { startIndex: 7, type: 'keyword.msdax' }, + { startIndex: 10, type: 'white.msdax' }, + { startIndex: 11, type: 'identifier.msdax' }, + { startIndex: 12, type: 'operator.msdax' }, + { startIndex: 13, type: 'string.msdax' } + ] + }], [{ - line: '"a "" string with quotes"', - tokens: [ - { startIndex: 0, type: 'string.msdax' }, - ]}], + line: '"a "" string with quotes"', + tokens: [ + { startIndex: 0, type: 'string.msdax' }, + ] + }], [{ - line: '"a // string with comment"', - tokens: [ - { startIndex: 0, type: 'string.msdax' }, - ]}], + line: '"a // string with comment"', + tokens: [ + { startIndex: 0, type: 'string.msdax' }, + ] + }], [{ - line: 'N"a unicode string"', - tokens: [ - { startIndex: 0, type: 'string.msdax' }, - ]}], + line: 'N"a unicode string"', + tokens: [ + { startIndex: 0, type: 'string.msdax' }, + ] + }], [{ - line: '"a endless string', - tokens: [ - { startIndex: 0, type: 'string.msdax' }, - ]}], + line: '"a endless string', + tokens: [ + { startIndex: 0, type: 'string.msdax' }, + ] + }], // Operators [{ - line: 'define var x=1+3', - tokens: [ - { startIndex: 0, type: 'keyword.msdax' }, - { startIndex: 6, type: 'white.msdax' }, - { startIndex: 7, type: 'keyword.msdax' }, - { startIndex: 10, type: 'white.msdax' }, - { startIndex: 11, type: 'identifier.msdax' }, - { startIndex: 12, type: 'operator.msdax' }, - { startIndex: 13, type: 'number.msdax' }, - { startIndex: 14, type: 'operator.msdax' }, - { startIndex: 15, type: 'number.msdax' } - ]}], + line: 'define var x=1+3', + tokens: [ + { startIndex: 0, type: 'keyword.msdax' }, + { startIndex: 6, type: 'white.msdax' }, + { startIndex: 7, type: 'keyword.msdax' }, + { startIndex: 10, type: 'white.msdax' }, + { startIndex: 11, type: 'identifier.msdax' }, + { startIndex: 12, type: 'operator.msdax' }, + { startIndex: 13, type: 'number.msdax' }, + { startIndex: 14, type: 'operator.msdax' }, + { startIndex: 15, type: 'number.msdax' } + ] + }], [{ - line: 'define var x=1^+abc', - tokens: [ - { startIndex: 0, type: 'keyword.msdax' }, - { startIndex: 6, type: 'white.msdax' }, - { startIndex: 7, type: 'keyword.msdax' }, - { startIndex: 10, type: 'white.msdax' }, - { startIndex: 11, type: 'identifier.msdax' }, - { startIndex: 12, type: 'operator.msdax' }, - { startIndex: 13, type: 'number.msdax' }, - { startIndex: 14, type: 'operator.msdax' }, - { startIndex: 16, type: 'identifier.msdax' } - ]}], + line: 'define var x=1^+abc', + tokens: [ + { startIndex: 0, type: 'keyword.msdax' }, + { startIndex: 6, type: 'white.msdax' }, + { startIndex: 7, type: 'keyword.msdax' }, + { startIndex: 10, type: 'white.msdax' }, + { startIndex: 11, type: 'identifier.msdax' }, + { startIndex: 12, type: 'operator.msdax' }, + { startIndex: 13, type: 'number.msdax' }, + { startIndex: 14, type: 'operator.msdax' }, + { startIndex: 16, type: 'identifier.msdax' } + ] + }], - // Realistic queries and expressions + // Realistic queries and expressions [{ - line: 'EVALUATE \'Products\' ORDER BY [Product Id] DESC', - tokens: [ - { startIndex: 0, type: 'keyword.msdax' }, - { startIndex: 8, type: 'white.msdax' }, - { startIndex: 9, type: 'identifier.quote.msdax' }, - { startIndex: 10, type: 'identifier.msdax' }, - { startIndex: 18, type: 'identifier.quote.msdax' }, - { startIndex: 19, type: 'white.msdax' }, - { startIndex: 20, type: 'keyword.msdax' }, - { startIndex: 25, type: 'white.msdax' }, - { startIndex: 26, type: 'keyword.msdax' }, - { startIndex: 28, type: 'white.msdax' }, - { startIndex: 29, type: 'identifier.quote.msdax' }, - { startIndex: 30, type: 'identifier.msdax' }, - { startIndex: 40, type: 'identifier.quote.msdax' }, - { startIndex: 41, type: 'white.msdax' }, - { startIndex: 42, type: 'keyword.msdax' } - ]}], + line: 'EVALUATE \'Products\' ORDER BY [Product Id] DESC', + tokens: [ + { startIndex: 0, type: 'keyword.msdax' }, + { startIndex: 8, type: 'white.msdax' }, + { startIndex: 9, type: 'identifier.quote.msdax' }, + { startIndex: 10, type: 'identifier.msdax' }, + { startIndex: 18, type: 'identifier.quote.msdax' }, + { startIndex: 19, type: 'white.msdax' }, + { startIndex: 20, type: 'keyword.msdax' }, + { startIndex: 25, type: 'white.msdax' }, + { startIndex: 26, type: 'keyword.msdax' }, + { startIndex: 28, type: 'white.msdax' }, + { startIndex: 29, type: 'identifier.quote.msdax' }, + { startIndex: 30, type: 'identifier.msdax' }, + { startIndex: 40, type: 'identifier.quote.msdax' }, + { startIndex: 41, type: 'white.msdax' }, + { startIndex: 42, type: 'keyword.msdax' } + ] + }], [{ - line: 'DATATABLE("Price", STRING, {{"Low"},{"Medium"}})', - tokens: [ - { startIndex: 0, type: 'keyword.msdax' }, - { startIndex: 9, type: 'delimiter.parenthesis.msdax' }, - { startIndex: 10, type: 'string.msdax' }, - { startIndex: 17, type: 'delimiter.msdax' }, - { startIndex: 18, type: 'white.msdax' }, - { startIndex: 19, type: 'keyword.msdax' }, - { startIndex: 25, type: 'delimiter.msdax' }, - { startIndex: 26, type: 'white.msdax' }, - { startIndex: 27, type: 'delimiter.brackets.msdax' }, - { startIndex: 29, type: 'string.msdax' }, - { startIndex: 34, type: 'delimiter.brackets.msdax' }, - { startIndex: 35, type: 'delimiter.msdax' }, - { startIndex: 36, type: 'delimiter.brackets.msdax' }, - { startIndex: 37, type: 'string.msdax' }, - { startIndex: 45, type: 'delimiter.brackets.msdax' }, - { startIndex: 47, type: 'delimiter.parenthesis.msdax' } - ]}] + line: 'DATATABLE("Price", STRING, {{"Low"},{"Medium"}})', + tokens: [ + { startIndex: 0, type: 'keyword.msdax' }, + { startIndex: 9, type: 'delimiter.parenthesis.msdax' }, + { startIndex: 10, type: 'string.msdax' }, + { startIndex: 17, type: 'delimiter.msdax' }, + { startIndex: 18, type: 'white.msdax' }, + { startIndex: 19, type: 'keyword.msdax' }, + { startIndex: 25, type: 'delimiter.msdax' }, + { startIndex: 26, type: 'white.msdax' }, + { startIndex: 27, type: 'delimiter.brackets.msdax' }, + { startIndex: 29, type: 'string.msdax' }, + { startIndex: 34, type: 'delimiter.brackets.msdax' }, + { startIndex: 35, type: 'delimiter.msdax' }, + { startIndex: 36, type: 'delimiter.brackets.msdax' }, + { startIndex: 37, type: 'string.msdax' }, + { startIndex: 45, type: 'delimiter.brackets.msdax' }, + { startIndex: 47, type: 'delimiter.parenthesis.msdax' } + ] + }] ]); diff --git a/test/objective-c.test.ts b/test/objective-c.test.ts index 5b3d2708..cd44bbfd 100644 --- a/test/objective-c.test.ts +++ b/test/objective-c.test.ts @@ -5,287 +5,316 @@ 'use strict'; -import {testTokenization} from './testRunner'; +import { testTokenization } from './testRunner'; testTokenization('objective-c', [ // Keywords [{ - line: '-(id) initWithParams:(id) aHandler withDeviceStateManager:(id) deviceStateManager', - tokens: [ - { startIndex: 0, type: '' }, - { startIndex: 1, type: 'delimiter.parenthesis.objective-c' }, - { startIndex: 2, type: 'keyword.objective-c' }, - { startIndex: 4, type: 'delimiter.parenthesis.objective-c' }, - { startIndex: 5, type: 'white.objective-c' }, - { startIndex: 6, type: 'identifier.objective-c' }, - { startIndex: 20, type: 'delimiter.objective-c' }, - { startIndex: 21, type: 'delimiter.parenthesis.objective-c' }, - { startIndex: 22, type: 'keyword.objective-c' }, - { startIndex: 24, type: 'delimiter.angle.objective-c' }, - { startIndex: 25, type: 'identifier.objective-c' }, - { startIndex: 33, type: 'delimiter.angle.objective-c' }, - { startIndex: 34, type: 'delimiter.parenthesis.objective-c' }, - { startIndex: 35, type: 'white.objective-c' }, - { startIndex: 36, type: 'identifier.objective-c' }, - { startIndex: 44, type: 'white.objective-c' }, - { startIndex: 45, type: 'identifier.objective-c' }, - { startIndex: 67, type: 'delimiter.objective-c' }, - { startIndex: 68, type: 'delimiter.parenthesis.objective-c' }, - { startIndex: 69, type: 'keyword.objective-c' }, - { startIndex: 71, type: 'delimiter.angle.objective-c' }, - { startIndex: 72, type: 'identifier.objective-c' }, - { startIndex: 85, type: 'delimiter.angle.objective-c' }, - { startIndex: 86, type: 'delimiter.parenthesis.objective-c' }, - { startIndex: 87, type: 'white.objective-c' }, - { startIndex: 88, type: 'identifier.objective-c' } - ]}], + line: '-(id) initWithParams:(id) aHandler withDeviceStateManager:(id) deviceStateManager', + tokens: [ + { startIndex: 0, type: '' }, + { startIndex: 1, type: 'delimiter.parenthesis.objective-c' }, + { startIndex: 2, type: 'keyword.objective-c' }, + { startIndex: 4, type: 'delimiter.parenthesis.objective-c' }, + { startIndex: 5, type: 'white.objective-c' }, + { startIndex: 6, type: 'identifier.objective-c' }, + { startIndex: 20, type: 'delimiter.objective-c' }, + { startIndex: 21, type: 'delimiter.parenthesis.objective-c' }, + { startIndex: 22, type: 'keyword.objective-c' }, + { startIndex: 24, type: 'delimiter.angle.objective-c' }, + { startIndex: 25, type: 'identifier.objective-c' }, + { startIndex: 33, type: 'delimiter.angle.objective-c' }, + { startIndex: 34, type: 'delimiter.parenthesis.objective-c' }, + { startIndex: 35, type: 'white.objective-c' }, + { startIndex: 36, type: 'identifier.objective-c' }, + { startIndex: 44, type: 'white.objective-c' }, + { startIndex: 45, type: 'identifier.objective-c' }, + { startIndex: 67, type: 'delimiter.objective-c' }, + { startIndex: 68, type: 'delimiter.parenthesis.objective-c' }, + { startIndex: 69, type: 'keyword.objective-c' }, + { startIndex: 71, type: 'delimiter.angle.objective-c' }, + { startIndex: 72, type: 'identifier.objective-c' }, + { startIndex: 85, type: 'delimiter.angle.objective-c' }, + { startIndex: 86, type: 'delimiter.parenthesis.objective-c' }, + { startIndex: 87, type: 'white.objective-c' }, + { startIndex: 88, type: 'identifier.objective-c' } + ] + }], // Comments - single line [{ - line: '//', - tokens: [ - { startIndex: 0, type: 'comment.objective-c' } - ]}], + line: '//', + tokens: [ + { startIndex: 0, type: 'comment.objective-c' } + ] + }], [{ - line: ' // a comment', - tokens: [ - { startIndex: 0, type: 'white.objective-c' }, - { startIndex: 4, type: 'comment.objective-c' } - ]}], + line: ' // a comment', + tokens: [ + { startIndex: 0, type: 'white.objective-c' }, + { startIndex: 4, type: 'comment.objective-c' } + ] + }], [{ - line: '// a comment', - tokens: [ - { startIndex: 0, type: 'comment.objective-c' } - ]}], + line: '// a comment', + tokens: [ + { startIndex: 0, type: 'comment.objective-c' } + ] + }], [{ - line: '//sticky comment', - tokens: [ - { startIndex: 0, type: 'comment.objective-c' } - ]}], + line: '//sticky comment', + tokens: [ + { startIndex: 0, type: 'comment.objective-c' } + ] + }], [{ - line: '/almost a comment', - tokens: [ - { startIndex: 0, type: 'operator.objective-c' }, - { startIndex: 1, type: 'identifier.objective-c' }, - { startIndex: 7, type: 'white.objective-c' }, - { startIndex: 8, type: 'identifier.objective-c' }, - { startIndex: 9, type: 'white.objective-c' }, - { startIndex: 10, type: 'identifier.objective-c' } - ]}], + line: '/almost a comment', + tokens: [ + { startIndex: 0, type: 'operator.objective-c' }, + { startIndex: 1, type: 'identifier.objective-c' }, + { startIndex: 7, type: 'white.objective-c' }, + { startIndex: 8, type: 'identifier.objective-c' }, + { startIndex: 9, type: 'white.objective-c' }, + { startIndex: 10, type: 'identifier.objective-c' } + ] + }], [{ - line: '1 / 2; /* comment', - tokens: [ - { startIndex: 0, type: 'number.objective-c' }, - { startIndex: 1, type: 'white.objective-c' }, - { startIndex: 2, type: 'operator.objective-c' }, - { startIndex: 3, type: 'white.objective-c' }, - { startIndex: 4, type: 'number.objective-c' }, - { startIndex: 5, type: 'delimiter.objective-c' }, - { startIndex: 6, type: 'white.objective-c' }, - { startIndex: 7, type: 'comment.objective-c' } - ]}], + line: '1 / 2; /* comment', + tokens: [ + { startIndex: 0, type: 'number.objective-c' }, + { startIndex: 1, type: 'white.objective-c' }, + { startIndex: 2, type: 'operator.objective-c' }, + { startIndex: 3, type: 'white.objective-c' }, + { startIndex: 4, type: 'number.objective-c' }, + { startIndex: 5, type: 'delimiter.objective-c' }, + { startIndex: 6, type: 'white.objective-c' }, + { startIndex: 7, type: 'comment.objective-c' } + ] + }], [{ - line: 'int x = 1; // my comment // is a nice one', - tokens: [ - { startIndex: 0, type: 'keyword.objective-c' }, - { startIndex: 3, type: 'white.objective-c' }, - { startIndex: 4, type: 'identifier.objective-c' }, - { startIndex: 5, type: 'white.objective-c' }, - { startIndex: 6, type: 'operator.objective-c' }, - { startIndex: 7, type: 'white.objective-c' }, - { startIndex: 8, type: 'number.objective-c' }, - { startIndex: 9, type: 'delimiter.objective-c' }, - { startIndex: 10, type: 'white.objective-c' }, - { startIndex: 11, type: 'comment.objective-c' } - ]}], + line: 'int x = 1; // my comment // is a nice one', + tokens: [ + { startIndex: 0, type: 'keyword.objective-c' }, + { startIndex: 3, type: 'white.objective-c' }, + { startIndex: 4, type: 'identifier.objective-c' }, + { startIndex: 5, type: 'white.objective-c' }, + { startIndex: 6, type: 'operator.objective-c' }, + { startIndex: 7, type: 'white.objective-c' }, + { startIndex: 8, type: 'number.objective-c' }, + { startIndex: 9, type: 'delimiter.objective-c' }, + { startIndex: 10, type: 'white.objective-c' }, + { startIndex: 11, type: 'comment.objective-c' } + ] + }], // Comments - range comment, single line [{ - line: '/* a simple comment */', - tokens: [ - { startIndex: 0, type: 'comment.objective-c' } - ]}], + line: '/* a simple comment */', + tokens: [ + { startIndex: 0, type: 'comment.objective-c' } + ] + }], [{ - line: 'int x = /* embedded comment */ 1;', - tokens: [ - { startIndex: 0, type: 'keyword.objective-c' }, - { startIndex: 3, type: 'white.objective-c' }, - { startIndex: 4, type: 'identifier.objective-c' }, - { startIndex: 5, type: 'white.objective-c' }, - { startIndex: 6, type: 'operator.objective-c' }, - { startIndex: 7, type: 'white.objective-c' }, - { startIndex: 8, type: 'comment.objective-c' }, - { startIndex: 30, type: 'white.objective-c' }, - { startIndex: 31, type: 'number.objective-c' }, - { startIndex: 32, type: 'delimiter.objective-c' } - ]}], + line: 'int x = /* embedded comment */ 1;', + tokens: [ + { startIndex: 0, type: 'keyword.objective-c' }, + { startIndex: 3, type: 'white.objective-c' }, + { startIndex: 4, type: 'identifier.objective-c' }, + { startIndex: 5, type: 'white.objective-c' }, + { startIndex: 6, type: 'operator.objective-c' }, + { startIndex: 7, type: 'white.objective-c' }, + { startIndex: 8, type: 'comment.objective-c' }, + { startIndex: 30, type: 'white.objective-c' }, + { startIndex: 31, type: 'number.objective-c' }, + { startIndex: 32, type: 'delimiter.objective-c' } + ] + }], [{ - line: 'int x = /* comment and syntax error*/ 1; */', - tokens: [ - { startIndex: 0, type: 'keyword.objective-c' }, - { startIndex: 3, type: 'white.objective-c' }, - { startIndex: 4, type: 'identifier.objective-c' }, - { startIndex: 5, type: 'white.objective-c' }, - { startIndex: 6, type: 'operator.objective-c' }, - { startIndex: 7, type: 'white.objective-c' }, - { startIndex: 8, type: 'comment.objective-c' }, - { startIndex: 37, type: 'white.objective-c' }, - { startIndex: 38, type: 'number.objective-c' }, - { startIndex: 39, type: 'delimiter.objective-c' }, - { startIndex: 40, type: 'white.objective-c' }, - { startIndex: 41, type: 'operator.objective-c' } - ]}], + line: 'int x = /* comment and syntax error*/ 1; */', + tokens: [ + { startIndex: 0, type: 'keyword.objective-c' }, + { startIndex: 3, type: 'white.objective-c' }, + { startIndex: 4, type: 'identifier.objective-c' }, + { startIndex: 5, type: 'white.objective-c' }, + { startIndex: 6, type: 'operator.objective-c' }, + { startIndex: 7, type: 'white.objective-c' }, + { startIndex: 8, type: 'comment.objective-c' }, + { startIndex: 37, type: 'white.objective-c' }, + { startIndex: 38, type: 'number.objective-c' }, + { startIndex: 39, type: 'delimiter.objective-c' }, + { startIndex: 40, type: 'white.objective-c' }, + { startIndex: 41, type: 'operator.objective-c' } + ] + }], [{ - line: 'x = /**/;', - tokens: [ - { startIndex: 0, type: 'identifier.objective-c' }, - { startIndex: 1, type: 'white.objective-c' }, - { startIndex: 2, type: 'operator.objective-c' }, - { startIndex: 3, type: 'white.objective-c' }, - { startIndex: 4, type: 'comment.objective-c' }, - { startIndex: 8, type: 'delimiter.objective-c' } - ]}], + line: 'x = /**/;', + tokens: [ + { startIndex: 0, type: 'identifier.objective-c' }, + { startIndex: 1, type: 'white.objective-c' }, + { startIndex: 2, type: 'operator.objective-c' }, + { startIndex: 3, type: 'white.objective-c' }, + { startIndex: 4, type: 'comment.objective-c' }, + { startIndex: 8, type: 'delimiter.objective-c' } + ] + }], [{ - line: 'x = /*/;', - tokens: [ - { startIndex: 0, type: 'identifier.objective-c' }, - { startIndex: 1, type: 'white.objective-c' }, - { startIndex: 2, type: 'operator.objective-c' }, - { startIndex: 3, type: 'white.objective-c' }, - { startIndex: 4, type: 'comment.objective-c' } - ]}], + line: 'x = /*/;', + tokens: [ + { startIndex: 0, type: 'identifier.objective-c' }, + { startIndex: 1, type: 'white.objective-c' }, + { startIndex: 2, type: 'operator.objective-c' }, + { startIndex: 3, type: 'white.objective-c' }, + { startIndex: 4, type: 'comment.objective-c' } + ] + }], // Non-Alpha Keywords [{ - line: '#import ', - tokens: [ - { startIndex: 0, type: 'keyword.objective-c' }, - { startIndex: 7, type: 'white.objective-c' }, - { startIndex: 8, type: 'delimiter.angle.objective-c' }, - { startIndex: 9, type: 'identifier.objective-c' }, - { startIndex: 13, type: '' }, - { startIndex: 14, type: 'identifier.objective-c' }, - { startIndex: 15, type: 'delimiter.angle.objective-c' } - ]}], + line: '#import ', + tokens: [ + { startIndex: 0, type: 'keyword.objective-c' }, + { startIndex: 7, type: 'white.objective-c' }, + { startIndex: 8, type: 'delimiter.angle.objective-c' }, + { startIndex: 9, type: 'identifier.objective-c' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'identifier.objective-c' }, + { startIndex: 15, type: 'delimiter.angle.objective-c' } + ] + }], // Numbers [{ - line: '0 ', - tokens: [ - { startIndex: 0, type: 'number.objective-c' }, - { startIndex: 1, type: 'white.objective-c' } - ]}], + line: '0 ', + tokens: [ + { startIndex: 0, type: 'number.objective-c' }, + { startIndex: 1, type: 'white.objective-c' } + ] + }], [{ - line: '0x ', - tokens: [ - { startIndex: 0, type: 'number.hex.objective-c' }, - { startIndex: 2, type: 'white.objective-c' } - ]}], + line: '0x ', + tokens: [ + { startIndex: 0, type: 'number.hex.objective-c' }, + { startIndex: 2, type: 'white.objective-c' } + ] + }], [{ - line: '0x123 ', - tokens: [ - { startIndex: 0, type: 'number.hex.objective-c' }, - { startIndex: 5, type: 'white.objective-c' } - ]}], + line: '0x123 ', + tokens: [ + { startIndex: 0, type: 'number.hex.objective-c' }, + { startIndex: 5, type: 'white.objective-c' } + ] + }], [{ - line: '23.5 ', - tokens: [ - { startIndex: 0, type: 'number.float.objective-c' }, - { startIndex: 4, type: 'white.objective-c' } - ]}], + line: '23.5 ', + tokens: [ + { startIndex: 0, type: 'number.float.objective-c' }, + { startIndex: 4, type: 'white.objective-c' } + ] + }], [{ - line: '23.5e3 ', - tokens: [ - { startIndex: 0, type: 'number.float.objective-c' }, - { startIndex: 6, type: 'white.objective-c' } - ]}], + line: '23.5e3 ', + tokens: [ + { startIndex: 0, type: 'number.float.objective-c' }, + { startIndex: 6, type: 'white.objective-c' } + ] + }], [{ - line: '23.5E3 ', - tokens: [ - { startIndex: 0, type: 'number.float.objective-c' }, - { startIndex: 6, type: 'white.objective-c' } - ]}], + line: '23.5E3 ', + tokens: [ + { startIndex: 0, type: 'number.float.objective-c' }, + { startIndex: 6, type: 'white.objective-c' } + ] + }], [{ - line: '23.5F ', - tokens: [ - { startIndex: 0, type: 'number.float.objective-c' }, - { startIndex: 5, type: 'white.objective-c' } - ]}], + line: '23.5F ', + tokens: [ + { startIndex: 0, type: 'number.float.objective-c' }, + { startIndex: 5, type: 'white.objective-c' } + ] + }], [{ - line: '23.5f ', - tokens: [ - { startIndex: 0, type: 'number.float.objective-c' }, - { startIndex: 5, type: 'white.objective-c' } - ]}], + line: '23.5f ', + tokens: [ + { startIndex: 0, type: 'number.float.objective-c' }, + { startIndex: 5, type: 'white.objective-c' } + ] + }], [{ - line: '1.72E3F ', - tokens: [ - { startIndex: 0, type: 'number.float.objective-c' }, - { startIndex: 7, type: 'white.objective-c' } - ]}], + line: '1.72E3F ', + tokens: [ + { startIndex: 0, type: 'number.float.objective-c' }, + { startIndex: 7, type: 'white.objective-c' } + ] + }], [{ - line: '1.72E3f ', - tokens: [ - { startIndex: 0, type: 'number.float.objective-c' }, - { startIndex: 7, type: 'white.objective-c' } - ]}], + line: '1.72E3f ', + tokens: [ + { startIndex: 0, type: 'number.float.objective-c' }, + { startIndex: 7, type: 'white.objective-c' } + ] + }], [{ - line: '1.72e3F ', - tokens: [ - { startIndex: 0, type: 'number.float.objective-c' }, - { startIndex: 7, type: 'white.objective-c' } - ]}], + line: '1.72e3F ', + tokens: [ + { startIndex: 0, type: 'number.float.objective-c' }, + { startIndex: 7, type: 'white.objective-c' } + ] + }], [{ - line: '1.72e3f ', - tokens: [ - { startIndex: 0, type: 'number.float.objective-c' }, - { startIndex: 7, type: 'white.objective-c' } - ]}], + line: '1.72e3f ', + tokens: [ + { startIndex: 0, type: 'number.float.objective-c' }, + { startIndex: 7, type: 'white.objective-c' } + ] + }], [{ - line: '0+0', - tokens: [ - { startIndex: 0, type: 'number.objective-c' }, - { startIndex: 1, type: 'operator.objective-c' }, - { startIndex: 2, type: 'number.objective-c' } - ]}], + line: '0+0', + tokens: [ + { startIndex: 0, type: 'number.objective-c' }, + { startIndex: 1, type: 'operator.objective-c' }, + { startIndex: 2, type: 'number.objective-c' } + ] + }], [{ - line: '100+10', - tokens: [ - { startIndex: 0, type: 'number.objective-c' }, - { startIndex: 3, type: 'operator.objective-c' }, - { startIndex: 4, type: 'number.objective-c' } - ]}], + line: '100+10', + tokens: [ + { startIndex: 0, type: 'number.objective-c' }, + { startIndex: 3, type: 'operator.objective-c' }, + { startIndex: 4, type: 'number.objective-c' } + ] + }], [{ - line: '0 + 0', - tokens: [ - { startIndex: 0, type: 'number.objective-c' }, - { startIndex: 1, type: 'white.objective-c' }, - { startIndex: 2, type: 'operator.objective-c' }, - { startIndex: 3, type: 'white.objective-c' }, - { startIndex: 4, type: 'number.objective-c' } - ]}] + line: '0 + 0', + tokens: [ + { startIndex: 0, type: 'number.objective-c' }, + { startIndex: 1, type: 'white.objective-c' }, + { startIndex: 2, type: 'operator.objective-c' }, + { startIndex: 3, type: 'white.objective-c' }, + { startIndex: 4, type: 'number.objective-c' } + ] + }] ]); diff --git a/test/php.test.ts b/test/php.test.ts index d2c25afd..2ca76a61 100644 --- a/test/php.test.ts +++ b/test/php.test.ts @@ -5,1880 +5,2043 @@ 'use strict'; -import {testTokenization} from './testRunner'; -import {htmlTokenTypes} from '../src/php'; +import { testTokenization } from './testRunner'; +import { htmlTokenTypes } from '../src/php'; testTokenization(['php', 'css'], [ // Bug 13596:[ErrorTelemetry] Stream did not advance while tokenizing. Mode id is php (stuck) // We're testing the fact that tokenize does not throw [ - { line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'comment.php' }, - { startIndex:19, type: '' }, - { startIndex:20, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'comment.php' }, + { startIndex: 19, type: '' }, + { startIndex: 20, type: 'metatag.php' } + ] + }], // Variables [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.php' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'delimiter.php' }, - { startIndex:12, type: '' }, - { startIndex:13, type: 'number.php' }, - { startIndex:14, type: 'delimiter.php' }, - { startIndex:15, type: '' }, - { startIndex:16, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.php' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'delimiter.php' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'number.php' }, + { startIndex: 14, type: 'delimiter.php' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.php' }, - { startIndex:8, type: '' }, - { startIndex:9, type: 'delimiter.php' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'string.php' }, - { startIndex:18, type: 'delimiter.php' }, - { startIndex:19, type: '' }, - { startIndex:20, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.php' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'delimiter.php' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'string.php' }, + { startIndex: 18, type: 'delimiter.php' }, + { startIndex: 19, type: '' }, + { startIndex: 20, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.php' }, - { startIndex:12, type: '' }, - { startIndex:13, type: 'delimiter.php' }, - { startIndex:14, type: '' }, - { startIndex:15, type: 'delimiter.php' }, - { startIndex:16, type: 'number.php' }, - { startIndex:18, type: 'delimiter.php' }, - { startIndex:19, type: '' }, - { startIndex:20, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.php' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'delimiter.php' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'delimiter.php' }, + { startIndex: 16, type: 'number.php' }, + { startIndex: 18, type: 'delimiter.php' }, + { startIndex: 19, type: '' }, + { startIndex: 20, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.php' }, - { startIndex:12, type: '' }, - { startIndex:13, type: 'delimiter.php' }, - { startIndex:14, type: '' }, - { startIndex:15, type: 'number.php' }, - { startIndex:16, type: '' }, - { startIndex:17, type: 'delimiter.php' }, - { startIndex:18, type: '' }, - { startIndex:19, type: 'delimiter.parenthesis.php' }, - { startIndex:20, type: 'number.php' }, - { startIndex:22, type: '' }, - { startIndex:23, type: 'delimiter.php' }, - { startIndex:24, type: '' }, - { startIndex:25, type: 'number.php' }, - { startIndex:26, type: 'delimiter.parenthesis.php' }, - { startIndex:27, type: 'delimiter.php' }, - { startIndex:28, type: '' }, - { startIndex:29, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.php' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'delimiter.php' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'number.php' }, + { startIndex: 16, type: '' }, + { startIndex: 17, type: 'delimiter.php' }, + { startIndex: 18, type: '' }, + { startIndex: 19, type: 'delimiter.parenthesis.php' }, + { startIndex: 20, type: 'number.php' }, + { startIndex: 22, type: '' }, + { startIndex: 23, type: 'delimiter.php' }, + { startIndex: 24, type: '' }, + { startIndex: 25, type: 'number.php' }, + { startIndex: 26, type: 'delimiter.parenthesis.php' }, + { startIndex: 27, type: 'delimiter.php' }, + { startIndex: 28, type: '' }, + { startIndex: 29, type: 'metatag.php' } + ] + }], // Keywords [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:14, type: '' }, - { startIndex:15, type: 'identifier.php' }, - { startIndex:21, type: 'delimiter.parenthesis.php' }, - { startIndex:23, type: '' }, - { startIndex:24, type: 'delimiter.bracket.php' }, - { startIndex:25, type: '' }, - { startIndex:26, type: 'delimiter.bracket.php' }, - { startIndex:27, type: '' }, - { startIndex:28, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:14, type: '' }, - { startIndex:15, type: 'metatag.php' } - ]}], - - [{ - line: ' 52) { $start = 0; } ?>', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:8, type: '' }, - { startIndex:9, type: 'delimiter.parenthesis.php' }, - { startIndex:10, type: 'variable.php' }, - { startIndex:16, type: '' }, - { startIndex:17, type: 'delimiter.php' }, - { startIndex:18, type: '' }, - { startIndex:19, type: 'number.php' }, - { startIndex:21, type: 'delimiter.parenthesis.php' }, - { startIndex:22, type: '' }, - { startIndex:23, type: 'delimiter.bracket.php' }, - { startIndex:24, type: '' }, - { startIndex:25, type: 'variable.php' }, - { startIndex:31, type: '' }, - { startIndex:32, type: 'delimiter.php' }, - { startIndex:33, type: '' }, - { startIndex:34, type: 'number.php' }, - { startIndex:35, type: 'delimiter.php' }, - { startIndex:36, type: '' }, - { startIndex:37, type: 'delimiter.bracket.php' }, - { startIndex:38, type: '' }, - { startIndex:39, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:8, type: '' }, - { startIndex:9, type: 'delimiter.parenthesis.php' }, - { startIndex:10, type: 'keyword.php' }, - { startIndex:14, type: 'delimiter.parenthesis.php' }, - { startIndex:15, type: '' }, - { startIndex:16, type: 'delimiter.bracket.php' }, - { startIndex:17, type: '' }, - { startIndex:18, type: 'variable.php' }, - { startIndex:24, type: '' }, - { startIndex:25, type: 'delimiter.php' }, - { startIndex:26, type: '' }, - { startIndex:27, type: 'number.php' }, - { startIndex:28, type: 'delimiter.php' }, - { startIndex:29, type: '' }, - { startIndex:30, type: 'delimiter.bracket.php' }, - { startIndex:31, type: '' }, - { startIndex:32, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:14, type: '' }, - { startIndex:15, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:9, type: '' }, - { startIndex:10, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:8, type: '' }, - { startIndex:9, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:15, type: '' }, - { startIndex:16, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:14, type: '' }, - { startIndex:15, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:13, type: '' }, - { startIndex:14, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:13, type: '' }, - { startIndex:14, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:8, type: '' }, - { startIndex:9, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:12, type: '' }, - { startIndex:13, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:16, type: '' }, - { startIndex:17, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:12, type: '' }, - { startIndex:13, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:16, type: '' }, - { startIndex:17, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:15, type: '' }, - { startIndex:16, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:14, type: '' }, - { startIndex:15, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:13, type: '' }, - { startIndex:14, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:9, type: '' }, - { startIndex:10, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:13, type: '' }, - { startIndex:14, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:14, type: '' }, - { startIndex:15, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:12, type: '' }, - { startIndex:13, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:8, type: '' }, - { startIndex:9, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:16, type: '' }, - { startIndex:17, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:15, type: '' }, - { startIndex:16, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:16, type: '' }, - { startIndex:17, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:15, type: '' }, - { startIndex:16, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:9, type: '' }, - { startIndex:10, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:12, type: '' }, - { startIndex:13, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:18, type: '' }, - { startIndex:19, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:8, type: '' }, - { startIndex:9, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:13, type: '' }, - { startIndex:14, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:15, type: '' }, - { startIndex:16, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:12, type: '' }, - { startIndex:13, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:14, type: '' }, - { startIndex:15, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:12, type: '' }, - { startIndex:13, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:12, type: '' }, - { startIndex:13, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:9, type: '' }, - { startIndex:10, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:9, type: '' }, - { startIndex:10, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:9, type: '' }, - { startIndex:10, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:9, type: '' }, - { startIndex:10, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:9, type: '' }, - { startIndex:10, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:13, type: '' }, - { startIndex:14, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:18, type: '' }, - { startIndex:19, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:13, type: '' }, - { startIndex:14, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:18, type: '' }, - { startIndex:19, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:12, type: '' }, - { startIndex:13, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], - - [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:17, type: '' }, - { startIndex:18, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'identifier.php' }, + { startIndex: 21, type: 'delimiter.parenthesis.php' }, + { startIndex: 23, type: '' }, + { startIndex: 24, type: 'delimiter.bracket.php' }, + { startIndex: 25, type: '' }, + { startIndex: 26, type: 'delimiter.bracket.php' }, + { startIndex: 27, type: '' }, + { startIndex: 28, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'metatag.php' } + ] + }], + + [{ + line: ' 52) { $start = 0; } ?>', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'delimiter.parenthesis.php' }, + { startIndex: 10, type: 'variable.php' }, + { startIndex: 16, type: '' }, + { startIndex: 17, type: 'delimiter.php' }, + { startIndex: 18, type: '' }, + { startIndex: 19, type: 'number.php' }, + { startIndex: 21, type: 'delimiter.parenthesis.php' }, + { startIndex: 22, type: '' }, + { startIndex: 23, type: 'delimiter.bracket.php' }, + { startIndex: 24, type: '' }, + { startIndex: 25, type: 'variable.php' }, + { startIndex: 31, type: '' }, + { startIndex: 32, type: 'delimiter.php' }, + { startIndex: 33, type: '' }, + { startIndex: 34, type: 'number.php' }, + { startIndex: 35, type: 'delimiter.php' }, + { startIndex: 36, type: '' }, + { startIndex: 37, type: 'delimiter.bracket.php' }, + { startIndex: 38, type: '' }, + { startIndex: 39, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'delimiter.parenthesis.php' }, + { startIndex: 10, type: 'keyword.php' }, + { startIndex: 14, type: 'delimiter.parenthesis.php' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'delimiter.bracket.php' }, + { startIndex: 17, type: '' }, + { startIndex: 18, type: 'variable.php' }, + { startIndex: 24, type: '' }, + { startIndex: 25, type: 'delimiter.php' }, + { startIndex: 26, type: '' }, + { startIndex: 27, type: 'number.php' }, + { startIndex: 28, type: 'delimiter.php' }, + { startIndex: 29, type: '' }, + { startIndex: 30, type: 'delimiter.bracket.php' }, + { startIndex: 31, type: '' }, + { startIndex: 32, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 16, type: '' }, + { startIndex: 17, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 16, type: '' }, + { startIndex: 17, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 16, type: '' }, + { startIndex: 17, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 16, type: '' }, + { startIndex: 17, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 18, type: '' }, + { startIndex: 19, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 18, type: '' }, + { startIndex: 19, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 18, type: '' }, + { startIndex: 19, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], + + [{ + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 17, type: '' }, + { startIndex: 18, type: 'metatag.php' } + ] + }], // Compile Time Constants [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'constant.php' }, - { startIndex:14, type: '' }, - { startIndex:15, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'constant.php' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.php' }, - { startIndex:15, type: '' }, - { startIndex:16, type: 'delimiter.php' }, - { startIndex:17, type: '' }, - { startIndex:18, type: 'constant.php' }, - { startIndex:26, type: 'delimiter.php' }, - { startIndex:27, type: '' }, - { startIndex:28, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.php' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'delimiter.php' }, + { startIndex: 17, type: '' }, + { startIndex: 18, type: 'constant.php' }, + { startIndex: 26, type: 'delimiter.php' }, + { startIndex: 27, type: '' }, + { startIndex: 28, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'constant.php' }, - { startIndex:15, type: '' }, - { startIndex:16, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'constant.php' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'constant.php' }, - { startIndex:13, type: '' }, - { startIndex:14, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'constant.php' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'constant.php' }, - { startIndex:14, type: '' }, - { startIndex:15, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'constant.php' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'constant.php' }, - { startIndex:19, type: '' }, - { startIndex:20, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'constant.php' }, + { startIndex: 19, type: '' }, + { startIndex: 20, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'constant.php' }, - { startIndex:16, type: '' }, - { startIndex:17, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'constant.php' }, + { startIndex: 16, type: '' }, + { startIndex: 17, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'constant.php' }, - { startIndex:18, type: '' }, - { startIndex:19, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'constant.php' }, + { startIndex: 18, type: '' }, + { startIndex: 19, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'constant.php' }, - { startIndex:15, type: '' }, - { startIndex:16, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'constant.php' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'metatag.php' } + ] + }], // Predefined Variables [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.predefined.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.predefined.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'keyword.php' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'variable.predefined.php' }, - { startIndex:16, type: 'delimiter.php' }, - { startIndex:17, type: '' }, - { startIndex:18, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'keyword.php' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'variable.predefined.php' }, + { startIndex: 16, type: 'delimiter.php' }, + { startIndex: 17, type: '' }, + { startIndex: 18, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.predefined.php' }, - { startIndex:14, type: '' }, - { startIndex:15, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.predefined.php' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.predefined.php' }, - { startIndex:14, type: '' }, - { startIndex:15, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.predefined.php' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.predefined.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.predefined.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.predefined.php' }, - { startIndex:12, type: '' }, - { startIndex:13, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.predefined.php' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.predefined.php' }, - { startIndex:13, type: '' }, - { startIndex:14, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.predefined.php' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.predefined.php' }, - { startIndex:15, type: '' }, - { startIndex:16, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.predefined.php' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.predefined.php' }, - { startIndex:15, type: '' }, - { startIndex:16, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.predefined.php' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.predefined.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.predefined.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.predefined.php' }, - { startIndex:14, type: '' }, - { startIndex:15, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.predefined.php' }, + { startIndex: 14, type: '' }, + { startIndex: 15, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.predefined.php' }, - { startIndex:19, type: '' }, - { startIndex:20, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.predefined.php' }, + { startIndex: 19, type: '' }, + { startIndex: 20, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.predefined.php' }, - { startIndex:25, type: '' }, - { startIndex:26, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.predefined.php' }, + { startIndex: 25, type: '' }, + { startIndex: 26, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.predefined.php' }, - { startIndex:27, type: '' }, - { startIndex:28, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.predefined.php' }, + { startIndex: 27, type: '' }, + { startIndex: 28, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.predefined.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.predefined.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.predefined.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.predefined.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], // Comments - single line [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'comment.php' }, - { startIndex:28, type: '' }, - { startIndex:29, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'comment.php' }, + { startIndex: 28, type: '' }, + { startIndex: 29, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.php' }, - { startIndex:8, type: '' }, - { startIndex:9, type: 'delimiter.php' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'comment.php' }, - { startIndex:33, type: '' }, - { startIndex:34, type: 'number.php' }, - { startIndex:35, type: 'delimiter.php' }, - { startIndex:36, type: '' }, - { startIndex:37, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.php' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'delimiter.php' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'comment.php' }, + { startIndex: 33, type: '' }, + { startIndex: 34, type: 'number.php' }, + { startIndex: 35, type: 'delimiter.php' }, + { startIndex: 36, type: '' }, + { startIndex: 37, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.php' }, - { startIndex:8, type: '' }, - { startIndex:9, type: 'delimiter.php' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'comment.php' }, - { startIndex:24, type: '' }, - { startIndex:25, type: 'number.php' }, - { startIndex:26, type: 'delimiter.php' }, - { startIndex:27, type: '' }, - { startIndex:28, type: 'delimiter.php' }, - { startIndex:30, type: '' }, - { startIndex:31, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.php' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'delimiter.php' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'comment.php' }, + { startIndex: 24, type: '' }, + { startIndex: 25, type: 'number.php' }, + { startIndex: 26, type: 'delimiter.php' }, + { startIndex: 27, type: '' }, + { startIndex: 28, type: 'delimiter.php' }, + { startIndex: 30, type: '' }, + { startIndex: 31, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.php' }, - { startIndex:8, type: '' }, - { startIndex:9, type: 'delimiter.php' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'comment.php' }, - { startIndex:15, type: 'delimiter.php' }, - { startIndex:16, type: '' }, - { startIndex:17, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.php' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'delimiter.php' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'comment.php' }, + { startIndex: 15, type: 'delimiter.php' }, + { startIndex: 16, type: '' }, + { startIndex: 17, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.php' }, - { startIndex:8, type: '' }, - { startIndex:9, type: 'delimiter.php' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'string.php' }, - { startIndex:14, type: 'delimiter.php' }, - { startIndex:15, type: '' }, - { startIndex:16, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.php' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'delimiter.php' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'string.php' }, + { startIndex: 14, type: 'delimiter.php' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'string.php' }, - { startIndex:18, type: 'delimiter.php' }, - { startIndex:19, type: '' }, - { startIndex:20, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'string.php' }, + { startIndex: 18, type: 'delimiter.php' }, + { startIndex: 19, type: '' }, + { startIndex: 20, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.php' }, - { startIndex:8, type: '' }, - { startIndex:9, type: 'delimiter.php' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'variable.php' }, - { startIndex:13, type: '' }, - { startIndex:14, type: 'delimiter.php' }, - { startIndex:15, type: '' }, - { startIndex:16, type: 'string.php' }, - { startIndex:27, type: '' }, - { startIndex:28, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.php' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'delimiter.php' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'variable.php' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'delimiter.php' }, + { startIndex: 15, type: '' }, + { startIndex: 16, type: 'string.php' }, + { startIndex: 27, type: '' }, + { startIndex: 28, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'number.php' }, - { startIndex:7, type: '' }, - { startIndex:8, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'number.php' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'number.php' }, - { startIndex:7, type: 'delimiter.php' }, - { startIndex:8, type: 'number.php' }, - { startIndex:9, type: '' }, - { startIndex:10, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'number.php' }, + { startIndex: 7, type: 'delimiter.php' }, + { startIndex: 8, type: 'number.php' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'number.php' }, - { startIndex:9, type: 'delimiter.php' }, - { startIndex:10, type: 'number.php' }, - { startIndex:12, type: '' }, - { startIndex:13, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'number.php' }, + { startIndex: 9, type: 'delimiter.php' }, + { startIndex: 10, type: 'number.php' }, + { startIndex: 12, type: '' }, + { startIndex: 13, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'number.php' }, - { startIndex:7, type: '' }, - { startIndex:8, type: 'delimiter.php' }, - { startIndex:9, type: '' }, - { startIndex:10, type: 'number.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'number.php' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'delimiter.php' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'number.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'number.octal.php' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'number.octal.php' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'number.octal.php' }, - { startIndex:10, type: 'number.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'number.octal.php' }, + { startIndex: 10, type: 'number.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'number.php' }, - { startIndex:7, type: 'identifier.php' }, - { startIndex:8, type: '' }, - { startIndex:9, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'number.php' }, + { startIndex: 7, type: 'identifier.php' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'number.hex.php' }, - { startIndex:11, type: '' }, - { startIndex:12, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'number.hex.php' }, + { startIndex: 11, type: '' }, + { startIndex: 12, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'number.binary.php' }, - { startIndex:9, type: '' }, - { startIndex:10, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'number.binary.php' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'delimiter.bracket.php' }, - { startIndex:7, type: '' }, - { startIndex:8, type: 'delimiter.bracket.php' }, - { startIndex:9, type: '' }, - { startIndex:10, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.bracket.php' }, + { startIndex: 7, type: '' }, + { startIndex: 8, type: 'delimiter.bracket.php' }, + { startIndex: 9, type: '' }, + { startIndex: 10, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'delimiter.array.php' }, - { startIndex:7, type: 'number.php' }, - { startIndex:8, type: 'delimiter.php' }, - { startIndex:9, type: 'number.php' }, - { startIndex:10, type: 'delimiter.php' }, - { startIndex:11, type: 'number.php' }, - { startIndex:12, type: 'delimiter.array.php' }, - { startIndex:13, type: '' }, - { startIndex:14, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'delimiter.array.php' }, + { startIndex: 7, type: 'number.php' }, + { startIndex: 8, type: 'delimiter.php' }, + { startIndex: 9, type: 'number.php' }, + { startIndex: 10, type: 'delimiter.php' }, + { startIndex: 11, type: 'number.php' }, + { startIndex: 12, type: 'delimiter.array.php' }, + { startIndex: 13, type: '' }, + { startIndex: 14, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'variable.php' }, - { startIndex:8, type: '' }, - { startIndex:9, type: 'delimiter.php' }, - { startIndex:10, type: '' }, - { startIndex:11, type: 'string.php' }, - { startIndex:19, type: '' }, - { startIndex:20, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'variable.php' }, + { startIndex: 8, type: '' }, + { startIndex: 9, type: 'delimiter.php' }, + { startIndex: 10, type: '' }, + { startIndex: 11, type: 'string.php' }, + { startIndex: 19, type: '' }, + { startIndex: 20, type: 'metatag.php' } + ] + }], // Comments - comment with sharp [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'comment.php' }, - { startIndex:15, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'comment.php' }, + { startIndex: 15, type: 'metatag.php' } + ] + }], [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: '' }, - { startIndex:6, type: 'comment.php' }, - { startIndex:17, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: '' }, + { startIndex: 6, type: 'comment.php' }, + { startIndex: 17, type: 'metatag.php' } + ] + }], // 3-languages parser // php [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:3, type: 'string.php' }, - { startIndex:7, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 3, type: 'string.php' }, + { startIndex: 7, type: 'metatag.php' } + ] + }], // php/html/php [{ - line: '
', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: 'number.php' }, - { startIndex:6, type: 'delimiter.php' }, - { startIndex:7, type: 'number.php' }, - { startIndex:8, type: 'metatag.php' }, - { startIndex:10, type: htmlTokenTypes.DELIM_START }, - { startIndex:11, type: htmlTokenTypes.getTag('br') }, - { startIndex:13, type: htmlTokenTypes.DELIM_END }, - { startIndex:15, type: 'metatag.php' }, - { startIndex:18, type: 'number.php' }, - { startIndex:19, type: 'metatag.php' } - ]}], + line: '
', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: 'number.php' }, + { startIndex: 6, type: 'delimiter.php' }, + { startIndex: 7, type: 'number.php' }, + { startIndex: 8, type: 'metatag.php' }, + { startIndex: 10, type: htmlTokenTypes.DELIM_START }, + { startIndex: 11, type: htmlTokenTypes.getTag('br') }, + { startIndex: 13, type: htmlTokenTypes.DELIM_END }, + { startIndex: 15, type: 'metatag.php' }, + { startIndex: 18, type: 'number.php' }, + { startIndex: 19, type: 'metatag.php' } + ] + }], // php/html/php [{ - line: '', - tokens: [ - { startIndex:0, type: 'metatag.php' }, - { startIndex:5, type: 'number.php' }, - { startIndex:6, type: 'delimiter.php' }, - { startIndex:7, type: 'number.php' }, - { startIndex:8, type: 'metatag.php' }, - { startIndex:10, type: htmlTokenTypes.DELIM_START }, - { startIndex:11, type: htmlTokenTypes.getTag('abc') }, - { startIndex:14, type: htmlTokenTypes.DELIM_END }, - { startIndex:15, type: 'metatag.php' }, - { startIndex:18, type: 'number.php' }, - { startIndex:19, type: 'metatag.php' } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: 'metatag.php' }, + { startIndex: 5, type: 'number.php' }, + { startIndex: 6, type: 'delimiter.php' }, + { startIndex: 7, type: 'number.php' }, + { startIndex: 8, type: 'metatag.php' }, + { startIndex: 10, type: htmlTokenTypes.DELIM_START }, + { startIndex: 11, type: htmlTokenTypes.getTag('abc') }, + { startIndex: 14, type: htmlTokenTypes.DELIM_END }, + { startIndex: 15, type: 'metatag.php' }, + { startIndex: 18, type: 'number.php' }, + { startIndex: 19, type: 'metatag.php' } + ] + }], // html/php/html [{ - line: '', - tokens: [ - { startIndex:0, type: htmlTokenTypes.DELIM_START }, - { startIndex:1, type: htmlTokenTypes.getTag('abc') }, - { startIndex:4, type: htmlTokenTypes.DELIM_END }, - { startIndex:5, type: 'metatag.php' }, - { startIndex:10, type: 'number.php' }, - { startIndex:11, type: 'delimiter.php' }, - { startIndex:12, type: 'number.php' }, - { startIndex:13, type: 'metatag.php' }, - { startIndex:15, type: htmlTokenTypes.DELIM_START }, - { startIndex:16, type: htmlTokenTypes.getTag('abc') }, - { startIndex:19, type: htmlTokenTypes.DELIM_END } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: htmlTokenTypes.DELIM_START }, + { startIndex: 1, type: htmlTokenTypes.getTag('abc') }, + { startIndex: 4, type: htmlTokenTypes.DELIM_END }, + { startIndex: 5, type: 'metatag.php' }, + { startIndex: 10, type: 'number.php' }, + { startIndex: 11, type: 'delimiter.php' }, + { startIndex: 12, type: 'number.php' }, + { startIndex: 13, type: 'metatag.php' }, + { startIndex: 15, type: htmlTokenTypes.DELIM_START }, + { startIndex: 16, type: htmlTokenTypes.getTag('abc') }, + { startIndex: 19, type: htmlTokenTypes.DELIM_END } + ] + }], // html/js/php/html [{ - line: '', - tokens: [ - { startIndex:0, type: htmlTokenTypes.DELIM_START }, - { startIndex:1, type: htmlTokenTypes.getTag('abc') }, - { startIndex:4, type: htmlTokenTypes.DELIM_END }, - // { startIndex:5, type: htmlTokenTypes.DELIM_START }, - { startIndex:6, type: htmlTokenTypes.getTag('script') }, - { startIndex:12, type: htmlTokenTypes.DELIM_END }, - { startIndex:13, type: '' }, - { startIndex:23, type: htmlTokenTypes.DELIM_START }, - { startIndex:25, type: htmlTokenTypes.getTag('script') }, - { startIndex:31, type: htmlTokenTypes.DELIM_END }, - { startIndex:32, type: 'metatag.php' }, - { startIndex:37, type: 'number.php' }, - { startIndex:38, type: 'delimiter.php' }, - { startIndex:39, type: 'number.php' }, - { startIndex:40, type: 'metatag.php' }, - { startIndex:42, type: htmlTokenTypes.DELIM_START }, - { startIndex:43, type: htmlTokenTypes.getTag('abc') }, - { startIndex:46, type: htmlTokenTypes.DELIM_END } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: htmlTokenTypes.DELIM_START }, + { startIndex: 1, type: htmlTokenTypes.getTag('abc') }, + { startIndex: 4, type: htmlTokenTypes.DELIM_END }, + // { startIndex:5, type: htmlTokenTypes.DELIM_START }, + { startIndex: 6, type: htmlTokenTypes.getTag('script') }, + { startIndex: 12, type: htmlTokenTypes.DELIM_END }, + { startIndex: 13, type: '' }, + { startIndex: 23, type: htmlTokenTypes.DELIM_START }, + { startIndex: 25, type: htmlTokenTypes.getTag('script') }, + { startIndex: 31, type: htmlTokenTypes.DELIM_END }, + { startIndex: 32, type: 'metatag.php' }, + { startIndex: 37, type: 'number.php' }, + { startIndex: 38, type: 'delimiter.php' }, + { startIndex: 39, type: 'number.php' }, + { startIndex: 40, type: 'metatag.php' }, + { startIndex: 42, type: htmlTokenTypes.DELIM_START }, + { startIndex: 43, type: htmlTokenTypes.getTag('abc') }, + { startIndex: 46, type: htmlTokenTypes.DELIM_END } + ] + }], // html/js/php/js/ [{ - line: '', - tokens: [ - { startIndex:0, type: htmlTokenTypes.DELIM_START }, - { startIndex:1, type: htmlTokenTypes.getTag('abc') }, - { startIndex:4, type: htmlTokenTypes.DELIM_END }, - // { startIndex:5, type: htmlTokenTypes.DELIM_START }, - { startIndex:6, type: htmlTokenTypes.getTag('script') }, - { startIndex:12, type: htmlTokenTypes.DELIM_END }, - { startIndex:13, type: '' }, - { startIndex:23, type: htmlTokenTypes.DELIM_START }, - { startIndex:25, type: htmlTokenTypes.getTag('script') }, - { startIndex:31, type: htmlTokenTypes.DELIM_END }, - { startIndex:32, type: 'metatag.php' }, - { startIndex:37, type: 'number.php' }, - { startIndex:38, type: 'delimiter.php' }, - { startIndex:39, type: 'number.php' }, - { startIndex:40, type: 'metatag.php' }, - { startIndex:42, type: htmlTokenTypes.DELIM_START }, - { startIndex:43, type: htmlTokenTypes.getTag('script') }, - { startIndex:49, type: htmlTokenTypes.DELIM_END }, - { startIndex:50, type: '' }, - { startIndex:60, type: htmlTokenTypes.DELIM_START }, - { startIndex:62, type: htmlTokenTypes.getTag('script') }, - { startIndex:68, type: htmlTokenTypes.DELIM_END } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: htmlTokenTypes.DELIM_START }, + { startIndex: 1, type: htmlTokenTypes.getTag('abc') }, + { startIndex: 4, type: htmlTokenTypes.DELIM_END }, + // { startIndex:5, type: htmlTokenTypes.DELIM_START }, + { startIndex: 6, type: htmlTokenTypes.getTag('script') }, + { startIndex: 12, type: htmlTokenTypes.DELIM_END }, + { startIndex: 13, type: '' }, + { startIndex: 23, type: htmlTokenTypes.DELIM_START }, + { startIndex: 25, type: htmlTokenTypes.getTag('script') }, + { startIndex: 31, type: htmlTokenTypes.DELIM_END }, + { startIndex: 32, type: 'metatag.php' }, + { startIndex: 37, type: 'number.php' }, + { startIndex: 38, type: 'delimiter.php' }, + { startIndex: 39, type: 'number.php' }, + { startIndex: 40, type: 'metatag.php' }, + { startIndex: 42, type: htmlTokenTypes.DELIM_START }, + { startIndex: 43, type: htmlTokenTypes.getTag('script') }, + { startIndex: 49, type: htmlTokenTypes.DELIM_END }, + { startIndex: 50, type: '' }, + { startIndex: 60, type: htmlTokenTypes.DELIM_START }, + { startIndex: 62, type: htmlTokenTypes.getTag('script') }, + { startIndex: 68, type: htmlTokenTypes.DELIM_END } + ] + }], // Multiline test [{ - line: '', - tokens: [ - { startIndex:0, type: htmlTokenTypes.DELIM_START }, - { startIndex:1, type: htmlTokenTypes.getTag('html') }, - { startIndex:5, type: htmlTokenTypes.DELIM_END } - ]}, { - line: '', - tokens: [ - { startIndex:0, type: htmlTokenTypes.DELIM_START }, - { startIndex:1, type: htmlTokenTypes.getTag('style') }, - { startIndex:6, type: htmlTokenTypes.DELIM_END }, - { startIndex:7, type: 'metatag.php' }, - { startIndex:10, type: 'string.php' }, - { startIndex:15, type: 'metatag.php' }, - { startIndex:17, type: 'delimiter.bracket.css' }, - { startIndex:18, type: '' }, - { startIndex:19, type: 'attribute.name.css' }, - { startIndex:25, type: 'attribute.value.css' }, - { startIndex:29, type: 'delimiter.css' }, - { startIndex:30, type: '' }, - { startIndex:31, type: 'delimiter.bracket.css' }, - { startIndex:32, type: htmlTokenTypes.DELIM_START }, - { startIndex:34, type: htmlTokenTypes.getTag('style') }, - { startIndex:39, type: htmlTokenTypes.DELIM_END } - ]}], + line: '', + tokens: [ + { startIndex: 0, type: htmlTokenTypes.DELIM_START }, + { startIndex: 1, type: htmlTokenTypes.getTag('html') }, + { startIndex: 5, type: htmlTokenTypes.DELIM_END } + ] + }, { + line: '', + tokens: [ + { startIndex: 0, type: htmlTokenTypes.DELIM_START }, + { startIndex: 1, type: htmlTokenTypes.getTag('style') }, + { startIndex: 6, type: htmlTokenTypes.DELIM_END }, + { startIndex: 7, type: 'metatag.php' }, + { startIndex: 10, type: 'string.php' }, + { startIndex: 15, type: 'metatag.php' }, + { startIndex: 17, type: 'delimiter.bracket.css' }, + { startIndex: 18, type: '' }, + { startIndex: 19, type: 'attribute.name.css' }, + { startIndex: 25, type: 'attribute.value.css' }, + { startIndex: 29, type: 'delimiter.css' }, + { startIndex: 30, type: '' }, + { startIndex: 31, type: 'delimiter.bracket.css' }, + { startIndex: 32, type: htmlTokenTypes.DELIM_START }, + { startIndex: 34, type: htmlTokenTypes.getTag('style') }, + { startIndex: 39, type: htmlTokenTypes.DELIM_END } + ] + }], // HTML (CSS (PHP)), HTML ( PHP, JS (PHP), PHP) [{ - line: '*/?> */var y = 4;', - tokens: [ - { startIndex:0, type: htmlTokenTypes.DELIM_START }, - { startIndex:1, type: htmlTokenTypes.getTag('html') }, - { startIndex:5, type: htmlTokenTypes.DELIM_END }, - // { startIndex:6, type: htmlTokenTypes.DELIM_START }, - { startIndex:7, type: htmlTokenTypes.getTag('style') }, - { startIndex:12, type: htmlTokenTypes.DELIM_END }, - { startIndex:13, type: 'metatag.php' }, - { startIndex:16, type: 'string.php' }, - { startIndex:21, type: 'metatag.php' }, - { startIndex:23, type: '' }, - { startIndex:24, type: 'delimiter.bracket.css' }, - { startIndex:25, type: '' }, - { startIndex:26, type: 'attribute.name.css' }, - { startIndex:32, type: 'attribute.value.css' }, - { startIndex:36, type: 'delimiter.css' }, - { startIndex:37, type: '' }, - { startIndex:38, type: 'delimiter.bracket.css' }, - { startIndex:39, type: htmlTokenTypes.DELIM_START }, - { startIndex:41, type: htmlTokenTypes.getTag('style') }, - { startIndex:46, type: htmlTokenTypes.DELIM_END }, - { startIndex:47, type: htmlTokenTypes.DELIM_COMMENT }, - { startIndex:51, type: 'metatag.php' }, - { startIndex:54, type: 'string.php' }, - { startIndex:68, type: 'metatag.php' }, - { startIndex:70, type: htmlTokenTypes.DELIM_COMMENT }, - { startIndex:73, type: htmlTokenTypes.DELIM_START }, - { startIndex:74, type: htmlTokenTypes.getTag('script') }, - { startIndex:80, type: htmlTokenTypes.DELIM_END }, - { startIndex:81, type: '' }, - { startIndex:94, type: 'metatag.php' }, - { startIndex:97, type: 'string.php' }, - { startIndex:109, type: 'comment.php' }, - { startIndex:122, type: 'metatag.php' }, - { startIndex:124, type: '' }, - { startIndex:137, type: htmlTokenTypes.DELIM_START }, - { startIndex:139, type: htmlTokenTypes.getTag('script') }, - { startIndex:145, type: htmlTokenTypes.DELIM_END }, - // { startIndex:146, type: htmlTokenTypes.DELIM_START }, - { startIndex:148, type: htmlTokenTypes.getTag('html') }, - { startIndex:152, type: htmlTokenTypes.DELIM_END }, - { startIndex:153, type: 'metatag.php' }, - { startIndex:155, type: '' }, - { startIndex:156, type: 'variable.php' }, - { startIndex:158, type: '' }, - { startIndex:159, type: 'delimiter.php' }, - { startIndex:160, type: '' }, - { startIndex:161, type: 'number.php' }, - { startIndex:162, type: 'delimiter.php' }, - { startIndex:163, type: 'metatag.php' } - ]}], + line: '*/?> */var y = 4;', + tokens: [ + { startIndex: 0, type: htmlTokenTypes.DELIM_START }, + { startIndex: 1, type: htmlTokenTypes.getTag('html') }, + { startIndex: 5, type: htmlTokenTypes.DELIM_END }, + // { startIndex:6, type: htmlTokenTypes.DELIM_START }, + { startIndex: 7, type: htmlTokenTypes.getTag('style') }, + { startIndex: 12, type: htmlTokenTypes.DELIM_END }, + { startIndex: 13, type: 'metatag.php' }, + { startIndex: 16, type: 'string.php' }, + { startIndex: 21, type: 'metatag.php' }, + { startIndex: 23, type: '' }, + { startIndex: 24, type: 'delimiter.bracket.css' }, + { startIndex: 25, type: '' }, + { startIndex: 26, type: 'attribute.name.css' }, + { startIndex: 32, type: 'attribute.value.css' }, + { startIndex: 36, type: 'delimiter.css' }, + { startIndex: 37, type: '' }, + { startIndex: 38, type: 'delimiter.bracket.css' }, + { startIndex: 39, type: htmlTokenTypes.DELIM_START }, + { startIndex: 41, type: htmlTokenTypes.getTag('style') }, + { startIndex: 46, type: htmlTokenTypes.DELIM_END }, + { startIndex: 47, type: htmlTokenTypes.DELIM_COMMENT }, + { startIndex: 51, type: 'metatag.php' }, + { startIndex: 54, type: 'string.php' }, + { startIndex: 68, type: 'metatag.php' }, + { startIndex: 70, type: htmlTokenTypes.DELIM_COMMENT }, + { startIndex: 73, type: htmlTokenTypes.DELIM_START }, + { startIndex: 74, type: htmlTokenTypes.getTag('script') }, + { startIndex: 80, type: htmlTokenTypes.DELIM_END }, + { startIndex: 81, type: '' }, + { startIndex: 94, type: 'metatag.php' }, + { startIndex: 97, type: 'string.php' }, + { startIndex: 109, type: 'comment.php' }, + { startIndex: 122, type: 'metatag.php' }, + { startIndex: 124, type: '' }, + { startIndex: 137, type: htmlTokenTypes.DELIM_START }, + { startIndex: 139, type: htmlTokenTypes.getTag('script') }, + { startIndex: 145, type: htmlTokenTypes.DELIM_END }, + // { startIndex:146, type: htmlTokenTypes.DELIM_START }, + { startIndex: 148, type: htmlTokenTypes.getTag('html') }, + { startIndex: 152, type: htmlTokenTypes.DELIM_END }, + { startIndex: 153, type: 'metatag.php' }, + { startIndex: 155, type: '' }, + { startIndex: 156, type: 'variable.php' }, + { startIndex: 158, type: '' }, + { startIndex: 159, type: 'delimiter.php' }, + { startIndex: 160, type: '' }, + { startIndex: 161, type: 'number.php' }, + { startIndex: 162, type: 'delimiter.php' }, + { startIndex: 163, type: 'metatag.php' } + ] + }], // PHP-tag detection [{ - line: '////""', - tokens: [ - { startIndex:0, type: htmlTokenTypes.DELIM_START }, - { startIndex:1, type: htmlTokenTypes.getTag('script') }, - { startIndex:7, type: htmlTokenTypes.DELIM_END }, - { startIndex:8, type: '' }, - { startIndex:9, type: 'metatag.php' }, - { startIndex:14, type: 'number.php' }, - { startIndex:15, type: 'delimiter.php' }, - { startIndex:16, type: 'number.php' }, - { startIndex:17, type: 'metatag.php' }, - { startIndex:19, type: '' } - ]}], + line: '