mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 23:13:02 +01:00
Simplifying .type to recognized any types specified
This commit is contained in:
parent
27c31112a6
commit
2db4b4ef7f
2 changed files with 3 additions and 16 deletions
|
|
@ -214,11 +214,11 @@ testTokenization('pla', [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
line: '.type inval',
|
line: '.type other',
|
||||||
tokens: [
|
tokens: [
|
||||||
{ startIndex: 0, type: 'keyword.type.pla' },
|
{ startIndex: 0, type: 'keyword.type.pla' },
|
||||||
{ startIndex: 5, type: '' },
|
{ startIndex: 5, type: '' },
|
||||||
{ startIndex: 6, type: 'invalid.pla' }
|
{ startIndex: 6, type: 'type.pla' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,6 @@ export const language = <languages.IMonarchLanguage>{
|
||||||
'.end'
|
'.end'
|
||||||
],
|
],
|
||||||
|
|
||||||
types: ['f', 'r', 'fd', 'fr', 'dr', 'fdr'],
|
|
||||||
|
|
||||||
// regular expressions
|
// regular expressions
|
||||||
comment: /#.*$/,
|
comment: /#.*$/,
|
||||||
identifier: /[a-zA-Z]+[a-zA-Z0-9_\-]*/,
|
identifier: /[a-zA-Z]+[a-zA-Z0-9_\-]*/,
|
||||||
|
|
@ -94,18 +92,7 @@ export const language = <languages.IMonarchLanguage>{
|
||||||
|
|
||||||
whitespace: [[/[ \t\r\n]+/, '']],
|
whitespace: [[/[ \t\r\n]+/, '']],
|
||||||
|
|
||||||
type: [
|
type: [{ include: '@whitespace' }, [/\w+/, { token: 'type', next: '@pop' }]],
|
||||||
{ include: '@whitespace' },
|
|
||||||
[
|
|
||||||
/\w+/,
|
|
||||||
{
|
|
||||||
cases: {
|
|
||||||
'@types': { token: 'type', next: '@pop' },
|
|
||||||
'@default': { token: 'invalid', next: '@pop' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
],
|
|
||||||
|
|
||||||
keywordArg: [
|
keywordArg: [
|
||||||
// whitespace
|
// whitespace
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue