From: Jérémie Astor Date: Sun, 13 Jun 2021 17:59:32 +0000 (+0200) Subject: :art: Use Ref as a bool X-Git-Tag: nightly~590 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=7dad9ccba2b8479fcc2d2e6dbc40fb74e41e8712;p=gwion.git :art: Use Ref as a bool --- diff --git a/ast b/ast index 591953c6..6d965961 160000 --- a/ast +++ b/ast @@ -1 +1 @@ -Subproject commit 591953c6a241aa5ec7cbfed3ed73ab819fdeb75f +Subproject commit 6d965961163bf32e912acd09d6cda41b93e24ff7 diff --git a/src/parse/type_decl.c b/src/parse/type_decl.c index 56e7f718..c74f2408 100644 --- a/src/parse/type_decl.c +++ b/src/parse/type_decl.c @@ -20,17 +20,16 @@ ANN static Type option(const Env env, Type_Decl *td) { return t; } -ANN static Type _ref(const Env env, Type_Decl *td, const uint8_t n) { +ANN static Type _ref(const Env env, Type_Decl *td) { struct Type_List_ tl = {.td = td}; Type_Decl tmp = {.xid = insert_symbol("Ref"), .types = &tl, .pos = td->pos}; - return !(n - 1) ? known_type(env, &tmp) : _ref(env, &tmp, n - 1); + return known_type(env, &tmp); } ANN static inline Type ref(const Env env, Type_Decl *td) { - const uint8_t ref = td->ref; - td->ref = 0; - const Type t = _ref(env, td, ref); - td->ref = ref; + td->ref = false; + const Type t = _ref(env, td); + td->ref = true; return t; }