lua-repl.c does not compile with lua 5.2

On my Archlinux system, which has lua 5.2, I cannot compile OCL; it has undeclared variables in lua-repl.c.

I think this question and answer on Stack Overflow relates to it: http://stackoverflow.com/questions/10087226/lua-5-2-lua-globalsindex-alternative

I do not have enough understanding of lua to solve this; please help.

Regards, Theo