From 398f51bae3983dc7907465711de1cc86030ff0cd Mon Sep 17 00:00:00 2001 From: Novus Nota <68142933+novusnota@users.noreply.github.com> Date: Thu, 30 May 2024 19:39:14 +0200 Subject: [PATCH] chore: final enhancements for the Tact's grammar Description of changes: https://github.com/tact-lang/tact-sublime/commit/ffc2d9a73a95c85815acfdd3a221c3d48a51a979 --- grammars/grammar-tact.json | 91 ++++++++++++++++++++++++++------------ 1 file changed, 62 insertions(+), 29 deletions(-) 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": "(?