comparison src/luan/interp/LuanStateImpl.java @ 88:6ca02b188dba

add LuanBit to clean up code; add repr(); git-svn-id: https://luan-java.googlecode.com/svn/trunk@89 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Wed, 27 Feb 2013 23:50:32 +0000
parents 6db8f286fa6c
children 3c404a296995
comparison
equal deleted inserted replaced
87:eaf37cfa30c2 88:6ca02b188dba
130 if( frame==null ) 130 if( frame==null )
131 return null; 131 return null;
132 return (LuanTable)frame.closure.upValues()[0].get(); 132 return (LuanTable)frame.closure.upValues()[0].get();
133 } 133 }
134 134
135
136 final Object arithmetic(LuanElement el,String op,Object o1,Object o2) throws LuanException {
137 LuanFunction fn = getBinHandler(el,op,o1,o2);
138 if( fn != null )
139 return Luan.first(call(fn,el,op,o1,o2));
140 String type = Luan.toNumber(o1)==null ? Luan.type(o1) : Luan.type(o2);
141 throw new LuanException(this,el,"attempt to perform arithmetic on a "+type+" value");
142 }
143
144 } 135 }