summaryrefslogtreecommitdiff
path: root/src/symtable.zig
diff options
context:
space:
mode:
authorNic Gaffney <gaffney_nic@protonmail.com>2024-08-13 20:36:31 -0500
committerNic Gaffney <gaffney_nic@protonmail.com>2024-08-13 20:36:31 -0500
commit760a9246618862b56bafe3dd5d95a77fdd668a6c (patch)
tree9e85eec354e98f6e6ab916956266438d54780573 /src/symtable.zig
parentb1ad4a1c280d25f92fdb1103edf2faa5e3e1daac (diff)
downloadcalico-760a9246618862b56bafe3dd5d95a77fdd668a6c.tar.gz
Unit tests now pass
Diffstat (limited to 'src/symtable.zig')
-rw-r--r--src/symtable.zig9
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 {