about summary refs log tree commit diff
path: root/gir
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 /gir
parente5d712e6185dd807728de5e8887042e2b8ea8fd0 (diff)
all: updates for nomem upstream
Diffstat (limited to 'gir')
-rw-r--r--gir/parse.ha64
1 files changed, 32 insertions, 32 deletions
diff --git a/gir/parse.ha b/gir/parse.ha
index a68a7f6..9b7d911 100644
--- a/gir/parse.ha
+++ b/gir/parse.ha
@@ -55,7 +55,7 @@ fn parse_include(parser: *xml::parser, includes: *opaque) (void | error) = {
 		("name", &new.name),
 		("version", &new.version),
 	)?;
-	append(includes, new);
+	append(includes, new)!;
 };
 
 fn parse_namespace(parser: *xml::parser, namespaces: *opaque) (void | error) = {
@@ -85,7 +85,7 @@ fn parse_namespace(parser: *xml::parser, namespaces: *opaque) (void | error) = {
 		("docsection", null, null),
 		("function-macro", null, null),
 	)?;
-	append(namespaces, new);
+	append(namespaces, new)!;
 };
 
 fn parse_alias(parser: *xml::parser, aliases: *opaque) (void | error) = {
@@ -97,7 +97,7 @@ fn parse_alias(parser: *xml::parser, aliases: *opaque) (void | error) = {
 		("c:type", &new.c_type),
 		("type", &parse_simple_type, &new.inner),
 	)?;
-	append(aliases, new);
+	append(aliases, new)!;
 };
 
 fn parse_class(parser: *xml::parser, classes: *opaque) (void | error) = {
@@ -133,7 +133,7 @@ fn parse_class(parser: *xml::parser, classes: *opaque) (void | error) = {
 		("record", &parse_record_entry, &new.entries),
 		("callback", &parse_callback, &new.callbacks),
 	)?;
-	append(classes, new);
+	append(classes, new)!;
 };
 fn parse_implements(parser: *xml::parser, implements: *opaque) (void | error) = {
 	const implements = implements: *[]str;
@@ -141,7 +141,7 @@ fn parse_implements(parser: *xml::parser, implements: *opaque) (void | error) =
 	parse_element(parser, "implements",
 		("name", &name),
 	)?;
-	append(implements, name);
+	append(implements, name)!;
 };
 fn parse_interface(parser: *xml::parser, interfaces: *opaque) (void | error) = {
 	const interfaces = interfaces: *[]interface;
@@ -167,7 +167,7 @@ fn parse_interface(parser: *xml::parser, interfaces: *opaque) (void | error) = {
 		("callback", &parse_callback, &new.callbacks),
 		("constant", &parse_constant, &new.constants),
 	)?;
-	append(interfaces, new);
+	append(interfaces, new)!;
 };
 fn parse_prerequisite(parser: *xml::parser, prerequisites: *opaque) (void | error) = {
 	const prerequisites = prerequisites: *[]str;
@@ -175,7 +175,7 @@ fn parse_prerequisite(parser: *xml::parser, prerequisites: *opaque) (void | erro
 	parse_element(parser, "prerequisite",
 		("name", &name),
 	)?;
-	append(prerequisites, name);
+	append(prerequisites, name)!;
 };
 
 fn parse_record(parser: *xml::parser, records: *opaque) (void | error) = {
@@ -202,7 +202,7 @@ fn parse_record(parser: *xml::parser, records: *opaque) (void | error) = {
 		("method", &parse_method, &new.methods),
 		("constructor", &parse_constructor, &new.constructors),
 	)?;
-	append(records, new);
+	append(records, new)!;
 };
 
 fn parse_record_entry(parser: *xml::parser, entries: *opaque) (void | error) = {
@@ -210,7 +210,7 @@ fn parse_record_entry(parser: *xml::parser, entries: *opaque) (void | error) = {
 	let records: []record = [];
 	defer free(records);
 	parse_record(parser, &records)?;
-	append(entries, records[0]);
+	append(entries, records[0])!;
 };
 
 fn parse_constructor(parser: *xml::parser, constructors: *opaque) (void | error) = {
@@ -221,7 +221,7 @@ fn parse_constructor(parser: *xml::parser, constructors: *opaque) (void | error)
 		("parameters", &parse_parameters, &new.params),
 		("return-value", &parse_return_value, &new.return_value),
 	)?;
-	append(constructors, new);
+	append(constructors, new)!;
 };
 fn parse_method(parser: *xml::parser, methods: *opaque) (void | error) = {
 	const methods = methods: *[]method;
@@ -234,7 +234,7 @@ fn parse_method(parser: *xml::parser, methods: *opaque) (void | error) = {
 			&(&new.instance, &new.params)),
 		("return-value", &parse_return_value, &new.return_value),
 	)?;
-	append(methods, new);
+	append(methods, new)!;
 };
 fn parse_virtual_method(parser: *xml::parser, vmethods: *opaque) (void | error) = {
 	const vmethods = vmethods: *[]virtual_method;
@@ -246,7 +246,7 @@ fn parse_virtual_method(parser: *xml::parser, vmethods: *opaque) (void | error)
 			&(&new.instance, &new.params)),
 		("return-value", &parse_return_value, &new.return_value),
 	)?;
