hare

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

commit ef5a7b6543faa88802c3f3206e6c4601ce59ca86
parent 0bf26c68a25a31cc5e5f3d84167645ebf3a73ccc
Author: Drew DeVault <sir@cmpwn.com>
Date:   Thu,  4 Feb 2021 18:00:23 -0500

rt::start+test: style

Diffstat:
Mrt/+test/start.ha | 27+++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/rt/+test/start.ha b/rt/+test/start.ha @@ -1,25 +1,15 @@ -const @symbol("__init_array_start") init_start: [*]*fn() void; -const @symbol("__init_array_end") init_end: [*]*fn() void; -const @symbol("__fini_array_start") fini_start: [*]*fn() void; -const @symbol("__fini_array_end") fini_end: [*]*fn() void; - type test = struct { name: str, func: *fn() void, }; +const @symbol("__init_array_start") init_start: [*]*fn() void; +const @symbol("__init_array_end") init_end: [*]*fn() void; +const @symbol("__fini_array_start") fini_start: [*]*fn() void; +const @symbol("__fini_array_end") fini_end: [*]*fn() void; const @symbol("__test_array_start") test_start: [*]test; const @symbol("__test_array_end") test_end: [*]test; -fn print(msg: str) void = write(1, msg: *const char, len(msg)); - -fn dots(n: size) void = { - // XXX: this is slow, I guess - for (let i = 0z; i < n; i += 1z) { - print("."); - }; -}; - let jmp: jmpbuf = jmpbuf { ... }; let reason: str = ""; @@ -75,3 +65,12 @@ export fn start_ha() void = { exit(if (nfail > 0z) 1 else 0); }; + +fn print(msg: str) void = write(1, msg: *const char, len(msg)); + +fn dots(n: size) void = { + // XXX: this is slow, I guess + for (let i = 0z; i < n; i += 1z) { + print("."); + }; +};