def evaluate_postfix_with_info(postfix, conan_vars_info): # Evaluate conaninfo with the expression def evaluate_info(expression): """Receives an expression like compiler.version="12" Uses conan_vars_info in the closure to evaluate it""" name, value = expression.split("=", 1) value = value.replace("\"", "") return evaluate(name, value, conan_vars_info) return evaluate_postfix(postfix, evaluate_info)
def evaluate(q): r = infix_to_postfix(q) return evaluate_postfix(r, evaluator)