From 33b392a8073429c32e02ee2faacc95ded23778e4 Mon Sep 17 00:00:00 2001 From: Anders Elfgren Date: Tue, 26 Dec 2023 21:19:52 +0100 Subject: [PATCH] Added support for having "class" as part of the type. --- src/Transpiler.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Transpiler.zig b/src/Transpiler.zig index 0d44c7d..c0ab453 100644 --- a/src/Transpiler.zig +++ b/src/Transpiler.zig @@ -2717,6 +2717,11 @@ fn transpileType(self: *Self, tname: []const u8) ![]u8 { ttname = ttname["struct ".len..]; } + // remove class from C style definition + if (mem.startsWith(u8, ttname, "class ")) { + ttname = ttname["class ".len..]; + } + const ch = ttname[ttname.len - 1]; if (ch == '*' or ch == '&') { // note: avoid c-style pointers `[*c]` when dealing with references types