| 695 | |
| 696 | |
| 697 | void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e) { |
| 698 | expdesc e2; |
| 699 | e2.t = e2.f = NO_JUMP; e2.k = VKNUM; e2.u.nval = 0; |
| 700 | switch (op) { |
| 701 | case OPR_MINUS: { |
| 702 | if (!isnumeral(e)) |
| 703 | luaK_exp2anyreg(fs, e); /* cannot operate on non-numeric constants */ |
| 704 | codearith(fs, OP_UNM, e, &e2); |
| 705 | break; |
| 706 | } |
| 707 | case OPR_NOT: codenot(fs, e); break; |
| 708 | case OPR_LEN: { |
| 709 | luaK_exp2anyreg(fs, e); /* cannot operate on constants */ |
| 710 | codearith(fs, OP_LEN, e, &e2); |
| 711 | break; |
| 712 | } |
| 713 | default: lua_assert(0); |
| 714 | } |
| 715 | } |
| 716 | |
| 717 | |
| 718 | void luaK_infix (FuncState *fs, BinOpr op, expdesc *v) { |
no test coverage detected