rns / MarpaX-Languages-Lua-AST

Roundtrip parser for Lua 5.1
Artistic License 2.0
0 stars 2 forks source link

handle operator precedence #5

Closed rns closed 9 years ago

rns commented 10 years ago

Operator precedence in Lua follows the table below, from lower to higher priority:

     or
     and
     <     >     <=    >=    ~=    ==
     ..
     +     -
     *     /     %
     not   #     - (unary)
     ^

As usual, you can use parentheses to change the precedences of an expression. The concatenation ('..') and exponentiation ('^') operators are right associative. All other binary operators are left associative. — http://www.lua.org/manual/5.1/manual.html#2.5.6

rns commented 9 years ago

done as of commit f8df682 with some test failures