diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-05-03 16:37:48 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-05-03 16:38:06 -0700 |
| commit | 36ead4d82bdb058229271fb742f659d47c5c48a3 (patch) | |
| tree | a87295955bdc3f553248b3fb5b1f78162cf3fba6 /nomsu_tree.lua | |
| parent | e64a91b8ba7e0d2cd4af4154e3b9adcccb299854 (diff) | |
Cleanup of unnecessary parens in generated lua code for math operations.
Diffstat (limited to 'nomsu_tree.lua')
| -rw-r--r-- | nomsu_tree.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/nomsu_tree.lua b/nomsu_tree.lua index 817c325..92871e5 100644 --- a/nomsu_tree.lua +++ b/nomsu_tree.lua @@ -203,13 +203,15 @@ Tree("Action", { local src = tok.source:get_text() error("non-expression value inside math expression: " .. tostring(colored.yellow(src))) end + if tok.type == "Action" then + tok_lua:parenthesize() + end lua:append(tok_lua) end if i < #self.value then lua:append(" ") end end - lua:parenthesize() return lua end local args = { } |
