summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMura Li <mura_li@castech.com.tw>2020-04-22 07:00:16 +0000
committerOri Bernstein <ori@eigenstate.org>2020-05-05 20:33:19 -0700
commit49b61a099de4734e638b1122a5542dd616edd462 (patch)
treedaf96eb9f54c6568e9d7712b7fb9c885b58a6ee7
parent321aec6bf2b82698196a94725e37cee135b1fe2b (diff)
downloadmc-49b61a099de4734e638b1122a5542dd616edd462.tar.gz
Fix wrong order of recursive calls
Also, improve slightly the error messages.
-rw-r--r--mi/match.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mi/match.c b/mi/match.c
index d07f516..de2a9b7 100644
--- a/mi/match.c
+++ b/mi/match.c
@@ -458,9 +458,9 @@ addrec(Frontier *fs, Node *pat, Node *val, Path *path)
pat = fold(pat, 1);
switch (exprop(pat)) {
case Olor:
- addrec(fs, pat->expr.args[1], val, path);
next = frontierdup(fs);
fs->next = next;
+ addrec(fs, pat->expr.args[1], val, path);
addrec(next, pat->expr.args[0], val, path);
break;
case Ogap:
@@ -938,10 +938,10 @@ gendtree(Node *m, Node *val, Node **lbl, size_t nlbl)
cur = frontier[i];
if (last && last->i == cur->i) {
if (last->ncap != cur->ncap)
- fatal(pat[cur->i], "captured variables are not equally bound in all or-pattern of the same group");
+ fatal(pat[cur->i], "number of wildcard variables in the or-patterns are not equal (%d != %d)", last->ncap, cur->ncap);
for (j = 0; j < cur->ncap; j++) {
if (!capeq(last->cap[j], cur->cap[j]))
- fatal(pat[cur->i], "captured variables are not equally bound in all or-pattern of the same group");
+ fatal(pat[cur->i], "wildcard variables have different types in the or-patterns");
}
} else {
addcapture(pat[cur->i]->match.block, cur->cap, cur->ncap);