hare

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

commit 750f72667d9c1e436db2ce87290a0ee7292764c4
parent 0018d3879dc237609aa3bd92ae7984f67e0282da
Author: Sebastian <sebastian@sebsite.pw>
Date:   Thu, 24 Feb 2022 20:47:40 -0500

haredoc: improve -Ftty syntax highlighting

All types are now highlighted the same color, as opposed to only
highlighting the builtin types. This makes highlighting more consistent
and doesn't give the builtin types any unnecessary importance when it's
not warranted.

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

Diffstat:
Mcmd/haredoc/tty.ha | 8+++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/cmd/haredoc/tty.ha b/cmd/haredoc/tty.ha @@ -258,19 +258,17 @@ fn type_tty( n += fmt::fprint(out, "\x1b[36m" "const " "\x1b[0m")?; }; if (t.flags & ast::type_flags::ERROR != 0) { - if (t.repr is ast::builtin_type) { - n += fmt::fprint(out, "\x1b[36m" "!" "\x1b[0m")?; - } else { - n += fmt::fprint(out, "!")?; - }; + n += fmt::fprint(out, "!")?; }; match (t.repr) { case let a: ast::alias_type => + n += fmt::fprint(out, "\x1b[36m")?; if (a.unwrap) { n += fmt::fprint(out, "...")?; }; n += unparse::ident(out, a.ident)?; + n += fmt::fprint(out, "\x1b[0m")?; case let b: ast::builtin_type => n += fmt::fprintf(out, "\x1b[36m" "{}" "\x1b[0m", builtin_type(b))?;