diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-11-17 14:38:05 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-11-17 14:39:08 -0800 |
| commit | 7f47d4204039258cec78c767f489b7809b4257ff (patch) | |
| tree | c8533068b75ab453accfe1f688705e9e94c9e279 /syntax_tree.lua | |
| parent | 34a3dd22a4e132bd4e0fe3ce89831c3fe761d3d9 (diff) | |
In-progress (but working) overhaul of some elements including: function
calls, lib/thing.nom API, multi-assignments, varargs, etc.
Diffstat (limited to 'syntax_tree.lua')
| -rw-r--r-- | syntax_tree.lua | 13 |
1 files changed, 7 insertions, 6 deletions
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 |
