summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2012-12-07 01:21:04 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2012-12-07 01:22:04 +0100
commit8d7af88e79067b9fd425d71bb7b34c2b4cdea5de (patch)
treebfe9367a9d0f1692ee3e01db70eaec2e7d865257
parentc2af0c8e8b3df50ee25d0e6bc2361461b498bec9 (diff)
Fix get_menus() ordering w.r.t. nested menus.
Menus were being added in the order of their 'endmenu's instead of the order of their 'menu's.
-rw-r--r--kconfiglib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index d522aa4..4d6c994 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -961,6 +961,7 @@ class Config():
elif t0 == T_MENU:
menu = Menu()
+ self.menus.append(menu)
menu.config = self
menu.parent = parent
menu.title = tokens.get_next()
@@ -978,7 +979,6 @@ class Config():
menu.visible_if_expr))
block.add_item(menu)
- self.menus.append(menu)
elif t0 == T_IF:
# If statements are treated as syntactic sugar for adding
@@ -1006,6 +1006,7 @@ class Config():
choice = self.named_choices[name]
else:
choice = Choice()
+ self.choices.append(choice)
if name is not None:
choice.name = name
self.named_choices[name] = choice
@@ -1042,7 +1043,6 @@ class Config():
# at the first definition
if not already_defined:
block.add_item(choice)
- self.choices.append(choice)
elif t0 == T_COMMENT:
comment = Comment()