| 551 | |
| 552 | |
| 553 | static 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 | |
| 575 | static te_expr *expr(state *s) { |
no test coverage detected