hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 8af679b0e9ae7f7a91d73bf19975dad50c1d0054
parent d83b1b0e37b73dbf774e677d32eccfaaff78bc5b
Author: Sebastian <sebastian@sebsite.pw>
Date:   Sun, 10 Apr 2022 16:12:59 -0400

unparse: return correct size from struct_constant

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mhare/unparse/expr.ha | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/hare/unparse/expr.ha b/hare/unparse/expr.ha @@ -556,7 +556,7 @@ fn struct_constant( z += fmt::fprint(out, " {")?; indent += 1; for (let i = 0z; i < len(sc.fields); i += 1) { - newline(out, indent)?; + z += newline(out, indent)?; match (sc.fields[i]) { case let sv: ast::struct_value => match (sv._type) { @@ -574,12 +574,12 @@ fn struct_constant( z += fmt::fprint(out, ",")?; }; if (sc.autofill) { - newline(out, indent)?; - fmt::fprint(out, "...")?; + z += newline(out, indent)?; + z += fmt::fprint(out, "...")?; }; indent -= 1; - newline(out, indent)?; - fmt::fprint(out, "}")?; + z += newline(out, indent)?; + z += fmt::fprint(out, "}")?; return z; };