|
2 | 2 | "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", |
3 | 3 | "name": "Vilnius BASIC 86", |
4 | 4 | "patterns": [ |
5 | | - { "include": "#comments" }, |
6 | | - { "include": "#keywords" }, |
7 | | - { "include": "#functions" }, |
8 | 5 | { "include": "#strings" }, |
| 6 | + { "include": "#comments" }, |
| 7 | + { "include": "#lineNumber" }, |
9 | 8 | { "include": "#numbers" }, |
10 | | - { "include": "#operators" } |
| 9 | + { "include": "#logical" }, |
| 10 | + { "include": "#operators" }, |
| 11 | + { "include": "#keywords" }, |
| 12 | + { "include": "#functions" } |
11 | 13 | ], |
12 | 14 | "repository": { |
| 15 | + "lineNumber": { |
| 16 | + "name": "constant.numeric.line-number.vilniusbasic", |
| 17 | + "match": "^\\s*\\d+" |
| 18 | + }, |
13 | 19 | "comments": { |
14 | 20 | "patterns": [ |
15 | 21 | { |
16 | 22 | "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.*" |
30 | 24 | }, |
31 | 25 | { |
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": "(?<!\")'.*" |
42 | 28 | } |
43 | 29 | ] |
44 | 30 | }, |
45 | 31 | "strings": { |
46 | 32 | "name": "string.quoted.double.vilniusbasic", |
47 | 33 | "begin": "\"", |
48 | | - "end": "\"", |
49 | | - "patterns": [ |
50 | | - { |
51 | | - "name": "constant.character.escape.vilniusbasic", |
52 | | - "match": "\\\\." |
53 | | - } |
54 | | - ] |
| 34 | + "end": "\"|$" |
55 | 35 | }, |
56 | 36 | "numbers": { |
57 | 37 | "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" |
59 | 43 | }, |
60 | 44 | "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" |
71 | 55 | } |
72 | 56 | }, |
73 | 57 | "scopeName": "source.vilniusbasic" |
|
0 commit comments