diff options
| -rw-r--r-- | kconfiglib.py | 21 | ||||
| -rw-r--r-- | tests/Kstr | 3 | ||||
| -rw-r--r-- | testsuite.py | 3 |
3 files changed, 11 insertions, 16 deletions
diff --git a/kconfiglib.py b/kconfiglib.py index ed945ca..46da1c1 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -4106,23 +4106,20 @@ def expr_str(expr): Passing subexpressions of expressions to this function works as expected. """ - if not isinstance(expr, tuple): - if isinstance(expr, Choice): - if expr.name is not None: - return "<choice {}>".format(expr.name) - return "<choice>" - - # Symbol - + if isinstance(expr, Symbol): if expr.is_constant: return '"{}"'.format(escape(expr.name)) - return expr.name + if isinstance(expr, Choice): + if expr.name is not None: + return "<choice {}>".format(expr.name) + return "<choice>" + if expr[0] == NOT: - if isinstance(expr[1], Symbol): - return "!" + expr_str(expr[1]) - return "!({})".format(expr_str(expr[1])) + if isinstance(expr[1], tuple): + return "!({})".format(expr_str(expr[1])) + return "!" + expr_str(expr[1]) # Symbol if expr[0] == AND: return "{} && {}".format(_format_and_op(expr[1]), @@ -30,8 +30,7 @@ config ADVANCED prompt "prompt 2" menuconfig ADVANCED - prompt "prompt 3" - depends on DEP2 + prompt "prompt 3" if DEP2 && (DEP3 || !DEP4 || !(DEP5 && DEP6)) if DEP3 diff --git a/testsuite.py b/testsuite.py index 7617226..9177efd 100644 --- a/testsuite.py +++ b/testsuite.py @@ -528,8 +528,7 @@ config ADVANCED prompt "prompt 2" menuconfig ADVANCED - prompt "prompt 3" if DEP2 - depends on DEP2 + prompt "prompt 3" if DEP2 && (DEP3 || !DEP4 || !(DEP5 && DEP6)) config ADVANCED depends on DEP4 && DEP3 |
