diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-07-02 00:48:45 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-07-02 01:46:52 +0200 |
| commit | b5c719b72320b655b448cfd91feb5eee5eadebd7 (patch) | |
| tree | b6b9bd129c39e5f0cd42e7679ed8d4c7836f0aee /kconfiglib.py | |
| parent | 0c28974bedd21e5c992ae9667e75f800dc04fe32 (diff) | |
Tighten up named choice parsing
Things like 'choice NAMED_CHOICE oops extra tokens' and 'choice &&' are
now detected as syntax errors.
Bit faster too, though it doesn't matter here.
Diffstat (limited to 'kconfiglib.py')
| -rw-r--r-- | kconfiglib.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kconfiglib.py b/kconfiglib.py index b851a40..b5a878e 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -2029,14 +2029,14 @@ class Kconfig(object): prev.next = prev = node elif t0 == _T_CHOICE: - name = self._next_token() - if name is None: + if self._peek_token() is None: choice = Choice() choice.direct_dep = self.n self.choices.append(choice) else: # Named choice + name = self._expect_str_and_eol() choice = self.named_choices.get(name) if not choice: choice = Choice() |
