MCPcopy Create free account
hub / github.com/OpenIPC/firmware / _walk_expr

Function _walk_expr

general/scripts/kconfig_graph.py:147–160  ·  view source on GitHub ↗

Collect all symbol names referenced anywhere in a Kconfig expression.

(expr)

Source from the content-addressed store, hash-verified

145 expr_str = kconfiglib.expr_str
146
147 def _walk_expr(expr) -> list[str]:
148 """Collect all symbol names referenced anywhere in a Kconfig expression."""
149 out: list[str] = []
150
151 def rec(e):
152 if isinstance(e, kconfiglib.Symbol):
153 if e.name and e.name != "y" and e.name != "n":
154 out.append(e.name)
155 elif isinstance(e, tuple):
156 for child in e[1:]:
157 rec(child)
158
159 rec(expr)
160 return sorted(set(out))
161
162 # Pre-build a reverse-select index: target_symbol -> [symbols that `select`
163 # it]. Walking `sym.rev_dep` directly collects symbols from the condition

Callers 1

build_reportFunction · 0.85

Calls 1

recFunction · 0.85

Tested by

no test coverage detected