From d23accda70935ddbf6d01f3c0043f17bffad3706 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sun, 21 Oct 2018 13:40:35 +0200 Subject: Test _parse_block() blank line case earlier Can be treated as just another case, and moved later so that the cases become sorted by frequency. --- kconfiglib.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kconfiglib.py b/kconfiglib.py index 8d0e61c..670b312 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -2450,8 +2450,6 @@ class Kconfig(object): while self._next_line(): t0 = self._next_token() - if t0 is None: - continue if t0 in (_T_CONFIG, _T_MENUCONFIG): # The tokenizer allocates Symbol objects for us @@ -2479,6 +2477,10 @@ class Kconfig(object): # Tricky Python semantics: This assigns prev.next before prev prev.next = prev = node + elif t0 is None: + # Blank line + continue + elif t0 in (_T_SOURCE, _T_RSOURCE, _T_OSOURCE, _T_ORSOURCE): pattern = self._expect_str_and_eol() -- cgit v1.2.3