diff options
Diffstat (limited to 'lparser.c')
| -rw-r--r-- | lparser.c | 14 |
1 files changed, 6 insertions, 8 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lparser.c,v 1.76 2000/04/05 17:51:58 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 1.77 2000/04/06 17:36:52 roberto Exp roberto $ |
| 3 | ** LL(1) Parser and code generator for Lua | 3 | ** LL(1) Parser and code generator for Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -751,7 +751,7 @@ static int get_priority (int op, int *rp) { | |||
| 751 | 751 | ||
| 752 | case '+': case '-': *rp = 5; return 5; | 752 | case '+': case '-': *rp = 5; return 5; |
| 753 | 753 | ||
| 754 | case TK_CONC: *rp = 3; return 4; /* right associative (?) */ | 754 | case TK_CONCAT: *rp = 3; return 4; /* right associative (?) */ |
| 755 | 755 | ||
| 756 | case TK_EQ: case TK_NE: case '>': case '<': case TK_LE: case TK_GE: | 756 | case TK_EQ: case TK_NE: case '>': case '<': case TK_LE: case TK_GE: |
| 757 | *rp = 2; return 2; | 757 | *rp = 2; return 2; |
| @@ -832,13 +832,11 @@ static int assignment (LexState *ls, expdesc *v, int nvars) { | |||
| 832 | nexps = explist1(ls); | 832 | nexps = explist1(ls); |
| 833 | adjust_mult_assign(ls, nvars, nexps); | 833 | adjust_mult_assign(ls, nvars, nexps); |
| 834 | } | 834 | } |
| 835 | if (v->k != VINDEXED || left+(nvars-1) == 0) { | 835 | if (v->k != VINDEXED) |
| 836 | /* global/local var or indexed var without values in between */ | ||
| 837 | luaK_storevar(ls, v); | 836 | luaK_storevar(ls, v); |
| 838 | } | 837 | else { /* there may be garbage between table-index and value */ |
| 839 | else { /* indexed var with values in between*/ | 838 | luaK_AB(ls->fs, OP_SETTABLE, left+nvars+2, 1, -1); |
| 840 | luaK_U(ls->fs, OP_SETTABLE, left+(nvars-1), -1); | 839 | left += 2; |
| 841 | left += 2; /* table&index are not popped, because they aren't on top */ | ||
| 842 | } | 840 | } |
| 843 | return left; | 841 | return left; |
| 844 | } | 842 | } |
