diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2015-06-05 07:10:49 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2015-06-05 07:12:48 +0200 |
| commit | 4ac3bfb9f7e1452715c98c9e1a3d0dd1815a11ce (patch) | |
| tree | 20d6a1d9cdcad7be6a87d9a24f231483792d8569 | |
| parent | 8d05539463f99ffb4d1b788df971ce0ff6d223bd (diff) | |
_parse_block() style nit, take two.
The menu must be added to self.menus before parsing its contents, so
that it comes before any contained menus. Make the comment and menu
cases consistent by rearranging the comment case instead.
| -rw-r--r-- | kconfiglib.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/kconfiglib.py b/kconfiglib.py index 392148c..3bf6415 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -1013,27 +1013,29 @@ class Config(object): elif t0 == T_COMMENT: comment = Comment() + comment.config = self comment.parent = parent - comment.filename = filename comment.linenr = linenr - comment.text = tokens.get_next() - self._parse_properties(line_feeder, comment, deps, visible_if_deps) - block.add_item(comment) self.comments.append(comment) + block.add_item(comment) + + self._parse_properties(line_feeder, comment, deps, visible_if_deps) elif t0 == T_MENU: menu = Menu() - self.menus.append(menu) + menu.config = self menu.parent = parent - menu.title = tokens.get_next() - menu.filename = filename menu.linenr = linenr + menu.title = tokens.get_next() + + self.menus.append(menu) + block.add_item(menu) # Parse properties and contents self._parse_properties(line_feeder, menu, deps, visible_if_deps) @@ -1044,8 +1046,6 @@ class Config(object): _make_and(visible_if_deps, menu.visible_if_expr)) - block.add_item(menu) - elif t0 == T_CHOICE: # We support named choices already_defined = False |
