Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/dok.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Farabet <clement.farabet@gmail.com>2012-02-12 08:26:41 +0400
committerClement Farabet <clement.farabet@gmail.com>2012-02-12 08:26:41 +0400
commite39ed8bc955c112029789e93e208f813eeaa20e5 (patch)
tree5a5abd2291de77e2785c907169e9c2c843c3d062
parenta892d91f64ba8aaff46461bf8622b42c451d1239 (diff)
Fixed inline doc parser
-rw-r--r--inline.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/inline.lua b/inline.lua
index 76f6229..4f0b5d9 100644
--- a/inline.lua
+++ b/inline.lua
@@ -185,10 +185,11 @@ function dok.refresh()
local html = dok.dok2html(content)
local funcs = dok.html2funcs(html, package)
local pkg = _G[package]
- if type(pkg) ~= 'table' then -- unsafe import, use protected import
+ if type(pkg) ~= 'table' and _G._torchimport then
+ -- unsafe import, use protected import
pkg = _G._torchimport[package]
end
- if pkg then
+ if pkg and type(pkg) == 'table' then
-- level 0: the package itself
dok.inline[pkg] = dok.inline[pkg] or funcs['dok'] or funcs['reference.dok'] or funcs['overview.dok']
-- next levels