From: fennecdjay Date: Sun, 3 Nov 2019 22:22:22 +0000 (+0100) Subject: :art: Remove useless name_valid X-Git-Tag: nightly~2116^2~13 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=38a336a54805b10e06913d7648d4dc897de3c812;p=gwion.git :art: Remove useless name_valid --- diff --git a/include/import/internals.h b/include/import/internals.h index 6723f5ac..4ec57954 100644 --- a/include/import/internals.h +++ b/include/import/internals.h @@ -8,8 +8,6 @@ ANN void gwi_body(const Gwi, const Class_Body); -ANN m_bool name_valid(const Gwi, const m_str); - ANN Exp make_exp(const Gwi gwi, const m_str type, const m_str name); ANN void gwi_reset(const Gwi gwi); diff --git a/src/import/internals.c b/src/import/internals.c index 240f9d36..72b1d240 100644 --- a/src/import/internals.c +++ b/src/import/internals.c @@ -22,37 +22,6 @@ void gwi_body(const Gwi gwi, const Class_Body body) { gwi->body = body; } -ANN m_bool _name_valid(const Gwi gwi, const m_str a) { - const m_uint len = strlen(a); - m_uint lvl = 0; - for(m_uint i = 0; i < len; i++) { - char c = a[i]; - if((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') - || (c == '_') || (c >= '0' && c <= '9')) - continue; - if(c == '<') { - if(a[++i] != '~') - GWI_ERR_B(_("illegal templating in name '%s'."), a) - ++lvl; - ++i; - continue; - } else if(c == ',') { - if(!lvl) - GWI_ERR_B(_("illegal use of ',' outside of templating in name '%s'."), a) - } else if(c == '~') { - if(!lvl || a[++i] != '>') - GWI_ERR_B(_("illegal templating in name '%s'."), a) - --lvl; - } else - GWI_ERR_B(_("illegal character '%c' in name '%s'."), c, a) - } - return !lvl ? 1 : -1; -} - -ANN m_bool name_valid(const Gwi gwi, const m_str a) { - return _name_valid(gwi, a[0] != '@' ? a : a + 1); -} - ANN void gwi_reset(const Gwi gwi) { if(gwi->ck) ck_clean(gwi);