lua-users home
lua-l archive

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


Shmuel Zeigerman wrote:

David Given wrote:

My point is that field names are not just arbitrary symbols (like local
variable names). They're actually *data*, which your program may need to
process, and therefore changing them will break your program.


I can see your point. This may possibly be considered as a special case for the obfuscator to handle. The obfuscator can be made smart! :)

After a second thought: this doesn't have to be special case. The obfuscator can build a table putting in there all the string keys and all the string values (may be excluding those involved with `require'). Then it replaces all those strings with their obfuscated counterparts.

That way:
  d = {	  one = 1, [1] = "one",
	  two = 2, [2] = "two",  }
will become:
  a1 = {  ["a2"] = 1, [1] = "a2",
	  ["a3"] = 2, [2] = "a3",  }

--
Shmuel