Mercurial Hosting > luan
diff core/src/luan/LuanState.java @ 221:ec016471c6eb
make LuanTable an interface
git-svn-id: https://luan-java.googlecode.com/svn/trunk@222 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Thu, 17 Jul 2014 07:49:26 +0000 |
parents | 5ba136769034 |
children | 05eb2837ddbf |
line wrap: on
line diff
--- a/core/src/luan/LuanState.java Wed Jul 16 04:59:45 2014 +0000 +++ b/core/src/luan/LuanState.java Thu Jul 17 07:49:26 2014 +0000 @@ -19,13 +19,13 @@ final List<StackTraceElement> stackTrace = new ArrayList<StackTraceElement>(); - private LuanTable registry; - private LuanTable global; - private LuanTable metatable; // generic metatable + private LuanTableImpl registry; + private LuanTableImpl global; + private LuanTableImpl metatable; // generic metatable protected LuanState() { - registry = new LuanTable(); - global = new LuanTable(); + registry = new LuanTableImpl(); + global = new LuanTableImpl(); global.put("_G",global); metatable = newMetatable(); } @@ -47,7 +47,7 @@ public final LuanTable registryTable(Object key) { LuanTable tbl = (LuanTable)registry.get(key); if( tbl == null ) { - tbl = new LuanTable(); + tbl = new LuanTableImpl(); registry.put(key,tbl); } return tbl; @@ -68,7 +68,7 @@ } public final Object eval(String cmd) { - return eval(cmd,new LuanTable()); + return eval(cmd,new LuanTableImpl()); } public final Object eval(String cmd,LuanTable env) { @@ -99,8 +99,8 @@ return t==null ? null : t.get(op); } - private static LuanTable newMetatable() { - LuanTable metatable = new LuanTable(); + private static LuanTableImpl newMetatable() { + LuanTableImpl metatable = new LuanTableImpl(); try { metatable.put( "__index", new LuanJavaFunction( LuanState.class.getMethod("__index",LuanState.class,Object.class,Object.class), null