aboutsummaryrefslogtreecommitdiffstats
path: root/root/$mmm/plugins/moonscript/converts: text$lua -> table.lua
diff options
context:
space:
mode:
Diffstat (limited to 'root/$mmm/plugins/moonscript/converts: text$lua -> table.lua')
-rw-r--r--root/$mmm/plugins/moonscript/converts: text$lua -> table.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/root/$mmm/plugins/moonscript/converts: text$lua -> table.lua b/root/$mmm/plugins/moonscript/converts: text$lua -> table.lua
new file mode 100644
index 0000000..1ac91b4
--- /dev/null
+++ b/root/$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
+ }
+}