From b615a7cf0fc9d81b4b905a9d4e1db0beebdebd3d Mon Sep 17 00:00:00 2001 From: s-ol Date: Sun, 8 May 2022 21:14:58 +0200 Subject: initial commit --- .../moonscript/converts: text$lua -> table.lua | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 $mmm/plugins/moonscript/converts: text$lua -> table.lua (limited to '$mmm/plugins/moonscript/converts: text$lua -> table.lua') diff --git a/$mmm/plugins/moonscript/converts: text$lua -> table.lua b/$mmm/plugins/moonscript/converts: text$lua -> table.lua new file mode 100644 index 0000000..1ac91b4 --- /dev/null +++ b/$mmm/plugins/moonscript/converts: text$lua -> table.lua @@ -0,0 +1,24 @@ +if MODE == 'CLIENT' then + return { } +end +local _, moon = assert(pcall(require, 'moonscript.base')) +local _load = moon.load or moon.loadstring +return { + { + inp = 'text/moonscript -> (.+)', + out = '%1', + cost = 1, + transform = function(self, val, fileder, key) + local func = _load(val, tostring(fileder) .. "#" .. tostring(key)) + return func() + end + }, + { + inp = 'text/moonscript -> (.+)', + out = 'text/lua -> %1', + cost = 2, + transform = function(self, val) + return moon.to_lua(val) + end + } +} -- cgit v1.2.3