Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/5] Re-use typename sanitiziation to handle identifiers


Caused by libxcb calling struct members "type" in a few places.
---
 myrglue.myr | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/myrglue.myr b/myrglue.myr
index 4827dff..c9cd975 100644
--- a/myrglue.myr
+++ b/myrglue.myr
@@ -84,7 +84,9 @@ const protostruct = {f, name, ty : cb.cstruct#
 	bio.put(f, "\ttype {}{} = struct\n", pfx, name)
 	for (mname, mty) : ty.membs
 		match mname
-		| `std.Some n:	bio.put(f, "\t\t{} : ", n)
+		| `std.Some n:
+			pfx = myrname(n) ? "_" : ""
+			bio.put(f, "\t\t{}{} : ", pfx, n)
 		| `std.None:	bio.put(f, "\t\t_a{} : ", nanon++)
 		;;
 		myrtype(f, &mty)
-- 
2.26.2


References:
[PATCH 0/5] mcbind patches, round 2"S. Gilles" <sgilles@xxxxxxx>