From ec5d730fa0ac26ace7fdd6a1de5fed9e05c133c0 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 24 Apr 2018 20:38:25 -0700 Subject: Switched repr() to only return ""-style strings, and not [[]]-style, which helps with indenting generated lua code correctly. Also made a few ergonomic fixes/changes for line breaking. --- nomsu_tree.moon | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'nomsu_tree.moon') diff --git a/nomsu_tree.moon b/nomsu_tree.moon index fcef992..ff71c54 100644 --- a/nomsu_tree.moon +++ b/nomsu_tree.moon @@ -278,8 +278,9 @@ Tree "List", line, src = item.source\get_line!, item.source\get_text! error "#{line}: Cannot use #{colored.yellow src} as a list item, since it's not an expression.", 0 lua\append item_lua - newlines, last_line = tostring(item_lua)\match("^(.-)([^\n]*)$") - if #newlines > 0 + item_string = tostring(item_lua) + last_line = item_string\match("[^\n]*$") + if item_string\match("\n") line_length = #last_line else line_length += #last_line -- cgit v1.2.3