diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-10-28 17:25:29 +0100 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-10-28 17:54:26 +0100 |
| commit | e0256b65a939732b768d594f466a3b380fc26515 (patch) | |
| tree | 0a4095249398cc8ac29586ed50d8b8a8b0c87b2e /kconfiglib.py | |
| parent | d3e5d547da77124395a4fdc62f97655544d464b6 (diff) | |
Have MENU and COMMENT match _T_MENU and _T_COMMENT
Same approach as for the expression type symbolic constants. Removes a
tiny bit of conversion and makes things a bit more consistent.
Diffstat (limited to 'kconfiglib.py')
| -rw-r--r-- | kconfiglib.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/kconfiglib.py b/kconfiglib.py index 2a8d471..ced3e9a 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -2545,7 +2545,7 @@ class Kconfig(object): elif t0 is _T_MENU: node = MenuNode() node.kconfig = self - node.item = MENU + node.item = t0 # _T_MENU == MENU node.is_menuconfig = True node.prompt = (self._expect_str_and_eol(), self.y) node.visibility = self.y @@ -2565,7 +2565,7 @@ class Kconfig(object): elif t0 is _T_COMMENT: node = MenuNode() node.kconfig = self - node.item = COMMENT + node.item = t0 # _T_COMMENT == COMMENT node.is_menuconfig = False node.prompt = (self._expect_str_and_eol(), self.y) node.list = None @@ -6041,12 +6041,6 @@ def _shell_fn(kconf, _, command): UNKNOWN ) = range(6) -# Integers representing menu and comment menu nodes -( - MENU, - COMMENT, -) = range(2) - # Converts a symbol/choice type to a string TYPE_TO_STR = { UNKNOWN: "unknown", @@ -6147,10 +6141,12 @@ _IS_PY2 = sys.version_info[0] < 3 _T_VISIBLE, ) = range(1, 51) -# Public integers representing expression types +# Public integers representing expression types and menu and comment menu +# nodes # # Having these match the value of the corresponding tokens removes the need # for conversion + AND = _T_AND OR = _T_OR NOT = _T_NOT @@ -6161,6 +6157,9 @@ LESS_EQUAL = _T_LESS_EQUAL GREATER = _T_GREATER GREATER_EQUAL = _T_GREATER_EQUAL +MENU = _T_MENU +COMMENT = _T_COMMENT + # Keyword to token map, with the get() method assigned directly as a small # optimization _get_keyword = { |