-	append(vmethods, new);
+	append(vmethods, new)!;
 };
 fn parse_field(parser: *xml::parser, entries: *opaque) (void | error) = {
 	const entries = entries: *[]entry;
@@ -269,7 +269,7 @@ fn parse_field(parser: *xml::parser, entries: *opaque) (void | error) = {
 	} else {
 		new.type_ = type_;
 	};
-	append(entries, new);
+	append(entries, new)!;
 };
 fn parse_property(parser: *xml::parser, properties: *opaque) (void | error) = {
 	const properties = properties: *[]property;
@@ -288,7 +288,7 @@ fn parse_property(parser: *xml::parser, properties: *opaque) (void | error) = {
 
 		parse_any_type(&new.type_),
 	)?;
-	append(properties, new);
+	append(properties, new)!;
 };
 
 fn parse_enumeration(parser: *xml::parser, enums: *opaque) (void | error) = {
@@ -305,7 +305,7 @@ fn parse_enumeration(parser: *xml::parser, enums: *opaque) (void | error) = {
 		("member", &parse_member, &new.members),
 		("function", &parse_function, &new.functions),
 	)?;
-	append(enums, new);
+	append(enums, new)!;
 };
 
 fn parse_function(parser: *xml::parser, functions: *opaque) (void | error) = {
@@ -316,7 +316,7 @@ fn parse_function(parser: *xml::parser, functions: *opaque) (void | error) = {
 		("parameters", &parse_parameters, &new.params),
 		("return-value", &parse_return_value, &new.return_value),
 	)?;
-	append(functions, new);
+	append(functions, new)!;
 };
 
 fn parse_union(parser: *xml::parser, unions: *opaque) (void | error) = {
@@ -338,7 +338,7 @@ fn parse_union(parser: *xml::parser, unions: *opaque) (void | error) = {
 		("function", &parse_function, &new.functions),
 		("record", &parse_record_entry, &new.entries),
 	)?;
-	append(unions, new);
+	append(unions, new)!;
 };
 
 fn parse_union_entry(parser: *xml::parser, entries: *opaque) (void | error) = {
@@ -346,7 +346,7 @@ fn parse_union_entry(parser: *xml::parser, entries: *opaque) (void | error) = {
 	let unions: []union_ = [];
 	defer free(unions);
 	parse_union(parser, &unions)?;
-	append(entries, unions[0]);
+	append(entries, unions[0])!;
 };
 
 fn parse_bitfield(parser: *xml::parser, bitfields: *opaque) (void | error) = {
@@ -362,14 +362,14 @@ fn parse_bitfield(parser: *xml::parser, bitfields: *opaque) (void | error) = {
 		("member", &parse_member, &new.members),
 		("function", &parse_function, &new.functions),
 	)?;
-	append(bitfields, new);
+	append(bitfields, new)!;
 };
 
 fn parse_callback(parser: *xml::parser, callbacks: *opaque) (void | error) = {
 	const callbacks = callbacks: *[]callback;
 	let new = callback { return_value = void, ... };
 	parse_one_callback(parser, &new)?;
-	append(callbacks, new);
+	append(callbacks, new)!;
 };
 fn parse_one_callback(parser: *xml::parser, cb: *opaque) (void | error) = {
 	const cb = cb: *callback;
@@ -401,7 +401,7 @@ fn parse_constant(parser: *xml::parser, constants: *opaque) (void | error) = {
 	} else {
 		new.type_ = void;
 	};
-	append(constants, new);
+	append(constants, new)!;
 };
 
 fn parse_signal(parser: *xml::parser, signals: *opaque) (void | error) = {
@@ -420,7 +420,7 @@ fn parse_signal(parser: *xml::parser, signals: *opaque) (void | error) = {
 		("parameters", &parse_parameters, &new.params),
 		("return-value", &parse_return_value, &new.return_value),
 	)?;
-	append(signals, new);
+	append(signals, new)!;
 };
 
 // enum + bitfield
@@ -435,7 +435,7 @@ fn parse_member(parser: *xml::parser, members: *opaque) (void | error) = {
 		("glib:nick", &new.glib_nick),
 		("glib:name", &new.glib_name),
 	)?;
-	append(members, new);
+	append(members, new)!;
 };
 
 // callable
