hare

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

commit 6656a5b9fc3a0e7dab53816c5be91da890f14569
parent 0193a81d039770c7909c274d75471ac815cb8007
Author: Stacy Harper <contact@stacyharper.net>
Date:   Mon,  2 Jan 2023 19:34:29 +0100

Add @packed to haredoc

Signed-off-by: Stacy Harper <contact@stacyharper.net>

Diffstat:
Mcmd/haredoc/html.ha | 6+++++-
Mcmd/haredoc/tty.ha | 4++++
2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/cmd/haredoc/html.ha b/cmd/haredoc/html.ha @@ -558,7 +558,11 @@ fn struct_union_html( let z = 0z; let members = match (t.repr) { case let t: ast::struct_type => - z += fmt::fprint(out, "<span class='keyword'>struct</span> {")?; + z += fmt::fprint(out, "<span class='keyword'>struct</span>")?; + if (t.packed) { + z += fmt::fprint(out, " @packed")?; + }; + z += fmt::fprint(out, " {")?; yield t.members: []ast::struct_member; case let t: ast::union_type => z += fmt::fprint(out, "<span class='keyword'>union</span> {")?; diff --git a/cmd/haredoc/tty.ha b/cmd/haredoc/tty.ha @@ -359,6 +359,10 @@ fn struct_union_type_tty( case let st: ast::struct_type => n += render(out, syn::TYPE)?; n += fmt::fprint(out, "struct")?; + if (st.packed) { + n += render(out, syn::ATTRIBUTE)?; + n += fmt::fprint(out, " @packed")?; + }; n += render(out, syn::PUNCTUATION)?; n += fmt::fprint(out, " {")?; yield st.members: []ast::struct_member;