aboutsummaryrefslogtreecommitdiff
path: root/code_obj.moon
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-11-17 14:38:05 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-11-17 14:39:08 -0800
commit7f47d4204039258cec78c767f489b7809b4257ff (patch)
treec8533068b75ab453accfe1f688705e9e94c9e279 /code_obj.moon
parent34a3dd22a4e132bd4e0fe3ce89831c3fe761d3d9 (diff)
In-progress (but working) overhaul of some elements including: function
calls, lib/thing.nom API, multi-assignments, varargs, etc.
Diffstat (limited to 'code_obj.moon')
-rw-r--r--code_obj.moon11
1 files changed, 3 insertions, 8 deletions
diff --git a/code_obj.moon b/code_obj.moon
index e7fb5f3..4fcfd42 100644
--- a/code_obj.moon
+++ b/code_obj.moon
@@ -42,7 +42,6 @@ class Source
return Source(@filename, @start+offset, @stop)
class Code
- is_code: true
new: (...)=>
@bits = {}
@append(...)
@@ -101,9 +100,7 @@ class Code
assert(b, "code bit is nil")
assert(not Source\is_instance(b), "code bit is a Source")
if b == '' then continue
- b.dirty = error if b.is_code
- --if type(b) != 'string' and not (type(b) == 'table' and b.is_code)
- -- b = b\as_lua!
+ b.dirty = error if type(b) != 'string'
bits[#bits+1] = b
@dirty!
@@ -140,7 +137,7 @@ class Code
else
bits[#bits+1] = joiner
bits[#bits+1] = b
- b.dirty = error if b.is_code
+ b.dirty = error if type(b) != 'string'
unless type(b) == 'string'
b = b\text!
line = match(b, "\n([^\n]*)$")
@@ -157,9 +154,7 @@ class Code
bits[i] = bits[i-n]
for i=1,n
b = select(i, ...)
- b.dirty = error if b.is_code
- --if type(b) != 'string' and not (type(b) == 'table' and b.is_code)
- -- b = b\as_lua!
+ b.dirty = error if type(b) != 'string'
bits[i] = b
@dirty!