lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> - a%m - b%n ~= - b%n - a%m
> It's looks very weird

Remove space between unary minus and variable,
and some parenthesis, it does not look weird

(-a % m) - (b % n) ~= (-b % n) - (a % n)

You can do the same trick to make any expression weird:

a  *  b+c  *  d+e / a  ^  3*c

> I think it would be good to lower the priority of unary minus in Lua.
> For example, unary minus may have the same priority as binary minus.
> -- Egor

Even if the idea is sound, it is too late to fix precedence

Anyway, how can it parse simple x / -y ?