diff --git a/grammars/grammar-tact.json b/grammars/grammar-tact.json index f77248c2..97a7e653 100644 --- a/grammars/grammar-tact.json +++ b/grammars/grammar-tact.json @@ -18,11 +18,14 @@ "include": "#literal" }, { - "include": "#type" + "include": "#invalid" }, { "include": "#constant" }, + { + "include": "#type" + }, { "include": "#expression" }, @@ -234,6 +237,53 @@ } }, + "invalid": { + "patterns": [ + { + "comment": "Anything starting with __gen or __tact", + "match": "\\b__(?:gen|tact)[a-zA-Z0-9_]*\\b", + "name": "invalid.illegal.identifier.tact" + } + ] + }, + + "constant": { + "patterns": [ + { + "comment": "self.storageReserve", + "match": "(?<=self\\.)(storageReserve)\\b", + "name": "constant.other.builtin.tact" + }, + { + "comment": "Other constants from the core library", + "match": "(?