lujian101 / LuaTableOptimizer

simple readonly lua table optimizer
283 stars 85 forks source link

串行化table 以数字开始key失败 #2

Closed c3076802 closed 7 years ago

c3076802 commented 7 years ago

如果导出表的key以数字开始如 100_s,就失败,因为lua不允许以数字为前缀的变量,建议修改为:

if string.match(name,'^%d+') then
    append( "[\"")
    append( name )
    append("\"]" )
else
    ...
lujian101 commented 7 years ago

thanks!