aboutsummaryrefslogtreecommitdiff
path: root/syntax_tree.moon
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-12-30 21:16:49 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-12-30 21:17:10 -0800
commit435eae7c0ab10577431bb943a6f48873e5ecdf7c (patch)
treee56cf4f0ecdf0a0502fb2e24148ab490ebd00549 /syntax_tree.moon
parent44c3fb26bfe922eb8bd749e8397a5de716b5d56c (diff)
Some minor fixes for (type of $ast) and indexing codegen.
Diffstat (limited to 'syntax_tree.moon')
-rw-r--r--syntax_tree.moon3
1 files changed, 1 insertions, 2 deletions
diff --git a/syntax_tree.moon b/syntax_tree.moon
index d9f9da1..2579fad 100644
--- a/syntax_tree.moon
+++ b/syntax_tree.moon
@@ -16,8 +16,6 @@ as_lua = =>
--types = {"Number", "Var", "Block", "EscapedNomsu", "Text", "List", "Dict", "DictEntry",
-- "IndexChain", "Action", "FileChunks", "Error", "Comment"}
class SyntaxTree
- @__type: "Syntax Tree"
-
__tostring: =>
bits = [type(b) == 'string' and b\as_lua! or tostring(b) for b in *@]
for k,v in pairs(@)
@@ -104,6 +102,7 @@ class SyntaxTree
@is_instance: (t)=>
type(t) == 'table' and getmetatable(t) == @__base
+SyntaxTree.__base.__type = "Syntax Tree"
getmetatable(SyntaxTree).__call = (t)=>
if type(t.source) == 'string'