hare

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

commit 825cd293af2d1b60e32f2fc7a2426d668eb1e030
parent b341269c9aeb2e86f6be8c4eccba732844f1f6a8
Author: Autumn! <autumnull@posteo.net>
Date:   Wed, 15 Mar 2023 13:59:28 +0000

datetime: populate time in finish(*builder)

Signed-off-by: Autumn! <autumnull@posteo.net>

Diffstat:
Mdatetime/datetime.ha | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/datetime/datetime.ha b/datetime/datetime.ha @@ -239,6 +239,15 @@ export fn finish(f: *builder, m: strategy...) (datetime | insufficient | invalid m = [strategy::ALL]; }; + f.time = 0; + if (f.hour is int) f.time += f.hour as int; + f.time *= 60; + if (f.min is int) f.time += f.min as int; + f.time *= 60; + if (f.sec is int) f.time += f.sec as int; + f.time *= 1000000000; + if (f.nsec is int) f.time += f.nsec as int; + for (let i = 0z; i < len(m); i += 1) { const M = m[i]; if (