Skip to content

Commit

Permalink
Refactor definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
xsebek committed Jun 3, 2024
1 parent af53fcf commit 3a6f6fb
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions editors/vscode/syntaxes/swarm.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
{ "include": "#keyword" },
{ "include": "#require" },
{ "include": "#operator" },
{ "include": "#lambda" }
{ "include": "#lambda" },
{ "include": "#in" },
{ "include": "#end" }
],
"repository": {
"keyword": {
Expand All @@ -37,7 +39,9 @@
"operator": {
"name": "keyword.operator",
"match": "-|==|!=|<|>|<=|>=|\\|\\||&&|\\+|-|\\*|/(?![/|*])|\\^|\\+\\+|\\$"
}
},
"in": { "name": "keyword.control.dictionary.let.in", "match": "\\b(in)\\b" },
"end": { "name": "keyword.control.dictionary.def.end", "match": "\\b(end)\\b" }
}
},
"parens": {
Expand Down Expand Up @@ -78,7 +82,12 @@
"constants": { "patterns": [{ "name": "constant.numeric", "match": "([0-9]+|0b[01]+|0o[0-8]+|0x\\x+)" }] },
"definitions": {
"patterns": [
{
{ "include": "#tydef" },
{ "include": "#def" },
{ "include": "#let" }
],
"repository": {
"tydef": {
"name": "keyword.control.dictionary.tydef",
"match": "\\b(tydef)\\s+([^=]+)\\s*=((\\s*([A-Z][a-z]*|\\(|\\)|\\{|\\}|(\\*|\\+|->)|[a-z]\\w*|forall ([a-z]\\w*\\s*)+.)\\s*)+)\\s*(end)\\b",
"captures": {
Expand All @@ -88,19 +97,17 @@
"8": { "name": "keyword.control.dictionary.tydef.end" }
}
},
{
"def": {
"name": "keyword.control.dictionary.def",
"match": "\\bdef\\s+(\\w+)\\s*(:((\\s*([A-Z][a-zA-Z]*|\\(|\\)|\\{|\\}|(\\*|\\+|->)|[a-z]\\w*|forall ([a-z]\\w*\\s*)+.)\\s*)+))?=",
"captures": { "1": { "name": "entity.name.function" }, "3": { "name": "entity.name.type" } }
},
{
"let": {
"name": "keyword.control.dictionary.let",
"match": "\\blet\\s+(\\w+)\\s*(:((\\s*([A-Z][a-zA-Z]*|\\(|\\)|\\{|\\}|(\\*|\\+|->)|[a-z]\\w*|forall ([a-z]\\w*\\s*)+.)\\s*)+))?=",
"captures": { "1": { "name": "entity.name.function" }, "3": { "name": "entity.name.type" } }
},
{ "name": "keyword.control.dictionary.let.in", "match": "\\b(in)\\b" },
{ "name": "keyword.control.dictionary.def.end", "match": "\\b(end)\\b" }
]
}
}
},
"variables": {
"patterns": [
Expand Down

0 comments on commit 3a6f6fb

Please sign in to comment.