diff src/luan/LuanTable.java @ 796:6b8ea0a9b7c9

remove LuanMeta
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 05 Sep 2016 19:52:49 -0600
parents d69d3c51c44e
children 2443152dc2f1
line wrap: on
line diff
--- a/src/luan/LuanTable.java	Mon Sep 05 16:32:55 2016 -0600
+++ b/src/luan/LuanTable.java	Mon Sep 05 19:52:49 2016 -0600
@@ -117,10 +117,6 @@
 		Object h = getHandler("__to_string");
 		if( h == null )
 			return rawToString();
-		if( h instanceof LuanMeta ) {
-			LuanMeta meta = (LuanMeta)h;
-			return meta.__to_string(luan,this);
-		}
 		LuanFunction fn = Luan.checkFunction(h);
 		return Luan.checkString( Luan.first( fn.call(luan,new Object[]{this}) ) );
 	}
@@ -140,10 +136,6 @@
 			LuanFunction fn = (LuanFunction)h;
 			return Luan.first(fn.call(luan,new Object[]{this,key}));
 		}
-		if( h instanceof LuanMeta ) {
-			LuanMeta meta = (LuanMeta)h;
-			return meta.__index(luan,this,key);
-		}
 		return luan.index(h,key);
 	}
 
@@ -177,11 +169,6 @@
 			fn.call(luan,new Object[]{this,key,value});
 			return;
 		}
-		if( h instanceof LuanMeta ) {
-			LuanMeta meta = (LuanMeta)h;
-			meta.__new_index(luan,this,key,value);
-			return;
-		}
 		if( h instanceof LuanTable ) {
 			LuanTable tbl = (LuanTable)h;
 			tbl.put(luan,key,value);
@@ -354,10 +341,6 @@
 					throw new LuanException( "metamethod __pairs should return function but returned " + Luan.type(obj) );
 				return (LuanFunction)obj;
 			}
-			if( h instanceof LuanMeta ) {
-				LuanMeta meta = (LuanMeta)h;
-				return meta.__pairs(luan,this);
-			}
 			throw new LuanException( "invalid type of metamethod __pairs: " + Luan.type(h) );
 		}
 		return rawPairs();