comparison core/src/luan/LuanState.java @ 419:8fbb961aabd5

improve repr() to check metamethod recursively
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 30 Apr 2015 23:15:40 -0600
parents abce9b0041b0
children 1eafb11a150d
comparison
equal deleted inserted replaced
418:455784e2227d 419:8fbb961aabd5
44 44
45 public final LuanBit bit(LuanElement el) { 45 public final LuanBit bit(LuanElement el) {
46 return new LuanBit(this,el); 46 return new LuanBit(this,el);
47 } 47 }
48 48
49 public final static Object getHandler(String op,LuanTable table) {
50 LuanTable t = table.getMetatable();
51 return t==null ? null : t.get(op);
52 }
53
54 // convenience methods 49 // convenience methods
55 50
56 private final LuanBit JAVA = bit(LuanElement.JAVA); 51 final LuanBit JAVA = bit(LuanElement.JAVA);
57 52
58 public LuanException exception(Object msg) { 53 public LuanException exception(Object msg) {
59 return JAVA.exception(msg); 54 return JAVA.exception(msg);
60 } 55 }
61 56