aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/lparser.c b/lparser.c
index 0f53ff7c..c23b2dde 100644
--- a/lparser.c
+++ b/lparser.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lparser.c,v 2.134 2013/08/16 18:55:49 roberto Exp roberto $ 2** $Id: lparser.c,v 2.135 2013/08/30 16:01:37 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*/
@@ -990,10 +990,10 @@ static BinOpr getbinopr (int op) {
990 case '+': return OPR_ADD; 990 case '+': return OPR_ADD;
991 case '-': return OPR_SUB; 991 case '-': return OPR_SUB;
992 case '*': return OPR_MUL; 992 case '*': return OPR_MUL;
993 case '/': return OPR_DIV;
994 case TK_IDIV: return OPR_IDIV;
995 case '%': return OPR_MOD; 993 case '%': return OPR_MOD;
996 case '^': return OPR_POW; 994 case '^': return OPR_POW;
995 case '/': return OPR_DIV;
996 case TK_IDIV: return OPR_IDIV;
997 case TK_CONCAT: return OPR_CONCAT; 997 case TK_CONCAT: return OPR_CONCAT;
998 case TK_NE: return OPR_NE; 998 case TK_NE: return OPR_NE;
999 case TK_EQ: return OPR_EQ; 999 case TK_EQ: return OPR_EQ;
@@ -1012,12 +1012,14 @@ static const struct {
1012 lu_byte left; /* left priority for each binary operator */ 1012 lu_byte left; /* left priority for each binary operator */
1013 lu_byte right; /* right priority */ 1013 lu_byte right; /* right priority */
1014} priority[] = { /* ORDER OPR */ 1014} priority[] = { /* ORDER OPR */
1015 {6, 6}, {6, 6}, /* '+' '-' */ 1015 {6, 6}, {6, 6}, /* '+' '-' */
1016 {7, 7}, {7, 7}, {7, 7}, {7, 7}, /* '*' '/' '//' '%' */ 1016 {7, 7}, {7, 7}, /* '*' '%' */
1017 {10, 9}, {5, 4}, /* ^, .. (right associative) */ 1017 {10, 9}, /* '^' (right associative) */
1018 {3, 3}, {3, 3}, {3, 3}, /* ==, <, <= */ 1018 {7, 7}, {7, 7}, /* '/' '//' */
1019 {3, 3}, {3, 3}, {3, 3}, /* ~=, >, >= */ 1019 {5, 4}, /* '..' (right associative) */
1020 {2, 2}, {1, 1} /* and, or */ 1020 {3, 3}, {3, 3}, {3, 3}, /* ==, <, <= */
1021 {3, 3}, {3, 3}, {3, 3}, /* ~=, >, >= */
1022 {2, 2}, {1, 1} /* and, or */
1021}; 1023};
1022 1024
1023#define UNARY_PRIORITY 8 /* priority for unary operators */ 1025#define UNARY_PRIORITY 8 /* priority for unary operators */