From 5ba53665c99c01f407576406b4c619d180efd384 Mon Sep 17 00:00:00 2001 From: lemon Date: Fri, 26 Aug 2022 09:58:48 +0200 Subject: some fixes + .[] syntax sugar --- src/env.cff | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/env.cff') diff --git a/src/env.cff b/src/env.cff index d45e373..1c525b9 100644 --- a/src/env.cff +++ b/src/env.cff @@ -34,11 +34,18 @@ extern fn envput_alloc(env *Env, alloc *Allocator, decl Decl, old **const Decl) and decl.u.Fn.ty == old.u.Fn.ty and (old.u.Fn.body->empty() or decl.u.Fn.body->empty()); decl.u.Fn.id = old.u.Fn.id; + case old.u.#tag == :Fn and decl.u.#tag == :Fn + and memcmp(&old.u.Fn, &decl.u.Fn, sizeof(old.u.Fn)) == 0; + 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 == :Static and decl.u.#tag == :Static + and decl.u.Static.ty == old.u.Static.ty and (old.u.Static.fwd or decl.u.Static.fwd); + decl.u.Static.id = old.u.Static.id; + case old.u.#tag == :Static and decl.u.#tag == :Static and memcmp(&old.u.Static, &decl.u.Static, sizeof(old.u.Static)) == 0; -- cgit v1.2.3