Resolve type errors

This commit is contained in:
Jeremy
2023-01-12 18:23:43 -05:00
parent 8ab1635508
commit cceb697eb8
5 changed files with 17 additions and 37 deletions
+4 -4
View File
@@ -33,17 +33,17 @@ function definition(): monaco.languages.IMonarchLanguage {
[/^(\| )*local table.*$/, 'comment'],
[/^(\| )*\[\s*\d+\].*$/, 'comment'],
[/^(\| )*\|-+$/, 'comment'],
[/^((?:\| )*)(\d+)/, ['comment', {token: 'number', next: '@opcode'}]],
[/^((?:\| )*)(\d+)(\s+)/, ['comment', 'number', {token: '', next: '@opcode'}]],
[/^((?:\| )*)(\d+)/, ['comment', 'number'], '@opcode'],
[/^((?:\| )*)(\d+)(\s+)/, ['comment', 'number'], '@opcode'],
],
opcode: [
[/[a-z_]\w*\s*$/, {token: 'keyword', next: '@root'}],
[/([a-z_]\w*)(\s+)/, ['keyword', {token: '', next: '@arguments'}]],
[/([a-z_]\w*)(\s+)/, 'keyword', '@arguments'],
],
arguments: [
[/(.*?)(\(\s*\d+\)(?:\[[^\]]+\])?)$/, ['', {token: 'comment', next: '@root'}]],
[/(.*?)(\(\s*\d+\)(?:\[[^\]]+\])?)$/, {token: 'comment', next: '@root'}],
[/.*$/, {token: '', next: '@root'}],
],
},
+5 -14
View File
@@ -90,20 +90,11 @@ function configuration(): monaco.languages.LanguageConfiguration {
['{', '}'],
['(', ')'],
],
__electricCharacterSupport: {
brackets: [
{tokenType: 'delimiter.curly.ts', open: '{', close: '}', isElectric: true},
{tokenType: 'delimiter.square.ts', open: '[', close: ']', isElectric: true},
{tokenType: 'delimiter.paren.ts', open: '(', close: ')', isElectric: true},
],
},
__characterPairSupport: {
autoClosingPairs: [
{open: '{', close: '}'},
{open: '(', close: ')'},
{open: '"', close: '"', notIn: ['string']},
],
},
autoClosingPairs: [
{open: '{', close: '}'},
{open: '(', close: ')'},
{open: '"', close: '"', notIn: ['string']},
],
};
}
+3 -3
View File
@@ -86,7 +86,7 @@ function definition(): monaco.languages.IMonarchLanguage {
[/[;.,]/, 'delimiter'],
],
whitespace: [[/\s/]],
whitespace: [[/\s/, 'whitespace']],
comment: [[/%/, 'comment']],
@@ -126,8 +126,8 @@ function configuration(): monaco.languages.LanguageConfiguration {
],
folding: {
markers: {
start: '^\\s*\\%\\%region\\b',
end: '^\\s*\\%\\%endregion\\b',
start: /^\s*%%region\b/,
end: /^\s*%%endregion\b/,
},
},
};
+1 -1
View File
@@ -27,7 +27,7 @@ import * as monaco from 'monaco-editor';
// This definition is based on the official LLVM vim syntax:
// http://llvm.org/svn/llvm-project/llvm/trunk/utils/vim/syntax/llvm.vim
// For VIM regex syntax, see: http://vimdoc.sourceforge.net/htmldoc/pattern.html
export function definition() {
export function definition(): monaco.languages.IMonarchLanguage {
return {
// llvmType
types: [
+4 -15
View File
@@ -27,7 +27,10 @@ function configuration(): monaco.languages.LanguageConfiguration {
/* Toit Language Configuration: */
return {
comment: [[/\/\*/, 'comment'], [/\*\//, 'comment', '@pop'], [{lineComment: /\/\//}]],
comments: {
blockComment: ['/*', '*/'],
lineComment: '//',
},
brackets: [
['{', '}'],
@@ -36,20 +39,6 @@ function configuration(): monaco.languages.LanguageConfiguration {
['(', ')'],
['<', '>'],
],
writespace: [[/[ \t\r\n]+/, 'write']],
string: [
[/@escapes/, 'string.escape'],
[/"/, 'string', '@pop'],
],
tripleQuoteString: [[/"""/, 'string', '@pop']],
rawString: [[/"/, 'string', '@pop']],
character: [
[/@charEscapes/, 'string.escape'],
[/'/, 'string', '@pop'],
],
};
}