lua-users home
lua-l archive

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


On Thu, Mar 6, 2014 at 12:12 AM, Lourival Vieira Neto
<lourival.neto@gmail.com> wrote:
> On Wed, Mar 5, 2014 at 1:59 PM, Roberto Ierusalimschy
> <roberto@inf.puc-rio.br> wrote:
>>> > About the floating-point constants, by now what happens is that they
>>> > are accepted, but they are converted to integers. Another weird thing
>>> > (at least to me) is that I defined getlocaledecpoint() as '.', but the
>>> > lexer is still considering ','.
>>>
>>> Sorry.. my fault.. I've made some confusion.. ',' is handled correctly
>>> as the delimiter of values.. and the usage of floating-point constants
>>> (using '.')  raises this neat error: 'malformed number' =)..
>>
>> Did you do that without changing the source?
>
> Yes, just redefining LUA_NUMBER* and luai_num*.

Actually, redefining lua_str2number as strtoll. However, I noticed now
that this is incorrect because the manual states that integers must
wrap around in case of overflow. I have updated my patch to disable
luaO_str2d [1], instead of using strtoll.

[1] https://github.com/lneto/lua/compare/no_float

Regards,
-- 
Lourival Vieira Neto