From cceb697eb81ddc5b136d995c4bb537db048b6f5b Mon Sep 17 00:00:00 2001 From: Jeremy <51220084+jeremy-rifkin@users.noreply.github.com> Date: Thu, 12 Jan 2023 18:23:43 -0500 Subject: [PATCH] Resolve type errors --- static/modes/asmruby-mode.ts | 8 ++++---- static/modes/cmake-mode.ts | 19 +++++-------------- static/modes/erlang-mode.ts | 6 +++--- static/modes/llvm-ir-mode.ts | 2 +- static/modes/toit-mode.ts | 19 ++++--------------- 5 files changed, 17 insertions(+), 37 deletions(-) diff --git a/static/modes/asmruby-mode.ts b/static/modes/asmruby-mode.ts index 2c8a20c1f..f81724880 100644 --- a/static/modes/asmruby-mode.ts +++ b/static/modes/asmruby-mode.ts @@ -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'}], ], }, diff --git a/static/modes/cmake-mode.ts b/static/modes/cmake-mode.ts index 5fa3e4344..7d5aea642 100644 --- a/static/modes/cmake-mode.ts +++ b/static/modes/cmake-mode.ts @@ -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']}, + ], }; } diff --git a/static/modes/erlang-mode.ts b/static/modes/erlang-mode.ts index 0afe59b1c..74919c55d 100644 --- a/static/modes/erlang-mode.ts +++ b/static/modes/erlang-mode.ts @@ -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/, }, }, }; diff --git a/static/modes/llvm-ir-mode.ts b/static/modes/llvm-ir-mode.ts index 7bbcd9e17..4121b4cbb 100644 --- a/static/modes/llvm-ir-mode.ts +++ b/static/modes/llvm-ir-mode.ts @@ -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: [ diff --git a/static/modes/toit-mode.ts b/static/modes/toit-mode.ts index e7720c1a8..f10f965a3 100644 --- a/static/modes/toit-mode.ts +++ b/static/modes/toit-mode.ts @@ -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'], - ], }; }