AST struct call

This commit is contained in:
2026-04-23 19:10:52 +02:00
parent 488b985992
commit 5855a6cb5b
3 changed files with 10 additions and 1 deletions
+8
View File
@@ -271,6 +271,14 @@ impl GoCodegen {
.join(", ");
format!("{}({})", result, args_str)
}
Postfix::StructCall(fields) => {
let args_str = fields
.iter()
.map(|(a, b)| format!("{a}: {}", self.generate_expression(b)))
.collect::<Vec<_>>()
.join(", ");
format!("{}{{{}}}", result, args_str)
}
Postfix::Index(idx) => format!("{}[{}]", result, self.generate_expression(idx)),
Postfix::Binary(op, rhs) => {
let op_str = match op {