aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-07-28 15:31:20 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2003-07-28 15:31:20 -0300
commitd407d3fe0eb44b9bad0b5f37e55400b8eeb095ec (patch)
tree9e77090d801f74868b857548a89395f9f4d7d7dd /lparser.c
parent522407e23ae02cdfcb221f1fea96c6c44aae0200 (diff)
downloadlua-d407d3fe0eb44b9bad0b5f37e55400b8eeb095ec.tar.gz
lua-d407d3fe0eb44b9bad0b5f37e55400b8eeb095ec.tar.bz2
lua-d407d3fe0eb44b9bad0b5f37e55400b8eeb095ec.zip
details
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 8ca5d8d5..01161f7a 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lparser.c,v 1.212 2003/07/09 15:36:38 roberto Exp roberto $ 2** $Id: lparser.c,v 1.213 2003/07/09 20:11:30 roberto Exp roberto $
3** Lua Parser 3** Lua Parser
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -793,7 +793,7 @@ static const struct {
793** subexpr -> (simplexep | unop subexpr) { binop subexpr } 793** subexpr -> (simplexep | unop subexpr) { binop subexpr }
794** where `binop' is any binary operator with a priority higher than `limit' 794** where `binop' is any binary operator with a priority higher than `limit'
795*/ 795*/
796static BinOpr subexpr (LexState *ls, expdesc *v, int limit) { 796static BinOpr subexpr (LexState *ls, expdesc *v, unsigned int limit) {
797 BinOpr op; 797 BinOpr op;
798 UnOpr uop; 798 UnOpr uop;
799 enterlevel(ls); 799 enterlevel(ls);
@@ -806,13 +806,13 @@ static BinOpr subexpr (LexState *ls, expdesc *v, int limit) {
806 else simpleexp(ls, v); 806 else simpleexp(ls, v);
807 /* expand while operators have priorities higher than `limit' */ 807 /* expand while operators have priorities higher than `limit' */
808 op = getbinopr(ls->t.token); 808 op = getbinopr(ls->t.token);
809 while (op != OPR_NOBINOPR && cast(int, priority[op].left) > limit) { 809 while (op != OPR_NOBINOPR && priority[op].left > limit) {
810 expdesc v2; 810 expdesc v2;
811 BinOpr nextop; 811 BinOpr nextop;
812 next(ls); 812 next(ls);
813 luaK_infix(ls->fs, op, v); 813 luaK_infix(ls->fs, op, v);
814 /* read sub-expression with higher priority */ 814 /* read sub-expression with higher priority */
815 nextop = subexpr(ls, &v2, cast(int, priority[op].right)); 815 nextop = subexpr(ls, &v2, priority[op].right);
816 luaK_posfix(ls->fs, op, v, &v2); 816 luaK_posfix(ls->fs, op, v, &v2);
817 op = nextop; 817 op = nextop;
818 } 818 }
@@ -822,7 +822,7 @@ static BinOpr subexpr (LexState *ls, expdesc *v, int limit) {
822 822
823 823
824static void expr (LexState *ls, expdesc *v) { 824static void expr (LexState *ls, expdesc *v) {
825 subexpr(ls, v, -1); 825 subexpr(ls, v, 0);
826} 826}
827 827
828/* }==================================================================== */ 828/* }==================================================================== */