diff options
Diffstat (limited to 'src/symtable.zig')
| -rw-r--r-- | src/symtable.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/symtable.zig b/src/symtable.zig index 5da6081..2e6e86f 100644 --- a/src/symtable.zig +++ b/src/symtable.zig @@ -41,6 +41,15 @@ pub const SymbType = union(enum) { else => "void", }; } + pub fn toTypeIdent(self: SymbType, allocator: std.mem.Allocator) !pars.TypeIdent { + return pars.TypeIdent{ + .ident = try self.toString(allocator), + .list = switch (self) { + .String => true, + else => false, + }, + }; + } }; pub const SymbValue = struct { |
