Support asm template groups

This commit is contained in:
gingerBill
2026-08-17 19:54:21 +01:00
parent 8f2a4346fc
commit c3b2029f64
8 changed files with 235 additions and 2 deletions

View File

@@ -12518,6 +12518,12 @@ gb_internal ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast
o->mode = Addressing_Invalid;
case_end;
case_ast_node(ag, AsmGroup, node);
error(node, "Illegal use of a asm group");
o->mode = Addressing_Invalid;
case_end;
case_ast_node(pl, ProcLit, node);
CheckerContext ctx = *c;
@@ -13039,6 +13045,16 @@ gb_internal gbString write_expr_to_string(gbString str, Ast *node, bool shorthan
str = gb_string_append_rune(str, '}');
case_end;
case_ast_node(pg, AsmGroup, node);
str = gb_string_appendc(str, "asm{");
for_array(i, pg->args) {
if (i > 0) str = gb_string_appendc(str, ", ");
str = write_expr_to_string(str, pg->args[i], shorthand);
}
str = gb_string_append_rune(str, '}');
case_end;
case_ast_node(pl, ProcLit, node);
str = write_expr_to_string(str, pl->type, shorthand);
if (pl->body) {