Commit b969a882 authored by Megax's avatar Megax
Browse files

* Project fajlok at lettek alakitva. Igy most mindegyik normalisan hasznalhato...

* Project fajlok at lettek alakitva. Igy most mindegyik normalisan hasznalhato forditasnal. Nincsenek hibak. KopiLua-ba kerult egy fix. Nem ertem mitol jott elo az a hiba ami elojott de most van a kodban (vagy is volt mert fixaltam).
parent d7bb0c93
...@@ -758,18 +758,24 @@ namespace KopiLua ...@@ -758,18 +758,24 @@ namespace KopiLua
public static int luaO_rawequalObj (TValue t1, TValue t2) { public static int luaO_rawequalObj (TValue t1, TValue t2) {
Console.WriteLine("luaO_rawequalObj:" + (ttype(t1) != ttype(t2)).ToString());
if (ttype(t1) != ttype(t2)) return 0; if (ttype(t1) != ttype(t2)) return 0;
else switch (ttype(t1)) { else switch (ttype(t1)) {
case LUA_TNIL: case LUA_TNIL:
Console.WriteLine("luaO_rawequalObj1:" + (1).ToString());
return 1; return 1;
case LUA_TNUMBER: case LUA_TNUMBER:
Console.WriteLine("luaO_rawequalObj2:" + (luai_numeq(nvalue(t1), nvalue(t2))).ToString());
return luai_numeq(nvalue(t1), nvalue(t2)) ? 1 : 0; return luai_numeq(nvalue(t1), nvalue(t2)) ? 1 : 0;
case LUA_TBOOLEAN: case LUA_TBOOLEAN:
Console.WriteLine("luaO_rawequalObj3:" + (bvalue(t1) == bvalue(t2)).ToString());
return bvalue(t1) == bvalue(t2) ? 1 : 0; /* boolean true must be 1....but not in C# !! */ return bvalue(t1) == bvalue(t2) ? 1 : 0; /* boolean true must be 1....but not in C# !! */
case LUA_TLIGHTUSERDATA: case LUA_TLIGHTUSERDATA:
Console.WriteLine("luaO_rawequalObj4:" + (pvalue(t1) == pvalue(t2)).ToString());
return pvalue(t1) == pvalue(t2) ? 1 : 0; return pvalue(t1) == pvalue(t2) ? 1 : 0;
default: default:
lua_assert(iscollectable(t1)); lua_assert(iscollectable(t1));
Console.WriteLine("luaO_rawequalObj5:" + (gcvalue(t1) == gcvalue(t2)).ToString());
return gcvalue(t1) == gcvalue(t2) ? 1 : 0; return gcvalue(t1) == gcvalue(t2) ? 1 : 0;
} }
} }
......
...@@ -424,7 +424,33 @@ namespace KopiLua ...@@ -424,7 +424,33 @@ namespace KopiLua
if (s == null) return null; if (s == null) return null;
p+=2; goto init; /* else return match(ms, s, p+2) */ p+=2; goto init; /* else return match(ms, s, p+2) */
} }
goto dflt; /* case default */ //ismeretlen hiba miatt lett ide átmásolva
{ /* it is a pattern item */
CharPtr ep = classend(ms, p); /* points to what is next */
int m = (s<ms.src_end) && (singlematch((byte)(s[0]), p, ep)!=0) ? 1 : 0;
switch (ep[0]) {
case '?': { /* optional */
CharPtr res;
if ((m!=0) && ((res=match(ms, s+1, ep+1)) != null))
return res;
p=ep+1; goto init; /* else return match(ms, s, ep+1); */
}
case '*': { /* 0 or more repetitions */
return max_expand(ms, s, p, ep);
}
case '+': { /* 1 or more repetitions */
return ((m!=0) ? max_expand(ms, s+1, p, ep) : null);
}
case '-': { /* 0 or more repetitions (minimum) */
return min_expand(ms, s, p, ep);
}
default: {
if (m==0) return null;
s = s.next(); p=ep; goto init; /* else return match(ms, s+1, ep); */
}
}
}
//goto dflt; /* case default */
} }
} }
} }
......
...@@ -99,6 +99,7 @@ namespace KopiLua ...@@ -99,6 +99,7 @@ namespace KopiLua
mt = G(L).mt[ttype(o)]; mt = G(L).mt[ttype(o)];
break; break;
} }
Console.WriteLine("mt: " + (mt!=null).ToString());
return ((mt!=null) ? luaH_getstr(mt, G(L).tmname[(int)event_]) : luaO_nilobject); return ((mt!=null) ? luaH_getstr(mt, G(L).tmname[(int)event_]) : luaO_nilobject);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment