Beispiel #1
0
            /*
            ** {======================================================
            ** Error-recovery functions
            ** =======================================================
            */

            /*
            ** LUAI_THROW/LUAI_TRY define how Lua does exception handling. By
            ** default, Lua handles errors with exceptions when compiling as
            ** C++ code, with _longjmp/_setjmp when asked to use them, and with
            ** longjmp/setjmp otherwise.
            */

            public static void LUAI_TRY(lua_State L, Pfunc f, object ud, lua_longjmp lj)
            {
                try { f(L, ud); }
                catch (Exception) { if (lj.status == 0)
                                    {
                                        lj.status = -1;
                                    }
                }
            }
Beispiel #2
0
 public LuaException(lua_longjmp jmp)
 {
     lj = jmp;
 }
Beispiel #3
0
 public static void LUAI_THROW(lua_State L, lua_longjmp lj)
 {
     throw (new LuaException(lj));
 }