[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Case sensitivity
- From: "Dušan Majkić" <dmajkic@...>
- Date: Thu, 10 Nov 2005 17:38:04 +0100
Hi. I need help.
Lua is case-sensitive, and I know that.
But when I allow users to modify scripts, most complaints turn out
to be issues like "Function" and "End" in user-modified scripts.
To make things more robust, this came to my mind:
* Exploit the fact that all lua keywords and libs are lowercase.
* Make all my exports to lua_state also lowercase
* Preprocess script in lua, making everything lowercase
But I need to skip string literals. Eg:
PRINT("Mr \"Hyde") -> change PRINT to print, but skip "Mr \"Hyde"
Print[[Dady]] -> - // - skip Dady
Is there a way to gsub() and get everythig in lua script except
Did I miss something else in this approach?