From: Jérémie Astor Date: Mon, 28 Dec 2020 17:42:18 +0000 (+0100) Subject: :art: Remove unsed func X-Git-Tag: nightly~1075 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=efb48d3feb6282b5052d8c2a436176d49f23c64c;p=gwion.git :art: Remove unsed func --- diff --git a/include/env/data.h b/include/env/data.h deleted file mode 100644 index 51281f5a..00000000 --- a/include/env/data.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef __AST_DATA -#define __AST_DATA - -typedef struct DataTable_* DataTable; -ANN DataTable new_datatable(MemPool p, size_t sz); -ANN void datatable_reset(DataTable); -ANN void free_datatable(DataTable); - -ANN struct Type_* dataget_type (DataTable, void*); -//ANN Type dataget_cast (Data, void*); -//ANN Value dataget_val (Data, void*); -//ANN Func dataget_func (Data, void*); -//ANN Nspc dataget_nspc (Data, void*); -//ANN Vector dataget_vec (Data, void*); -//ANN Instr dataget_instr (Data, void*); - -ANN void dataset_type (DataTable, void*, struct Type_*); -//ANN void dataset_cast (Data, void*); -//ANN void dataset_val (Data, void*); -//ANN void dataset_func (Data, void*); -//ANN void dataset_nspc (Data, void*); -//ANN void dataset_vec (Data, void*); -//ANN void dataset_instr (Data, void*); -#endif diff --git a/include/env/type.h b/include/env/type.h index 55bf9659..64068fa2 100644 --- a/include/env/type.h +++ b/include/env/type.h @@ -53,7 +53,6 @@ FLAG_FUNC(Type, t) ANN2(1,2) ANEW Type new_type(MemPool, const m_str name, const Type); ANEW ANN Type type_copy(MemPool, const Type type); -ANN m_str get_type_name(const Env, const Type t, const m_uint); ANN Value find_value(const Type, const Symbol); ANN m_bool isa(const Type, const Type) __attribute__((pure)); ANN m_bool isres(const Env, const Symbol, const loc_t pos); diff --git a/src/env/type.c b/src/env/type.c index 4c1bd621..ff93ad87 100644 --- a/src/env/type.c +++ b/src/env/type.c @@ -139,37 +139,6 @@ ANN m_bool type_ref(Type t) { } -ANN m_str get_type_name(const Env env, const Type t, const m_uint index) { - if(!index) - return NULL; - m_str name = strchr(t->name, ':'); - if(!name) - return NULL; - name += 2; - const size_t slen = strlen(name); - m_uint lvl = 0; - m_uint n = 1; - char c, buf[slen + 1], *tmp = buf; - while((c = *name)) { - if(c == ':') - ++lvl; - else if(c == ']') { - if(!lvl-- && n == index) - break; - } else if(c == ',') { - if(!lvl && n++ == index) - break; - if(!lvl) - ++name; - } - if(n == index) - *tmp++ = *name; - ++name; - } - *tmp = '\0'; - return tmp - buf ? s_name(insert_symbol(buf)) : NULL; -} - ANN m_uint get_depth(const Type type) { m_uint depth = 0; Type t = type;