MCPcopy Create free account
hub / github.com/KratosMultiphysics/Kratos / expr

Function expr

external_libraries/tinyexpr/tinyexpr/tinyexpr.c:575–594  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

573
574
575static te_expr *expr(state *s) {
576 /* <expr> = <term> {("+" | "-") <term>} */
577 te_expr *ret = term(s);
578 CHECK_NULL(ret);
579
580 while (s->type == TOK_INFIX && (s->function == add || s->function == sub)) {
581 te_fun2 t = s->function;
582 next_token(s);
583 te_expr *te = term(s);
584 CHECK_NULL(te, te_free(ret));
585
586 te_expr *prev = ret;
587 ret = NEW_EXPR(TE_FUNCTION2 | TE_FLAG_PURE, ret, te);
588 CHECK_NULL(ret, te_free(te), te_free(prev));
589
590 ret->function = t;
591 }
592
593 return ret;
594}
595
596
597static te_expr *list(state *s) {

Callers 2

baseFunction · 0.85
listFunction · 0.85

Calls 3

termFunction · 0.85
next_tokenFunction · 0.85
te_freeFunction · 0.85

Tested by

no test coverage detected