From 57d61529038fe4c1a27e20871b13788409388c25 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 14 Apr 2015 18:26:46 +0100 Subject: [PATCH] Pass group name to lua in task:get_symbol method. --- src/lua/lua_task.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 4d9f44cee..90bf39e1b 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -354,6 +354,7 @@ LUA_FUNCTION_DEF (task, get_images); * - `metric` - name of metric * - `score` - score of a symbol in that metric * - `options` - a table of strings representing options of a symbol + * - `group` - a group of symbol (or 'ungrouped') * @param {string} name symbol's name * @return {list of tables} list of tables or nil if symbol was not found in any metric */ @@ -1528,6 +1529,18 @@ lua_push_symbol_result (lua_State *L, lua_pushstring (L, "score"); lua_pushnumber (L, s->score); lua_settable (L, -3); + + if (s->def) { + lua_pushstring (L, "group"); + lua_pushstring (L, s->def->gr->name); + lua_settable (L, -3); + } + else { + lua_pushstring (L, "group"); + lua_pushstring (L, "ungrouped"); + lua_settable (L, -3); + } + if (s->options) { opt = s->options; lua_pushstring (L, "options"); -- 2.39.5