[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Wrong activelines In Lua5.4
- From: Philippe Verdy <verdyp@...>
- Date: Sat, 13 Nov 2021 10:07:48 +0100
You're wrong: the code is effectively compiled as a function, which will be called (even if this is not by prepending/appending Lua source code, there's effectivly some bytecode implicitly added by the compiler, at start and end of the compiled source code, to make it a valid binary-compiled function).
> 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.
This is definitely not true: the Lua compiler does not prepend or
append any text to the code it receives. Use my ltokenp token
processor to see the stream of tokens that the compiler receives.