diff options
| author | 2022-08-19 16:31:16 +0200 | |
|---|---|---|
| committer | 2022-08-19 16:31:16 +0200 | |
| commit | 57af02b91cb3a9eef66137c85aab7e47bdd7d0a5 (patch) | |
| tree | c0597811c61d473263559ab7ffefe68ab8785c47 /src/env.cff | |
| parent | 9e408967cbdfa1d04e4bd4bc963399e7be78c0a7 (diff) | |
labels, #FILE #LINE, some bugfixes, c types
Diffstat (limited to 'src/env.cff')
| -rw-r--r-- | src/env.cff | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/env.cff b/src/env.cff index aa5c6d4..816053e 100644 --- a/src/env.cff +++ b/src/env.cff @@ -30,7 +30,13 @@ extern fn envput(env *Env, decl Decl, old **const Decl) *Decl { if *l { // decl with this name exists let old = (*old = &(*l).decl); switch { - case old.u.#tag == :Fn and decl.u.#tag == :Fn and decl.u.Fn.ty == old.u.Fn.ty and old.u.Fn.body->empty(); + case old.u.#tag == :Fn and decl.u.#tag == :Fn + and decl.u.Fn.ty == old.u.Fn.ty and (old.u.Fn.body->empty() or decl.u.Fn.body->empty()); + case old.u.#tag == :Ty and decl.u.#tag == :Ty and old.u.Ty == decl.u.Ty; + case old.u.#tag == :Def and decl.u.#tag == :Def + and memcmp(&old.u.Def, &decl.u.Def, sizeof(old.u.Def)) == 0; + case old.u.#tag == :Macro and decl.u.#tag == :Macro + and memcmp(&old.u.Macro, &decl.u.Macro, sizeof(old.u.Macro)) == 0; case decl.u.#tag == :Let; case env != old.myenv; |