diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-04-24 20:38:25 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-04-24 20:39:18 -0700 |
| commit | ec5d730fa0ac26ace7fdd6a1de5fed9e05c133c0 (patch) | |
| tree | 0f414c109d4fceae47eb23b6c3ca167180d9c6fb /nomsu_tree.moon | |
| parent | bb31a98a5674a64cb015b843be534dccb24632db (diff) | |
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.
Diffstat (limited to 'nomsu_tree.moon')
| -rw-r--r-- | nomsu_tree.moon | 5 |
1 files changed, 3 insertions, 2 deletions
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 |
