ref: 795f8b6e4d14e56fa248b26cd85c5e5f9807106c
parent: d619645586593515ab9b589f97006975c5fa3d5e
author: Ori Bernstein <[email protected]>
date: Wed Oct 15 12:07:46 EDT 2014
Stub in addstruct(), and turn failed dups into errors.
--- a/opt/match.c
+++ b/opt/match.c
@@ -105,6 +105,11 @@
return t;
}
+static Dtree *addstruct(Dtree *t, Node *pat, Node ***cap, size_t *ncap)
+{
+ return NULL;
+}
+
static Dtree *addpat(Dtree *t, Node *pat, Node ***cap, size_t *ncap)
{
Dtree *ret;
@@ -127,11 +132,13 @@
case Oarr:
ret = addarr(t, pat, cap, ncap);
break;
+ case Ostruct:
+ ret = addstruct(t, pat, cap, ncap);
+ break;
default:
- /* Right now, we just use this code for warning.
- *
- * We shoudl fatal(unsupported match) here*/
- return NULL;
+ ret = NULL;
+ fatal(pat, "unsupported pattern %s of type %s", opstr(exprop(pat)), tystr(exprtype(pat)));
+ break;
}
return ret;