From 39a0121856f8230332bcef1b6a7108696f2a765d Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 17 Jul 2018 15:00:57 -0700 Subject: Improvements to nomsu codegen. --- code_obj.moon | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'code_obj.moon') diff --git a/code_obj.moon b/code_obj.moon index 0981d5a..5397cf6 100644 --- a/code_obj.moon +++ b/code_obj.moon @@ -72,8 +72,11 @@ class Code if trailing_text @current_indent = #spaces @trailing_line_len = #trailing_text + else @trailing_line_len += #b else - @trailing_line_len = math.min(@trailing_line_len + #tostring(b), b.trailing_line_len) + if trailing_text = match(tostring(b), "\n([^\n]*)$") + @trailing_line_len = #trailing_text + @current_indent + else @trailing_line_len += #tostring(b) if @current_indent != 0 indents[#bits] = @current_indent @__str = nil -- cgit v1.2.3