mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-02 05:39:47 -06:00
Resolve type errors
This commit is contained in:
@@ -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'}],
|
||||
],
|
||||
},
|
||||
|
||||
@@ -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']},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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/,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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: [
|
||||
|
||||
@@ -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'],
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user