commit 521e3767ff942d9c2e341a58131a03d979bda149
parent dea8dc7c441cd67ceb42ef74ac8b82fc452445a2
Author: Alexey Yerin <yyp@disroot.org>
Date: Fri, 27 Aug 2021 22:18:54 +0300
cmd/haredoc/html: move alias types into type_html
Prevents adding double '!'s on such error types.
Signed-off-by: Alexey Yerin <yyp@disroot.org>
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/cmd/haredoc/html.ha b/cmd/haredoc/html.ha
@@ -553,6 +553,12 @@ fn type_html(
};
match (_type.repr) {
+ a: ast::alias_type => {
+ if (a.unwrap) {
+ z += fmt::fprint(out, "...")?;
+ };
+ z += unparse::ident(out, a.ident)?;
+ },
t: ast::builtin_type => {
z += fmt::fprintf(out, "<span class='type'>{}</span>",
builtin_type(t))?;
@@ -626,7 +632,6 @@ fn type_html(
},
t: ast::struct_type => z += struct_union_html(out, indent, _type, brief)?,
t: ast::union_type => z += struct_union_html(out, indent, _type, brief)?,
- * => z += html_escape(out, strio::string(buf))?,
};
z;