Skip to content

Commit

Permalink
Merge pull request #23 from Srekel/srekel-class-fwd-declare
Browse files Browse the repository at this point in the history
Added support for having "class" as part of the type.
  • Loading branch information
lassade authored Jan 3, 2024
2 parents fc7781a + 33b392a commit e3d700d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Transpiler.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e3d700d

Please sign in to comment.