1
0
mirror of https://github.com/salexdv/bsl_console.git synced 2025-02-21 19:19:40 +02:00

Merge branch 'salexdv:develop' into develop

This commit is contained in:
Sergey Starykh 2023-08-11 22:57:51 +03:00 committed by GitHub
commit 230701be6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 8 deletions

View File

@ -67,6 +67,7 @@
| `removeWordWrap` | Удаляет перенос строки у текущего блока |
| [`insertLine`](docs/insert_line.md) | Вставляет текст в строку с указанным номером |
| [`addLine`](docs/add_line.md) | Добавляет новую строку с указанным текстом |
| `deleteLine` | Удаляет строки с указанным номером |
| [`getPositionOffset`](docs/get_position_offset.md) | Возвращает координаты текущей позиции курсора |
| `jumpToBracket` | Переход к парной скобке `CTRL+[]` |
| `selectToBracket` | Выделяет скобки и текст между ними `SHIFT+ALT+B` |

View File

@ -5723,7 +5723,8 @@ define([], function () {
"И": {},
"ИЛИ": {},
"NULL": {},
"Новый": {}
"Новый": {},
"Перейти": {}
},
"en": {
"Procedure": {},
@ -5763,7 +5764,8 @@ define([], function () {
"NOT": {},
"AND": {},
"OR": {},
"New": {}
"New": {},
"Goto": {}
}
},
"classes": {

View File

@ -3495,8 +3495,8 @@ class bslHelper {
getLoopsVarNames(currentLine) {
let names = [];
let each_pattern = '(?:для каждого|for each)\\s+([a-zA-Z0-9\u0410-\u044F_,\\s=]+)\\s+(?:из|in)';
let for_pattern = '(?:для|for)\\s+([a-zA-Z0-9\u0410-\u044F_,\\s=]+)\\s+=.*(?:по|to)';
let each_pattern = '(?:для каждого|for each)\\s+([a-zA-Z0-9\u0410-\u044F_,\\s=]+?)\\s+(?:из|in)';
let for_pattern = '(?:для|for)\\s+([a-zA-Z0-9\u0410-\u044F_,\\s=]+?)\\s+=.*(?:по|to)';
if (currentLine == 0) {

View File

@ -57,7 +57,8 @@ define([], function () {
{ token: 'string.invalidbsl', foreground: '000000' },
{ token: 'numberbsl', foreground: '000000' },
{ token: 'number.floatbsl', foreground: '000000' },
{ token: 'preprocbsl', foreground: '963200' }
{ token: 'preprocbsl', foreground: '963200' },
{ token: 'gotomarkbsl', foreground: '3a3a3a' }
],
whiteQueryOn: [
{ token: 'querybsl', foreground: '000000' },
@ -85,7 +86,8 @@ define([], function () {
{ token: 'string.invalidbsl', foreground: 'c3602c' },
{ token: 'numberbsl', foreground: 'b5cea8' },
{ token: 'number.floatbsl', foreground: 'b5cea8' },
{ token: 'preprocbsl', foreground: '963200' }
{ token: 'preprocbsl', foreground: '963200' },
{ token: 'gotomarkbsl', foreground: 'ff9000' }
],
darkQueryOff: [
{ token: 'querybsl', foreground: 'c3602c' },
@ -163,7 +165,7 @@ define([], function () {
'New', 'Процедура', 'Procedure', 'Функция', 'Function', 'Перем', 'Var',
'Экспорт', 'Export', 'Знач', 'Val', 'Неопределено', 'Выполнить',
'Истина', 'Ложь', 'True', 'False', 'Undefined', 'Асинх', 'Async',
'Ждать', 'Await', 'Null'
'Ждать', 'Await', 'Null', 'Перейти', 'Goto'
],
namespaceFollows: [
'namespace', 'using',
@ -249,9 +251,10 @@ define([], function () {
expBeforeAs: [
'КОНЕЦ', 'END', 'NULL', 'НЕОПРЕДЕЛЕНО', 'UNDEFINED'
],
// The main tokenizer for our languages
tokenizer: {
root: [
[/(перейти|goto)(\s+)(~[a-zA-Z\u0410-\u044F_0-9]*)/, ['keyword', '', 'gotomark']],
[/(~[a-zA-Z\u0410-\u044F_0-9]*)(:)/, ['gotomark', 'delimiter']],
[/(\.)(выполнить)(\(?)/, ['delimiter', 'identifier', 'delimiter.parenthesis']],
[/[a-zA-Z\u0410-\u044F_][a-zA-Z\u0410-\u044F_0-9]*/, { cases: { '@keywords': 'keyword', '@default': 'identifier' } }],
// whitespace

View File

@ -599,6 +599,15 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
}
deleteLine = function(lineNumber) {
editor.executeEdits('addLine', [{
range: new monaco.Range(lineNumber, 1, lineNumber + 1, 1),
text: null
}]);
}
getPositionOffset = function() {
let position = editor.getPosition();