diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2018-11-01 10:17:55 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2018-11-01 10:17:55 +0000 |
| commit | 30fb0dc40d595b9e0b7747ad8e5c4e8cf7e3023b (patch) | |
| tree | dc56f20ec4d78115e15761c402589b5aec94ef55 /lib/init.client.moon | |
| parent | defer all scripts (diff) | |
| download | mmm-30fb0dc40d595b9e0b7747ad8e5c4e8cf7e3023b.tar.gz mmm-30fb0dc40d595b9e0b7747ad8e5c4e8cf7e3023b.zip | |
move mmm code from lib to mmm etc
Diffstat (limited to 'lib/init.client.moon')
| -rw-r--r-- | lib/init.client.moon | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/lib/init.client.moon b/lib/init.client.moon deleted file mode 100644 index 144543b..0000000 --- a/lib/init.client.moon +++ /dev/null @@ -1,49 +0,0 @@ -export MODE, print, warn, relative, on_client -export window, document - -window = js.global -{ :document, :console } = window - -MODE = 'CLIENT' - -deep_tostring = (tbl, space='') -> - return tbl if 'userdata' == type tbl - - buf = space .. tostring tbl - return buf unless 'table' == type tbl - - buf = buf .. ' {\n' - for k,v in pairs tbl - buf = buf .. "#{space} [#{k}]: #{deep_tostring v, space .. ' '}\n" - buf = buf .. "#{space}}" - buf - -print = (...) -> - contents = [deep_tostring v for v in *{ ... } ] - console\log table.unpack contents - -warn = (...) -> - contents = [deep_tostring v for v in *{ ... } ] - console\warn table.unpack contents - --- package.path = '/?.client.moon.lua;/?.moon.lua;/?/init.moon.lua;/?.lua;/?/init.lua' -package.path = '/?.lua;/?/init.lua' - --- relative imports -relative = do - _require = require - - (base, sub) -> - sub = 0 unless 'number' == type sub - - for i=1, sub - base = base\match '^(.*)%.%w+$' - - (name, x) -> - name = base .. name if '.' == name\sub 1, 1 - _require name - -on_client = (f, ...) -> f ... - -if on_load - for f in *on_load do f! |
