コード例 #1
0
ファイル: __init__.py プロジェクト: TheLartians/Expresso
def evaluate(expr,context = pc.global_context,cache = None,format = True):

    if context in __cached_evaluators:
        main = __cached_evaluators[context]
    else:
        main = pc.MultiEvaluator(recursive=True,split_binary=True)
        main.add_evaluator(context)
        main.add_evaluator(main_evaluator.main_evaluator)
        __cached_evaluators[context] = main

    if cache == None and __use_global_cache:
        cache = __cached_evaluators

    expr = main(expr,cache = cache)
    if format:
        expr = canonical_form.format_evaluator(expr,cache = cache)
    return expr
コード例 #2
0
ファイル: __init__.py プロジェクト: TheLartians/Expresso
def evaluate(expr,context = pc.global_context,cache = None,format = True):

    if context in __cached_evaluators:
        main = __cached_evaluators[context]
    else:
        main = pc.MultiEvaluator(recursive=True,split_binary=True)
        main.add_evaluator(context)
        main.add_evaluator(main_evaluator.main_evaluator)
        __cached_evaluators[context] = main

    if cache == None and __use_global_cache:
        cache = __cached_evaluators

    expr = main(expr,cache = cache)
    if format:
        expr = canonical_form.format_evaluator(expr,cache = cache)
    return expr
コード例 #3
0
ファイル: __init__.py プロジェクト: TheLartians/Expresso
def expand(expr,**kwargs):
    return canonical_form.format_evaluator(expand_evaluator.expand_evaluator(expr,**kwargs),**kwargs)
コード例 #4
0
ファイル: __init__.py プロジェクト: TheLartians/Expresso
def expand(expr,**kwargs):
    return canonical_form.format_evaluator(expand_evaluator.expand_evaluator(expr,**kwargs),**kwargs)