Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit 6593326

Browse files
authored
feat: update TextMate grammar for Tact 1.5.0 (#394)
1 parent 6748c43 commit 6593326

File tree

1 file changed

+35
-4
lines changed

1 file changed

+35
-4
lines changed

grammars/grammar-tact.json

+35-4
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
"patterns": [
105105
{
106106
"comment": "FunC identifier",
107-
"match": "((?:[a-zA-Z_\\'\\?!&]|::)(?:[a-zA-Z0-9_\\'\\?!&]|::)*)",
107+
"match": "(.*?)",
108108
"name": "entity.name.function.func.tact"
109109
}
110110
],
@@ -138,9 +138,40 @@
138138
}
139139
}
140140
},
141+
{
142+
"comment": "Asm arrangements",
143+
"begin": "(?<!\\.)(asm)\\s*(\\()",
144+
"beginCaptures": {
145+
"1": {
146+
"name": "entity.other.attribute-name.tact"
147+
},
148+
"2": {
149+
"name": "punctuation.brackets.round.tact"
150+
}
151+
},
152+
"patterns": [
153+
{
154+
"include": "#variable"
155+
},
156+
{
157+
"match": "->",
158+
"name": "keyword.operator.mapsto.tact"
159+
},
160+
{
161+
"match": "\\b([0-9]*)\\b",
162+
"name": "constant.numeric.decimal.tact"
163+
}
164+
],
165+
"end": "\\)",
166+
"endCaptures": {
167+
"0": {
168+
"name": "punctuation.brackets.round.tact"
169+
}
170+
}
171+
},
141172
{
142173
"comment": "Fallback match",
143-
"match": "(?<!\\.)\\b(@name|@interface)\\b",
174+
"match": "(?<!\\.)\\b(@name|@interface|asm)\\b",
144175
"name": "entity.other.attribute-name.tact"
145176
}
146177
]
@@ -256,7 +287,7 @@
256287
},
257288
{
258289
"comment": "Other constants from the core library",
259-
"match": "(?<!\\.)\\b(SendRemainingValue|SendRemainingBalance|SendPayGasSeparately|SendIgnoreErrors|SendBounceIfActionFail|SendDestroyIfZero|ReserveExact|ReserveAllExcept|ReserveAtMost|ReserveAddOriginalBalance|ReserveInvertSign|ReserveBounceIfActionFail)\\b",
290+
"match": "(?<!\\.)\\b(SendRemainingValue|SendRemainingBalance|SendPayGasSeparately|SendIgnoreErrors|SendBounceIfActionFail|SendDestroyIfZero|SendOnlyEstimateFee|ReserveExact|ReserveAllExcept|ReserveAtMost|ReserveAddOriginalBalance|ReserveInvertSign|ReserveBounceIfActionFail)\\b",
260291
"name": "constant.other.builtin.tact"
261292
},
262293
{
@@ -365,7 +396,7 @@
365396
"comment": "Serialization",
366397
"patterns": [
367398
{
368-
"match": "(?<!\\.)\\b(as)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\b",
399+
"match": "(?<!\\.)\\b(as)\\s+(coins|remaining|bytes32|bytes64|int257|u?int(?:2[0-5][0-6]|1[0-9][0-9]|[1-9][0-9]?))\\b",
369400
"captures": {
370401
"1": {
371402
"name": "keyword.other.as.tact storage.modifier.tact"

0 commit comments

Comments
 (0)