From 27daf656c320c96f0b57f3e3404f2ac94cd85216 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 21 Feb 2025 11:41:27 +0100 Subject: cmd/hare-gi: use parse::identstr to parse namespace This fixes a problem when specifying a namespace with multiple levels, e.g. foo::bar, due to the fact that strings::split splits strings on byte-sized delimiters, not multibyte tokens. Signed-off-by: Drew DeVault --- cmd/hare-gi/main.ha | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/hare-gi/main.ha b/cmd/hare-gi/main.ha index ec4cfe9..a02d5b0 100644 --- a/cmd/hare-gi/main.ha +++ b/cmd/hare-gi/main.ha @@ -2,6 +2,7 @@ use fmt; use fs; use getopt; use gir; +use hare::parse; use io; use os; use strings; @@ -74,7 +75,7 @@ export fn main() void = { case null => fmt::fatalf("No such namespace '{}'", ns); }; - ns.module = strings::split(module, "::")!; + ns.module = parse::identstr(module)!; if (len(output) > 0) { match (os::create(output, fs::mode::USER_RW)) { case let f: io::file => -- cgit 1.3.0-6-gf8a5