@@ -218,6 +218,18 @@ module.exports = grammar({
218
218
asm_arrangement_rets : ( $ ) =>
219
219
seq ( "->" , repeat1 ( alias ( $ . _decimal_integer , $ . integer ) ) ) ,
220
220
221
+ // NOTE:
222
+ // The following asm-related pieces intentionally differ from the grammar.gg.
223
+ // This is done to provide a better API for the language server.
224
+ //
225
+ // There's no catch because there's no well-defined Tact assembly syntax
226
+ // that we've agreed upon — the current parser in the compiler
227
+ // simply produces a large string to be passed as-is to the rest of the pipeline.
228
+ //
229
+ // Therefore, most of the things below would be internally refactored and/or removed completely once there's a proper definition of the Tact assembly.
230
+ // (That does NOT require Fift removal, a first step might be just
231
+ // converting our syntax to bits of the Fift syntax seen below)
232
+ //
221
233
asm_function_body : ( $ ) => seq ( "{" , repeat ( $ . asm_expression ) , "}" ) ,
222
234
223
235
// Zero or more arguments, followed by a TVM instruction
@@ -379,7 +391,7 @@ module.exports = grammar({
379
391
field ( "body" , alias ( $ . struct_body , $ . message_body ) ) ,
380
392
) ,
381
393
382
- message_value : ( $ ) => seq ( "(" , $ . integer , ")" ) ,
394
+ message_value : ( $ ) => seq ( "(" , $ . _expression , ")" ) ,
383
395
384
396
struct_body : ( $ ) => seq ( "{" , semicolonSepWithTrailing ( $ . field ) , "}" ) ,
385
397
@@ -602,7 +614,20 @@ module.exports = grammar({
602
614
field ( "left" , $ . _path_expression ) ,
603
615
field (
604
616
"operator" ,
605
- choice ( "+=" , "-=" , "*=" , "/=" , "%=" , "&=" , "|=" , "^=" ) ,
617
+ choice (
618
+ "+=" ,
619
+ "-=" ,
620
+ "*=" ,
621
+ "/=" ,
622
+ "%=" ,
623
+ "&=" ,
624
+ "|=" ,
625
+ "^=" ,
626
+ "||=" ,
627
+ "&&=" ,
628
+ ">>=" ,
629
+ "<<=" ,
630
+ ) ,
606
631
) ,
607
632
field ( "right" , $ . _expression ) ,
608
633
) ,
0 commit comments