• antirez's avatar
    Lua debugger: try to eval as expression first. · e6eb6ead
    antirez authored
    It's handly to just eval "5+5" without the return and see it printed on
    the screen as result. However prepending "return" does not always result
    into valid Lua code. So what we do is to exploit a common Lua community
    trick of trying to compile with return prepended, and if compilation
    fails then it's not an expression that can be returned, so we try again
    without prepending "return". Works great apparently.
    e6eb6ead
scripting.c 74.3 KB