From 7f47d4204039258cec78c767f489b7809b4257ff Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 17 Nov 2018 14:38:05 -0800 Subject: In-progress (but working) overhaul of some elements including: function calls, lib/thing.nom API, multi-assignments, varargs, etc. --- syntax_tree.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'syntax_tree.lua') diff --git a/syntax_tree.lua b/syntax_tree.lua index 098dbce..ddd607c 100644 --- a/syntax_tree.lua +++ b/syntax_tree.lua @@ -147,16 +147,16 @@ do end, get_args = function(self) assert(self.type == "Action", "Only actions have arguments") - local _accum_0 = { } - local _len_0 = 1 + local args = { + self.target + } for _index_0 = 1, #self do local tok = self[_index_0] if type(tok) ~= 'string' then - _accum_0[_len_0] = tok - _len_0 = _len_0 + 1 + args[#args + 1] = tok end end - return _accum_0 + return args end, get_stub = function(self) local stub_bits = { } @@ -198,7 +198,8 @@ do local Files = require('files') local f = Files.read(s.filename) return f - end + end, + __mode = "k" }) self.is_instance = function(self, t) return type(t) == 'table' and getmetatable(t) == self.__base -- cgit v1.2.3