コード例 #1
0
ファイル: BoolType.java プロジェクト: jglrxavpok/WeaC
 public boolean equal(WeaCValue a, WeaCValue b) {
   if (a.getValue() instanceof Boolean && b.getValue() instanceof Boolean)
     return a.getValue() == b.getValue();
   if (a.type == this && b.type == this) {
     return a.getValue() == b.getValue();
   } else if (a.type == this) {
     return ((int) NumberType.convert(b.getValue(), WeaCType.intType) != 0)
         == (boolean) a.getValue();
   } else if (b.type == this) {
     return ((int) NumberType.convert(a.getValue(), WeaCType.intType) != 0)
         == (boolean) b.getValue();
   }
   return false;
 }