diff options
author | David Walter Seikel | 2015-03-22 17:35:10 +1000 |
---|---|---|
committer | David Walter Seikel | 2015-03-22 17:35:10 +1000 |
commit | b75e596af61da88aa705491778a5fd6845ab43ba (patch) | |
tree | 1f969b3c4012ae0fb81ab7591ea559403efe855a /lib | |
parent | New idea about contact sets. (diff) | |
download | SledjHamr-b75e596af61da88aa705491778a5fd6845ab43ba.zip SledjHamr-b75e596af61da88aa705491778a5fd6845ab43ba.tar.gz SledjHamr-b75e596af61da88aa705491778a5fd6845ab43ba.tar.bz2 SledjHamr-b75e596af61da88aa705491778a5fd6845ab43ba.tar.xz |
Add internal reference for skang modules, so they can find themselves.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/skang.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/skang.lua b/lib/skang.lua index e44d4bc..8de692e 100644 --- a/lib/skang.lua +++ b/lib/skang.lua | |||
@@ -117,6 +117,8 @@ moduleBegin = function (name, author, copyright, version, timestamp, skin, isLua | |||
117 | end | 117 | end |
118 | 118 | ||
119 | _M._M = _M -- So that references to _M below the setfenv() actually go to the real _M. | 119 | _M._M = _M -- So that references to _M below the setfenv() actually go to the real _M. |
120 | --[[ TODO - Check if it exists before doing this, or could override standard Lua stuff. ]] | ||
121 | _M[name] = _M -- So that the module can refer to itself internally. | ||
120 | _M._NAME = name | 122 | _M._NAME = name |
121 | _M._PACKAGE = string.gsub(_M._NAME, "[^.]*$", "") -- Strip the name down to the package name. | 123 | _M._PACKAGE = string.gsub(_M._NAME, "[^.]*$", "") -- Strip the name down to the package name. |
122 | _M.isLua = isLua | 124 | _M.isLua = isLua |