|
@ -1,5 +1,5 @@ |
|
|
/*
|
|
|
/*
|
|
|
** $Id: lparser.c,v 2.134 2013/08/16 18:55:49 roberto Exp roberto $ |
|
|
** $Id: lparser.c,v 2.135 2013/08/30 16:01:37 roberto Exp roberto $ |
|
|
** Lua Parser |
|
|
** Lua Parser |
|
|
** See Copyright Notice in lua.h |
|
|
** See Copyright Notice in lua.h |
|
|
*/ |
|
|
*/ |
|
@ -990,10 +990,10 @@ static BinOpr getbinopr (int op) { |
|
|
case '+': return OPR_ADD; |
|
|
case '+': return OPR_ADD; |
|
|
case '-': return OPR_SUB; |
|
|
case '-': return OPR_SUB; |
|
|
case '*': return OPR_MUL; |
|
|
case '*': return OPR_MUL; |
|
|
case '/': return OPR_DIV; |
|
|
|
|
|
case TK_IDIV: return OPR_IDIV; |
|
|
|
|
|
case '%': return OPR_MOD; |
|
|
case '%': return OPR_MOD; |
|
|
case '^': return OPR_POW; |
|
|
case '^': return OPR_POW; |
|
|
|
|
|
case '/': return OPR_DIV; |
|
|
|
|
|
case TK_IDIV: return OPR_IDIV; |
|
|
case TK_CONCAT: return OPR_CONCAT; |
|
|
case TK_CONCAT: return OPR_CONCAT; |
|
|
case TK_NE: return OPR_NE; |
|
|
case TK_NE: return OPR_NE; |
|
|
case TK_EQ: return OPR_EQ; |
|
|
case TK_EQ: return OPR_EQ; |
|
@ -1013,8 +1013,10 @@ static const struct { |
|
|
lu_byte right; /* right priority */ |
|
|
lu_byte right; /* right priority */ |
|
|
} priority[] = { /* ORDER OPR */ |
|
|
} priority[] = { /* ORDER OPR */ |
|
|
{6, 6}, {6, 6}, /* '+' '-' */ |
|
|
{6, 6}, {6, 6}, /* '+' '-' */ |
|
|
{7, 7}, {7, 7}, {7, 7}, {7, 7}, /* '*' '/' '//' '%' */ |
|
|
{7, 7}, {7, 7}, /* '*' '%' */ |
|
|
{10, 9}, {5, 4}, /* ^, .. (right associative) */ |
|
|
{10, 9}, /* '^' (right associative) */ |
|
|
|
|
|
{7, 7}, {7, 7}, /* '/' '//' */ |
|
|
|
|
|
{5, 4}, /* '..' (right associative) */ |
|
|
{3, 3}, {3, 3}, {3, 3}, /* ==, <, <= */ |
|
|
{3, 3}, {3, 3}, {3, 3}, /* ==, <, <= */ |
|
|
{3, 3}, {3, 3}, {3, 3}, /* ~=, >, >= */ |
|
|
{3, 3}, {3, 3}, {3, 3}, /* ~=, >, >= */ |
|
|
{2, 2}, {1, 1} /* and, or */ |
|
|
{2, 2}, {1, 1} /* and, or */ |
|
|