bydgoszcz

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

commit ee5489632598abc911fcde49069ec0aa19d59dbe
parent c72f426d224d91b8aca6ebaec240c2133dcb12c1
Author: kocotian <kocotian@kocotian.pl>
Date:   Fri, 28 May 2021 11:29:08 +0200

czlonek organizacji - accessing struct members

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

diff --git a/compile.c b/compile.c @@ -383,6 +383,18 @@ tester: greater ? ">" : lower ? "<" : equal ? "=" : "", equal ? "=" : "", Strevalf(rexpr)); + } else if (!Strccmp(t->c, "czlonek")) { + ExpressionString organization; + String member; + t = enextToken(f, TokenIdentifier); + member = t->c; + t = enextToken(f, TokenIdentifier); + if (Strccmp(t->c, "organizacji")) + errwarn(*f, 1, "unexpected identifier (expected organizacji)"); + t = enextToken(f, TokenNULL); + g_expression(f, &organization); + str->len = (size_t)snprintf(str->data, MAX_EXPRESSIONSIZE, "(%.*s).%.*s", + Strevalf(organization), Strevalf(member)); } else { strncpy(str->data, t->c.data, UMIN(MAX_EXPRESSIONSIZE, t->c.len)); str->len = t->c.len;