@@ -516,7 +516,7 @@ fn parse_parameter(parser: *xml::parser, parameters: *opaque) (void | error) = {
 	} else {
 		new.parameter = type_;
 	};
-	append(parameters, new);
+	append(parameters, new)!;
 };
 fn parse_varargs(parser: *xml::parser, has_varargs: *opaque) (void | error) = {
 	*(has_varargs: *bool) = true;
@@ -591,7 +591,7 @@ fn parse_array_type(parser: *xml::parser, out: *opaque) (void | error) = {
 		("c:type", &out.c_type),
 		parse_any_type(&inner),
 	)?;
-	out.inner = alloc(inner);
+	out.inner = alloc(inner)!;
 };
 
 fn parse_any_type(out: *any_type) [2]scan = [
@@ -640,18 +640,18 @@ fn parse_element(
 		case let s: []scan =>
 			for (let j = 0z; j < len(s); j += 1) match (s[j]) {
 			case let s: scan_element =>
-				append(elements, s);
+				append(elements, s)!;
 			case let s: scan_attribute =>
-				append(attrs, s);
+				append(attrs, s)!;
 			case let s: scan_text =>
 				assert(text_out is null, "only one scan_text is allowed");
 				text_out = s;
 			case => abort("too deep");
 			};
 		case let s: scan_element =>
-			append(elements, s);
+			append(elements, s)!;
 		case let s: scan_attribute =>
-			append(attrs, s);
+			append(attrs, s)!;
 		case let s: scan_text =>
 			assert(text_out is null, "only one scan_text is allowed");
 			text_out = s;
@@ -690,7 +690,7 @@ fn parse_element(
 				case let s: nullable *str =>
 					match(s) {
 					case let s: *str =>
-						*s = strings::dup(attr.1);
+						*s = strings::dup(attr.1)!;
 					case null => yield;
 					};
 				case let b: *bool =>
@@ -715,7 +715,7 @@ fn parse_element(
 		if (len(strings::trim(text)) > 0) {
 			match (text_out) {
 			case let s: *str =>
-				*s = strings::dup(text);
+				*s = strings::dup(text)!;
 			case null =>
 				yield;
 			};
@@ -729,7 +729,7 @@ fn parse_element(
 };
 
 fn ignore(parser: *xml::parser, name: str) (void | error) = {
-	const name = strings::dup(name);
+	const name = strings::dup(name)!;
 	defer free(name);
 
 	for (true) match (xml::scan(parser)?) {