hare

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

commit 6d0c8c52cea98c087c6b944e18d1652508b5bfc8
parent 8ae07061eb4cd68b0ef694da348ed523ae4929a9
Author: Sebastian <sebastian@sebsite.pw>
Date:   Sun, 23 Apr 2023 02:40:59 -0400

driver: handle invalid namespace identifier error

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mcmd/hare/subcmds.ha | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/cmd/hare/subcmds.ha b/cmd/hare/subcmds.ha @@ -111,7 +111,13 @@ fn build(args: []str) void = { case 'l' => append(libs, opt.1); case 'N' => - namespace = parse::identstr(opt.1)!; + namespace = match (parse::identstr(opt.1)) { + case let id: ast::ident => + yield id; + case let err: parse::error => + fmt::fatalf("Error parsing namespace {}: {}", + opt.1, parse::strerror(err)); + }; case 'o' => output = opt.1; case 't' =>