aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lparser.c b/lparser.c
index b635a418..b07557b9 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lparser.c,v 1.116 2000/10/27 11:39:52 roberto Exp roberto $ 2** $Id: lparser.c,v 1.117 2000/11/29 11:57:42 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*/
@@ -690,8 +690,8 @@ static BinOpr getbinopr (int op) {
690 690
691 691
692static const struct { 692static const struct {
693 char left; /* left priority for each binary operator */ 693 unsigned char left; /* left priority for each binary operator */
694 char right; /* right priority */ 694 unsigned char right; /* right priority */
695} priority[] = { /* ORDER OPR */ 695} priority[] = { /* ORDER OPR */
696 {5, 5}, {5, 5}, {6, 6}, {6, 6}, /* arithmetic */ 696 {5, 5}, {5, 5}, {6, 6}, {6, 6}, /* arithmetic */
697 {9, 8}, {4, 3}, /* power and concat (right associative) */ 697 {9, 8}, {4, 3}, /* power and concat (right associative) */
@@ -718,13 +718,13 @@ static BinOpr subexpr (LexState *ls, expdesc *v, int limit) {
718 else simpleexp(ls, v); 718 else simpleexp(ls, v);
719 /* expand while operators have priorities higher than `limit' */ 719 /* expand while operators have priorities higher than `limit' */
720 op = getbinopr(ls->t.token); 720 op = getbinopr(ls->t.token);
721 while (op != OPR_NOBINOPR && priority[op].left > limit) { 721 while (op != OPR_NOBINOPR && (int)priority[op].left > limit) {
722 expdesc v2; 722 expdesc v2;
723 BinOpr nextop; 723 BinOpr nextop;
724 next(ls); 724 next(ls);
725 luaK_infix(ls, op, v); 725 luaK_infix(ls, op, v);
726 /* read sub-expression with higher priority */ 726 /* read sub-expression with higher priority */
727 nextop = subexpr(ls, &v2, priority[op].right); 727 nextop = subexpr(ls, &v2, (int)priority[op].right);
728 luaK_posfix(ls, op, v, &v2); 728 luaK_posfix(ls, op, v, &v2);
729 op = nextop; 729 op = nextop;
730 } 730 }