bydgoszcz

simple, fast and efficient programming language
git clone git://git.kocotian.pl/bydgoszczscript.git
Log | Files | Refs | README | LICENSE

commit 43528561c894be7fbead20e12b17a7d09b068053
parent ee5489632598abc911fcde49069ec0aa19d59dbe
Author: kocotian <kocotian@kocotian.pl>
Date:   Fri, 28 May 2021 11:49:28 +0200

rzucaj (type casting)

Diffstat:
Mcompile.c | 11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/compile.c b/compile.c @@ -395,6 +395,17 @@ tester: g_expression(f, &organization); str->len = (size_t)snprintf(str->data, MAX_EXPRESSIONSIZE, "(%.*s).%.*s", Strevalf(organization), Strevalf(member)); + } else if (!Strccmp(t->c, "rzucaj")) { + ExpressionString expr; + TypeString type; + t = enextToken(f, TokenNULL); + g_expression(f, &expr); + t = enextToken(f, TokenIdentifier); + if (Strccmp(t->c, "w")) + errwarn(*f, 1, "unexpected identifier (expected organizacji)"); + g_type(f, &type); + str->len = (size_t)snprintf(str->data, MAX_EXPRESSIONSIZE, "(%.*s)(%.*s)", + Strevalf(type), Strevalf(expr)); } else { strncpy(str->data, t->c.data, UMIN(MAX_EXPRESSIONSIZE, t->c.len)); str->len = t->c.len;