Skip to content

Commit bdfe32c

Browse files
Helmut Grohnejserv
authored andcommitted
Add rudimentary support for modules property
Fixes: ulfalizer/Kconfiglib#106 In linux commit 6dd85ff178cd76851e2184b13e545f5a88d1be30, Linux Torvalds changed "option modules" to plain "modules" since it was the only option left. kconfiglib does not have much support for either besides parsing it and suppressing warnings when it is applied to the 'MODULES' symbol. Mirror this behaviour for the newer "modules" property. Signed-off-by: Jim Huang <[email protected]>
1 parent 121c88e commit bdfe32c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

kconfiglib.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3263,6 +3263,20 @@ def _parse_props(self, node):
32633263
else:
32643264
self._parse_error("unrecognized option")
32653265

3266+
elif t0 is _T_MODULES:
3267+
# 'modules' formerly was 'option modules'. See above for why
3268+
# and when it is ignored. It was changed in
3269+
# linux commit 6dd85ff178cd76851e2184b13e545f5a88d1be30.
3270+
if node.item is not self.modules:
3271+
self._warn("the 'modules' property is not supported. Let "
3272+
"me know if this is a problem for you, as it "
3273+
"wouldn't be that hard to implement. Note that "
3274+
"modules are supported -- Kconfiglib just "
3275+
"assumes the symbol name MODULES, like older "
3276+
"versions of the C implementation did when "
3277+
"'modules' wasn't used.",
3278+
self.filename, self.linenr)
3279+
32663280
elif t0 is _T_OPTIONAL:
32673281
if node.item.__class__ is not Choice:
32683282
self._parse_error('"optional" is only valid for choices')

0 commit comments

Comments
 (0)