Skip to content

Commit dc642bb

Browse files
committed
#13 Added XSTS syntax highlight
1 parent c13ef98 commit dc642bb

File tree

4 files changed

+92
-8
lines changed

4 files changed

+92
-8
lines changed

subprojects/oxsts-vs-code/language-configuration.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"surroundingPairs": [
1818
["{", "}"],
1919
["[", "]"],
20-
["(", ")"],
20+
["(", ")"]
2121
],
2222
"folding": {
2323
"markers": {
@@ -30,4 +30,4 @@
3030
"increaseIndentPattern": "^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$",
3131
"decreaseIndentPattern": "^((?!.*?\\/\\*).*\\*/)?\\s*[\\)\\}\\]].*$"
3232
}
33-
}
33+
}

subprojects/oxsts-vs-code/package.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,30 @@
1212
"activationEvents": [],
1313
"main": "./dist/extension.js",
1414
"contributes": {
15-
"commands": [
16-
{
17-
"command": "semantifyr.helloWorld",
18-
"title": "Hello World"
19-
}
20-
],
2115
"languages": [
2216
{
2317
"id": "oxsts",
2418
"extensions": [".oxsts"],
2519
"aliases": ["OXSTS"],
2620
"configuration": "./language-configuration.json"
21+
},
22+
{
23+
"id": "xsts",
24+
"extensions": [".xsts"],
25+
"aliases": ["XSTS"],
26+
"configuration": "./language-configuration.json"
2727
}
2828
],
2929
"grammars": [
3030
{
3131
"language": "oxsts",
3232
"scopeName": "source.oxsts",
3333
"path": "./syntaxes/oxsts.tmLanguage.json"
34+
},
35+
{
36+
"language": "xsts",
37+
"scopeName": "source.xsts",
38+
"path": "./syntaxes/xsts.tmLanguage.json"
3439
}
3540
]
3641
},
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"scopeName": "source.xsts",
3+
"name": "xsts",
4+
"patterns": [
5+
{
6+
"include": "#keywords"
7+
},
8+
{
9+
"include": "#operators"
10+
},
11+
{
12+
"include": "#types"
13+
},
14+
{
15+
"include": "#literals"
16+
},
17+
{
18+
"include": "#comments"
19+
}
20+
],
21+
"repository": {
22+
"keywords": {
23+
"patterns": [
24+
{
25+
"name": "keyword.control.xsts",
26+
"match": "\\b(or|enum|ctrl|assume|var|type|init|havoc|trans|choice|if|else|prop|env)\\b"
27+
}
28+
]
29+
},
30+
"operators": {
31+
"patterns": [
32+
{
33+
"name": "keyword.operator.xsts",
34+
"match": "(==|!=|<=|>=|<|>|\\+|-|&&|\\|\\|)"
35+
},
36+
{
37+
"name": "keyword.operator.assignment.xsts",
38+
"match": ":="
39+
}
40+
]
41+
},
42+
"types": {
43+
"patterns": [
44+
{
45+
"name": "storage.type.xsts",
46+
"match": "\\b(Integer|Boolean|Self|Nothing)\\b"
47+
}
48+
]
49+
},
50+
"literals": {
51+
"patterns": [
52+
{
53+
"name": "constant.numeric.xsts",
54+
"match": "\\b\\d+\\b"
55+
},
56+
{
57+
"name": "constant.language.boolean.xsts",
58+
"match": "\\b(true|false)\\b"
59+
}
60+
]
61+
},
62+
"comments": {
63+
"patterns": [
64+
{
65+
"name": "comment.block.xsts",
66+
"begin": "/\\*",
67+
"end": "\\*/"
68+
},
69+
{
70+
"name": "comment.line.double-slash.xsts",
71+
"match": "//.*$"
72+
}
73+
]
74+
}
75+
}
76+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2023-2024 The Semantifyr Authors
2+
3+
SPDX-License-Identifier: EPL-2.0

0 commit comments

Comments
 (0)