From 3b37aa2a869652b2718b399ad0a4831e263023b3 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 11 Dec 2019 17:32:46 +0000 Subject: [Minor] Selectors: Try to fix last transformation --- lualib/lua_selectors/transforms.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lualib') diff --git a/lualib/lua_selectors/transforms.lua b/lualib/lua_selectors/transforms.lua index ffc9acd00..b6fc0a001 100644 --- a/lualib/lua_selectors/transforms.lua +++ b/lualib/lua_selectors/transforms.lua @@ -54,7 +54,13 @@ local transform_function = { ['list'] = true, }, ['process'] = function(inp, t) - return fun.nth(#inp, inp),pure_type(t) + local gen,param,state = fun.iter(inp) + local prev_state + repeat + prev_state = state + state = gen(param, state) + until state == nil + return prev_state,pure_type(t) end, ['description'] = 'Returns the last element', }, -- cgit v1.2.3