osm2pgsql
osm2pgsql copied to clipboard
Check that Lua functions on OSM object are called correctly
The code that deals with functions called on the Lua OSM object given as parameter to the process callbacks is somewhat strange. The result is that calling "object.as_point()" etc. will work, but the correct Lua way to do this is "object:as_point()". This adds a check to all the functions that detects this case and prints a warning. It will also check that those functions are not called with any additional arguments.
Checking for this now, users will hopefully fix this. This gives us the opportunity later to change or code to be more in line with usual Lua syntax.
This will only print a warning once per function.