hare

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

commit 11adbdad89732418fa559fd643bba50f9340a801
parent 343fc33965c0b9be8b3ed34e998c630eb683243f
Author: Armin Preiml <apreiml@strohwolke.at>
Date:   Tue,  3 Oct 2023 12:14:58 +0200

time::date: move def to global scope

A function local def breaks haredoc.

Diffstat:
Mtime/date/error.ha | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/time/date/error.ha b/time/date/error.ha @@ -6,6 +6,8 @@ use fmt; // All possible errors returned from [[date]]. export type error = !(insufficient | invalid | parsefail); +def FMTMSG = "Invalid date format for specifier '{}'"; + // Converts an [[error]] into a human-friendly string. The result may be // statically allocated. export fn strerror(err: error) const str = { @@ -18,7 +20,6 @@ export fn strerror(err: error) const str = { if (rn == '\0') { return "Date parsing error"; }; - def FMTMSG = "Invalid date format for specifier '{}'"; static let buf: [len(FMTMSG) + 2]u8 = [0...]; return fmt::bsprintf(buf, FMTMSG, rn); };