From c4be74a5d33e8c92aa05ebda883361480a1000c6 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 20 Jul 2018 17:51:21 -0700 Subject: Simplifying and correcting the nomsu codegen. --- code_obj.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'code_obj.lua') diff --git a/code_obj.lua b/code_obj.lua index 51d9b00..8a51832 100644 --- a/code_obj.lua +++ b/code_obj.lua @@ -83,7 +83,9 @@ do dirty = function(self) self.__str = nil self._trailing_line_len = nil - self._is_multiline = nil + if self._is_multiline == false then + self._is_multiline = nil + end end, append = function(self, ...) local n = select("#", ...) @@ -100,6 +102,9 @@ do break end bits[#bits + 1] = b + if b.is_code then + b.dirty = error + end if type(b) ~= 'string' and not (type(b) == 'table' and b.is_code) then b = repr(b) end @@ -153,6 +158,9 @@ do end end bits[#bits + 1] = b + if b.is_code then + b.dirty = error + end local b_str = tostring(b) local line = match(b_str, "\n([^\n]*)$") if line then @@ -170,7 +178,11 @@ do bits[i] = bits[i - n] end for i = 1, n do - bits[i] = select(i, ...) + local b = select(i, ...) + bits[i] = b + if b.is_code then + b.dirty = error + end end return self:dirty() end -- cgit v1.2.3