aboutsummaryrefslogtreecommitdiffstats
path: root/root/$mmm/plugins/moonscript
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2022-03-28 13:58:08 +0000
committers-ol <s+removethis@s-ol.nu>2022-03-28 14:24:26 +0000
commit269d9986c12e277eb6fd5241f34c027c439f84ae (patch)
tree748f965272ada1293b5d5f12420f9f7cb069c0fa /root/$mmm/plugins/moonscript
parentmove layout into user content (diff)
downloadmmm-269d9986c12e277eb6fd5241f34c027c439f84ae.tar.gz
mmm-269d9986c12e277eb6fd5241f34c027c439f84ae.zip
fix plugins in example root
Diffstat (limited to 'root/$mmm/plugins/moonscript')
-rw-r--r--root/$mmm/plugins/moonscript/converts: text$lua -> table.lua24
-rw-r--r--root/$mmm/plugins/moonscript/converts: text$moonscript -> table.moon22
2 files changed, 46 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
+ }
+}
diff --git a/root/$mmm/plugins/moonscript/converts: text$moonscript -> table.moon b/root/$mmm/plugins/moonscript/converts: text$moonscript -> table.moon
new file mode 100644
index 0000000..2e5652c
--- /dev/null
+++ b/root/$mmm/plugins/moonscript/converts: text$moonscript -> table.moon
@@ -0,0 +1,22 @@
+if MODE == 'CLIENT'
+ return {}
+
+_, moon = assert pcall require, 'moonscript.base'
+_load = moon.load or moon.loadstring
+
+{
+ {
+ inp: 'text/moonscript -> (.+)',
+ out: '%1',
+ cost: 1
+ transform: (val, fileder, key) =>
+ func = _load val, "#{fileder}##{key}"
+ func!
+ },
+ {
+ inp: 'text/moonscript -> (.+)',
+ out: 'text/lua -> %1',
+ cost: 2
+ transform: (val) => moon.to_lua val
+ },
+}