Пример #1
0
def ifx(argv):
    op, lb, val, rb, qualifier = argv[:5]
    if lb != '(' or rb != ')' or qualifier != 'do':
        raise SyntaxError
    op = op.lower()
    if not op in ('true', 'false', 'parse'):
        raise SyntaxError, 'invalid conditional operator'
    if op in ('true', 'false'):
        result = sv.bool(val)
        if op == 'false':
            result = not result
    else:
        del sv['_tempcoreesc']
        es.set('_tempcoreesc', 0)
        es.mathparse('_tempcoreesc', val)
        result = sv._tempcoreesc
    stack.setcond(bool(result))
def ifx(argv):
  op, lb, val, rb, qualifier = argv[:5]
  if lb != '(' or rb != ')' or qualifier != 'do':
    raise SyntaxError
  op = op.lower()
  if not op in ('true', 'false', 'parse'):
    raise SyntaxError, 'invalid conditional operator'
  if op in ('true', 'false'):
    result = sv.bool(val)
    if op == 'false':
      result = not result
  else:
    del sv['_tempcoreesc']
    es.set('_tempcoreesc', 0)
    es.mathparse('_tempcoreesc', val)
    result = sv._tempcoreesc
  stack.setcond(bool(result))
Пример #3
0
def mathparse(argv):
  del sv[argv[0]]
  es.mathparse(argv[0], argv[1])
Пример #4
0
def mathparse(argv):
    del sv[argv[0]]
    es.mathparse(argv[0], argv[1])