As the title says... Chat on...

User avatar
By FrankX
#49967 I would like to be able to verify the syntax of a LUA program before actually calling it.
If I use node.compile() from a LUA program, it will stop execution if the target LUA program has syntax errors.
I would like e.g. that node.compile() returns False in case the target file has errors.
How could I accomplish this?
User avatar
By marcelstoer
#49970 Lua is not an acronym, please don't write LUA.

Not sure if there's a satisfactory answer.

You can run it through a standard Lua compiler on the platform of your choice. You can even cross-compile the code to create an executable for the device. That'll allow you to weed out Lua syntax errors but you won't find NodeMCU API usage errors.