Skip to content

Commit

Permalink
#13 Added XSTS syntax highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
arminzavada committed Oct 5, 2024
1 parent c13ef98 commit dc642bb
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 8 deletions.
4 changes: 2 additions & 2 deletions subprojects/oxsts-vs-code/language-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["(", ")"]
],
"folding": {
"markers": {
Expand All @@ -30,4 +30,4 @@
"increaseIndentPattern": "^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$",
"decreaseIndentPattern": "^((?!.*?\\/\\*).*\\*/)?\\s*[\\)\\}\\]].*$"
}
}
}
17 changes: 11 additions & 6 deletions subprojects/oxsts-vs-code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,30 @@
"activationEvents": [],
"main": "./dist/extension.js",
"contributes": {
"commands": [
{
"command": "semantifyr.helloWorld",
"title": "Hello World"
}
],
"languages": [
{
"id": "oxsts",
"extensions": [".oxsts"],
"aliases": ["OXSTS"],
"configuration": "./language-configuration.json"
},
{
"id": "xsts",
"extensions": [".xsts"],
"aliases": ["XSTS"],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "oxsts",
"scopeName": "source.oxsts",
"path": "./syntaxes/oxsts.tmLanguage.json"
},
{
"language": "xsts",
"scopeName": "source.xsts",
"path": "./syntaxes/xsts.tmLanguage.json"
}
]
},
Expand Down
76 changes: 76 additions & 0 deletions subprojects/oxsts-vs-code/syntaxes/xsts.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"scopeName": "source.xsts",
"name": "xsts",
"patterns": [
{
"include": "#keywords"
},
{
"include": "#operators"
},
{
"include": "#types"
},
{
"include": "#literals"
},
{
"include": "#comments"
}
],
"repository": {
"keywords": {
"patterns": [
{
"name": "keyword.control.xsts",
"match": "\\b(or|enum|ctrl|assume|var|type|init|havoc|trans|choice|if|else|prop|env)\\b"
}
]
},
"operators": {
"patterns": [
{
"name": "keyword.operator.xsts",
"match": "(==|!=|<=|>=|<|>|\\+|-|&&|\\|\\|)"
},
{
"name": "keyword.operator.assignment.xsts",
"match": ":="
}
]
},
"types": {
"patterns": [
{
"name": "storage.type.xsts",
"match": "\\b(Integer|Boolean|Self|Nothing)\\b"
}
]
},
"literals": {
"patterns": [
{
"name": "constant.numeric.xsts",
"match": "\\b\\d+\\b"
},
{
"name": "constant.language.boolean.xsts",
"match": "\\b(true|false)\\b"
}
]
},
"comments": {
"patterns": [
{
"name": "comment.block.xsts",
"begin": "/\\*",
"end": "\\*/"
},
{
"name": "comment.line.double-slash.xsts",
"match": "//.*$"
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023-2024 The Semantifyr Authors

SPDX-License-Identifier: EPL-2.0

0 comments on commit dc642bb

Please sign in to comment.