summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-10-15 16:07:46 -0400
committerOri Bernstein <ori@eigenstate.org>2014-10-15 16:07:46 -0400
commit795f8b6e4d14e56fa248b26cd85c5e5f9807106c (patch)
treee12a398c1fd53e285884c5fd647569c82096275c
parentd619645586593515ab9b589f97006975c5fa3d5e (diff)
downloadmc-795f8b6e4d14e56fa248b26cd85c5e5f9807106c.tar.gz
Stub in addstruct(), and turn failed dups into errors.
-rw-r--r--opt/match.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/opt/match.c b/opt/match.c
index e62aee9..f5b2e07 100644
--- a/opt/match.c
+++ b/opt/match.c
@@ -105,6 +105,11 @@ static Dtree *addarr(Dtree *t, Node *pat, Node ***cap, size_t *ncap)
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 @@ static Dtree *addpat(Dtree *t, Node *pat, Node ***cap, size_t *ncap)
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;