From dcff9ecfcf0c3f81cc22bacd082472ea744c9070 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 26 Sep 2018 13:57:13 -0700 Subject: Fix for calling function with non-literal list. --- core/metaprogramming.nom | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/metaprogramming.nom b/core/metaprogramming.nom index f92fb0c..00151d5 100644 --- a/core/metaprogramming.nom +++ b/core/metaprogramming.nom @@ -91,7 +91,11 @@ lua> "\ compile [call %fn with %args] to: lua> "\ ..local lua = LuaCode.Value(tree.source, nomsu:compile(\%fn), "(") - lua:concat_append(table.map(\%args, function(a) return nomsu:compile(a) end), ", ") + if \%args.type == 'List' then + lua:concat_append(table.map(\%args, function(a) return nomsu:compile(a) end), ", ") + else + lua:append('unpack(', nomsu:compile(\%args), ')') + end lua:append(")") return lua" -- cgit v1.2.3