hare

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

commit 9b813f2dc2c3b39d870395661b9be633e5e3e15b
parent 01e17009058ae55aa0e7fbb4469fa50e11c409d9
Author: citrons <citrons@mondecitronne.com>
Date:   Thu,  7 Mar 2024 15:32:37 -0600

hare::module::find(): provide more error context

% echo "use bar;" > foo.ha
% ln -s /does/not/exist/ bar
% hare build foo.ha # before
Error: /path/to/foo.ha: File or directory not found
% hare build foo.ha # after
Error: /path/to/foo.ha: /path/to/bar: File or directory not found
%

Signed-off-by: Raven Randall <citrons@mondecitronne.com>

Diffstat:
Mhare/module/srcs.ha | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hare/module/srcs.ha b/hare/module/srcs.ha @@ -82,7 +82,7 @@ export fn find(ctx: *context, loc: location) ((str, srcset) | error) = { return (path::string(&buf), s); case not_found => void; case let e: error => - return e; + return attach(strings::dup(path::string(&buf)), e); }; }; return attach(locstr(mod), not_found);