Mercurial Hosting > luan
comparison src/luan/interp/LeExpr.java @ 112:f5af13062b10
fix previous rev
git-svn-id: https://luan-java.googlecode.com/svn/trunk@113 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 23 May 2014 22:52:39 +0000 |
parents | 6ca02b188dba |
children |
comparison
equal
deleted
inserted
replaced
111:2428ecfed375 | 112:f5af13062b10 |
---|---|
27 return s1.compareTo(s2) <= 0; | 27 return s1.compareTo(s2) <= 0; |
28 } | 28 } |
29 LuanBit bit = luan.bit(se); | 29 LuanBit bit = luan.bit(se); |
30 LuanFunction fn = bit.getBinHandler("__le",o1,o2); | 30 LuanFunction fn = bit.getBinHandler("__le",o1,o2); |
31 if( fn != null ) | 31 if( fn != null ) |
32 return Luan.toBoolean( Luan.first(bit.call(fn,"__le",o1,o2)) ); | 32 return Luan.toBoolean( Luan.first(bit.call(fn,"__le",new Object[]{o1,o2})) ); |
33 fn = bit.getBinHandler("__lt",o1,o2); | 33 fn = bit.getBinHandler("__lt",o1,o2); |
34 if( fn != null ) | 34 if( fn != null ) |
35 return !Luan.toBoolean( Luan.first(bit.call(fn,"__lt",o2,o1)) ); | 35 return !Luan.toBoolean( Luan.first(bit.call(fn,"__lt",new Object[]{o2,o1})) ); |
36 throw bit.exception( "attempt to compare " + Luan.type(o1) + " with " + Luan.type(o2) ); | 36 throw bit.exception( "attempt to compare " + Luan.type(o1) + " with " + Luan.type(o2) ); |
37 } | 37 } |
38 } | 38 } |