mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 16:15:41 +01:00
run prettier
This commit is contained in:
parent
5f40d268df
commit
25cb9d78a8
35 changed files with 144 additions and 161 deletions
|
|
@ -425,7 +425,7 @@ export const language = <languages.IMonarchLanguage>{
|
|||
'inner',
|
||||
'inout',
|
||||
'input',
|
||||
'insert', // also a built-in
|
||||
'insert', // also a built-in
|
||||
'instance',
|
||||
'instances',
|
||||
'instr',
|
||||
|
|
@ -1200,10 +1200,7 @@ export const language = <languages.IMonarchLanguage>{
|
|||
'*sys*'
|
||||
],
|
||||
|
||||
builtinMethods: [
|
||||
'class_constructor',
|
||||
'constructor'
|
||||
],
|
||||
builtinMethods: ['class_constructor', 'constructor'],
|
||||
|
||||
derivedTypes: [
|
||||
'%CID',
|
||||
|
|
@ -1243,13 +1240,7 @@ export const language = <languages.IMonarchLanguage>{
|
|||
'$SELF'
|
||||
],
|
||||
|
||||
selectors: [
|
||||
'->',
|
||||
'->*',
|
||||
'=>',
|
||||
'~',
|
||||
'~*'
|
||||
],
|
||||
selectors: ['->', '->*', '=>', '~', '~*'],
|
||||
|
||||
//
|
||||
// Operators
|
||||
|
|
@ -1339,7 +1330,7 @@ export const language = <languages.IMonarchLanguage>{
|
|||
tokenizer: {
|
||||
root: [
|
||||
[
|
||||
/[a-z_\/$%@]([\w\/$%]|-(?!>))*/, // exclude '->' selector
|
||||
/[a-z_\/$%@]([\w\/$%]|-(?!>))*/, // exclude '->' selector
|
||||
{
|
||||
cases: {
|
||||
'@typeKeywords': 'type',
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ import type { languages } from '../fillers/monaco-editor-core';
|
|||
|
||||
export const conf: languages.LanguageConfiguration = {
|
||||
// the default separators except `@$`
|
||||
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
wordPattern:
|
||||
/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
comments: {
|
||||
lineComment: '//',
|
||||
blockComment: ['/*', '*/']
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@ export const language = <languages.IMonarchLanguage>{
|
|||
{ token: 'delimiter.square', open: '[', close: ']' }
|
||||
],
|
||||
|
||||
keywords: /call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/,
|
||||
keywords:
|
||||
/call|defined|echo|errorlevel|exist|for|goto|if|pause|set|shift|start|title|not|pushd|popd/,
|
||||
|
||||
// we include these common regular expressions
|
||||
symbols: /[=><!~?&|+\-*\/\^;\.,]+/,
|
||||
|
|
|
|||
|
|
@ -66,8 +66,7 @@ testTokenization('bicep', [
|
|||
]
|
||||
},
|
||||
{
|
||||
line:
|
||||
" domainConfigurationType/*comment*/:/*comment*/'as//notacomment!d/* also not a comment */fsdf'// test!/*",
|
||||
line: " domainConfigurationType/*comment*/:/*comment*/'as//notacomment!d/* also not a comment */fsdf'// test!/*",
|
||||
tokens: [
|
||||
{ startIndex: 0, type: '' },
|
||||
{ startIndex: 4, type: 'identifier.bicep' },
|
||||
|
|
@ -374,8 +373,7 @@ testTokenization('bicep', [
|
|||
tokens: [{ startIndex: 0, type: '' }]
|
||||
},
|
||||
{
|
||||
line:
|
||||
"resource secrets1 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = if (secrets0.id == '') {",
|
||||
line: "resource secrets1 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = if (secrets0.id == '') {",
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.bicep' },
|
||||
{ startIndex: 8, type: '' },
|
||||
|
|
@ -429,8 +427,7 @@ testTokenization('bicep', [
|
|||
tokens: []
|
||||
},
|
||||
{
|
||||
line:
|
||||
"resource secrets2 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = [for secret in secretsObject.secrets: {",
|
||||
line: "resource secrets2 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = [for secret in secretsObject.secrets: {",
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.bicep' },
|
||||
{ startIndex: 8, type: '' },
|
||||
|
|
@ -478,8 +475,7 @@ testTokenization('bicep', [
|
|||
tokens: []
|
||||
},
|
||||
{
|
||||
line:
|
||||
"resource secrets3 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = [for secret in secretsObject.secrets: {",
|
||||
line: "resource secrets3 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = [for secret in secretsObject.secrets: {",
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.bicep' },
|
||||
{ startIndex: 8, type: '' },
|
||||
|
|
@ -551,8 +547,7 @@ testTokenization('bicep', [
|
|||
tokens: []
|
||||
},
|
||||
{
|
||||
line:
|
||||
"resource secrets4 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = [for secret in secretsObject.secrets: if (true) {",
|
||||
line: "resource secrets4 'Microsoft.KeyVault/vaults/secrets@2018-02-14' = [for secret in secretsObject.secrets: if (true) {",
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.bicep' },
|
||||
{ startIndex: 8, type: '' },
|
||||
|
|
@ -609,8 +604,7 @@ testTokenization('bicep', [
|
|||
tokens: []
|
||||
},
|
||||
{
|
||||
line:
|
||||
"resource virtualNetwork 'Microsoft.Network/virtualNetworks@2020-08-01' existing = {",
|
||||
line: "resource virtualNetwork 'Microsoft.Network/virtualNetworks@2020-08-01' existing = {",
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.bicep' },
|
||||
{ startIndex: 8, type: '' },
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ export const conf: languages.LanguageConfiguration = {
|
|||
{ open: '(', close: ')' },
|
||||
{ open: '<', close: '>' },
|
||||
{ open: "'", close: "'" },
|
||||
{ open: "\"", close: "\""},
|
||||
{ open: "(*", close: "*)"},
|
||||
{ open: '"', close: '"' },
|
||||
{ open: '(*', close: '*)' }
|
||||
],
|
||||
surroundingPairs: [
|
||||
{ open: '{', close: '}' },
|
||||
|
|
@ -31,8 +31,8 @@ export const conf: languages.LanguageConfiguration = {
|
|||
{ open: '(', close: ')' },
|
||||
{ open: '<', close: '>' },
|
||||
{ open: "'", close: "'" },
|
||||
{ open: "\"", close: "\""},
|
||||
{ open: "(*", close: "*)"},
|
||||
{ open: '"', close: '"' },
|
||||
{ open: '(*', close: '*)' }
|
||||
]
|
||||
};
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ export const language = <languages.IMonarchLanguage>{
|
|||
'to',
|
||||
'true',
|
||||
'type',
|
||||
'with',
|
||||
'with'
|
||||
],
|
||||
|
||||
typeKeywords: ['int', 'unit', 'string', 'tz', 'nat', 'bool'],
|
||||
|
|
@ -116,7 +116,7 @@ export const language = <languages.IMonarchLanguage>{
|
|||
'->',
|
||||
'<-',
|
||||
'&&',
|
||||
'||',
|
||||
'||'
|
||||
],
|
||||
|
||||
// we include these common regular expressions
|
||||
|
|
|
|||
|
|
@ -46,16 +46,19 @@ export const language = <languages.IMonarchLanguage>{
|
|||
|
||||
// delimiters: /[\\\[\]\s"#'(),;@^`{}~]|$/,
|
||||
|
||||
numbers: /^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/,
|
||||
numbers:
|
||||
/^(?:[+\-]?\d+(?:(?:N|(?:[eE][+\-]?\d+))|(?:\.?\d*(?:M|(?:[eE][+\-]?\d+))?)|\/\d+|[xX][0-9a-fA-F]+|r[0-9a-zA-Z]+)?(?=[\\\[\]\s"#'(),;@^`{}~]|$))/,
|
||||
|
||||
characters: /^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/,
|
||||
characters:
|
||||
/^(?:\\(?:backspace|formfeed|newline|return|space|tab|o[0-7]{3}|u[0-9A-Fa-f]{4}|x[0-9A-Fa-f]{4}|.)?(?=[\\\[\]\s"(),;@^`{}~]|$))/,
|
||||
|
||||
escapes: /^\\(?:["'\\bfnrt]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
|
||||
|
||||
// simple-namespace := /^[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*/
|
||||
// simple-symbol := /^(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)/
|
||||
// qualified-symbol := (<simple-namespace>(<.><simple-namespace>)*</>)?<simple-symbol>
|
||||
qualifiedSymbols: /^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/,
|
||||
qualifiedSymbols:
|
||||
/^(?:(?:[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*(?:\.[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*\/)?(?:\/|[^\\\/\[\]\d\s"#'(),;@^`{}~][^\\\[\]\s"(),;@^`{}~]*)*(?=[\\\[\]\s"(),;@^`{}~]|$))/,
|
||||
|
||||
specialForms: [
|
||||
'.',
|
||||
|
|
|
|||
|
|
@ -809,8 +809,7 @@ testTokenization('coffeescript', [
|
|||
// syntax highligting issue with {} - bug 16176
|
||||
[
|
||||
{
|
||||
line:
|
||||
'"/api/v2/course/#{ $stateParams.courseId }/grading/student/#{$stateParams.studentId}",',
|
||||
line: '"/api/v2/course/#{ $stateParams.courseId }/grading/student/#{$stateParams.studentId}",',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'string.coffee' },
|
||||
{ startIndex: 18, type: '' },
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@
|
|||
import type { languages } from '../fillers/monaco-editor-core';
|
||||
|
||||
export const conf: languages.LanguageConfiguration = {
|
||||
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
wordPattern:
|
||||
/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
comments: {
|
||||
blockComment: ['###', '###'],
|
||||
lineComment: '#'
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@
|
|||
import type { languages } from '../fillers/monaco-editor-core';
|
||||
|
||||
export const conf: languages.LanguageConfiguration = {
|
||||
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
wordPattern:
|
||||
/(-?\d*\.\d\w*)|([^\`\~\!\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
comments: {
|
||||
lineComment: '//',
|
||||
blockComment: ['/*', '*/']
|
||||
|
|
|
|||
|
|
@ -484,8 +484,7 @@ testTokenization('css', [
|
|||
// .a{background:#f5f9fc !important}.b{font-family:"Helvetica Neue", Helvetica;height:31px;}
|
||||
[
|
||||
{
|
||||
line:
|
||||
'.a{background:#f5f9fc !important}.b{font-family:"Helvetica Neue", Helvetica;height:31px;}',
|
||||
line: '.a{background:#f5f9fc !important}.b{font-family:"Helvetica Neue", Helvetica;height:31px;}',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'tag.css' },
|
||||
{ startIndex: 2, type: 'delimiter.bracket.css' },
|
||||
|
|
@ -515,8 +514,7 @@ testTokenization('css', [
|
|||
//.even { background: #fff url(data:image/gif;base64,R0lGODlhBgASALMAAOfn5+rq6uvr6+zs7O7u7vHx8fPz8/b29vj4+P39/f///wAAAAAAAAAAAAAAAAAAACwAAAAABgASAAAIMAAVCBxIsKDBgwgTDkzAsKGAhxARSJx4oKJFAxgzFtjIkYDHjwNCigxAsiSAkygDAgA7) repeat-x bottom}
|
||||
[
|
||||
{
|
||||
line:
|
||||
'.even { background: #fff url(data:image/gif;base64,R0lGODlhBgASALMAAOfn5+rq6uvr6+zs7O7u7vHx8fPz8/b29vj4+P39/f///wAAAAAAAAAAAAAAAAAAACwAAAAABgASAAAIMAAVCBxIsKDBgwgTDkzAsKGAhxARSJx4oKJFAxgzFtjIkYDHjwNCigxAsiSAkygDAgA7) repeat-x bottom}',
|
||||
line: '.even { background: #fff url(data:image/gif;base64,R0lGODlhBgASALMAAOfn5+rq6uvr6+zs7O7u7vHx8fPz8/b29vj4+P39/f///wAAAAAAAAAAAAAAAAAAACwAAAAABgASAAAIMAAVCBxIsKDBgwgTDkzAsKGAhxARSJx4oKJFAxgzFtjIkYDHjwNCigxAsiSAkygDAgA7) repeat-x bottom}',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'tag.css' },
|
||||
{ startIndex: 5, type: '' },
|
||||
|
|
|
|||
|
|
@ -53,8 +53,7 @@ testTokenization('dockerfile', [
|
|||
tokens: []
|
||||
},
|
||||
{
|
||||
line:
|
||||
'ONBUILD RUN curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/kvminstall.sh | sh',
|
||||
line: 'ONBUILD RUN curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/kvminstall.sh | sh',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.dockerfile' },
|
||||
{ startIndex: 7, type: '' },
|
||||
|
|
@ -79,8 +78,7 @@ testTokenization('dockerfile', [
|
|||
tokens: [{ startIndex: 0, type: 'string.dockerfile' }]
|
||||
},
|
||||
{
|
||||
line:
|
||||
' && kvm alias default | xargs -i ln -s $KRE_USER_HOME/packages/{} $KRE_USER_HOME/packages/default"',
|
||||
line: ' && kvm alias default | xargs -i ln -s $KRE_USER_HOME/packages/{} $KRE_USER_HOME/packages/default"',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'string.dockerfile' },
|
||||
{ startIndex: 42, type: 'variable.dockerfile' },
|
||||
|
|
@ -94,8 +92,7 @@ testTokenization('dockerfile', [
|
|||
tokens: []
|
||||
},
|
||||
{
|
||||
line:
|
||||
'# Install libuv for Kestrel from source code (binary is not in wheezy and one in jessie is still too old)',
|
||||
line: '# Install libuv for Kestrel from source code (binary is not in wheezy and one in jessie is still too old)',
|
||||
tokens: [{ startIndex: 0, type: 'comment.dockerfile' }]
|
||||
},
|
||||
{
|
||||
|
|
@ -129,8 +126,7 @@ testTokenization('dockerfile', [
|
|||
]
|
||||
},
|
||||
{
|
||||
line:
|
||||
' && curl -sSL https://github.com/joyent/libuv/archive/v${LIBUV_VERSION}.tar.gz | tar zxfv - -C /usr/local/src \\',
|
||||
line: ' && curl -sSL https://github.com/joyent/libuv/archive/v${LIBUV_VERSION}.tar.gz | tar zxfv - -C /usr/local/src \\',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: '' },
|
||||
{ startIndex: 58, type: 'variable.dockerfile' },
|
||||
|
|
|
|||
|
|
@ -108,7 +108,8 @@ export const language = <languages.IMonarchLanguage>{
|
|||
|
||||
// Matches any of the operator names:
|
||||
// <<< >>> ||| &&& ^^^ ~~~ === !== ~>> <~> |~> <|> == != <= >= && || \\ <> ++ -- |> =~ -> <- ~> <~ :: .. = < > + - * / | . ^ & !
|
||||
operator: /-[->]?|!={0,2}|\*|\/|\\\\|&{1,3}|\.\.?|\^(?:\^\^)?|\+\+?|<(?:-|<<|=|>|\|>|~>?)?|=~|={1,3}|>(?:=|>>)?|\|~>|\|>|\|{1,3}|~>>?|~~~|::/,
|
||||
operator:
|
||||
/-[->]?|!={0,2}|\*|\/|\\\\|&{1,3}|\.\.?|\^(?:\^\^)?|\+\+?|<(?:-|<<|=|>|\|>|~>?)?|=~|={1,3}|>(?:=|>>)?|\|~>|\|>|\|{1,3}|~>>?|~~~|::/,
|
||||
|
||||
// See https://hexdocs.pm/elixir/syntax-reference.html#variables
|
||||
variableName: /[a-z_][a-zA-Z0-9_]*[?!]?/,
|
||||
|
|
|
|||
|
|
@ -76,7 +76,8 @@ export const language = <languages.IMonarchLanguage>{
|
|||
|
||||
symbols: /[=><!~?:&|+\-*\/\^%]+/,
|
||||
escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
|
||||
terraformFunctions: /(abs|ceil|floor|log|max|min|pow|signum|chomp|format|formatlist|indent|join|lower|regex|regexall|replace|split|strrev|substr|title|trimspace|upper|chunklist|coalesce|coalescelist|compact|concat|contains|distinct|element|flatten|index|keys|length|list|lookup|map|matchkeys|merge|range|reverse|setintersection|setproduct|setunion|slice|sort|transpose|values|zipmap|base64decode|base64encode|base64gzip|csvdecode|jsondecode|jsonencode|urlencode|yamldecode|yamlencode|abspath|dirname|pathexpand|basename|file|fileexists|fileset|filebase64|templatefile|formatdate|timeadd|timestamp|base64sha256|base64sha512|bcrypt|filebase64sha256|filebase64sha512|filemd5|filemd1|filesha256|filesha512|md5|rsadecrypt|sha1|sha256|sha512|uuid|uuidv5|cidrhost|cidrnetmask|cidrsubnet|tobool|tolist|tomap|tonumber|toset|tostring)/,
|
||||
terraformFunctions:
|
||||
/(abs|ceil|floor|log|max|min|pow|signum|chomp|format|formatlist|indent|join|lower|regex|regexall|replace|split|strrev|substr|title|trimspace|upper|chunklist|coalesce|coalescelist|compact|concat|contains|distinct|element|flatten|index|keys|length|list|lookup|map|matchkeys|merge|range|reverse|setintersection|setproduct|setunion|slice|sort|transpose|values|zipmap|base64decode|base64encode|base64gzip|csvdecode|jsondecode|jsonencode|urlencode|yamldecode|yamlencode|abspath|dirname|pathexpand|basename|file|fileexists|fileset|filebase64|templatefile|formatdate|timeadd|timestamp|base64sha256|base64sha512|bcrypt|filebase64sha256|filebase64sha512|filemd5|filemd1|filesha256|filesha512|md5|rsadecrypt|sha1|sha256|sha512|uuid|uuidv5|cidrhost|cidrnetmask|cidrsubnet|tobool|tolist|tomap|tonumber|toset|tostring)/,
|
||||
terraformMainBlocks: /(module|data|terraform|resource|provider|variable|output|locals)/,
|
||||
tokenizer: {
|
||||
root: [
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ import type { languages } from '../fillers/monaco-editor-core';
|
|||
|
||||
export const conf: languages.LanguageConfiguration = {
|
||||
// the default separators except `@$`
|
||||
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
wordPattern:
|
||||
/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
comments: {
|
||||
lineComment: '//',
|
||||
blockComment: ['/*', '*/']
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ import type { languages } from '../fillers/monaco-editor-core';
|
|||
|
||||
export const conf: languages.LanguageConfiguration = {
|
||||
// the default separators except `@$`
|
||||
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
wordPattern:
|
||||
/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
comments: {
|
||||
lineComment: '//',
|
||||
blockComment: ['/*', '*/']
|
||||
|
|
|
|||
|
|
@ -1001,8 +1001,7 @@ testTokenization(
|
|||
|
||||
[
|
||||
{
|
||||
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))); }',
|
||||
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' },
|
||||
|
|
|
|||
|
|
@ -118,8 +118,7 @@ testTokenization(
|
|||
// If tag / keywords / block style tags
|
||||
[
|
||||
{
|
||||
line:
|
||||
'<div>{% if true=false %}<div>True</div>{% else %}<div>False</div>{% endif %}</div>',
|
||||
line: '<div>{% if true=false %}<div>True</div>{% else %}<div>False</div>{% endif %}</div>',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'delimiter.html' },
|
||||
{ startIndex: 1, type: 'tag.html' },
|
||||
|
|
@ -187,8 +186,7 @@ testTokenization(
|
|||
// Raw tag
|
||||
[
|
||||
{
|
||||
line:
|
||||
'<div>Everything here should be escaped {% raw %} In Handlebars, {{ this }} will be HTML-escaped, but {{{ that }}} will not. {% endraw %}</div>',
|
||||
line: '<div>Everything here should be escaped {% raw %} In Handlebars, {{ this }} will be HTML-escaped, but {{{ that }}} will not. {% endraw %}</div>',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'delimiter.html' },
|
||||
{ startIndex: 1, type: 'tag.html' },
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ export const language = <languages.IMonarchLanguage>{
|
|||
[/^(?!\{\%\s*endraw\s*\%\}).+/],
|
||||
[/\{\%/, 'delimiter.tag.liquid'],
|
||||
[/@identifier/],
|
||||
[/\%\}/, { token: 'delimiter.tag.liquid', next: '@root' }],
|
||||
[/\%\}/, { token: 'delimiter.tag.liquid', next: '@root' }]
|
||||
],
|
||||
|
||||
liquidRoot: [
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@
|
|||
import type { languages } from '../fillers/monaco-editor-core';
|
||||
|
||||
export const conf: languages.LanguageConfiguration = {
|
||||
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
wordPattern:
|
||||
/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\$\-\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
comments: {
|
||||
blockComment: ['###', '###'],
|
||||
lineComment: '#'
|
||||
|
|
|
|||
|
|
@ -9,8 +9,7 @@ testTokenization('objective-c', [
|
|||
// Keywords
|
||||
[
|
||||
{
|
||||
line:
|
||||
'-(id) initWithParams:(id<anObject>) aHandler withDeviceStateManager:(id<anotherObject>) deviceStateManager',
|
||||
line: '-(id) initWithParams:(id<anObject>) aHandler withDeviceStateManager:(id<anotherObject>) deviceStateManager',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: '' },
|
||||
{ startIndex: 1, type: 'delimiter.parenthesis.objective-c' },
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ import type { languages } from '../fillers/monaco-editor-core';
|
|||
|
||||
export const conf: languages.LanguageConfiguration = {
|
||||
// the default separators except `@$`
|
||||
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
wordPattern:
|
||||
/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
comments: {
|
||||
lineComment: '//',
|
||||
blockComment: ['{', '}']
|
||||
|
|
|
|||
|
|
@ -2258,8 +2258,7 @@ testTokenization(
|
|||
// HTML (CSS (PHP)), HTML ( PHP, JS (PHP), PHP)
|
||||
[
|
||||
{
|
||||
line:
|
||||
'<html><style><?="div"?> { color:blue; }</style><!--<?="HTML Comment"?>--><script>var x = 3;/* <?="JS Comment"/*</script>*/?> */var y = 4;</script></html><? $x = 3;?>',
|
||||
line: '<html><style><?="div"?> { color:blue; }</style><!--<?="HTML Comment"?>--><script>var x = 3;/* <?="JS Comment"/*</script>*/?> */var y = 4;</script></html><? $x = 3;?>',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'delimiter.html' },
|
||||
{ startIndex: 1, type: 'tag.html' },
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@
|
|||
import type { languages } from '../fillers/monaco-editor-core';
|
||||
|
||||
export const conf: languages.LanguageConfiguration = {
|
||||
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
wordPattern:
|
||||
/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
|
||||
comments: {
|
||||
lineComment: '//',
|
||||
|
|
|
|||
|
|
@ -459,7 +459,8 @@ export const language = <languages.IMonarchLanguage>{
|
|||
fexponent_bin: /[pP][+-]?[0-9]+/,
|
||||
deciexp: /\.[0-9]*@fexponent?/,
|
||||
hexiexp: /\.[0-9a-zA-Z]*@fexponent_bin?/,
|
||||
irregular_keywords: /val[+-]?|case[+-]?|addr\@?|fold\@|free\@|fix\@?|lam\@?|llam\@?|prop[+-]?|type[+-]?|view[+-@]?|viewt@?ype[+-]?|t@?ype[+-]?|v(iew)?t@?ype[+-]?|abst@?ype|absv(iew)?t@?ype|for\*?|while\*?/,
|
||||
irregular_keywords:
|
||||
/val[+-]?|case[+-]?|addr\@?|fold\@|free\@|fix\@?|lam\@?|llam\@?|prop[+-]?|type[+-]?|view[+-@]?|viewt@?ype[+-]?|t@?ype[+-]?|v(iew)?t@?ype[+-]?|abst@?ype|absv(iew)?t@?ype|for\*?|while\*?/,
|
||||
ESCHAR: /[ntvbrfa\\\?'"\(\[\{]/,
|
||||
|
||||
start: 'root',
|
||||
|
|
|
|||
|
|
@ -480,8 +480,7 @@ testTokenization('powershell', [
|
|||
]
|
||||
},
|
||||
{
|
||||
line:
|
||||
'#the object info array contains hashmaps, each of which represent a parameter set and describe a target in the XenCenter resource list',
|
||||
line: '#the object info array contains hashmaps, each of which represent a parameter set and describe a target in the XenCenter resource list',
|
||||
tokens: [{ startIndex: 0, type: 'comment.ps1' }]
|
||||
},
|
||||
{
|
||||
|
|
@ -527,8 +526,7 @@ testTokenization('powershell', [
|
|||
]
|
||||
},
|
||||
{
|
||||
line:
|
||||
' #When the XenCenter node is selected a parameter set is created for each of your connected servers with the class and objUuid keys marked as blank',
|
||||
line: ' #When the XenCenter node is selected a parameter set is created for each of your connected servers with the class and objUuid keys marked as blank',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: '' },
|
||||
{ startIndex: 2, type: 'comment.ps1' }
|
||||
|
|
@ -622,8 +620,7 @@ testTokenization('powershell', [
|
|||
]
|
||||
},
|
||||
{
|
||||
line:
|
||||
' #When a disconnected server is selected there is no session information, we get null for everything except class',
|
||||
line: ' #When a disconnected server is selected there is no session information, we get null for everything except class',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: '' },
|
||||
{ startIndex: 2, type: 'comment.ps1' }
|
||||
|
|
@ -662,8 +659,7 @@ testTokenization('powershell', [
|
|||
]
|
||||
},
|
||||
{
|
||||
line:
|
||||
' Connect-XenServer -url $parameterSet["url"] -opaqueref $parameterSet["sessionRef"]',
|
||||
line: ' Connect-XenServer -url $parameterSet["url"] -opaqueref $parameterSet["sessionRef"]',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: '' },
|
||||
{ startIndex: 20, type: 'delimiter.ps1' },
|
||||
|
|
@ -689,16 +685,14 @@ testTokenization('powershell', [
|
|||
]
|
||||
},
|
||||
{
|
||||
line:
|
||||
' #-properties allows us to filter the results to just include the selected object',
|
||||
line: ' #-properties allows us to filter the results to just include the selected object',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: '' },
|
||||
{ startIndex: 2, type: 'comment.ps1' }
|
||||
]
|
||||
},
|
||||
{
|
||||
line:
|
||||
' $exp = "Get-XenServer:{0} -properties @{{uuid=\'{1}\'}}" -f $parameterSet["class"], $parameterSet["objUuid"]',
|
||||
line: ' $exp = "Get-XenServer:{0} -properties @{{uuid=\'{1}\'}}" -f $parameterSet["class"], $parameterSet["objUuid"]',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: '' },
|
||||
{ startIndex: 2, type: 'variable.ps1' },
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ import type { languages } from '../fillers/monaco-editor-core';
|
|||
|
||||
export const conf: languages.LanguageConfiguration = {
|
||||
// the default separators except `$-`
|
||||
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
wordPattern:
|
||||
/(-?\d*\.\d\w*)|([^\`\~\!\@\#%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
comments: {
|
||||
lineComment: '#',
|
||||
blockComment: ['<#', '#>']
|
||||
|
|
@ -90,7 +91,8 @@ export const language = <languages.IMonarchLanguage>{
|
|||
'configuration'
|
||||
],
|
||||
|
||||
helpKeywords: /SYNOPSIS|DESCRIPTION|PARAMETER|EXAMPLE|INPUTS|OUTPUTS|NOTES|LINK|COMPONENT|ROLE|FUNCTIONALITY|FORWARDHELPTARGETNAME|FORWARDHELPCATEGORY|REMOTEHELPRUNSPACE|EXTERNALHELP/,
|
||||
helpKeywords:
|
||||
/SYNOPSIS|DESCRIPTION|PARAMETER|EXAMPLE|INPUTS|OUTPUTS|NOTES|LINK|COMPONENT|ROLE|FUNCTIONALITY|FORWARDHELPTARGETNAME|FORWARDHELPCATEGORY|REMOTEHELPRUNSPACE|EXTERNALHELP/,
|
||||
|
||||
// we include these common regular expressions
|
||||
symbols: /[=><!~?&%|+\-*\/\^;\.,]+/,
|
||||
|
|
|
|||
|
|
@ -380,8 +380,7 @@ testTokenization('pug', [
|
|||
]
|
||||
},
|
||||
{
|
||||
line:
|
||||
' // Disclaimer: You will need to turn insertSpaces to true in order for the',
|
||||
line: ' // Disclaimer: You will need to turn insertSpaces to true in order for the',
|
||||
tokens: [{ startIndex: 0, type: 'comment.pug' }]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -107,13 +107,11 @@ testTokenization('r', [
|
|||
tokens: [
|
||||
{ startIndex: 0, type: 'white.r' },
|
||||
{ startIndex: 1, type: 'comment.doc.r' }
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
line: " ",
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'white.r' },
|
||||
]
|
||||
line: ' ',
|
||||
tokens: [{ startIndex: 0, type: 'white.r' }]
|
||||
}
|
||||
],
|
||||
|
||||
|
|
|
|||
120
src/r/r.ts
120
src/r/r.ts
|
|
@ -33,66 +33,66 @@ export const language = <languages.IMonarchLanguage>{
|
|||
tokenPostfix: '.r',
|
||||
|
||||
roxygen: [
|
||||
'@alias',
|
||||
'@aliases',
|
||||
'@assignee',
|
||||
'@author',
|
||||
'@backref',
|
||||
'@callGraph',
|
||||
'@callGraphDepth',
|
||||
'@callGraphPrimitives',
|
||||
'@concept',
|
||||
'@describeIn',
|
||||
'@description',
|
||||
'@details',
|
||||
'@docType',
|
||||
'@encoding',
|
||||
'@evalNamespace',
|
||||
'@evalRd',
|
||||
'@example',
|
||||
'@examples',
|
||||
'@export',
|
||||
'@exportClass',
|
||||
'@exportMethod',
|
||||
'@exportPattern',
|
||||
'@family',
|
||||
'@field',
|
||||
'@formals',
|
||||
'@format',
|
||||
'@import',
|
||||
'@importClassesFrom',
|
||||
'@importFrom',
|
||||
'@importMethodsFrom',
|
||||
'@include',
|
||||
'@inherit',
|
||||
'@inheritDotParams',
|
||||
'@inheritParams',
|
||||
'@inheritSection',
|
||||
'@keywords',
|
||||
'@md',
|
||||
'@method',
|
||||
'@name',
|
||||
'@noMd',
|
||||
'@noRd',
|
||||
'@note',
|
||||
'@param',
|
||||
'@rawNamespace',
|
||||
'@rawRd',
|
||||
'@rdname',
|
||||
'@references',
|
||||
'@return',
|
||||
'@S3method',
|
||||
'@section',
|
||||
'@seealso',
|
||||
'@setClass',
|
||||
'@slot',
|
||||
'@source',
|
||||
'@template',
|
||||
'@templateVar',
|
||||
'@title',
|
||||
'@TODO',
|
||||
'@usage',
|
||||
'@useDynLib'
|
||||
'@alias',
|
||||
'@aliases',
|
||||
'@assignee',
|
||||
'@author',
|
||||
'@backref',
|
||||
'@callGraph',
|
||||
'@callGraphDepth',
|
||||
'@callGraphPrimitives',
|
||||
'@concept',
|
||||
'@describeIn',
|
||||
'@description',
|
||||
'@details',
|
||||
'@docType',
|
||||
'@encoding',
|
||||
'@evalNamespace',
|
||||
'@evalRd',
|
||||
'@example',
|
||||
'@examples',
|
||||
'@export',
|
||||
'@exportClass',
|
||||
'@exportMethod',
|
||||
'@exportPattern',
|
||||
'@family',
|
||||
'@field',
|
||||
'@formals',
|
||||
'@format',
|
||||
'@import',
|
||||
'@importClassesFrom',
|
||||
'@importFrom',
|
||||
'@importMethodsFrom',
|
||||
'@include',
|
||||
'@inherit',
|
||||
'@inheritDotParams',
|
||||
'@inheritParams',
|
||||
'@inheritSection',
|
||||
'@keywords',
|
||||
'@md',
|
||||
'@method',
|
||||
'@name',
|
||||
'@noMd',
|
||||
'@noRd',
|
||||
'@note',
|
||||
'@param',
|
||||
'@rawNamespace',
|
||||
'@rawRd',
|
||||
'@rdname',
|
||||
'@references',
|
||||
'@return',
|
||||
'@S3method',
|
||||
'@section',
|
||||
'@seealso',
|
||||
'@setClass',
|
||||
'@slot',
|
||||
'@source',
|
||||
'@template',
|
||||
'@templateVar',
|
||||
'@title',
|
||||
'@TODO',
|
||||
'@usage',
|
||||
'@useDynLib'
|
||||
],
|
||||
|
||||
constants: [
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ testTokenization('rust', [
|
|||
tokens: [{ startIndex: 0, type: 'string.byteliteral.rust' }]
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
// Comment
|
||||
[
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ export const conf: languages.LanguageConfiguration = {
|
|||
* unary_<op> is allowed as an identifier.
|
||||
* <name>_= is allowed as an identifier.
|
||||
*/
|
||||
wordPattern: /(unary_[@~!#%^&*()\-=+\\|:<>\/?]+)|([a-zA-Z_$][\w$]*?_=)|(`[^`]+`)|([a-zA-Z_$][\w$]*)/g,
|
||||
wordPattern:
|
||||
/(unary_[@~!#%^&*()\-=+\\|:<>\/?]+)|([a-zA-Z_$][\w$]*?_=)|(`[^`]+`)|([a-zA-Z_$][\w$]*)/g,
|
||||
comments: {
|
||||
lineComment: '//',
|
||||
blockComment: ['/*', '*/']
|
||||
|
|
|
|||
|
|
@ -143,8 +143,10 @@ export const language = <languages.IMonarchLanguage>{
|
|||
symbols: /[=(){}\[\].,:;@#\_&\-<>`?!+*\\\/]/,
|
||||
|
||||
// Moved . to operatorstart so it can be a delimiter
|
||||
operatorstart: /[\/=\-+!*%<>&|^~?\u00A1-\u00A7\u00A9\u00AB\u00AC\u00AE\u00B0-\u00B1\u00B6\u00BB\u00BF\u00D7\u00F7\u2016-\u2017\u2020-\u2027\u2030-\u203E\u2041-\u2053\u2055-\u205E\u2190-\u23FF\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3001-\u3003\u3008-\u3030]/,
|
||||
operatorend: /[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE00-\uFE0F\uFE20-\uFE2F\uE0100-\uE01EF]/,
|
||||
operatorstart:
|
||||
/[\/=\-+!*%<>&|^~?\u00A1-\u00A7\u00A9\u00AB\u00AC\u00AE\u00B0-\u00B1\u00B6\u00BB\u00BF\u00D7\u00F7\u2016-\u2017\u2020-\u2027\u2030-\u203E\u2041-\u2053\u2055-\u205E\u2190-\u23FF\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3001-\u3003\u3008-\u3030]/,
|
||||
operatorend:
|
||||
/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE00-\uFE0F\uFE20-\uFE2F\uE0100-\uE01EF]/,
|
||||
operators: /(@operatorstart)((@operatorstart)|(@operatorend))*/,
|
||||
|
||||
// TODO(owensd): These are borrowed from C#; need to validate correctness for Swift.
|
||||
|
|
|
|||
|
|
@ -335,8 +335,7 @@ testTokenization('systemverilog', [
|
|||
],
|
||||
[
|
||||
{
|
||||
line:
|
||||
'typedef enum int {FAST_SIM = 0, RANDOM = 1, NOMINAL = 2, START_UP = 3} clock_plan_e;',
|
||||
line: 'typedef enum int {FAST_SIM = 0, RANDOM = 1, NOMINAL = 2, START_UP = 3} clock_plan_e;',
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'keyword.typedef.sv' },
|
||||
{ startIndex: 7, type: '' },
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@
|
|||
import { languages } from '../fillers/monaco-editor-core';
|
||||
|
||||
export const conf: languages.LanguageConfiguration = {
|
||||
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
wordPattern:
|
||||
/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
|
||||
comments: {
|
||||
lineComment: '//',
|
||||
|
|
|
|||
|
|
@ -452,8 +452,7 @@ testTokenization('yaml', [
|
|||
],
|
||||
[
|
||||
{
|
||||
line:
|
||||
"text: Pretty vector drawing. #this is comment doesn't have proper syntax higlighting",
|
||||
line: "text: Pretty vector drawing. #this is comment doesn't have proper syntax higlighting",
|
||||
tokens: [
|
||||
{ startIndex: 0, type: 'type.yaml' },
|
||||
{ startIndex: 4, type: 'operators.yaml' },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue