aboutsummaryrefslogtreecommitdiff
path: root/nomsu_compiler.lua
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-09-15 15:39:38 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-09-15 15:39:57 -0700
commitf8cfdd0f2276afe2f924295c192256601db595db (patch)
treedbc479765e51b3172f03103eea7dd1f694914365 /nomsu_compiler.lua
parentb721356d8bff2631b90c5c091568327b2ca187fc (diff)
Better parsing of strings and handling of non-printable characters and
tabs.
Diffstat (limited to 'nomsu_compiler.lua')
-rw-r--r--nomsu_compiler.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/nomsu_compiler.lua b/nomsu_compiler.lua
index d5921cf..bdacdfb 100644
--- a/nomsu_compiler.lua
+++ b/nomsu_compiler.lua
@@ -1217,9 +1217,12 @@ do
end
end
for i, bit in ipairs(tree) do
- if next_space == "\n.." or (next_space == " " and nomsu:trailing_line_len() > MAX_LINE) then
+ if next_space == "\n.." then
nomsu:append("\n", pop_comments(pos), '..')
next_space = ""
+ elseif next_space == " " and nomsu:trailing_line_len() > MAX_LINE then
+ nomsu:append(" \\\n", pop_comments(pos), '..')
+ next_space = ""
end
if type(bit) == "string" then
if not (type(tree[i - 1]) == 'string' and is_operator(tree[i - 1]) ~= is_operator(bit)) then