Suggestion: Lexer must replace "minus followed by a number" with "plus followed by negative number" before starting to calculate the number value.
It seems that the problem still exists.
In the following code : local obj = setmetatable({}, {__sub = ...}) obj = obj-9223372036854775808 we are not able to write it as "obj+math.mininteger" as it would invoke wrong metamethod ("__add" instead of "__sub").
As lexer does not have enough information to correctly choose the type of number, it should be parser's job.
Or we should handle "9223372036854775808" as a special literal in the language grammar.