From c9e972c9897eb52f6f07aeba510837e8a7151688 Mon Sep 17 00:00:00 2001 From: steve donovan Date: Tue, 14 Jun 2011 15:04:14 +0200 Subject: [PATCH] spoke too soon. Now using _initial_ global state to determine whether to look in Lua global builtin functions --- ldoc.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ldoc.lua b/ldoc.lua index 21cf685..abf6714 100644 --- a/ldoc.lua +++ b/ldoc.lua @@ -4,6 +4,9 @@ -- easier customization options. C/C++ support is provided. -- Steve Donovan, 2011 +local globals = {} +for k,v in pairs(_G) do globals[k] = v end + require 'pl' local append = table.insert @@ -447,7 +450,7 @@ local doc_path = ldoc_dir..'builtin/?.luadoc' -- ldoc -m is expecting a Lua package; this converts this to a file path if args.module then - if args.file:match '^%a+$' and _G[args.file] then + if args.file:match '^%a+$' and globals[args.file] then args.file = 'global.'..args.file end local fullpath,mod = tools.lookup_existing_module_or_function (args.file, doc_path)