summaryrefslogtreecommitdiff
path: root/mi/match.c
diff options
context:
space:
mode:
authorMura Li <mura_li@castech.com.tw>2020-04-22 09:32:04 +0000
committerOri Bernstein <ori@eigenstate.org>2020-05-05 20:33:19 -0700
commit15ad5bac3dd1a18be6e632afa73f5ac12b4a5ec1 (patch)
treed133a3ccd553cd5e00dc45864c8882cfd29fddab /mi/match.c
parent9ef8abbefa9171d713fba46d8f84ac0000cb758b (diff)
downloadmc-15ad5bac3dd1a18be6e632afa73f5ac12b4a5ec1.tar.gz
Support or-patterns with wildcard variables
Diffstat (limited to 'mi/match.c')
-rw-r--r--mi/match.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/mi/match.c b/mi/match.c
index 1d69eda..a6f585c 100644
--- a/mi/match.c
+++ b/mi/match.c
@@ -906,7 +906,14 @@ clearemit(Dtree *dt)
static int
capeq(Node *a, Node *b)
{
- return 1;
+ Node *pa, *pb, *va, *vb;
+
+ pa = a->expr.args[0];
+ pb = b->expr.args[0];
+ va = a->expr.args[1];
+ vb = b->expr.args[1];
+
+ return decltype(decls[pa->expr.did]) == decltype(decls[pb->expr.did]) && loadeq(va, vb);
}
Dtree *