about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2025-02-21 11:41:27 +0100
committerAlexey Yerin <yyp@disroot.org>2025-02-22 22:33:51 +0300
commit27daf656c320c96f0b57f3e3404f2ac94cd85216 (patch)
treeb09f1458535e994926f7a55ae4d3919d96d377a6
parenta53329a66b255684a92374c417f5612988293e1b (diff)
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 <sir@cmpwn.com>
-rw-r--r--cmd/hare-gi/main.ha3
1 files changed, 2 insertions, 1 deletions
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 =>