From 930d522fbc3ab57faa926ed85f0d35d661722402 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 27 Aug 2018 13:38:58 -0700 Subject: Bunch of miscellaneous changes. Paved the way a little bit for having different compiler domains. --- syntax_tree.moon | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'syntax_tree.moon') diff --git a/syntax_tree.moon b/syntax_tree.moon index 885892f..7132c64 100644 --- a/syntax_tree.moon +++ b/syntax_tree.moon @@ -19,7 +19,9 @@ for name in *types .__name = name .type = name .is_instance = (x)=> getmetatable(x) == @ - .__tostring = => "#{@type}(#{repr tostring(@source)}, #{concat([repr(v) for v in *@], ', ')})" + .__tostring = => + args = {tostring(@source), unpack(@)} + "#{@type}(#{concat([repr(v) for v in *args], ', ')})" .map = (fn)=> replacement = fn(@) if replacement == false then return nil @@ -47,7 +49,7 @@ for name in *types return true AST[name] = setmetatable cls, - __tostring: => @name + __tostring: => @__name __call: (source, ...)=> if type(source) == 'string' source = Source\from_string(source) -- cgit v1.2.3