aboutsummaryrefslogtreecommitdiff
path: root/interpreter/eval.c
diff options
context:
space:
mode:
authorCamil Staps2018-04-03 19:53:08 +0200
committerCamil Staps2018-04-03 19:53:08 +0200
commit4ecf8f54cd0ea04fa39469f5f7ea021e15c5e178 (patch)
tree59329b47453f613894c305549387ba8d7742cf0a /interpreter/eval.c
parentResolve #5: list notation shortcut in patterns (diff)
Fix some minor bugs
Diffstat (limited to 'interpreter/eval.c')
-rw-r--r--interpreter/eval.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/interpreter/eval.c b/interpreter/eval.c
index aa70e5a..b82f9b2 100644
--- a/interpreter/eval.c
+++ b/interpreter/eval.c
@@ -114,8 +114,8 @@ bool match_expr(struct fuspel *rules, struct expression *expr, struct node **nod
if ((int) (*node)->kind != (int) expr->kind)
return 0;
- if (!expr->var1)
- return (*node)->var1 == NULL;
+ if (!expr->var1 || !(*node)->var1)
+ return expr->var1 == (*node)->var1;
return
match_expr(rules, expr->var1, (struct node**) &(*node)->var1, _repls) &&