From 50c7c915ee2fa239043d5456237f5145d064089b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 19 Nov 2024 14:09:18 -0300 Subject: Debug information about extra arguments from __call 'debug.getinfo' can return number of extra arguments added to a call by a chain of __call metavalues. That information is being used to improve error messages about errors in these extra arguments. --- manual/manual.of | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'manual') diff --git a/manual/manual.of b/manual/manual.of index ce42ff51..a441cea1 100644 --- a/manual/manual.of +++ b/manual/manual.of @@ -4850,6 +4850,7 @@ typedef struct lua_Debug { unsigned char nups; /* (u) number of upvalues */ unsigned char nparams; /* (u) number of parameters */ char isvararg; /* (u) */ + unsigned char extraargs; /* (t) number of extra arguments */ char istailcall; /* (t) */ int ftransfer; /* (r) index of first value transferred */ int ntransfer; /* (r) number of transferred values */ @@ -4938,6 +4939,14 @@ true if this function invocation was called by a tail call. In this case, the caller of this level is not in the stack. } +@item{@id{extraargs}| +The number of extra arguments added by the call +to functions called through @idx{__call} metamethods. +(Each @idx{__call} metavalue adds a single extra argument, +the object being called, +but there may be a chain of @idx{__call} metavalues.) +} + @item{@id{nups}| the number of upvalues of the function. } @@ -5045,7 +5054,7 @@ fills in the fields @id{source}, @id{short_src}, @id{linedefined}, @id{lastlinedefined}, and @id{what}; } -@item{@Char{t}| fills in the field @id{istailcall}; +@item{@Char{t}| fills in the fields @id{istailcall} and @id{extraargs}; } @item{@Char{u}| fills in the fields @@ -7993,7 +8002,7 @@ returns @fail plus the position of the first invalid byte. @LibEntry{utf8.offset (s, n [, i])| -Returns the the position of the @id{n}-th character of @id{s} +Returns the position of the @id{n}-th character of @id{s} (counting from byte position @id{i}) as two integers: The index (in bytes) where its encoding starts and the index (in bytes) where it ends. -- cgit v1.2.3-55-g6feb