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

Function term

external_libraries/tinyexpr/tinyexpr/tinyexpr.c:553–572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

551
552
553static te_expr *term(state *s) {
554 /* <term> = <factor> {("*" | "/" | "%") <factor>} */
555 te_expr *ret = factor(s);
556 CHECK_NULL(ret);
557
558 while (s->type == TOK_INFIX && (s->function == mul || s->function == divide || s->function == fmod)) {
559 te_fun2 t = s->function;
560 next_token(s);
561 te_expr *f = factor(s);
562 CHECK_NULL(f, te_free(ret));
563
564 te_expr *prev = ret;
565 ret = NEW_EXPR(TE_FUNCTION2 | TE_FLAG_PURE, ret, f);
566 CHECK_NULL(ret, te_free(f), te_free(prev));
567
568 ret->function = t;
569 }
570
571 return ret;
572}
573
574
575static te_expr *expr(state *s) {

Callers 2

setMethod · 0.85
exprFunction · 0.85

Calls 3

factorFunction · 0.85
next_tokenFunction · 0.85
te_freeFunction · 0.85

Tested by

no test coverage detected