From 6677b45f07d0f84d53c521bcdd265db53734e2fe Mon Sep 17 00:00:00 2001 From: Alaina <68250402+alaidriel@users.noreply.github.com> Date: Wed, 28 Feb 2024 20:44:50 -0600 Subject: [PATCH] Highlight more language elements --- extensions/vscode/spec/grammar.tmLanguage.json | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/extensions/vscode/spec/grammar.tmLanguage.json b/extensions/vscode/spec/grammar.tmLanguage.json index c5f5821..1c7687b 100644 --- a/extensions/vscode/spec/grammar.tmLanguage.json +++ b/extensions/vscode/spec/grammar.tmLanguage.json @@ -1,4 +1,5 @@ { + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", "scopeName": "source.kyanite", "patterns": [{ "include": "#expression" }], "repository": { @@ -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" } ] @@ -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": "[\\+\\-\\/\\*]" @@ -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": {