about summary refs log tree commit diff
path: root/cmd
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2025-02-17 14:31:43 +0100
committerAlexey Yerin <yyp@disroot.org>2025-02-17 17:03:26 +0300
commita53329a66b255684a92374c417f5612988293e1b (patch)
tree54c7f00db09478b4818f4155b2d1e97a6d49f333 /cmd
parente5d712e6185dd807728de5e8887042e2b8ea8fd0 (diff)
all: updates for nomem upstream
Diffstat (limited to 'cmd')
-rw-r--r--cmd/hare-gi/context.ha8
-rw-r--r--cmd/hare-gi/emit.ha26
-rw-r--r--cmd/hare-gi/ident.ha6
-rw-r--r--cmd/hare-gi/main.ha2
-rw-r--r--cmd/hare-gi/populate.ha4
5 files changed, 23 insertions, 23 deletions
diff --git a/cmd/hare-gi/context.ha b/cmd/hare-gi/context.ha
index a1b4edf..672129f 100644
--- a/cmd/hare-gi/context.ha
+++ b/cmd/hare-gi/context.ha
@@ -81,8 +81,8 @@ fn add_repository(ctx: *context, repo: gir::repository) void = {
 			...
 		};
 		*(&new: *gir::namespace) = repo.namespaces[i];
-		append(new.includes, repo.includes...);
-		append(ctx.namespaces, new);
+		append(new.includes, repo.includes...)!;
+		append(ctx.namespaces, new)!;
 	};
 };
 
@@ -111,7 +111,7 @@ fn add_import(ns: *namespace, module: ident) void = {
 			return;
 		};
 	};
