mirror of
https://github.com/Noratrieb/riverdelta.git
synced 2026-01-15 00:45:04 +01:00
struct literals
This commit is contained in:
parent
b52abed441
commit
39a995b765
6 changed files with 149 additions and 17 deletions
|
|
@ -126,6 +126,11 @@ function printExpr(expr: Expr, indent: number): string {
|
|||
indent + 1
|
||||
)}${elsePart}`;
|
||||
}
|
||||
case "structLiteral": {
|
||||
return `${printIdent(expr.name)} { ${expr.fields
|
||||
.map(([name, expr]) => `${name.name}: ${printExpr(expr, indent + 1)}`)
|
||||
.join(", ")} }`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue