From 49adc12952789d3a7a8e0f02b172265a9cb9aa1b Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 14 Dec 2017 14:26:24 -0800 Subject: Minor fix. --- nomsu.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'nomsu.lua') diff --git a/nomsu.lua b/nomsu.lua index 9663a9e..d79c8ab 100644 --- a/nomsu.lua +++ b/nomsu.lua @@ -412,7 +412,7 @@ do end end for k, v in pairs(scope["#vars"] or { }) do - insert(buff, "<@" .. tostring(k) .. "> = " .. tostring(self:value_to_nomsu(v))) + insert(buff, "<%" .. tostring(k) .. "> = " .. tostring(self:value_to_nomsu(v))) end return concat(buff, "\n") end, @@ -853,6 +853,14 @@ end);]]):format(concat(buffer, "\n")) return _accum_0 end)(), "; ")) .. "})" end + elseif "string" == _exp_0 then + if value == "\n" then + return "'\\n'" + elseif not value:find([["]]) and not value:find("\n") and not value:find("\\") then + return "\"" .. value .. "\"" + else + return '".."\n ' .. (self:indent(value)) + end else return error("Unsupported value_to_nomsu type: " .. tostring(type(value))) end -- cgit v1.2.3