-	append(ns.imports, strings::dupall(module));
+	append(ns.imports, strings::dupall(module)!)!;
 };
 
 fn lookup_type(ctx: *context, name: str) ((*namespace, str, object_type) | void) = {
@@ -137,7 +137,7 @@ fn lookup_type_in_namespace(ns: *namespace, name: str) ((str, object_type) | voi
 };
 
 fn push(ctx: *context, name: str) void = {
-	append(ctx.stack, name);
+	append(ctx.stack, name)!;
 };
 fn pop(ctx: *context) void = {
 	assert(len(ctx.stack) > 0);
diff --git a/cmd/hare-gi/emit.ha b/cmd/hare-gi/emit.ha
index 3e3f0c4..bec5b4a 100644
--- a/cmd/hare-gi/emit.ha
+++ b/cmd/hare-gi/emit.ha
@@ -81,7 +81,7 @@ fn emit_alias(ctx: *context, alias: *gir::alias) (void | io::error) = {
 	if (is_exported(ctx, alias.c_type)) {
 		return;
 	};
-	append(ctx.current.exports, alias.c_type);
+	append(ctx.current.exports, alias.c_type)!;
 
 	emit_doc(ctx, alias)?;
 	fmt::fprintf(ctx.current.output, "export type {} = ",
@@ -94,7 +94,7 @@ fn emit_class(ctx: *context, class: *gir::class) (void | io::error) = {
 	if (is_exported(ctx, class.c_type)) {
 		return;
 	};
-	append(ctx.current.exports, class.c_type);
+	append(ctx.current.exports, class.c_type)!;
 
 	emit_doc(ctx, class)?;
 	fmt::fprintf(ctx.current.output, "export type {} = ",
@@ -139,7 +139,7 @@ fn emit_interface(ctx: *context, iface: *gir::interface) (void | io::error) = {
 	if (is_exported(ctx, iface.c_type)) {
 		return;
 	};
-	append(ctx.current.exports, iface.c_type);
+	append(ctx.current.exports, iface.c_type)!;
 
 	emit_doc(ctx, iface)?;
 	fmt::fprintf(ctx.current.output, "export type {} = ",
@@ -184,7 +184,7 @@ fn emit_union(ctx: *context, union_: *gir::union_) (void | io::error) = {
 	if (is_exported(ctx, union_.c_type)) {
 		return;
 	};
-	append(ctx.current.exports, union_.c_type);
+	append(ctx.current.exports, union_.c_type)!;
 
 	emit_doc(ctx, union_)?;
 	fmt::fprintf(ctx.current.output, "export type {} = ",
@@ -216,7 +216,7 @@ fn emit_record(ctx: *context, record: *gir::record) (void | io::error) = {
 	if (is_exported(ctx, record.c_type)) {
 		return;
 	};
-	append(ctx.current.exports, record.c_type);
+	append(ctx.current.exports, record.c_type)!;
 
 	emit_doc(ctx, record)?;
 	fmt::fprintf(ctx.current.output, "export type {} = ",
@@ -251,7 +251,7 @@ fn emit_enumeration(
 	if (is_exported(ctx, enumeration.c_type)) {
 		return;
 	};
-	append(ctx.current.exports, enumeration.c_type);
+	append(ctx.current.exports, enumeration.c_type)!;
 
 	emit_doc(ctx, enumeration)?;
 	fmt::fprintfln(ctx.current.output, "export type {} = enum uint {{",
@@ -272,7 +272,7 @@ fn emit_bitfield(ctx: *context, bitfield: *gir::bitfield) (void | io::error) = {
 	if (is_exported(ctx, bitfield.c_type)) {
 		return;
 	};
-	append(ctx.current.exports, bitfield.c_type);
+	append(ctx.current.exports, bitfield.c_type)!;
 
 	emit_doc(ctx, bitfield)?;
 	fmt::fprintfln(ctx.current.output, "export type {} = enum uint {{",
@@ -299,7 +299,7 @@ fn emit_callback(ctx: *context, callback: *gir::callback) (void | io::error) = {
 	if (is_exported(ctx, callback.c_type)) {
 		return;
 	};
-	append(ctx.current.exports, callback.c_type);
+	append(ctx.current.exports, callback.c_type)!;
 
 	emit_doc(ctx, callback)?;
 	fmt::fprintf(ctx.current.output, "export type {} = *fn(",
@@ -329,7 +329,7 @@ fn emit_constructor(
 	if (is_exported(ctx, constructor.c_identifier)) {
 		return;
 	};
-	append(ctx.current.exports, constructor.c_identifier);
+	append(ctx.current.exports, constructor.c_identifier)!;
 
 	emit_doc(ctx, constructor)?;
 	fmt::fprintf(ctx.current.output, `export @symbol("{}") fn `,
@@ -353,7 +353,7 @@ fn emit_method(ctx: *context, method: *gir::method) (void | io::error) = {
 	if (is_exported(ctx, method.c_identifier)) {
 		return;
 	};
-	append(ctx.current.exports, method.c_identifier);
+	append(ctx.current.exports, method.c_identifier)!;
 
 	emit_doc(ctx, method)?;
 	fmt::fprintf(ctx.current.output, `export @symbol("{}") fn `,
@@ -378,7 +378,7 @@ fn emit_function(ctx: *context, function: *gir::function) (void | io::error) = {
 	if (is_exported(ctx, function.c_identifier)) {
 		return;
 	};
-	append(ctx.current.exports, function.c_identifier);
+	append(ctx.current.exports, function.c_identifier)!;
 
 	emit_doc(ctx, function)?;
 	fmt::fprintf(ctx.current.output, `export @symbol("{}") fn `,
@@ -419,7 +419,7 @@ fn emit_signal(ctx: *context, signal: *gir::signal) (void | io::error) = {
 	const function = strings::concat(
 		"connect_",
 		normalize_signal(signal.name),
-	);
+	)!;
 	defer free(function);
 
 	fmt::fprintf(ctx.current.output, "export fn ")?;
@@ -500,7 +500,7 @@ fn emit_function_name(ctx: *context, name: str) (void | io::error) = {
 		return;
 	};
 
-	const path = strings::concat(ctx.stack...);
+	const path = strings::concat(ctx.stack...)!;
 	defer free(path);
 	const lower = swap_case(path);
 	defer free(lower);
diff --git a/cmd/hare-gi/ident.ha b/cmd/hare-gi/ident.ha
index 65571f4..1305192 100644
--- a/cmd/hare-gi/ident.ha
+++ b/cmd/hare-gi/ident.ha
@@ -74,7 +74,7 @@ fn swap_case(in: str) str = {
 		if (ascii::isupper(r) && !ascii::isupper(prev)) {
 			if (len(memio::string(&buf)!) > 0) {
 				append(parts,
-					strings::dup(memio::string(&buf)!));
+					strings::dup(memio::string(&buf)!)!)!;
 				memio::reset(&buf);
 			};
 		};
@@ -83,10 +83,10 @@ fn swap_case(in: str) str = {
 	};
 
 	if (len(memio::string(&buf)!) > 0) {
-		append(parts, strings::dup(memio::string(&buf)!));
+		append(parts, strings::dup(memio::string(&buf)!)!)!;
 	};
 
-	return strings::join("_", parts...);
+	return strings::join("_", parts...)!;
 };
 
 @test fn swap_case() void = {
diff --git a/cmd/hare-gi/main.ha b/cmd/hare-gi/main.ha
index e0afc98..ec4cfe9 100644
--- a/cmd/hare-gi/main.ha
+++ b/cmd/hare-gi/main.ha
@@ -74,7 +74,7 @@ export fn main() void = {
 			case null =>
 				fmt::fatalf("No such namespace '{}'", ns);
 			};
-			ns.module = strings::split(module, "::");
+			ns.module = strings::split(module, "::")!;
 			if (len(output) > 0) {
 				match (os::create(output, fs::mode::USER_RW)) {
 				case let f: io::file =>
diff --git a/cmd/hare-gi/populate.ha b/cmd/hare-gi/populate.ha
index b84d86d..542af78 100644
--- a/cmd/hare-gi/populate.ha
+++ b/cmd/hare-gi/populate.ha
@@ -66,6 +66,6 @@ fn populate_type(ctx: *context, c: str, name: str, objtype: object_type) void =
 	if (len(c) == 0) {
 		return;
 	};
-	const hare = strings::dup(fix_identifier(name));
-	append(ctx.current.types, (c, hare, objtype));
+	const hare = strings::dup(fix_identifier(name))!;
+	append(ctx.current.types, (c, hare, objtype))!;
 };