[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Making lua case insensitive
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 8 Dec 2000 22:06:16 -0200 (EDT)
>Has anyone here modified lua to be case insensitive? Since we have a whole
>lot of designers poised to do lua scripting, I want to avoid them having to
>debug capitalization errors. As such, I'd like to modify lua so that it
>ignores case - at least with variable/function names. Is there an easy way
>to do this?
The "idiomatic" Lua way would be to use get/setglobal tag methods, but this
does not handle locals or table fields, as has already been pointed.
If you really want this, the easiest route is to change readname in llex.c
(in 4.0) to lower case L->Mbuffer before returning it.
Changing the implementation of Lua is not something that I encourage, but
in this case it is the simplest solution, given that it is a single line of
code (if you have a strlower function in C).