From 92fdd7f2a69bdcf3b316f5e111155bed699ff63e Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Mon, 8 Jan 2024 18:16:48 -0300 Subject: [PATCH] standard library: complete debug table --- tl.lua | 38 +++++++++++++++++++++++++++++++++----- tl.tl | 38 +++++++++++++++++++++++++++++++++----- 2 files changed, 66 insertions(+), 10 deletions(-) diff --git a/tl.lua b/tl.lua index 540b31f45..376e2b735 100644 --- a/tl.lua +++ b/tl.lua @@ -91,12 +91,40 @@ do type HookFunction = function(HookEvent, integer) - getinfo: function(any): GetInfoTable - getinfo: function(any, string): GetInfoTable - getinfo: function(thread, any, string): GetInfoTable + type AnyFunction = function(any...):any... - sethook: function(thread, HookFunction, string, number) - sethook: function(HookFunction, string, number) + debug: function() + gethook: function(? thread): HookFunction, integer + + getinfo: function(AnyFunction | number): GetInfoTable + getinfo: function(AnyFunction | number, string): GetInfoTable + getinfo: function(thread, AnyFunction | number, string): GetInfoTable + + getlocal: function(thread, AnyFunction, number): string + getlocal: function(thread, number, number): string, any + getlocal: function(AnyFunction, number): string + getlocal: function(number, number): string, any + + getmetatable: function(T): metatable + getregistry: function(): {any:any} + getupvalue: function(AnyFunction, number): any + getuservalue: function(userdata, number): any + + sethook: function(thread, HookFunction, string, ? number) + sethook: function(HookFunction, string, ? number) + + setlocal: function(thread, number, number, any): string + setlocal: function(number, number, any): string + + setmetatable: function(T, metatable): T + setupvalue: function(AnyFunction, number, any): string + setuservalue: function(U, any, number): U --[[U is userdata]] + + traceback: function(thread, ? string, ? number): string + traceback: function(? string, ? number): string + + upvalueid: function(AnyFunction, number): userdata + upvaluejoin: function(AnyFunction, number, AnyFunction, number) end global record io diff --git a/tl.tl b/tl.tl index f50a1ceae..d5a5baa39 100644 --- a/tl.tl +++ b/tl.tl @@ -91,12 +91,40 @@ do type HookFunction = function(HookEvent, integer) - getinfo: function(any): GetInfoTable - getinfo: function(any, string): GetInfoTable - getinfo: function(thread, any, string): GetInfoTable + type AnyFunction = function(any...):any... - sethook: function(thread, HookFunction, string, number) - sethook: function(HookFunction, string, number) + debug: function() + gethook: function(? thread): HookFunction, integer + + getinfo: function(AnyFunction | number): GetInfoTable + getinfo: function(AnyFunction | number, string): GetInfoTable + getinfo: function(thread, AnyFunction | number, string): GetInfoTable + + getlocal: function(thread, AnyFunction, number): string + getlocal: function(thread, number, number): string, any + getlocal: function(AnyFunction, number): string + getlocal: function(number, number): string, any + + getmetatable: function(T): metatable + getregistry: function(): {any:any} + getupvalue: function(AnyFunction, number): any + getuservalue: function(userdata, number): any + + sethook: function(thread, HookFunction, string, ? number) + sethook: function(HookFunction, string, ? number) + + setlocal: function(thread, number, number, any): string + setlocal: function(number, number, any): string + + setmetatable: function(T, metatable): T + setupvalue: function(AnyFunction, number, any): string + setuservalue: function(U, any, number): U --[[U is userdata]] + + traceback: function(thread, ? string, ? number): string + traceback: function(? string, ? number): string + + upvalueid: function(AnyFunction, number): userdata + upvaluejoin: function(AnyFunction, number, AnyFunction, number) end global record io