示例#1
0
 def _eval(env, a, b):
     if (
         isinstance(a, base.tuple) and isinstance(b, base.tuple)
         or isinstance(a, string.string_t) and isinstance(b, string.string_t)
     ):
         if len(a) != len(b):
             return base.boolean(False)
         for i in xrange(len(a)):
             if not equal.eval(env, a[i], b[i]):
                 return base.boolean(False)
         return base.boolean(True)
     else:
         return eqv.eval(env, a, b)
示例#2
0
 def eval(env, *l):
     for p in l:
         v = p.eval(env)
         if not v:
             return v
     else:
         return base.boolean(True)
     return v
示例#3
0
 def eval(env, *l):
     for p in l:
         v = p.eval(env)
         if v:
             return v
     else:
         return base.boolean(False)
     return v
示例#4
0
 def _eval(env, a, b):
     if a.__class__ != b.__class__:
         return base.boolean(False)
     if isinstance(a, base.tuple) and isinstance(b, base.tuple) and len(a.value) == 0 and len(b.value) == 0:
         return base.boolean(True)
     if isinstance(a, base.boolean) and isinstance(b, base.boolean) and a.value == b.value:
         return base.boolean(True)
     if isinstance(a, char.char_t) and isinstance(b, char.char_t) and char.char_eq.eval(env, a, b):
         return base.boolean(True)
     if isinstance(a, base.label) and isinstance(b, base.label) and string.string_eq.eval(env, a.value, b.value):
         return base.boolean(True)
     if a != b:
         return base.boolean(False)
     return base.boolean(True)
示例#5
0
 def with_b(b_val):
     return base.Bounce(k, base.boolean(a_val < b_val))
示例#6
0
 def eval(env, a, b):
     return base.boolean(a.eval(env) < b.eval(env))
示例#7
0
 def __eq__(self, b):
     # TODO: assumption that b is a string_t instance
     return base.boolean(self.value == b.value)
示例#8
0
 def _eval(env, a, b):
     return base.boolean(a is b)