diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-08-27 13:38:58 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-08-27 13:39:22 -0700 |
| commit | 930d522fbc3ab57faa926ed85f0d35d661722402 (patch) | |
| tree | 8c91c71728b43b4e1817ed182c39bf991cb4b2a9 /syntax_tree.moon | |
| parent | c6a7b0be9ebdddb58a03749705987cb3058060d3 (diff) | |
Bunch of miscellaneous changes. Paved the way a little bit for having
different compiler domains.
Diffstat (limited to 'syntax_tree.moon')
| -rw-r--r-- | syntax_tree.moon | 6 |
1 files changed, 4 insertions, 2 deletions
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) |
