Skip to content

Commit a546120

Browse files
committed
fixed by nzeemin ( https://nzeemin.github.io/ ) comments #1
1 parent f9f20c8 commit a546120

4 files changed

Lines changed: 45 additions & 68 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# Vilnius BASIC 86 для VS Code
1+
# Vilnius BASIC для VS Code
22

3-
Подсветка синтаксиса, snippets и удобная работа с **Бейсик Вильнюс 86** (для семейства БК).
3+
Подсветка синтаксиса, snippets и удобная работа с **Бейсик Вильнюс** (для БК, УКНЦ и Немиги).
44

55
## Возможности
66

77
- Подсветка синтаксиса (команды, функции, операторы, строковые переменные)
88
- Базовые snippets (FOR-NEXT, IF-THEN-ELSE, LINE, CIRCLE и др.)
9-
- Поддерживаемые расширения файлов: `.bas`, `.bvk`, `.vil`, `.bk`
9+
- Поддерживаемые расширения файлов: `.bas`, `.bvk`, `.vil`, `.bk`, `.asc`
1010

1111
## Установка
1212

1313
1. Откройте **Extensions** (`Ctrl+Shift+X`)
14-
2. Найдите **"Vilnius BASIC 86"**
14+
2. Найдите **"Vilnius BASIC"**
1515
3. Нажмите **Install**
1616

1717
## Для БК-разработчиков

language-configuration.json

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"comments": {
3-
"lineComment": "REM",
4-
"blockComment": null
3+
"lineComment": ["REM", "'"]
54
},
65
"brackets": [
76
["{", "}"],
@@ -22,15 +21,9 @@
2221
["\"", "\""],
2322
["'", "'"]
2423
],
25-
"folding": {
26-
"markers": {
27-
"start": "^\\s*REM\\s+\\{\\{\\{",
28-
"end": "^\\s*REM\\s+\\}\\}\\}"
29-
}
30-
},
31-
"wordPattern": "\\b[A-Za-z][A-Za-z0-9]*¤?\\b",
24+
"wordPattern": "(?i)\\b[A-Za-z][A-Za-z0-9]*[#!%¤]?\\b|\\b\\d+\\b",
3225
"indentationRules": {
33-
"increaseIndentPattern": "^\\s*(FOR|IF|WHILE|DO|SUB|FUNCTION|REM\\s+\\{\\{\\{).*",
26+
"increaseIndentPattern": "^\\s*(FOR|IF|WHILE|DO|SUB|FUNCTION|REM\\s+\\{\\{\\{|THEN).*",
3427
"decreaseIndentPattern": "^\\s*(NEXT|ELSE|ENDIF|WEND|LOOP|ENDSUB|ENDFUNCTION|REM\\s+\\}\\}\\}).*"
3528
}
3629
}

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "bkbasic",
3-
"displayName": "Vilnius BASIC 86",
4-
"description": "BK BASIC VILNIUS 86 syntax highlighting / Подсветка синтаксиса, автодополнение и поддержка Бейсик Вильнюс 86 (для БК-0010-01)",
5-
"version": "0.0.1",
3+
"displayName": "Vilnius BASIC",
4+
"description": "BK BASIC VILNIUS syntax highlighting / Подсветка синтаксиса, автодополнение и поддержка Бейсик Вильнюс (для БК, УКНЦ и Немиги)",
5+
"version": "0.0.2",
66
"publisher": "kalininskiy",
77
"repository": {
88
"type": "git",
@@ -29,14 +29,14 @@
2929
"languages": [{
3030
"id": "bkbasic",
3131
"aliases": [
32-
"Vilnius BASIC 86",
33-
"BASIC-86",
32+
"Vilnius BASIC",
33+
"BASIC",
3434
"Vilnius Basic",
3535
"Бейсик",
36-
"Вильнюс 86",
36+
"Вильнюс",
3737
"BK BASIC"
3838
],
39-
"extensions": [".bas",".bkb",".bvk",".vil",".bk"],
39+
"extensions": [".bas",".bkb",".bvk",".vil",".bk",".asc"],
4040
"configuration": "./language-configuration.json"
4141
}],
4242
"grammars": [{
@@ -51,12 +51,12 @@
5151
}
5252
],
5353
"configuration": {
54-
"title": "Vilnius BASIC 86",
54+
"title": "Vilnius BASIC",
5555
"properties": {
5656
"bkbasic.enableSnippets": {
5757
"type": "boolean",
5858
"default": true,
59-
"description": "Включить/выключить snippets для Бейсик Вильнюс 86"
59+
"description": "Включить/выключить snippets для Бейсик Вильнюс"
6060
},
6161
"bkbasic.highlightStringVariables": {
6262
"type": "boolean",

syntaxes/bkbasic.tmLanguage.json

Lines changed: 29 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,72 +2,56 @@
22
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
33
"name": "Vilnius BASIC 86",
44
"patterns": [
5-
{ "include": "#comments" },
6-
{ "include": "#keywords" },
7-
{ "include": "#functions" },
85
{ "include": "#strings" },
6+
{ "include": "#comments" },
7+
{ "include": "#lineNumber" },
98
{ "include": "#numbers" },
10-
{ "include": "#operators" }
9+
{ "include": "#logical" },
10+
{ "include": "#operators" },
11+
{ "include": "#keywords" },
12+
{ "include": "#functions" }
1113
],
1214
"repository": {
15+
"lineNumber": {
16+
"name": "constant.numeric.line-number.vilniusbasic",
17+
"match": "^\\s*\\d+"
18+
},
1319
"comments": {
1420
"patterns": [
1521
{
1622
"name": "comment.line.rem.vilniusbasic",
17-
"match": "(?i:^\\s*(REM\\b|').*)"
18-
}
19-
]
20-
},
21-
"keywords": {
22-
"patterns": [
23-
{
24-
"name": "keyword.control.statement.vilniusbasic",
25-
"match": "(?i:\\b(AUTO|BEEP|CLEAR|CLS|CONT|DATA|DELETE|DIM|END|ERASE|ERROR|FOR|NEXT|GOSUB|RETURN|GOTO|IF|THEN|ELSE|INPUT|LET|LIST|LLIST|LOAD|NEW|ON|OFF|OPEN|CLOSE|PRINT|LPRINT|READ|RESTORE|RESUME|RUN|SAVE|STOP|SWAP|WAIT|WIDTH)\\b)"
26-
},
27-
{
28-
"name": "keyword.control.graphics.vilniusbasic",
29-
"match": "(?i:\\b(CIRCLE|DRAW|LINE|PAINT|PSET|PRESET|SCREEN|COLOR)\\b)"
23+
"match": "(?i)\\bREM\\b.*"
3024
},
3125
{
32-
"name": "keyword.control.sound.vilniusbasic",
33-
"match": "(?i:\\b(BEEP|SOUND)\\b)"
34-
}
35-
]
36-
},
37-
"functions": {
38-
"patterns": [
39-
{
40-
"name": "entity.name.function.vilniusbasic",
41-
"match": "(?i:\\b(ABS|ASC|ATN|BIN|CHR|COS|EXP|FIX|HEX|INKEY|INP|INSTR|INT|LEFT|LEN|LOG|MID|OCT|PEEK|POKE|POINT|POS|RIGHT|RND|SGN|SPC|STR|STRING|TAB|TAN|USR|VAL|VARPTR)\\b)"
26+
"name": "comment.line.apostrophe.vilniusbasic",
27+
"match": "(?<!\")'.*"
4228
}
4329
]
4430
},
4531
"strings": {
4632
"name": "string.quoted.double.vilniusbasic",
4733
"begin": "\"",
48-
"end": "\"",
49-
"patterns": [
50-
{
51-
"name": "constant.character.escape.vilniusbasic",
52-
"match": "\\\\."
53-
}
54-
]
34+
"end": "\"|$"
5535
},
5636
"numbers": {
5737
"name": "constant.numeric.vilniusbasic",
58-
"match": "-?\\b((([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?|(&H[0-9A-Fa-f]+)|(&O[0-7]+)|(&B[01]+)\\b"
38+
"match": "(?i)[-+]?(?:\\d*\\.?\\d+)(?:[eE][+-]?\\d+)?[#!%]?|\\b\\d+[#!%]?|&[Hh][0-9A-Fa-f]+|&[Oo][0-7]+|&[Bb][01]+\\b"
39+
},
40+
"logical": {
41+
"name": "keyword.operator.logical.vilniusbasic",
42+
"match": "(?i)\\b(AND|NOT|OR|XOR|MOD|IMP|EQV)\\b"
5943
},
6044
"operators": {
61-
"patterns": [
62-
{
63-
"name": "keyword.operator.logical.vilniusbasic",
64-
"match": "(?i:\\b(AND|NOT|OR|XOR|MOD|IMP|EQV)\\b)"
65-
},
66-
{
67-
"name": "keyword.operator.arithmetic.vilniusbasic",
68-
"match": "[+\\-*/\\\\^=<>]|<=|>=|<>|&"
69-
}
70-
]
45+
"name": "keyword.operator.arithmetic.vilniusbasic",
46+
"match": "[+*/\\\\^=<>]|<=|>=|<>|&"
47+
},
48+
"keywords": {
49+
"name": "keyword.control.vilniusbasic",
50+
"match": "(?i)\\b(AUTO|BEEP|CLEAR|CLS|CONT|DATA|DELETE|DIM|END|ERASE|ERROR|FOR|NEXT|GOSUB|RETURN|GOTO|IF|THEN|ELSE|INPUT|LET|LIST|LLIST|LOAD|NEW|ON|OFF|OPEN|CLOSE|PRINT|LPRINT|READ|RESTORE|RESUME|RUN|SAVE|STOP|SWAP|WAIT|WIDTH|CIRCLE|DRAW|LINE|PAINT|PSET|PRESET|SCREEN|COLOR|SOUND)\\b"
51+
},
52+
"functions": {
53+
"name": "entity.name.function.vilniusbasic",
54+
"match": "(?i)\\b(ABS|ASC|ATN|BIN|CHR|COS|EXP|FIX|HEX|INKEY|INP|INSTR|INT|LEFT|LEN|LOG|MID|OCT|PEEK|POKE|POINT|POS|RIGHT|RND|SGN|SPC|STR|STRING|TAB|TAN|USR|VAL|VARPTR|AT)\\b"
7155
}
7256
},
7357
"scopeName": "source.vilniusbasic"

0 commit comments

Comments
 (0)