lua-users home
lua-l archive

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


Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:

>> In the latest (beta) release of Lua I notice the textual output for both
>> floating and integer number formats remains <number> (llex.c line 44).
>> 
>> Would it not make more sense to change these to <integer> and <float> to
>> more correctly indicate in error messages which number type was used?
>> Or perhaps just change the integer one and leave floating as <number>?
> 
> Actually, those formats are never used (numbers are shown as themselves,
> like '45'), but that is not very clear in the code. We will correct that.
> 
> -- Roberto

Yes, I went back and checked and that is true for vanilla Lua. I do have a check(TK_INT) in one of my patches which is probably why I noticed that the string tokens for both integers and floats were both <number>.

Given that I do check specifically for an integer I will probably patch those tokens so one is <integer> and the other I will leave as <number> simply so my error message makes more sense.

~pmd