aboutsummaryrefslogtreecommitdiff
path: root/nomsu_compiler.lua
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-02-06 14:31:14 -0800
committerBruce Hill <bruce@bruce-hill.com>2019-02-06 14:31:43 -0800
commit9e9bcad6fab72fe66a52c174d27fce63dcae106c (patch)
tree77654de3212e6bae849820a0abad5c642df98c41 /nomsu_compiler.lua
parent5d5dea4639355c27aaa10d1ce3ecac5c99ad844d (diff)
Added underscores for numbers (e.g. 1_000, 0xDEAD_BEEF), and fixed some
compatibility and decompiling issues.
Diffstat (limited to 'nomsu_compiler.lua')
-rw-r--r--nomsu_compiler.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/nomsu_compiler.lua b/nomsu_compiler.lua
index 2521ce1..dfbe3b1 100644
--- a/nomsu_compiler.lua
+++ b/nomsu_compiler.lua
@@ -406,7 +406,8 @@ compile = function(self, tree)
end
return lua
elseif "Number" == _exp_0 then
- return LuaCode:from(tree.source, tostring(tree[1]))
+ local number = tostring(tree[1]):gsub("_", "")
+ return LuaCode:from(tree.source, number)
elseif "Var" == _exp_0 then
return LuaCode:from(tree.source, tree:as_var():as_lua_id())
elseif "FileChunks" == _exp_0 then