Thank you for special answer.
This is helpful, I also now found the defines/enums NUM_RESERVED and TK_EOS, and like this I see how I could find such "<eof> error events" in the lua code... . This is fine for me.
btw I am just implementing Lua 5.4.3 with Luaconf setting LUA_32BITS into the ARM CortexM4 STM32G4 device line for some IoT applications (M4 includes hardware 32bit floating point), and this really works extremely nice. If I use optimization level 3 in ARMCC-Keil compiler, and if I use luaL_openLibs function to include all standard libs, then it compiles to about 110kByte ROM size... and if I use only basic libraries like base, coroutines, math, string, utf8, table, then it compiles down to only about 50kByte ROM size, this is FULL size of complete application, including ARMCC microlib (but WITHOUT any file system - I want to run just ONE Lua "file" context which will be found at some fix defined location in ROM - this sounds probably very simple to you or any "Lua multi-system guys", but for me this promises an extremely cute and useful solution so far, thank you very much for this.).
The stripping down of code to 50kByte ROM size if the more sophisticated libs are kept out is also a very nice proof of the very efficient "automatic linker code stripping" by ARM CC, and about the somehow very clear programming style of your Lua code, thank you (but for now, and as STM32G4 meanwhile really is available with 512kB ROM quite by standard down to QFN housings, I keep with the luaL_openLibs and the 110kB ROM).
(using optimisation level O1, which somehow is required for "reasonable debugging facilities", the code size will increase by about 20% to 60kB / 120-130kB, but this still is really fine so far...).