hare

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

commit 8738deceafb75685a16a2ffdaa37ba04a2e668ef
parent c5c2869f3bda94a2b651bee5582106f17561f743
Author: Drew DeVault <sir@cmpwn.com>
Date:   Fri, 13 Aug 2021 11:44:38 +0200

all: fix bindings of zero size in match

See https://todo.sr.ht/~sircmpwn/hare/479

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Mbufio/scanner.ha | 2+-
Mhare/ast/expr.ha | 2+-
Mhare/unparse/expr.ha | 2+-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bufio/scanner.ha b/bufio/scanner.ha @@ -10,7 +10,7 @@ export fn scanbyte(stream: *io::stream) (u8 | io::EOF | io::error) = { return match (io::read(stream, buf)?) { read: size => if (read > 0) buf[0] else io::EOF, - e: io::EOF => e, + io::EOF => io::EOF, }; }; diff --git a/hare/ast/expr.ha b/hare/ast/expr.ha @@ -484,7 +484,7 @@ export fn expr_free(e: (expr | nullable *expr)) void = match (e) { }; free(m.cases); }, - o: offset_expr => abort(), // TODO + offset_expr => abort(), // TODO p: propagate_expr => expr_free(p.expr), r: return_expr => expr_free(r: *expr), s: size_expr => type_free(s: *_type), diff --git a/hare/unparse/expr.ha b/hare/unparse/expr.ha @@ -258,7 +258,7 @@ export fn expr( z += _type(out, indent, *e)?; z + fmt::fprint(out, ")")?; }, - e: ast::offset_expr => abort(), + ast::offset_expr => abort(), e: ast::propagate_expr => { let z = expr(out, indent, *e.expr)?; z + fmt::fprintf(out, if (e.is_abort) "!" else "?")?;