diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-17 15:00:57 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-17 15:01:04 -0700 |
| commit | 39a0121856f8230332bcef1b6a7108696f2a765d (patch) | |
| tree | 5773a088243f02be20a963c676fde6d52ec5fcd3 /code_obj.moon | |
| parent | 0442c8dd216f16c7371873a8e8fd8bf83d30dad0 (diff) | |
Improvements to nomsu codegen.
Diffstat (limited to 'code_obj.moon')
| -rw-r--r-- | code_obj.moon | 5 |
1 files changed, 4 insertions, 1 deletions
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 |
