summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-10-21 13:40:35 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2018-10-21 14:31:54 +0200
commitd23accda70935ddbf6d01f3c0043f17bffad3706 (patch)
tree77ac51ba5a51df9073c7159672874448ea810a68
parent40e3e36f41b211d89edbbedfbfb1e4ab8b102d49 (diff)
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.
-rw-r--r--kconfiglib.py6
1 files 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()