From cffb2b2c6934428fc5f677b2330eaf9cb438909e Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sun, 17 Apr 2016 16:38:49 +0000 Subject: MirLua: - added string interpolation: print('some {val} string' % { val = 'cool' }) - version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@16699 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/mlua.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'plugins/MirLua/src/mlua.cpp') diff --git a/plugins/MirLua/src/mlua.cpp b/plugins/MirLua/src/mlua.cpp index f2cdafb41b..8a9b0ce87c 100644 --- a/plugins/MirLua/src/mlua.cpp +++ b/plugins/MirLua/src/mlua.cpp @@ -56,6 +56,13 @@ void CMLua::Load() lua_setglobal(L, "_tonumber"); lua_register(L, "tonumber", luaM_tonumber); + lua_pushstring(L, ""); + lua_getmetatable(L, -1); + lua_pushstring(L, "__mod"); + lua_pushcfunction(L, luaM_interpolate); + lua_rawset(L, -3); + lua_pop(L, 2); + lua_atpanic(L, luaM_atpanic); Log("Loading miranda modules"); -- cgit v1.2.3