aboutsummaryrefslogtreecommitdiff
path: root/nomsu.lua
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2017-12-14 14:26:24 -0800
committerBruce Hill <bitbucket@bruce-hill.com>2017-12-14 14:26:24 -0800
commit49adc12952789d3a7a8e0f02b172265a9cb9aa1b (patch)
tree422f6f29152eee8f09f7c08fd4b5c9d0ab9ca259 /nomsu.lua
parentce398c255a9fb5c59b89c018ce1514eaac2fbd5d (diff)
Minor fix.
Diffstat (limited to 'nomsu.lua')
-rw-r--r--nomsu.lua10
1 files changed, 9 insertions, 1 deletions
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