comparison core/src/luan/LuanMeta.java @ 430:f28320fd671d

fix LuanTable.toString() to use metatables
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 02 May 2015 20:35:26 -0600
parents e3a6d9dbd694
children d9df6d6cb927
comparison
equal deleted inserted replaced
429:e3a6d9dbd694 430:f28320fd671d
46 } 46 }
47 47
48 protected abstract String type(LuanTable tbl); 48 protected abstract String type(LuanTable tbl);
49 49
50 public String __to_string(LuanState luan,LuanTable tbl) throws LuanException { 50 public String __to_string(LuanState luan,LuanTable tbl) throws LuanException {
51 return type(tbl) + "-" + tbl; 51 return type(tbl) + "-" + tbl.rawToString();
52 } 52 }
53 53
54 public LuanTable newMetatable() { 54 public LuanTable newMetatable() {
55 LuanTable mt = new LuanTable(); 55 LuanTable mt = new LuanTable();
56 mt.rawPut( "__index", this ); 56 mt.rawPut( "__index", this );