Skip to content

Commit

Permalink
Highlight more language elements
Browse files Browse the repository at this point in the history
  • Loading branch information
cecelot committed Feb 29, 2024
1 parent a6b308b commit 6677b45
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion extensions/vscode/spec/grammar.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"scopeName": "source.kyanite",
"patterns": [{ "include": "#expression" }],
"repository": {
Expand All @@ -9,9 +10,11 @@
{ "include": "#record-impl-decl" },
{ "include": "#strings" },
{ "include": "#numbers" },
{ "include": "#booleans" },
{ "include": "#functions" },
{ "include": "#keyword" },
{ "include": "#operators" },
{ "include": "#builtin-types" },
{ "include": "#paren-expression" },
{ "include": "#comment" }
]
Expand Down Expand Up @@ -45,6 +48,10 @@
"name": "constant.numeric.kyanite",
"match": "\\b[0-9]+\\b(.[0-9]+)?\\b"
},
"booleans": {
"name": "constant.language.boolean.kyanite",
"match": "\\b(true|false)\\b"
},
"operators": {
"name": "keyword.operator.kyanite",
"match": "[\\+\\-\\/\\*]"
Expand All @@ -56,12 +63,16 @@
"1": { "name": "keyword.kyanite" }
}
},
"builtin-types": {
"match": "\\b(int|str|bool)\\b",
"name": "entity.name.type.kyanite"
},
"keyword": {
"match": "\\b(let|const|fun|impl)\\b",
"name": "keyword.kyanite"
},
"control-flow": {
"match": "\\b(if|else|while|for|in)\\b",
"match": "\\b(if|else|while|for|in|return)\\b",
"name": "keyword.control.kyanite"
},
"record-impl-decl": {
Expand Down

0 comments on commit 6677b45

Please sign in to comment.