Mercurial Hosting > luan
diff src/luan/interp/LeExpr.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 | 8ede219cd111 |
children | f5af13062b10 |
line wrap: on
line diff
--- a/src/luan/interp/LeExpr.java Wed Feb 27 19:42:09 2013 +0000 +++ b/src/luan/interp/LeExpr.java Wed Feb 27 23:50:32 2013 +0000 @@ -4,6 +4,7 @@ import luan.LuanFunction; import luan.LuanException; import luan.LuanSource; +import luan.LuanBit; final class LeExpr extends BinaryOpExpr { @@ -25,12 +26,13 @@ String s2 = (String)o2; return s1.compareTo(s2) <= 0; } - LuanFunction fn = luan.getBinHandler(se,"__le",o1,o2); + LuanBit bit = luan.bit(se); + LuanFunction fn = bit.getBinHandler("__le",o1,o2); if( fn != null ) - return Luan.toBoolean( Luan.first(luan.call(fn,se,"__le",o1,o2)) ); - fn = luan.getBinHandler(se,"__lt",o1,o2); + return Luan.toBoolean( Luan.first(bit.call(fn,"__le",o1,o2)) ); + fn = bit.getBinHandler("__lt",o1,o2); if( fn != null ) - return !Luan.toBoolean( Luan.first(luan.call(fn,se,"__lt",o2,o1)) ); - throw new LuanException( luan, se, "attempt to compare " + Luan.type(o1) + " with " + Luan.type(o2) ); + return !Luan.toBoolean( Luan.first(bit.call(fn,"__lt",o2,o1)) ); + throw bit.exception( "attempt to compare " + Luan.type(o1) + " with " + Luan.type(o2) ); } }