MCPcopy Create free account
hub / github.com/crownengine/crown / expr

Function expr

3rdparty/tinyexpr/tinyexpr.c:549–568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

547
548
549static te_expr *expr(state *s) {
550 /* <expr> = <term> {("+" | "-") <term>} */
551 te_expr *ret = term(s);
552 CHECK_NULL(ret);
553
554 while (s->type == TOK_INFIX && (s->function == add || s->function == sub)) {
555 te_fun2 t = s->function;
556 next_token(s);
557 te_expr *te = term(s);
558 CHECK_NULL(te, te_free(ret));
559
560 te_expr *prev = ret;
561 ret = NEW_EXPR(TE_FUNCTION2 | TE_FLAG_PURE, ret, te);
562 CHECK_NULL(ret, te_free(te), te_free(prev));
563
564 ret->function = t;
565 }
566
567 return ret;
568}
569
570
571static te_expr *list(state *s) {

Callers 2

baseFunction · 0.70
listFunction · 0.70

Calls 3

termFunction · 0.85
next_tokenFunction · 0.85
te_freeFunction · 0.85

Tested by

no test coverage detected