hare

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

commit 2372a5a82364596a8b3ca8bffebfb41be9b983e7
parent be54eea9c21f24b37a5fd2385eb6eda927c571cf
Author: Alexey Yerin <yyp@disroot.org>
Date:   Sun, 28 Nov 2021 14:41:21 +0300

cmd/haredoc: tty: fix enum unparsing

This was causing an enum with default type to be displayed as:

    type foobar = enum  {
         // two spaces ^
    };

Signed-off-by: Alexey Yerin <yyp@disroot.org>

Diffstat:
Mcmd/haredoc/tty.ha | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmd/haredoc/tty.ha b/cmd/haredoc/tty.ha @@ -274,10 +274,10 @@ fn type_tty( n += fmt::fprint(out, "\x1b[36m" "enum " "\x1b[0m")?; if (e.storage != ast::builtin_type::INT) { n += fmt::fprintf(out, - "\x1b[36m" "{}" "\x1b[0m", + "\x1b[36m" "{} " "\x1b[0m", builtin_type(e.storage))?; }; - n += fmt::fprint(out, " {")?; + n += fmt::fprint(out, "{")?; indent += 1; for (let i = 0z; i < len(e.values); i += 1) { n += newline(out, indent)?;