lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


You probably do not see that this script is actually embedded at runtime in a block starting at line 1: the start of the block (which actually makes an anonymous function) has active (invisible) code prepended at start of the line, even if line 1 is then only followed by a comment. The script is also followed by an end of block containing some active code (with an implicit return statement just before it, and a function call just after it), but this appending does not increment the line counter.

Le lun. 8 nov. 2021 à 15:54, actboy168 <actboy168@gmail.com> a écrit :
For this code:
> --[[
>     comment
> ]]
> for k in pairs(debug.getinfo(1, "L").activelines) do
>    print(k)
> end

The output is:
1
4
5
6

I think it should be
4
5
6

-- actboy168