From 9fceff7e785bb234971b443809eef3da9051c598 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 14 Jan 2019 16:30:17 -0800 Subject: Added (SyntaxTree {...} ...) shorthand for SyntaxTree{..., ...} and added some shebangs. --- syntax_tree.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'syntax_tree.lua') diff --git a/syntax_tree.lua b/syntax_tree.lua index 9886753..017b44a 100644 --- a/syntax_tree.lua +++ b/syntax_tree.lua @@ -225,11 +225,14 @@ do SyntaxTree = _class_0 end SyntaxTree.__base.__type = "Syntax Tree" -getmetatable(SyntaxTree).__call = function(self, t) +getmetatable(SyntaxTree).__call = function(self, t, ...) if type(t.source) == 'string' then t.source = Source:from_string(t.source) end setmetatable(t, self.__base) + for i = 1, select("#", ...) do + t[i] = select(i, ...) + end if t.type == 'Action' then t.stub = t:get_stub() end -- cgit v1.2.3