diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-04-08 16:06:31 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-04-08 16:06:39 -0700 |
| commit | 4e51768ebdf98c0da545c6598b3d6e9af6c04409 (patch) | |
| tree | 64161dec44a88cc719060d52d80579a237f04033 /nomsu.lua | |
| parent | 680006b25ac9d6f0c25b5a35374a33c6047b21c1 (diff) | |
Improved codegen code.
Diffstat (limited to 'nomsu.lua')
| -rw-r--r-- | nomsu.lua | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1201,7 +1201,11 @@ do if item.type == 'Text' and #item.value == 1 and type(item.value[1]) == 'string' and item.value[1]:match("^[a-zA-Z_][a-zA-Z0-9_]$") then insert(items, "." .. tostring(item.value[1])) else - insert(items, "[ " .. tostring(lua.expr) .. "]") + if lua.expr:sub(1, 1) == '[' then + insert(items, "[ " .. tostring(lua.expr) .. "]") + else + insert(items, "[" .. tostring(lua.expr) .. "]") + end end end end |
