Skip to content

Commit a694530

Browse files
authored
fix: differentiate between message keyword and message function (#41)
1 parent c7c5aeb commit a694530

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

package/Tact.tmLanguage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@
829829
</dict>
830830
<dict>
831831
<key>match</key>
832-
<string>(?&lt;!\.)\b(message)\b</string>
832+
<string>(?&lt;!\.)\b(message(?!\s*\((?:MessageParameters|\))))\b</string>
833833
<key>name</key>
834834
<string>keyword.other.message.tact</string>
835835
</dict>

package/Tact.tmLanguage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@
542542
"name": "keyword.other.struct.tact"
543543
},
544544
{
545-
"match": "(?<!\\.)\\b(message)\\b",
545+
"match": "(?<!\\.)\\b(message(?!\\s*\\((?:MessageParameters|\\))))\\b",
546546
"name": "keyword.other.message.tact"
547547
},
548548
{

tests/syntax_test_primary_expression.tact

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,21 @@ extends fun c(self: Int, ) {
4040
// <- entity.name.function.tact
4141
now ();
4242
// <- entity.name.function.tact
43+
message(MessageParameters{to: sender(), value: 0});
44+
// <- entity.name.function.tact
45+
// ^^^^^^^^^^^^^^^^^ entity.name.type.tact
46+
// ^ punctuation.brackets.curly.tact
47+
// ^^ variable.other.tact
48+
// ^ punctuation.colon.tact
49+
// ^^^^^^ entity.name.function.tact
50+
// ^^ punctuation.brackets.round.tact
51+
// ^ punctuation.comma.tact
52+
// ^^^^^ variable.other.tact
53+
// ^ punctuation.colon.tact
54+
// ^ constant.numeric.decimal.tact
55+
// ^ punctuation.brackets.curly.tact
56+
// ^ punctuation.brackets.round.tact
57+
// ^ punctuation.semi.tact
4358

4459
// parens_expression
4560
( 10 );

0 commit comments

Comments
 (0)