[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: parse hex numerals [PATCH]
- From: LEGO <luis.ontanon@...>
- Date: Thu, 9 Feb 2006 12:19:54 +0100
I used 5.0.2 so i noticed there the lack of hex, My instinct told me
to look for hex in the lexer of the new release... as read_numeral()
there would not take an hex I assumed lua didn't so I changed it...
Good thing there's hex already, It was fun anyway going back to the
basics so it wasn't a complete loss of time.
Luis.
On 2/9/06, Mike Pall <mikelu-0602@mike.de> wrote:
> Hi,
>
> LEGO wrote:
> > the following patch against lua-5.1-rc3 allows the lexer to recognize
> > hexadecimal numerals in the form 0xa1234
>
> Umm ... have you checked whether plain Lua already supports
> this? :-)
>
> $ lua51rc3 -e 'print(0xff)'
> 255
>
> See:
>
> http://lua-users.org/lists/lua-l/2006-01/msg00464.html
>
> for an explanation and a (IMHO) better/simpler patch which makes
> hex numbers work with non-C99 libraries, too (MSVC for Windows).
>
> PS: Reread the CPP docs, too. '#if foo == bar' is always true.
> CPP has no idea of C types and doesn't do string compares.
> Unknown tokens evaluate to 0.
>
> Bye,
> Mike
>
--
This information is top security. When you have read it, destroy yourself.
-- Marshall McLuhan