diff options
author | Marvin Borner | 2023-06-01 16:14:34 +0200 |
---|---|---|
committer | Marvin Borner | 2023-06-01 16:56:39 +0200 |
commit | ccd4914d395b5a588868cffaad580c29167e6747 (patch) | |
tree | fd24dbb444745736ed07991a23e1305217a012f2 /src/parse.c | |
parent | 931df5e774eebb098c5d7be93937d2b2f12b86ac (diff) |
More parenting
Diffstat (limited to 'src/parse.c')
-rw-r--r-- | src/parse.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/parse.c b/src/parse.c index d25034e..e2d2498 100644 --- a/src/parse.c +++ b/src/parse.c @@ -22,10 +22,11 @@ static struct term_handle abs_blc(char **term, size_t depth) } else { res_term = term_new(res_type, res, depth); res_term->u.abs.term = inner.term; - map_set(map_all_terms(), res_term, res); + // TODO: remove hash from map_set (already in term anyway) + map_set(map_all_terms(), res_term); } - map_set(res_term->u.abs.term->parents, res_term, res_term->hash); + map_set(res_term->u.abs.term->parents, res_term); return (struct term_handle){ .term = res_term, .hash = res }; } @@ -45,11 +46,11 @@ static struct term_handle app_blc(char **term, size_t depth) res_term = term_new(res_type, res, depth); res_term->u.app.lhs = lhs.term; res_term->u.app.rhs = rhs.term; - map_set(map_all_terms(), res_term, res); + map_set(map_all_terms(), res_term); } - map_set(res_term->u.app.lhs->parents, res_term, res_term->hash); - map_set(res_term->u.app.rhs->parents, res_term, res_term->hash); + map_set(res_term->u.app.lhs->parents, res_term); + map_set(res_term->u.app.rhs->parents, res_term); return (struct term_handle){ .term = res_term, .hash = res }; } @@ -65,7 +66,7 @@ static struct term_handle var_blc(int index, size_t depth) } else { res_term = term_new(res_type, res, depth); res_term->u.var.index = index; - map_set(map_all_terms(), res_term, res); + map_set(map_all_terms(), res_term); } return (struct term_handle){ .term = res_term, .hash = res }; |