• Home
  • Raw
  • Download

Lines Matching refs:te

2625 	Test_env te;  in c_test()  local
2630 te.flags = 0; in c_test()
2631 te.isa = ptest_isa; in c_test()
2632 te.getopnd = ptest_getopnd; in c_test()
2633 te.eval = test_eval; in c_test()
2634 te.error = ptest_error; in c_test()
2646 te.pos.wp = wp + 1; in c_test()
2647 te.wp_end = wp + argc; in c_test()
2664 if (ptest_isa(&te, TM_NOT)) { in c_test()
2668 if ((op = ptest_isa(&te, TM_UNOP))) { in c_test()
2670 rv = test_eval(&te, op, *te.pos.wp++, NULL, true); in c_test()
2672 if (te.flags & TEF_ERROR) in c_test()
2680 swp = te.pos.wp; in c_test()
2682 lhs = *te.pos.wp++; in c_test()
2683 if ((op = ptest_isa(&te, TM_BINOP))) { in c_test()
2685 rv = test_eval(&te, op, lhs, *te.pos.wp++, true); in c_test()
2688 if (ptest_isa(&te, tm = TM_AND) || ptest_isa(&te, tm = TM_OR)) { in c_test()
2690 argc = test_eval(&te, TO_STNZE, lhs, NULL, true); in c_test()
2691 rv = test_eval(&te, TO_STNZE, *te.pos.wp++, NULL, true); in c_test()
2699 te.pos.wp = swp; in c_test()
2700 if (ptest_isa(&te, TM_NOT)) { in c_test()
2704 if (ptest_isa(&te, TM_OPAREN)) { in c_test()
2705 swp = te.pos.wp; in c_test()
2707 te.pos.wp++; in c_test()
2709 op = ptest_isa(&te, TM_CPAREN); in c_test()
2711 te.pos.wp = swp; in c_test()
2720 if (ptest_isa(&te, TM_NOT)) { in c_test()
2724 if (ptest_isa(&te, TM_OPAREN)) { in c_test()
2725 swp = te.pos.wp; in c_test()
2727 te.pos.wp++; in c_test()
2728 te.pos.wp++; in c_test()
2730 op = ptest_isa(&te, TM_CPAREN); in c_test()
2732 te.pos.wp = swp; in c_test()
2743 te.pos.wp = wp + 1; in c_test()
2744 return (test_parse(&te)); in c_test()
2799 test_eval(Test_env *te, Test_op op, const char *opnd1, const char *opnd2, in test_eval() argument
2829 te->flags |= TEF_ERROR; in test_eval()
2969 te->flags |= TEF_ERROR; in test_eval()
2991 if (te->flags & TEF_DBRACKET) { in test_eval()
3000 if (te->flags & TEF_DBRACKET) { in test_eval()
3062 te->flags |= TEF_ERROR; in test_eval()
3084 (*te->error)(te, 0, "internal error: unknown op"); in test_eval()
3089 test_parse(Test_env *te) in test_parse() argument
3093 rv = test_oexpr(te, 1); in test_parse()
3095 if (!(te->flags & TEF_ERROR) && !(*te->isa)(te, TM_END)) in test_parse()
3096 (*te->error)(te, 0, "unexpected operator/operand"); in test_parse()
3098 return ((te->flags & TEF_ERROR) ? T_ERR_EXIT : !rv); in test_parse()
3102 test_oexpr(Test_env *te, bool do_eval) in test_oexpr() argument
3106 if ((rv = test_aexpr(te, do_eval))) in test_oexpr()
3108 if (!(te->flags & TEF_ERROR) && (*te->isa)(te, TM_OR)) in test_oexpr()
3109 return (test_oexpr(te, do_eval) || rv); in test_oexpr()
3114 test_aexpr(Test_env *te, bool do_eval) in test_aexpr() argument
3118 if (!(rv = test_nexpr(te, do_eval))) in test_aexpr()
3120 if (!(te->flags & TEF_ERROR) && (*te->isa)(te, TM_AND)) in test_aexpr()
3121 return (test_aexpr(te, do_eval) && rv); in test_aexpr()
3126 test_nexpr(Test_env *te, bool do_eval) in test_nexpr() argument
3128 if (!(te->flags & TEF_ERROR) && (*te->isa)(te, TM_NOT)) in test_nexpr()
3129 return (!test_nexpr(te, do_eval)); in test_nexpr()
3130 return (test_primary(te, do_eval)); in test_nexpr()
3134 test_primary(Test_env *te, bool do_eval) in test_primary() argument
3140 if (te->flags & TEF_ERROR) in test_primary()
3142 if ((*te->isa)(te, TM_OPAREN)) { in test_primary()
3143 rv = test_oexpr(te, do_eval); in test_primary()
3144 if (te->flags & TEF_ERROR) in test_primary()
3146 if (!(*te->isa)(te, TM_CPAREN)) { in test_primary()
3147 (*te->error)(te, 0, "missing )"); in test_primary()
3156 if ((te->flags & TEF_DBRACKET) || (&te->pos.wp[1] < te->wp_end && in test_primary()
3157 !test_isop(TM_BINOP, te->pos.wp[1]))) { in test_primary()
3158 if ((op = (*te->isa)(te, TM_UNOP))) { in test_primary()
3160 opnd1 = (*te->getopnd)(te, op, do_eval); in test_primary()
3162 (*te->error)(te, -1, Tno_args); in test_primary()
3166 return ((*te->eval)(te, op, opnd1, NULL, do_eval)); in test_primary()
3169 opnd1 = (*te->getopnd)(te, TO_NONOP, do_eval); in test_primary()
3171 (*te->error)(te, 0, "expression expected"); in test_primary()
3174 if ((op = (*te->isa)(te, TM_BINOP))) { in test_primary()
3176 opnd2 = (*te->getopnd)(te, op, do_eval); in test_primary()
3178 (*te->error)(te, -1, "missing second argument"); in test_primary()
3182 return ((*te->eval)(te, op, opnd1, opnd2, do_eval)); in test_primary()
3184 return ((*te->eval)(te, TO_STNZE, opnd1, NULL, do_eval)); in test_primary()
3197 ptest_isa(Test_env *te, Test_meta meta) in ptest_isa() argument
3205 if (te->pos.wp >= te->wp_end) in ptest_isa()
3209 rv = test_isop(meta, *te->pos.wp); in ptest_isa()
3213 rv = !strcmp(*te->pos.wp, tokens[(int)meta]) ? in ptest_isa()
3218 te->pos.wp++; in ptest_isa()
3224 ptest_getopnd(Test_env *te, Test_op op, bool do_eval MKSH_A_UNUSED) in ptest_getopnd() argument
3226 if (te->pos.wp >= te->wp_end) in ptest_getopnd()
3228 return (*te->pos.wp++); in ptest_getopnd()
3232 ptest_error(Test_env *te, int ofs, const char *msg) in ptest_error() argument
3236 te->flags |= TEF_ERROR; in ptest_error()
3237 if ((op = te->pos.wp + ofs >= te->wp_end ? NULL : te->pos.wp[ofs])) in ptest_error()