summaryrefslogtreecommitdiff
path: root/parse/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse/node.c')
-rw-r--r--parse/node.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/parse/node.c b/parse/node.c
index 62be764..8d0decf 100644
--- a/parse/node.c
+++ b/parse/node.c
@@ -374,6 +374,15 @@ Node *mkbool(Srcloc loc, int val)
return n;
}
+Node *mkvoid(Srcloc loc)
+{
+ Node *n;
+
+ n = mknode(loc, Nlit);
+ n->lit.littype = Lvoid;
+ return n;
+}
+
char *declname(Node *n)
{
Node *name;
@@ -413,6 +422,7 @@ int liteq(Node *a, Node *b)
if (!tyeq(a->lit.type, b->lit.type))
return 0;
switch (a->lit.littype) {
+ case Lvoid: return 1;
case Lchr: return a->lit.chrval == b->lit.chrval;
case Lbool: return a->lit.boolval == b->lit.boolval;
case Lint: return a->lit.intval == b->lit.intval;