Esempio n. 1
0
 def __repr__(self): 
   if run_mode() is interactive:
     code = interactive_parser().parse(self)
     code = interactive_tagger().tag_loop_label(code)
     code = to_sexpression(code)
     result = interactive_solver().eval(code)
     return repr(result) if result is not None else ''
   else: return self.____repr____()
Esempio n. 2
0
 def __repr__(self):
   if run_mode() is interactive:
     code = interactive_parser().parse(self)
     code = interactive_tagger().tag_loop_label(code)
     result = interactive_solver().eval(code)
     return repr(result) if result is not None else ''
   x = _operator_repr(self.operand[0], self.operator)
   return '%s%s'%(self.operator.symbol, x)
Esempio n. 3
0
 def __repr__(self): 
   if run_mode() is interactive:
     code = interactive_parser().parse(self)
     code = interactive_tagger().tag_loop_label(code)
     code = to_sexpression(code)
     result = interactive_solver().eval(code)
     return repr(result) if result is not None else ''
   return '%s(%s)'%(self.operator, 
               ','.join([repr(e) for e in self.operand]))
Esempio n. 4
0
 def __repr__(self):
   if run_mode() is interactive:
     code = interactive_parser().parse(self)
     code = interactive_tagger().tag_loop_label(code)
     result = interactive_solver().eval(code)
     return repr(result) if result is not None else '' if result is not None else ''
   return ''.join([repr(x) for x in 
         [self.item, self.separator, self.min, self.max, 
         self.template, self.result, self.mode]])
Esempio n. 5
0
 def __repr__(self): 
   if run_mode()==interactive:
     set_run_mode(noninteractive)
     code  = interactive_parser().parse(self.exp)
     code  = interactive_tagger().tag_loop_label(code)
     result = "%s"%code
     set_run_mode(interactive)
     return result
   else: 
     return "'%s"%self.exp
Esempio n. 6
0
def solve(exp):
    code = interactive_parser().parse(exp)
    code = interactive_tagger().tag_loop_label(code)
    code = to_sexpression(code)
    return interactive_solver().solve(code)
Esempio n. 7
0
def solve(exp):
  code = interactive_parser().parse(exp)
  code = interactive_tagger().tag_loop_label(code)
  code = to_sexpression(code)
  return interactive_solver().solve(code)