mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 16:15:41 +01:00
Remove extraneous bracket directives
This commit is contained in:
parent
21953fde00
commit
36b879e624
16 changed files with 172 additions and 171 deletions
|
|
@ -61,8 +61,8 @@ export var language = <ILanguage> {
|
|||
[/[ \t\r\n]+/, ''],
|
||||
|
||||
// blocks
|
||||
[/setlocal(?!\w)/, { token: 'keyword.tag-setlocal', bracket: '@open' }],
|
||||
[/endlocal(?!\w)/, { token: 'keyword.tag-setlocal', bracket: '@close' }],
|
||||
[/setlocal(?!\w)/, 'keyword.tag-setlocal' ],
|
||||
[/endlocal(?!\w)/, 'keyword.tag-setlocal' ],
|
||||
|
||||
// words
|
||||
[/[a-zA-Z_]\w*/, ''],
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ export var language = <ILanguage> {
|
|||
[/@escapes/, 'string.escape'],
|
||||
[/\./, 'string.escape.invalid'],
|
||||
|
||||
[/#{/, { token: 'string.quote', bracket: '@open', next: 'root.interpolatedstring' } ],
|
||||
[/#{/, { token: 'string.quote', next: 'root.interpolatedstring' } ],
|
||||
[/#/, 'string']
|
||||
],
|
||||
|
||||
|
|
@ -147,7 +147,7 @@ export var language = <ILanguage> {
|
|||
],
|
||||
|
||||
hereregexp: [
|
||||
[/[^\\\/#]/, 'regexp'],
|
||||
[/[^\\\/#]+/, 'regexp'],
|
||||
[/\\./, 'regexp'],
|
||||
[/#.*$/, 'comment'],
|
||||
['///[igm]*', { token: 'regexp', next: '@pop' }],
|
||||
|
|
|
|||
|
|
@ -89,17 +89,17 @@ export var language = <ILanguage> {
|
|||
|
||||
// delimiters and operators
|
||||
[/}/, { cases: {
|
||||
'$S2==interpolatedstring' : { token: 'string.quote', bracket: '@close', next: '@pop' }
|
||||
'$S2==interpolatedstring' : { token: 'string.quote', next: '@pop' }
|
||||
, '@default' : '@brackets' } }],
|
||||
[/[{}()\[\]]/, '@brackets'],
|
||||
[/[<>](?!@symbols)/, '@brackets'],
|
||||
[/@symbols/, { cases: { '@operators': 'delimiter', '@default' : '' } } ],
|
||||
|
||||
// literal string
|
||||
[/\@"/, { token: 'string.quote', bracket: '@open', next: '@litstring' } ],
|
||||
[/\@"/, { token: 'string.quote', next: '@litstring' } ],
|
||||
|
||||
// interpolated string
|
||||
[/\$"/, { token: 'string.quote', bracket: '@open', next: '@interpolatedstring' } ],
|
||||
[/\$"/, { token: 'string.quote', next: '@interpolatedstring' } ],
|
||||
|
||||
// numbers
|
||||
[/\d*\.\d+([eE][\-+]?\d+)?[fFdD]?/, 'number.float'],
|
||||
|
|
@ -111,7 +111,7 @@ export var language = <ILanguage> {
|
|||
|
||||
// strings
|
||||
[/"([^"\\]|\\.)*$/, 'string.invalid' ], // non-teminated string
|
||||
[/"/, { token: 'string.quote', bracket: '@open', next: '@string' } ],
|
||||
[/"/, { token: 'string.quote', next: '@string' } ],
|
||||
|
||||
// characters
|
||||
[/'[^\\']'/, 'string'],
|
||||
|
|
@ -146,13 +146,13 @@ export var language = <ILanguage> {
|
|||
[/[^\\"]+/, 'string'],
|
||||
[/@escapes/, 'string.escape'],
|
||||
[/\\./, 'string.escape.invalid'],
|
||||
[/"/, { token: 'string.quote', bracket: '@close', next: '@pop' } ]
|
||||
[/"/, { token: 'string.quote', next: '@pop' } ]
|
||||
],
|
||||
|
||||
litstring: [
|
||||
[/[^"]+/, 'string'],
|
||||
[/""/, 'string.escape'],
|
||||
[/"/, { token: 'string.quote', bracket: '@close', next: '@pop' } ]
|
||||
[/"/, { token: 'string.quote', next: '@pop' } ]
|
||||
],
|
||||
|
||||
interpolatedstring: [
|
||||
|
|
@ -161,8 +161,8 @@ export var language = <ILanguage> {
|
|||
[/\\./, 'string.escape.invalid'],
|
||||
[/{{/, 'string.escape'],
|
||||
[/}}/, 'string.escape'],
|
||||
[/{/, { token: 'string.quote', bracket: '@open', next: 'root.interpolatedstring' } ],
|
||||
[/"/, { token: 'string.quote', bracket: '@close', next: '@pop' } ]
|
||||
[/{/, { token: 'string.quote', next: 'root.interpolatedstring' } ],
|
||||
[/"/, { token: 'string.quote', next: '@pop' } ]
|
||||
],
|
||||
|
||||
whitespace: [
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ export var language = <IMonarchLanguage> {
|
|||
|
||||
comment: [
|
||||
['\\*\\/', 'comment', '@pop'],
|
||||
['.', 'comment']
|
||||
[/[^*/]+/, 'comment']
|
||||
],
|
||||
|
||||
name: [
|
||||
|
|
@ -183,13 +183,13 @@ export var language = <IMonarchLanguage> {
|
|||
|
||||
stringenddoublequote: [
|
||||
['\\\\.', 'string'],
|
||||
['"', { token: 'string', next: '@pop', bracket: '@close' }],
|
||||
['"', { token: 'string', next: '@pop' }],
|
||||
['.', 'string']
|
||||
],
|
||||
|
||||
stringendquote: [
|
||||
['\\\\.', 'string'],
|
||||
['\'', { token: 'string', next: '@pop', bracket: '@close' }],
|
||||
['\'', { token: 'string', next: '@pop' }],
|
||||
['.', 'string']
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ export var language = <ILanguage> {
|
|||
[/"/, 'string', '@string."' ],
|
||||
|
||||
// literal string
|
||||
[/\@"/, { token: 'string.quote', bracket: '@open', next: '@litstring' }],
|
||||
[/\@"/, { token: 'string.quote', next: '@litstring' }],
|
||||
|
||||
// characters
|
||||
[/'[^\\']'B?/, 'string'],
|
||||
|
|
@ -127,7 +127,7 @@ export var language = <ILanguage> {
|
|||
litstring: [
|
||||
[/[^"]+/, 'string'],
|
||||
[/""/, 'string.escape'],
|
||||
[/"/, { token: 'string.quote', bracket: '@close', next: '@pop' } ]
|
||||
[/"/, { token: 'string.quote', next: '@pop' } ]
|
||||
],
|
||||
},
|
||||
};
|
||||
10
src/jade.ts
10
src/jade.ts
|
|
@ -113,7 +113,7 @@ export var language = <ILanguage> {
|
|||
// class
|
||||
[/\.[a-zA-Z_-][\w-]*/, { cases: { '@eos': { token: 'tag.class', next: '@pop' }, '@default': 'tag.class' } }],
|
||||
// attributes
|
||||
[/\(/, { token: 'delimiter.parenthesis', bracket: '@open', next: '@attributeList' }],
|
||||
[/\(/, { token: 'delimiter.parenthesis', next: '@attributeList' }],
|
||||
],
|
||||
|
||||
simpleText: [
|
||||
|
|
@ -137,14 +137,14 @@ export var language = <ILanguage> {
|
|||
|
||||
[/,/, { cases: { '@eos': { token: 'attribute.delimiter', next: '@popall' }, '@default': 'attribute.delimiter' } }],
|
||||
|
||||
[/\)$/, { token: 'delimiter.parenthesis', bracket: '@close', next: '@popall' }],
|
||||
[/\)/, { token: 'delimiter.parenthesis', bracket: '@close', next: '@pop' }],
|
||||
[/\)$/, { token: 'delimiter.parenthesis', next: '@popall' }],
|
||||
[/\)/, { token: 'delimiter.parenthesis', next: '@pop' }],
|
||||
],
|
||||
|
||||
whitespace: [
|
||||
[/^(\s*)(\/\/.*)$/, { token: 'comment', next: '@blockText.$1.comment' } ],
|
||||
[/[ \t\r\n]+/, ''],
|
||||
[/<!--/, { token: 'comment', bracket: '@open', next: '@comment' }],
|
||||
[/<!--/, { token: 'comment', next: '@comment' }],
|
||||
],
|
||||
|
||||
blockText: [
|
||||
|
|
@ -154,7 +154,7 @@ export var language = <ILanguage> {
|
|||
|
||||
comment: [
|
||||
[/[^<\-]+/, 'comment.content' ],
|
||||
[/-->/, { token: 'comment', bracket: '@close', next: '@pop' } ],
|
||||
[/-->/, { token: 'comment', next: '@pop' } ],
|
||||
[/<!--/, 'comment.content.invalid'],
|
||||
[/[<\-]/, 'comment.content' ]
|
||||
],
|
||||
|
|
|
|||
16
src/less.ts
16
src/less.ts
|
|
@ -57,7 +57,7 @@ export var language = <ILanguage> {
|
|||
{ include: '@numbers' },
|
||||
['[*_]?[a-zA-Z\\-\\s]+(?=:.*(;|(\\\\$)))', TOKEN_PROPERTY, '@attribute'],
|
||||
|
||||
['url(\\-prefix)?\\(', { token: 'tag', bracket: '@open', next: '@urldeclaration'}],
|
||||
['url(\\-prefix)?\\(', { token: 'tag', next: '@urldeclaration'}],
|
||||
|
||||
['[{}()\\[\\]]', '@brackets'],
|
||||
['[,:;]', 'delimiter'],
|
||||
|
|
@ -78,11 +78,11 @@ export var language = <ILanguage> {
|
|||
|
||||
nestedJSBegin: [
|
||||
['``', 'delimiter.backtick'],
|
||||
['`', { token: 'delimiter.backtick', bracket: '@open', next: '@nestedJSEnd', nextEmbedded: 'text/javascript' }],
|
||||
['`', { token: 'delimiter.backtick', next: '@nestedJSEnd', nextEmbedded: 'text/javascript' }],
|
||||
],
|
||||
|
||||
nestedJSEnd: [
|
||||
['`', { token: 'delimiter.backtick', bracket: '@close', next: '@pop', nextEmbedded: '@pop' }],
|
||||
['`', { token: 'delimiter.backtick', next: '@pop', nextEmbedded: '@pop' }],
|
||||
],
|
||||
|
||||
operators: [
|
||||
|
|
@ -96,7 +96,7 @@ export var language = <ILanguage> {
|
|||
urldeclaration: [
|
||||
{ include: '@strings'},
|
||||
[ '[^)\r\n]+', 'string' ],
|
||||
['\\)', { token: 'tag', bracket: '@close', next: '@pop'}],
|
||||
['\\)', { token: 'tag', next: '@pop'}],
|
||||
],
|
||||
|
||||
attribute: <any[]>[
|
||||
|
|
@ -143,19 +143,19 @@ export var language = <ILanguage> {
|
|||
],
|
||||
|
||||
strings: [
|
||||
<any[]>['~?"', { token: 'string.delimiter', bracket: '@open', next: '@stringsEndDoubleQuote' }],
|
||||
<any[]>['~?\'', { token: 'string.delimiter', bracket: '@open', next: '@stringsEndQuote' }]
|
||||
<any[]>['~?"', { token: 'string.delimiter', next: '@stringsEndDoubleQuote' }],
|
||||
<any[]>['~?\'', { token: 'string.delimiter', next: '@stringsEndQuote' }]
|
||||
],
|
||||
|
||||
stringsEndDoubleQuote: [
|
||||
['\\\\"', 'string'],
|
||||
<any[]>['"', { token: 'string.delimiter', next: '@popall', bracket: '@close' }],
|
||||
<any[]>['"', { token: 'string.delimiter', next: '@popall' }],
|
||||
['.', 'string']
|
||||
],
|
||||
|
||||
stringsEndQuote: [
|
||||
['\\\\\'', 'string'],
|
||||
<any[]>['\'', { token: 'string.delimiter', next: '@popall', bracket: '@close' }],
|
||||
<any[]>['\'', { token: 'string.delimiter', next: '@popall' }],
|
||||
['.', 'string']
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -132,10 +132,10 @@ export var language = <ILanguage>{
|
|||
[/<(\w+)/, {
|
||||
cases: {
|
||||
'@empty': { token: getTag('$1'), next: '@tag.$1' },
|
||||
'@default': { token: getTag('$1'), bracket: '@open', next: '@tag.$1' }
|
||||
'@default': { token: getTag('$1'), next: '@tag.$1' }
|
||||
}
|
||||
}],
|
||||
[/<\/(\w+)\s*>/, { token: getTag('$1'), bracket: '@close' }],
|
||||
[/<\/(\w+)\s*>/, { token: getTag('$1') }],
|
||||
|
||||
[/<!--/, 'comment', '@comment']
|
||||
],
|
||||
|
|
|
|||
|
|
@ -472,23 +472,23 @@ export var language = <ILanguage> {
|
|||
// NOTE: (*) is an invalid ML-like comment!
|
||||
{regex: /\(\*\)/, action: { token: 'invalid' }},
|
||||
{regex: /\(\*/, action: { token: 'comment', next: 'lexing_COMMENT_block_ml' } },
|
||||
{regex: /\(/, action: '@brackets'/*{ token: 'delimiter.parenthesis', bracket: '@open' }*/ },
|
||||
{regex: /\)/, action: '@brackets'/*{ token: 'delimiter.parenthesis', bracket: '@close' }*/ },
|
||||
{regex: /\[/, action: '@brackets'/*{ token: 'delimiter.bracket', bracket: '@open' }*/ },
|
||||
{regex: /\]/, action: '@brackets'/*{ token: 'delimiter.bracket', bracket: '@close' }*/ },
|
||||
{regex: /\{/, action: '@brackets'/*{ token: 'delimiter.brace', bracket: '@open' }*/ },
|
||||
{regex: /\}/, action: '@brackets'/*{ token: 'delimiter.brace', bracket: '@close' }*/ },
|
||||
{regex: /\(/, action: '@brackets'/*{ token: 'delimiter.parenthesis' }*/ },
|
||||
{regex: /\)/, action: '@brackets'/*{ token: 'delimiter.parenthesis' }*/ },
|
||||
{regex: /\[/, action: '@brackets'/*{ token: 'delimiter.bracket' }*/ },
|
||||
{regex: /\]/, action: '@brackets'/*{ token: 'delimiter.bracket' }*/ },
|
||||
{regex: /\{/, action: '@brackets'/*{ token: 'delimiter.brace' }*/ },
|
||||
{regex: /\}/, action: '@brackets'/*{ token: 'delimiter.brace' }*/ },
|
||||
|
||||
// lexing_COMMA
|
||||
{regex: /,\(/, action: '@brackets'/*{ token: 'delimiter.parenthesis', bracket: '@open' }*/ }, // meta-programming syntax
|
||||
{regex: /,\(/, action: '@brackets'/*{ token: 'delimiter.parenthesis' }*/ }, // meta-programming syntax
|
||||
{regex: /,/, action: { token: 'delimiter.comma' } },
|
||||
|
||||
{regex: /;/, action: { token: 'delimiter.semicolon' } },
|
||||
|
||||
// lexing_AT
|
||||
{regex: /@\(/, action: '@brackets'/* { token: 'delimiter.parenthesis', bracket: '@open' }*/ },
|
||||
{regex: /@\[/, action: '@brackets'/* { token: 'delimiter.bracket', bracket: '@open' }*/ },
|
||||
{regex: /@\{/, action: '@brackets'/*{ token: 'delimiter.brace', bracket: '@open' }*/ },
|
||||
{regex: /@\(/, action: '@brackets'/* { token: 'delimiter.parenthesis' }*/ },
|
||||
{regex: /@\[/, action: '@brackets'/* { token: 'delimiter.bracket' }*/ },
|
||||
{regex: /@\{/, action: '@brackets'/*{ token: 'delimiter.brace' }*/ },
|
||||
|
||||
// lexing_COLON
|
||||
{regex: /:</, action: { token: 'keyword', next: '@lexing_EFFECT_commaseq0'} }, // T_COLONLT
|
||||
|
|
@ -527,14 +527,14 @@ export var language = <ILanguage> {
|
|||
},
|
||||
|
||||
// lexing_PERCENT:
|
||||
{regex: /%\(/, action: { token: 'delimiter.parenthesis', bracket: '@open' } },
|
||||
{regex: /^%{(#|\^|\$)?/, action: { token: 'keyword', bracket: '@open', next: '@lexing_EXTCODE', nextEmbedded: 'text/javascript' } },
|
||||
{regex: /^%}/, action: { token: 'keyword', bracket: '@close' } },
|
||||
{regex: /%\(/, action: { token: 'delimiter.parenthesis' } },
|
||||
{regex: /^%{(#|\^|\$)?/, action: { token: 'keyword', next: '@lexing_EXTCODE', nextEmbedded: 'text/javascript' } },
|
||||
{regex: /^%}/, action: { token: 'keyword' } },
|
||||
|
||||
// lexing_QUOTE
|
||||
{regex: /'\(/, action: { token: 'delimiter.parenthesis', bracket: '@open' } },
|
||||
{regex: /'\[/, action: { token: 'delimiter.bracket', bracket: '@open' } },
|
||||
{regex: /'\{/, action: { token: 'delimiter.brace', bracket: '@open' } },
|
||||
{regex: /'\(/, action: { token: 'delimiter.parenthesis' } },
|
||||
{regex: /'\[/, action: { token: 'delimiter.bracket' } },
|
||||
{regex: /'\{/, action: { token: 'delimiter.brace' } },
|
||||
[/(')(\\@ESCHAR|\\[xX]@xdigit+|\\@digit+)(')/, ['string', 'string.escape', 'string']],
|
||||
[/'[^\\']'/, 'string'],
|
||||
|
||||
|
|
@ -542,7 +542,7 @@ export var language = <ILanguage> {
|
|||
[/"/, 'string.quote', '@lexing_DQUOTE'],
|
||||
|
||||
// lexing_BQUOTE
|
||||
{regex: /`\(/, action: '@brackets'/* { token: 'delimiter.parenthesis', bracket: '@open' }*/},
|
||||
{regex: /`\(/, action: '@brackets'/* { token: 'delimiter.parenthesis' }*/},
|
||||
// TODO: otherwise, try lexing_IDENT_sym
|
||||
|
||||
{regex: /\\/, action: { token: 'punctuation' } }, // just T_BACKSLASH
|
||||
|
|
@ -644,7 +644,7 @@ export var language = <ILanguage> {
|
|||
],
|
||||
|
||||
lexing_DQUOTE: [
|
||||
{regex: /"/, action: { token: 'string.quote', bracket: '@close', next: '@pop' }},
|
||||
{regex: /"/, action: { token: 'string.quote', next: '@pop' }},
|
||||
// AS-20160628: additional hi-lighting for variables in staload/dynload strings
|
||||
{regex: /(\{\$)(@IDENTFST@IDENTRST*)(\})/, action: [{token: 'string.escape'},{ token: 'identifier' },{token: 'string.escape'}]},
|
||||
{regex: /\\$/, action: { token: 'string.escape' }},
|
||||
|
|
|
|||
90
src/ruby.ts
90
src/ruby.ts
|
|
@ -143,17 +143,17 @@ export var language = <ILanguage> {
|
|||
// most complexity here is due to matching 'end' correctly with declarations.
|
||||
// We distinguish a declaration that comes first on a line, versus declarations further on a line (which are most likey modifiers)
|
||||
[/^(\s*)([a-z_]\w*[!?=]?)/, ['white',
|
||||
{ cases: { 'for|until|while': { token: 'keyword.$2', bracket: '@open', next: '@dodecl.$2' },
|
||||
'@declarations': { token: 'keyword.$2', bracket: '@open', next: '@root.$2' },
|
||||
'end': { token: 'keyword.$S2', bracket: '@close', next: '@pop' },
|
||||
{ cases: { 'for|until|while': { token: 'keyword.$2', next: '@dodecl.$2' },
|
||||
'@declarations': { token: 'keyword.$2', next: '@root.$2' },
|
||||
'end': { token: 'keyword.$S2', next: '@pop' },
|
||||
'@keywords': 'keyword',
|
||||
'@builtins': 'predefined',
|
||||
'@default': 'identifier' } }]],
|
||||
[/[a-z_]\w*[!?=]?/,
|
||||
{ cases: { 'if|unless|while|until': { token: 'keyword.$0x', bracket: '@open', next: '@modifier.$0x' },
|
||||
'for': { token: 'keyword.$2', bracket: '@open', next: '@dodecl.$2' },
|
||||
'@linedecls': { token: 'keyword.$0', bracket: '@open', next: '@root.$0' },
|
||||
'end': { token: 'keyword.$S2', bracket: '@close', next: '@pop' },
|
||||
{ cases: { 'if|unless|while|until': { token: 'keyword.$0x', next: '@modifier.$0x' },
|
||||
'for': { token: 'keyword.$2', next: '@dodecl.$2' },
|
||||
'@linedecls': { token: 'keyword.$0', next: '@root.$0' },
|
||||
'end': { token: 'keyword.$S2', next: '@pop' },
|
||||
'@keywords': 'keyword',
|
||||
'@builtins': 'predefined',
|
||||
'@default': 'identifier' } }],
|
||||
|
|
@ -164,29 +164,29 @@ export var language = <ILanguage> {
|
|||
[/@@[\w]*/, 'namespace.class.identifier' ], // class
|
||||
|
||||
// here document
|
||||
[/<<-(@heredelim).*/, { token: 'string.heredoc.delimiter', bracket: '@open', next: '@heredoc.$1' } ],
|
||||
[/[ \t\r\n]+<<(@heredelim).*/, { token: 'string.heredoc.delimiter', bracket: '@open', next: '@heredoc.$1' } ],
|
||||
[/^<<(@heredelim).*/, { token: 'string.heredoc.delimiter', bracket: '@open', next: '@heredoc.$1' } ],
|
||||
[/<<-(@heredelim).*/, { token: 'string.heredoc.delimiter', next: '@heredoc.$1' } ],
|
||||
[/[ \t\r\n]+<<(@heredelim).*/, { token: 'string.heredoc.delimiter', next: '@heredoc.$1' } ],
|
||||
[/^<<(@heredelim).*/, { token: 'string.heredoc.delimiter', next: '@heredoc.$1' } ],
|
||||
|
||||
|
||||
// whitespace
|
||||
{ include: '@whitespace' },
|
||||
|
||||
// strings
|
||||
[/"/, { token: 'string.d.delim', bracket: '@open', next: '@dstring.d."'} ],
|
||||
[/'/, { token: 'string.sq.delim', bracket: '@open', next: '@sstring.sq' } ],
|
||||
[/"/, { token: 'string.d.delim', next: '@dstring.d."'} ],
|
||||
[/'/, { token: 'string.sq.delim', next: '@sstring.sq' } ],
|
||||
|
||||
// % literals. For efficiency, rematch in the 'pstring' state
|
||||
[/%([rsqxwW]|Q?)/, { token: '@rematch', next: 'pstring' } ],
|
||||
|
||||
// commands and symbols
|
||||
[/`/, { token: 'string.x.delim', bracket: '@open', next: '@dstring.x.`' } ],
|
||||
[/`/, { token: 'string.x.delim', next: '@dstring.x.`' } ],
|
||||
[/:(\w|[$@])\w*[!?=]?/, 'string.s'],
|
||||
[/:"/, { token: 'string.s.delim', bracket: '@open', next: '@dstring.s."' } ],
|
||||
[/:'/, { token: 'string.s.delim', bracket: '@open', next: '@sstring.s' } ],
|
||||
[/:"/, { token: 'string.s.delim', next: '@dstring.s."' } ],
|
||||
[/:'/, { token: 'string.s.delim', next: '@sstring.s' } ],
|
||||
|
||||
// regular expressions. Lookahead for a (not escaped) closing forwardslash on the same line
|
||||
[/\/(?=(\\\/|[^\/\n])+\/)/, { token: 'regexp.delim', bracket: '@open', next: '@regexp' } ],
|
||||
[/\/(?=(\\\/|[^\/\n])+\/)/, { token: 'regexp.delim', next: '@regexp' } ],
|
||||
|
||||
// delimiters and operators
|
||||
[/[{}()\[\]]/, '@brackets'],
|
||||
|
|
@ -211,7 +211,7 @@ export var language = <ILanguage> {
|
|||
// dodecl.<decl> where decl is the declarations started, like 'while'
|
||||
dodecl: [
|
||||
[/^/, { token: '', switchTo: '@root.$S2' }], // get out of do-skipping mode on a new line
|
||||
[/[a-z_]\w*[!?=]?/, { cases: { 'end': { token: 'keyword.$S2', bracket: '@close', next: '@pop' }, // end on same line
|
||||
[/[a-z_]\w*[!?=]?/, { cases: { 'end': { token: 'keyword.$S2', next: '@pop' }, // end on same line
|
||||
'do' : { token: 'keyword', switchTo: '@root.$S2' }, // do on same line: not an open bracket here
|
||||
'@linedecls': { token: '@rematch', switchTo: '@root.$S2' }, // other declaration on same line: rematch
|
||||
'@keywords': 'keyword',
|
||||
|
|
@ -225,7 +225,7 @@ export var language = <ILanguage> {
|
|||
// modifier.<decl>x where decl is the declaration starter, like 'if'
|
||||
modifier: [
|
||||
[/^/, '', '@pop'], // it was a modifier: get out of modifier mode on a new line
|
||||
[/[a-z_]\w*[!?=]?/, { cases: { 'end': { token: 'keyword.$S2', bracket: '@close', next: '@pop' }, // end on same line
|
||||
[/[a-z_]\w*[!?=]?/, { cases: { 'end': { token: 'keyword.$S2', next: '@pop' }, // end on same line
|
||||
'then|else|elsif|do': { token: 'keyword', switchTo: '@root.$S2' }, // real declaration and not a modifier
|
||||
'@linedecls': { token: '@rematch', switchTo: '@root.$S2' }, // other declaration => not a modifier
|
||||
'@keywords': 'keyword',
|
||||
|
|
@ -240,7 +240,7 @@ export var language = <ILanguage> {
|
|||
[/[^\\']+/, 'string.$S2' ],
|
||||
[/\\\\|\\'|\\$/, 'string.$S2.escape'],
|
||||
[/\\./, 'string.$S2.invalid'],
|
||||
[/'/, { token: 'string.$S2.delim', bracket: '@close', next: '@pop'} ]
|
||||
[/'/, { token: 'string.$S2.delim', next: '@pop'} ]
|
||||
],
|
||||
|
||||
// double quoted "string".
|
||||
|
|
@ -252,14 +252,14 @@ export var language = <ILanguage> {
|
|||
[/\\$/, 'string.$S2.escape' ],
|
||||
[/@escapes/, 'string.$S2.escape'],
|
||||
[/\\./, 'string.$S2.escape.invalid'],
|
||||
[/[`"]/, { cases: { '$#==$S3': { token: 'string.$S2.delim', bracket: '@close', next: '@pop'},
|
||||
[/[`"]/, { cases: { '$#==$S3': { token: 'string.$S2.delim', next: '@pop'},
|
||||
'@default': 'string.$S2' } } ]
|
||||
],
|
||||
|
||||
// literal documents
|
||||
// heredoc.<close> where close is the closing delimiter
|
||||
heredoc: [
|
||||
[/^(\s*)(@heredelim)$/, { cases: { '$2==$S2': ['string.heredoc', { token: 'string.heredoc.delimiter', bracket: '@close', next: '@pop' }],
|
||||
[/^(\s*)(@heredelim)$/, { cases: { '$2==$S2': ['string.heredoc', { token: 'string.heredoc.delimiter', next: '@pop' }],
|
||||
'@default': ['string.heredoc','string.heredoc'] }}],
|
||||
[/.*/, 'string.heredoc' ],
|
||||
],
|
||||
|
|
@ -269,13 +269,13 @@ export var language = <ILanguage> {
|
|||
[/\$\w*/, 'global.constant', '@pop' ],
|
||||
[/@\w*/, 'namespace.class.identifier', '@pop' ],
|
||||
[/@@\w*/, 'namespace.instance.identifier', '@pop' ],
|
||||
[/[{]/, { token: 'string.escape.curly', bracket: '@open', switchTo: '@interpolated_compound' }],
|
||||
[/[{]/, { token: 'string.escape.curly', switchTo: '@interpolated_compound' }],
|
||||
['', '', '@pop' ], // just a # is interpreted as a #
|
||||
],
|
||||
|
||||
// any code
|
||||
interpolated_compound: [
|
||||
[/[}]/, { token: 'string.escape.curly', bracket: '@close', next: '@pop'} ],
|
||||
[/[}]/, { token: 'string.escape.curly', next: '@pop'} ],
|
||||
{ include: '@root' },
|
||||
],
|
||||
|
||||
|
|
@ -286,8 +286,8 @@ export var language = <ILanguage> {
|
|||
// turns out that you can quote using regex control characters, aargh!
|
||||
// for example; %r|kgjgaj| is ok (even though | is used for alternation)
|
||||
// so, we need to match those first
|
||||
[/[^\(\{\[\\]/, { cases: { '$#==$S3' : { token: 'regexp.delim', bracket: '@close', next: '@pop' },
|
||||
'$#==$S2' : { token: 'regexp.delim', bracket: '@open', next: '@push' }, // nested delimiters are allowed..
|
||||
[/[^\(\{\[\\]/, { cases: { '$#==$S3' : { token: 'regexp.delim', next: '@pop' },
|
||||
'$#==$S2' : { token: 'regexp.delim', next: '@push' }, // nested delimiters are allowed..
|
||||
'~[)}\\]]' : '@brackets.regexp.escape.control',
|
||||
'~@regexpctl': 'regexp.escape.control',
|
||||
'@default': 'regexp' }}],
|
||||
|
|
@ -298,14 +298,14 @@ export var language = <ILanguage> {
|
|||
regexp: [
|
||||
{ include: '@regexcontrol' },
|
||||
[/[^\\\/]/, 'regexp' ],
|
||||
['/[ixmp]*', { token: 'regexp.delim', bracket: '@close'}, '@pop' ],
|
||||
['/[ixmp]*', { token: 'regexp.delim'}, '@pop' ],
|
||||
],
|
||||
|
||||
regexcontrol: [
|
||||
[/(\{)(\d+(?:,\d*)?)(\})/, ['@brackets.regexp.escape.control', 'regexp.escape.control', '@brackets.regexp.escape.control'] ],
|
||||
[/(\[)(\^?)/, ['@brackets.regexp.escape.control',{ token: 'regexp.escape.control', next: '@regexrange'}]],
|
||||
[/(\()(\?[:=!])/, ['@brackets.regexp.escape.control', 'regexp.escape.control'] ],
|
||||
[/\(\?#/, { token: 'regexp.escape.control', bracket: '@open', next: '@regexpcomment' }],
|
||||
[/\(\?#/, { token: 'regexp.escape.control', next: '@regexpcomment' }],
|
||||
[/[()]/, '@brackets.regexp.escape.control'],
|
||||
[/@regexpctl/, 'regexp.escape.control'],
|
||||
[/\\$/, 'regexp.escape' ],
|
||||
|
|
@ -325,30 +325,30 @@ export var language = <ILanguage> {
|
|||
|
||||
regexpcomment: [
|
||||
[ /[^)]+/, 'comment' ],
|
||||
[ /\)/, { token: 'regexp.escape.control', bracket: '@close', next: '@pop' } ]
|
||||
[ /\)/, { token: 'regexp.escape.control', next: '@pop' } ]
|
||||
],
|
||||
|
||||
|
||||
// % quoted strings
|
||||
// A bit repetitive since we need to often special case the kind of ending delimiter
|
||||
pstring: [
|
||||
[/%([qws])\(/, { token: 'string.$1.delim', bracket: '@open', switchTo: '@qstring.$1.(.)' } ],
|
||||
[/%([qws])\[/, { token: 'string.$1.delim', bracket: '@open', switchTo: '@qstring.$1.[.]' } ],
|
||||
[/%([qws])\{/, { token: 'string.$1.delim', bracket: '@open', switchTo: '@qstring.$1.{.}' } ],
|
||||
[/%([qws])</, { token: 'string.$1.delim', bracket: '@open', switchTo: '@qstring.$1.<.>' } ],
|
||||
[/%([qws])(@delim)/, { token: 'string.$1.delim', bracket: '@open', switchTo: '@qstring.$1.$2.$2' } ],
|
||||
[/%([qws])\(/, { token: 'string.$1.delim', switchTo: '@qstring.$1.(.)' } ],
|
||||
[/%([qws])\[/, { token: 'string.$1.delim', switchTo: '@qstring.$1.[.]' } ],
|
||||
[/%([qws])\{/, { token: 'string.$1.delim', switchTo: '@qstring.$1.{.}' } ],
|
||||
[/%([qws])</, { token: 'string.$1.delim', switchTo: '@qstring.$1.<.>' } ],
|
||||
[/%([qws])(@delim)/, { token: 'string.$1.delim', switchTo: '@qstring.$1.$2.$2' } ],
|
||||
|
||||
[/%r\(/, { token: 'regexp.delim', bracket: '@open', switchTo: '@pregexp.(.)' } ],
|
||||
[/%r\[/, { token: 'regexp.delim', bracket: '@open', switchTo: '@pregexp.[.]' } ],
|
||||
[/%r\{/, { token: 'regexp.delim', bracket: '@open', switchTo: '@pregexp.{.}' } ],
|
||||
[/%r</, { token: 'regexp.delim', bracket: '@open', switchTo: '@pregexp.<.>' } ],
|
||||
[/%r(@delim)/, { token: 'regexp.delim', bracket: '@open', switchTo: '@pregexp.$1.$1' } ],
|
||||
[/%r\(/, { token: 'regexp.delim', switchTo: '@pregexp.(.)' } ],
|
||||
[/%r\[/, { token: 'regexp.delim', switchTo: '@pregexp.[.]' } ],
|
||||
[/%r\{/, { token: 'regexp.delim', switchTo: '@pregexp.{.}' } ],
|
||||
[/%r</, { token: 'regexp.delim', switchTo: '@pregexp.<.>' } ],
|
||||
[/%r(@delim)/, { token: 'regexp.delim', switchTo: '@pregexp.$1.$1' } ],
|
||||
|
||||
[/%(x|W|Q?)\(/, { token: 'string.$1.delim', bracket: '@open', switchTo: '@qqstring.$1.(.)' } ],
|
||||
[/%(x|W|Q?)\[/, { token: 'string.$1.delim', bracket: '@open', switchTo: '@qqstring.$1.[.]' } ],
|
||||
[/%(x|W|Q?)\{/, { token: 'string.$1.delim', bracket: '@open', switchTo: '@qqstring.$1.{.}' } ],
|
||||
[/%(x|W|Q?)</, { token: 'string.$1.delim', bracket: '@open', switchTo: '@qqstring.$1.<.>' } ],
|
||||
[/%(x|W|Q?)(@delim)/, { token: 'string.$1.delim', bracket: '@open', switchTo: '@qqstring.$1.$2.$2' } ],
|
||||
[/%(x|W|Q?)\(/, { token: 'string.$1.delim', switchTo: '@qqstring.$1.(.)' } ],
|
||||
[/%(x|W|Q?)\[/, { token: 'string.$1.delim', switchTo: '@qqstring.$1.[.]' } ],
|
||||
[/%(x|W|Q?)\{/, { token: 'string.$1.delim', switchTo: '@qqstring.$1.{.}' } ],
|
||||
[/%(x|W|Q?)</, { token: 'string.$1.delim', switchTo: '@qqstring.$1.<.>' } ],
|
||||
[/%(x|W|Q?)(@delim)/, { token: 'string.$1.delim', switchTo: '@qqstring.$1.$2.$2' } ],
|
||||
|
||||
[/%([rqwsxW]|Q?)./, { token: 'invalid', next: '@pop' } ], // recover
|
||||
[/./, { token: 'invalid', next: '@pop' } ], // recover
|
||||
|
|
@ -362,8 +362,8 @@ export var language = <ILanguage> {
|
|||
qstring: [
|
||||
[/\\$/, 'string.$S2.escape' ],
|
||||
[/\\./, 'string.$S2.escape' ],
|
||||
[/./, { cases: { '$#==$S4' : { token: 'string.$S2.delim', bracket: '@close', next: '@pop' },
|
||||
'$#==$S3' : { token: 'string.$S2.delim', bracket: '@open', next: '@push' }, // nested delimiters are allowed..
|
||||
[/./, { cases: { '$#==$S4' : { token: 'string.$S2.delim', next: '@pop' },
|
||||
'$#==$S3' : { token: 'string.$S2.delim', next: '@push' }, // nested delimiters are allowed..
|
||||
'@default': 'string.$S2' }}],
|
||||
],
|
||||
|
||||
|
|
|
|||
62
src/scss.ts
62
src/scss.ts
|
|
@ -61,13 +61,13 @@ export var language = <IMonarchLanguage> {
|
|||
['[@](charset|namespace)', { token: TOKEN_AT_KEYWORD, next: '@declarationbody' }],
|
||||
['[@](function)', { token: TOKEN_AT_KEYWORD, next: '@functiondeclaration' }],
|
||||
['[@](mixin)', { token: TOKEN_AT_KEYWORD, next: '@mixindeclaration' }],
|
||||
['url(\\-prefix)?\\(', { token: 'meta', bracket: '@open', next: '@urldeclaration' }],
|
||||
['url(\\-prefix)?\\(', { token: 'meta', next: '@urldeclaration' }],
|
||||
{ include: '@controlstatement' }, // sass control statements
|
||||
{ include: '@selectorname' },
|
||||
['[&\\*]', TOKEN_SELECTOR_TAG], // selector symbols
|
||||
['[>\\+,]', 'delimiter'], // selector operators
|
||||
['\\[', { token: 'delimiter.bracket', bracket: '@open', next: '@selectorattribute' }],
|
||||
['{', { token: 'delimiter.curly', bracket: '@open', next: '@selectorbody' }],
|
||||
['\\[', { token: 'delimiter.bracket', next: '@selectorattribute' }],
|
||||
['{', { token: 'delimiter.curly', next: '@selectorbody' }],
|
||||
],
|
||||
|
||||
selectorbody: [
|
||||
|
|
@ -75,22 +75,22 @@ export var language = <IMonarchLanguage> {
|
|||
{ include: '@selector' }, // sass: nested selectors
|
||||
['[@](extend)', { token: TOKEN_AT_KEYWORD, next: '@extendbody' }], // sass: extend other selectors
|
||||
['[@](return)', { token: TOKEN_AT_KEYWORD, next: '@declarationbody' }],
|
||||
['}', { token: 'delimiter.curly', bracket: '@close', next: '@pop' }],
|
||||
['}', { token: 'delimiter.curly', next: '@pop' }],
|
||||
],
|
||||
|
||||
selectorname: [
|
||||
['#{', { token: 'meta', bracket: '@open', next: '@variableinterpolation' }], // sass: interpolation
|
||||
['#{', { token: 'meta', next: '@variableinterpolation' }], // sass: interpolation
|
||||
['(\\.|#(?=[^{])|%|(@identifier)|:)+', TOKEN_SELECTOR], // selector (.foo, div, ...)
|
||||
],
|
||||
|
||||
selectorattribute: [
|
||||
{ include: '@term' },
|
||||
[']', { token: 'delimiter.bracket', bracket: '@close', next: '@pop' }],
|
||||
[']', { token: 'delimiter.bracket', next: '@pop' }],
|
||||
],
|
||||
|
||||
term: [
|
||||
{ include: '@comments' },
|
||||
['url(\\-prefix)?\\(', { token: 'meta', bracket: '@open', next: '@urldeclaration' }],
|
||||
['url(\\-prefix)?\\(', { token: 'meta', next: '@urldeclaration' }],
|
||||
{ include: '@functioninvocation' },
|
||||
{ include: '@numbers' },
|
||||
{ include: '@strings' },
|
||||
|
|
@ -100,21 +100,21 @@ export var language = <IMonarchLanguage> {
|
|||
['([<>=\\+\\-\\*\\/\\^\\|\\~,])', 'operator'],
|
||||
[',', 'delimiter'],
|
||||
['!default', 'literal'],
|
||||
['\\(', { token: 'delimiter.parenthesis', bracket: '@open', next: '@parenthizedterm' }],
|
||||
['\\(', { token: 'delimiter.parenthesis', next: '@parenthizedterm' }],
|
||||
],
|
||||
|
||||
rulevalue: [
|
||||
{ include: '@term' },
|
||||
['!important', 'literal'],
|
||||
[';', 'delimiter', '@pop'],
|
||||
['{', { token: 'delimiter.curly', bracket: '@open', switchTo: '@nestedproperty' }], // sass: nested properties
|
||||
['{', { token: 'delimiter.curly', switchTo: '@nestedproperty' }], // sass: nested properties
|
||||
['(?=})', { token: '', next: '@pop' }], // missing semicolon
|
||||
],
|
||||
|
||||
nestedproperty: [
|
||||
['[*_]?@identifier@ws:', TOKEN_PROPERTY, '@rulevalue'],
|
||||
{ include: '@comments' },
|
||||
['}', { token: 'delimiter.curly', bracket: '@close', next: '@pop' }],
|
||||
['}', { token: 'delimiter.curly', next: '@pop' }],
|
||||
],
|
||||
|
||||
warndebug: [
|
||||
|
|
@ -132,12 +132,12 @@ export var language = <IMonarchLanguage> {
|
|||
urldeclaration: [
|
||||
{ include: '@strings' },
|
||||
['[^)\r\n]+', 'string'],
|
||||
['\\)', { token: 'meta', bracket: '@close', next: '@pop' }],
|
||||
['\\)', { token: 'meta', next: '@pop' }],
|
||||
],
|
||||
|
||||
parenthizedterm: [
|
||||
{ include: '@term' },
|
||||
['\\)', { token: 'delimiter.parenthesis', bracket: '@close', next: '@pop' }],
|
||||
['\\)', { token: 'delimiter.parenthesis', next: '@pop' }],
|
||||
],
|
||||
|
||||
declarationbody: [
|
||||
|
|
@ -156,12 +156,12 @@ export var language = <IMonarchLanguage> {
|
|||
variablereference: [ // sass variable reference
|
||||
['\\$@identifier', 'variable.ref'],
|
||||
['\\.\\.\\.', 'operator'], // var args in reference
|
||||
['#{', { token: 'meta', bracket: '@open', next: '@variableinterpolation' }], // sass var resolve
|
||||
['#{', { token: 'meta', next: '@variableinterpolation' }], // sass var resolve
|
||||
],
|
||||
|
||||
variableinterpolation: [
|
||||
{ include: '@variablereference' },
|
||||
['}', { token: 'meta', bracket: '@close', next: '@pop' }],
|
||||
['}', { token: 'meta', next: '@pop' }],
|
||||
],
|
||||
|
||||
comments: [
|
||||
|
|
@ -188,16 +188,16 @@ export var language = <IMonarchLanguage> {
|
|||
],
|
||||
|
||||
functiondeclaration: [
|
||||
['@identifier@ws\\(', { token: 'meta', bracket: '@open', next: '@parameterdeclaration' }],
|
||||
['{', { token: 'delimiter.curly', bracket: '@open', switchTo: '@functionbody' }],
|
||||
['@identifier@ws\\(', { token: 'meta', next: '@parameterdeclaration' }],
|
||||
['{', { token: 'delimiter.curly', switchTo: '@functionbody' }],
|
||||
],
|
||||
|
||||
mixindeclaration: [
|
||||
// mixin with parameters
|
||||
['@identifier@ws\\(', { token: 'meta', bracket: '@open', next: '@parameterdeclaration' }],
|
||||
['@identifier@ws\\(', { token: 'meta', next: '@parameterdeclaration' }],
|
||||
// mixin without parameters
|
||||
['@identifier', 'meta'],
|
||||
['{', { token: 'delimiter.curly', bracket: '@open', switchTo: '@selectorbody' }],
|
||||
['{', { token: 'delimiter.curly', switchTo: '@selectorbody' }],
|
||||
],
|
||||
|
||||
parameterdeclaration: [
|
||||
|
|
@ -205,7 +205,7 @@ export var language = <IMonarchLanguage> {
|
|||
['\\.\\.\\.', 'operator'], // var args in declaration
|
||||
[',', 'delimiter'],
|
||||
{ include: '@term' },
|
||||
['\\)', { token: 'meta', bracket: '@close', next: '@pop' }],
|
||||
['\\)', { token: 'meta', next: '@pop' }],
|
||||
],
|
||||
|
||||
includedeclaration: [
|
||||
|
|
@ -213,18 +213,18 @@ export var language = <IMonarchLanguage> {
|
|||
['@identifier', 'meta'],
|
||||
[';', 'delimiter', '@pop'],
|
||||
['(?=})', { token: '', next: '@pop' }], // missing semicolon
|
||||
['{', { token: 'delimiter.curly', bracket: '@open', switchTo: '@selectorbody' }],
|
||||
['{', { token: 'delimiter.curly', switchTo: '@selectorbody' }],
|
||||
],
|
||||
|
||||
keyframedeclaration: [
|
||||
['@identifier', 'meta'],
|
||||
['{', { token: 'delimiter.curly', bracket: '@open', switchTo: '@keyframebody' }],
|
||||
['{', { token: 'delimiter.curly', switchTo: '@keyframebody' }],
|
||||
],
|
||||
|
||||
keyframebody: [
|
||||
{ include: '@term' },
|
||||
['{', { token: 'delimiter.curly', bracket: '@open', next: '@selectorbody' }],
|
||||
['}', { token: 'delimiter.curly', bracket: '@close', next: '@pop' }],
|
||||
['{', { token: 'delimiter.curly', next: '@selectorbody' }],
|
||||
['}', { token: 'delimiter.curly', next: '@pop' }],
|
||||
],
|
||||
|
||||
controlstatement: [
|
||||
|
|
@ -234,7 +234,7 @@ export var language = <IMonarchLanguage> {
|
|||
controlstatementdeclaration: [
|
||||
['(in|from|through|if|to)\\b', { token: 'keyword.flow' }],
|
||||
{ include: '@term' },
|
||||
['{', { token: 'delimiter.curly', bracket: '@open', switchTo: '@selectorbody' }],
|
||||
['{', { token: 'delimiter.curly', switchTo: '@selectorbody' }],
|
||||
],
|
||||
|
||||
functionbody: [
|
||||
|
|
@ -243,34 +243,34 @@ export var language = <IMonarchLanguage> {
|
|||
{ include: '@term' },
|
||||
{ include: '@controlstatement' },
|
||||
[';', 'delimiter'],
|
||||
['}', { token: 'delimiter.curly', bracket: '@close', next: '@pop' }],
|
||||
['}', { token: 'delimiter.curly', next: '@pop' }],
|
||||
],
|
||||
|
||||
functioninvocation: [
|
||||
['@identifier\\(', { token: 'meta', bracket: '@open', next: '@functionarguments' }],
|
||||
['@identifier\\(', { token: 'meta', next: '@functionarguments' }],
|
||||
],
|
||||
|
||||
functionarguments: [
|
||||
['\\$@identifier@ws:', TOKEN_PROPERTY],
|
||||
['[,]', 'delimiter'],
|
||||
{ include: '@term' },
|
||||
['\\)', { token: 'meta', bracket: '@close', next: '@pop' }],
|
||||
['\\)', { token: 'meta', next: '@pop' }],
|
||||
],
|
||||
|
||||
strings: [
|
||||
['~?"', { token: 'string.delimiter', bracket: '@open', next: '@stringenddoublequote' }],
|
||||
['~?\'', { token: 'string.delimiter', bracket: '@open', next: '@stringendquote' }]
|
||||
['~?"', { token: 'string.delimiter', next: '@stringenddoublequote' }],
|
||||
['~?\'', { token: 'string.delimiter', next: '@stringendquote' }]
|
||||
],
|
||||
|
||||
stringenddoublequote: [
|
||||
['\\\\.', 'string'],
|
||||
['"', { token: 'string.delimiter', next: '@pop', bracket: '@close' }],
|
||||
['"', { token: 'string.delimiter', next: '@pop' }],
|
||||
['.', 'string']
|
||||
],
|
||||
|
||||
stringendquote: [
|
||||
['\\\\.', 'string'],
|
||||
['\'', { token: 'string.delimiter', next: '@pop', bracket: '@close' }],
|
||||
['\'', { token: 'string.delimiter', next: '@pop' }],
|
||||
['.', 'string']
|
||||
]
|
||||
}
|
||||
|
|
|
|||
36
src/sql.ts
36
src/sql.ts
|
|
@ -1073,14 +1073,14 @@ export var language = <ILanguage> {
|
|||
],
|
||||
comments: [
|
||||
[/--+.*/, 'comment'],
|
||||
[/\/\*/, { token: 'comment.quote', bracket: '@open', next: '@comment' }]
|
||||
[/\/\*/, { token: 'comment.quote', next: '@comment' }]
|
||||
],
|
||||
comment: [
|
||||
[/[^*/]+/, 'comment'],
|
||||
// Not supporting nested comments, as nested comments seem to not be standard?
|
||||
// i.e. http://stackoverflow.com/questions/728172/are-there-multiline-comment-delimiters-in-sql-that-are-vendor-agnostic
|
||||
// [/\/\*/, { token: 'comment.quote', bracket: '@open', next: '@push' }], // nested comment not allowed :-(
|
||||
[/\*\//, { token: 'comment.quote', bracket: '@close', next: '@pop' }],
|
||||
// [/\/\*/, { token: 'comment.quote', next: '@push' }], // nested comment not allowed :-(
|
||||
[/\*\//, { token: 'comment.quote', next: '@pop' }],
|
||||
[/./, 'comment']
|
||||
],
|
||||
pseudoColumns: [
|
||||
|
|
@ -1095,38 +1095,38 @@ export var language = <ILanguage> {
|
|||
[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/, 'number']
|
||||
],
|
||||
strings: [
|
||||
[/N'/, { token: 'string.quote', bracket: '@open', next: '@string' }],
|
||||
[/'/, { token: 'string.quote', bracket: '@open', next: '@string' }]
|
||||
[/N'/, { token: 'string.quote', next: '@string' }],
|
||||
[/'/, { token: 'string.quote', next: '@string' }]
|
||||
],
|
||||
string: [
|
||||
[/[^']+/, 'string'],
|
||||
[/''/, 'string'],
|
||||
[/'/, { token: 'string.quote', bracket: '@close', next: '@pop' }]
|
||||
[/'/, { token: 'string.quote', next: '@pop' }]
|
||||
],
|
||||
complexIdentifiers: [
|
||||
[/\[/, { token: 'identifier.quote', bracket: '@open', next: '@bracketedIdentifier' }],
|
||||
[/"/, { token: 'identifier.quote', bracket: '@open', next: '@quotedIdentifier' }]
|
||||
[/\[/, { token: 'identifier.quote', next: '@bracketedIdentifier' }],
|
||||
[/"/, { token: 'identifier.quote', next: '@quotedIdentifier' }]
|
||||
],
|
||||
bracketedIdentifier: [
|
||||
[/[^\]]+/, 'identifier'],
|
||||
[/]]/, 'identifier'],
|
||||
[/]/, { token: 'identifier.quote', bracket: '@close', next: '@pop' }]
|
||||
[/]/, { token: 'identifier.quote', next: '@pop' }]
|
||||
],
|
||||
quotedIdentifier: [
|
||||
[/[^"]+/, 'identifier'],
|
||||
[/""/, 'identifier'],
|
||||
[/"/, { token: 'identifier.quote', bracket: '@close', next: '@pop' }]
|
||||
[/"/, { token: 'identifier.quote', next: '@pop' }]
|
||||
],
|
||||
scopes: [
|
||||
[/BEGIN\s+(DISTRIBUTED\s+)?TRAN(SACTION)?\b/i, 'keyword'],
|
||||
[/BEGIN\s+TRY\b/i, { token: 'keyword.try', bracket: '@open' }],
|
||||
[/END\s+TRY\b/i, { token: 'keyword.try', bracket: '@close' }],
|
||||
[/BEGIN\s+CATCH\b/i, { token: 'keyword.catch', bracket: '@open' }],
|
||||
[/END\s+CATCH\b/i, { token: 'keyword.catch', bracket: '@close' }],
|
||||
[/(BEGIN|CASE)\b/i, { token: 'keyword.block', bracket: '@open' }],
|
||||
[/END\b/i, { token: 'keyword.block', bracket: '@close' }],
|
||||
[/WHEN\b/i, { token: 'keyword.choice', bracket: '@open' }],
|
||||
[/THEN\b/i, { token: 'keyword.choice', bracket: '@close' }]
|
||||
[/BEGIN\s+TRY\b/i, { token: 'keyword.try' }],
|
||||
[/END\s+TRY\b/i, { token: 'keyword.try' }],
|
||||
[/BEGIN\s+CATCH\b/i, { token: 'keyword.catch' }],
|
||||
[/END\s+CATCH\b/i, { token: 'keyword.catch' }],
|
||||
[/(BEGIN|CASE)\b/i, { token: 'keyword.block' }],
|
||||
[/END\b/i, { token: 'keyword.block' }],
|
||||
[/WHEN\b/i, { token: 'keyword.choice' }],
|
||||
[/THEN\b/i, { token: 'keyword.choice' }]
|
||||
]
|
||||
}
|
||||
};
|
||||
|
|
|
|||
14
src/swift.ts
14
src/swift.ts
|
|
@ -97,7 +97,7 @@ export var language = <ILanguage> {
|
|||
],
|
||||
|
||||
literal: [
|
||||
[ /"/, { token: 'string.quote', bracket: '@open', next: '@stringlit' } ],
|
||||
[ /"/, { token: 'string.quote', next: '@stringlit' } ],
|
||||
[ /0[b]([01]_?)+/, 'number.binary' ],
|
||||
[ /0[o]([0-7]_?)+/, 'number.octal' ],
|
||||
[ /0[x]([0-9a-fA-F]_?)+([pP][\-+](\d_?)+)?/, 'number.hex' ],
|
||||
|
|
@ -106,28 +106,28 @@ export var language = <ILanguage> {
|
|||
],
|
||||
|
||||
stringlit: [
|
||||
[ /\\\(/, { token: 'operator', bracket: '@open', next: '@interpolatedexpression' } ],
|
||||
[ /\\\(/, { token: 'operator', next: '@interpolatedexpression' } ],
|
||||
[ /@escapes/, 'string' ],
|
||||
[ /\\./, 'string.escape.invalid' ],
|
||||
[ /"/, { token: 'string.quote', bracket: '@close', next: '@pop' } ],
|
||||
[ /"/, { token: 'string.quote', next: '@pop' } ],
|
||||
[ /./, 'string' ]
|
||||
],
|
||||
|
||||
interpolatedexpression: [
|
||||
[ /\(/, { token: 'operator', bracket: '@open', next: '@interpolatedexpression' } ],
|
||||
[ /\)/, { token: 'operator', bracket: '@close', next: '@pop' } ],
|
||||
[ /\(/, { token: 'operator', next: '@interpolatedexpression' } ],
|
||||
[ /\)/, { token: 'operator', next: '@pop' } ],
|
||||
{ include: '@literal' },
|
||||
{ include: '@keyword' },
|
||||
{ include: '@symbol' }
|
||||
],
|
||||
|
||||
keyword: [
|
||||
[ /`/, { token: 'operator', bracket: '@open', next: '@escapedkeyword' } ],
|
||||
[ /`/, { token: 'operator', next: '@escapedkeyword' } ],
|
||||
[ /@identifier/, { cases: { '@keywords': 'keyword', '[A-Z][\a-zA-Z0-9$]*': 'type.identifier', '@default': 'identifier' } }]
|
||||
],
|
||||
|
||||
escapedkeyword: [
|
||||
[ /`/, { token: 'operator', bracket: '@close', next: '@pop' } ],
|
||||
[ /`/, { token: 'operator', next: '@pop' } ],
|
||||
[ /./, 'identifier' ]
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -130,14 +130,14 @@ export var language = <ILanguage> {
|
|||
{ include: '@whitespace' },
|
||||
|
||||
// special ending tag-words
|
||||
[/next(?!\w)/, { token: 'keyword.tag-for', bracket: '@close'}],
|
||||
[/loop(?!\w)/, { token: 'keyword.tag-do', bracket: '@close' }],
|
||||
[/next(?!\w)/, { token: 'keyword.tag-for'}],
|
||||
[/loop(?!\w)/, { token: 'keyword.tag-do' }],
|
||||
|
||||
// usual ending tags
|
||||
[/end\s+(?!for|do)([a-zA-Z_]\w*)/, { token: 'keyword.tag-$1', bracket: '@close' }],
|
||||
[/end\s+(?!for|do)([a-zA-Z_]\w*)/, { token: 'keyword.tag-$1' }],
|
||||
|
||||
// identifiers, tagwords, and keywords
|
||||
[/[a-zA-Z_]\w*/, { cases: { '@tagwords': {token:'keyword.tag-$0', bracket: '@open'},
|
||||
[/[a-zA-Z_]\w*/, { cases: { '@tagwords': {token:'keyword.tag-$0'},
|
||||
'@keywords': {token:'keyword.$0'},
|
||||
'@default': 'identifier' } }],
|
||||
|
||||
|
|
|
|||
30
src/xml.ts
30
src/xml.ts
|
|
@ -44,35 +44,35 @@ export var language = <ILanguage> {
|
|||
|
||||
// Standard opening tag
|
||||
[/(<)(@qualifiedName)/, [
|
||||
{ token: 'delimiter.start', bracket: '@open' },
|
||||
{ token: 'tag.tag-$2', bracket: '@open', next: '@tag.$2' }]],
|
||||
{ token: 'delimiter.start' },
|
||||
{ token: 'tag.tag-$2', next: '@tag.$2' }]],
|
||||
|
||||
// Standard closing tag
|
||||
[/(<\/)(@qualifiedName)(\s*)(>)/, [
|
||||
{ token: 'delimiter.end', bracket: '@open' },
|
||||
{ token: 'tag.tag-$2', bracket: '@close' },
|
||||
{ token: 'delimiter.end' },
|
||||
{ token: 'tag.tag-$2' },
|
||||
'',
|
||||
{ token: 'delimiter.end', bracket: '@close' }]],
|
||||
{ token: 'delimiter.end' }]],
|
||||
|
||||
// Meta tags - instruction
|
||||
[/(<\?)(@qualifiedName)/, [
|
||||
{ token: 'delimiter.start', bracket: '@open' },
|
||||
{ token: 'delimiter.start' },
|
||||
{ token: 'metatag.instruction', next: '@tag' }]],
|
||||
|
||||
// Meta tags - declaration
|
||||
[/(<\!)(@qualifiedName)/, [
|
||||
{ token: 'delimiter.start', bracket: '@open' },
|
||||
{ token: 'delimiter.start' },
|
||||
{ token: 'metatag.declaration', next: '@tag' }]],
|
||||
|
||||
// CDATA
|
||||
[/<\!\[CDATA\[/, { token: 'delimiter.cdata', bracket: '@open', next: '@cdata' }],
|
||||
[/<\!\[CDATA\[/, { token: 'delimiter.cdata', next: '@cdata' }],
|
||||
|
||||
[/&\w+;/, 'string.escape'],
|
||||
],
|
||||
|
||||
cdata: [
|
||||
[/[^\]]+/, ''],
|
||||
[/\]\]>/, { token: 'delimiter.cdata', bracket: '@close', next: '@pop' }],
|
||||
[/\]\]>/, { token: 'delimiter.cdata', next: '@pop' }],
|
||||
[/\]/, '']
|
||||
],
|
||||
|
||||
|
|
@ -82,21 +82,21 @@ export var language = <ILanguage> {
|
|||
[/(@qualifiedName)(\s*=\s*)("[^">?\/]*|'[^'>?\/]*)(?=[\?\/]\>)/, ['attribute.name', '', 'attribute.value']],
|
||||
[/(@qualifiedName)(\s*=\s*)("[^">]*|'[^'>]*)/, ['attribute.name', '', 'attribute.value']],
|
||||
[/@qualifiedName/, 'attribute.name'],
|
||||
[/\?>/, { token: 'delimiter.start', bracket: '@close', next: '@pop' }],
|
||||
[/\?>/, { token: 'delimiter.start', next: '@pop' }],
|
||||
[/(\/)(>)/, [
|
||||
{ token: 'tag.tag-$S2', bracket: '@close' },
|
||||
{ token: 'delimiter.start', bracket: '@close', next: '@pop' }]],
|
||||
[/>/, { token: 'delimiter.start', bracket: '@close', next: '@pop' }],
|
||||
{ token: 'tag.tag-$S2' },
|
||||
{ token: 'delimiter.start', next: '@pop' }]],
|
||||
[/>/, { token: 'delimiter.start', next: '@pop' }],
|
||||
],
|
||||
|
||||
whitespace: [
|
||||
[/[ \t\r\n]+/, ''],
|
||||
[/<!--/, { token: 'comment', bracket: '@open', next: '@comment' }]
|
||||
[/<!--/, { token: 'comment', next: '@comment' }]
|
||||
],
|
||||
|
||||
comment: [
|
||||
[/[^<\-]+/, 'comment.content' ],
|
||||
[/-->/, { token: 'comment', bracket: '@close', next: '@pop' } ],
|
||||
[/-->/, { token: 'comment', next: '@pop' } ],
|
||||
[/<!--/, 'comment.content.invalid'],
|
||||
[/[<\-]/, 'comment.content' ]
|
||||
],
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ var jsdom = require('jsdom-no-contextify');
|
|||
requirejs.config({
|
||||
baseUrl: '',
|
||||
paths: {
|
||||
'vs': 'node_modules/monaco-editor-core/dev/vs'
|
||||
'vs': '../vscode/out/vs'
|
||||
// 'vs': 'node_modules/monaco-editor-core/dev/vs'
|
||||
},
|
||||
nodeRequire: require
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue