hare

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

commit 18fab5fae56db8f983ea2c0258549734fbc555ea
parent da60264750d28c7d38959be051691a8025ce4b6f
Author: Alexey Yerin <yyp@disroot.org>
Date:   Fri, 14 Jun 2024 23:16:32 +0300

hare::unparse: Add 'done' literal

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

Diffstat:
Mhare/parse/+test/expr_test.ha | 2+-
Mhare/unparse/expr.ha | 2++
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/hare/parse/+test/expr_test.ha b/hare/parse/+test/expr_test.ha @@ -113,7 +113,7 @@ @test fn constant() void = { roundtrip(`export fn main() void = { - 2 + (-4 + void) * true / ("hello" << '?'); + 2 + (-4 + void) * true % done / ("hello" << '?'); [1, 2, 3, 4]; [1, 2, 3, 4...]; (1, 2, 3); diff --git a/hare/unparse/expr.ha b/hare/unparse/expr.ha @@ -552,6 +552,8 @@ fn literal( case void => abort(); case ast::_null => return syn(ctx, "null", synkind::KEYWORD)?; + case done => + return syn(ctx, "done", synkind::KEYWORD)?; case let b: bool => return syn(ctx, if (b) "true" else "false", synkind::KEYWORD)?;