From 36ead4d82bdb058229271fb742f659d47c5c48a3 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 3 May 2018 16:37:48 -0700 Subject: Cleanup of unnecessary parens in generated lua code for math operations. --- nomsu_tree.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'nomsu_tree.lua') 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 = { } -- cgit v1.2.3