summaryrefslogtreecommitdiffstats
path: root/$mmm/plugins/moonscript/converts: text$moonscript -> table.moon
blob: 2e5652cbcc69f65f96d71388ef2e05454439e1ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
  },
}