private static void comparison(lua_Type tag_less, lua_Type tag_equal, lua_Type tag_great, CharPtr op) { Object_ l = top.get(-2); Object_ r = top.get(-1); int result; if (tag(l) == lua_Type.LUA_T_NUMBER && tag(r) == lua_Type.LUA_T_NUMBER) { result = (nvalue(l) < nvalue(r)) ? -1 : (nvalue(l) == nvalue(r)) ? 0 : 1; } else if (tostring(l) || tostring(r)) { lua_pushstring(op); do_call(luaI_fallBacks[FB_ORDER].function, ObjectRef.minus(top, stack) - 3, 1, ObjectRef.minus(top, stack) - 3); return; } else { result = strcmp(svalue(l), svalue(r)); } top.dec(); nvalue(top.get(-1), 1); tag(top.get(-1), (result < 0) ? tag_less : ((result == 0) ? tag_equal : tag_great)); }
public static void tag(Object_ o, lua_Type t) { // if (t == Type.T_NUMBER) // { // Console.WriteLine("=============="); // } o.tag = t; }
public static void s_tag(int i, lua_Type t) { tag(s_object(i), t); }
public Symbol(lua_Type tag, Cfunction f) { this.object_.tag = tag; this.object_.value.f = f; }
public Object_(lua_Type tag, Cfunction f) { this._tag = tag; this.value.f = f; }
public void set(Object_ obj) { this.tag = obj.tag; this.value.set(obj.value); }