MCPcopy Create free account
hub / github.com/OpenCCU/OpenCCU / expr_items

Function expr_items

buildroot-external/scripts/kconfiglib.py:6145–6169  ·  view source on GitHub ↗

Returns a set() of all items (symbols and choices) that appear in the expression 'expr'. Passing subexpressions of expressions to this function works as expected.

(expr)

Source from the content-addressed store, hash-verified

6143
6144
6145def expr_items(expr):
6146 """
6147 Returns a set() of all items (symbols and choices) that appear in the
6148 expression 'expr'.
6149
6150 Passing subexpressions of expressions to this function works as expected.
6151 """
6152 res = set()
6153
6154 def rec(subexpr):
6155 if subexpr.__class__ is tuple:
6156 # AND, OR, NOT, or relation
6157
6158 rec(subexpr[1])
6159
6160 # NOTs only have a single operand
6161 if subexpr[0] is not NOT:
6162 rec(subexpr[2])
6163
6164 else:
6165 # Symbol or choice
6166 res.add(subexpr)
6167
6168 rec(expr)
6169 return res
6170
6171
6172def split_expr(expr, op):

Callers 1

referencedMethod · 0.85

Calls 2

recFunction · 0.85
setFunction · 0.50

Tested by

no test coverage detected