Skip to content

Commit b2d00d7

Browse files
dgoudersmasahir0y
authored andcommitted
kconfig: fix line numbers for if-entries in menu tree
The line numers for if-entries in the menu tree are off by one or more lines which is confusing when debugging for correctness of unrelated changes. According to the git log, commit a02f057 (kconfig: improve error handling in the parser) was the last one that changed that part of the parser and replaced "if_entry: T_IF expr T_EOL" by "if_entry: T_IF expr nl" but the commit message does not state why this has been done. When reverting that part of the commit, only the line numers are corrected (checked with cdebug = DEBUG_PARSE in zconf.y), otherwise the menu tree remains unchanged (checked with zconfdump() enabled in conf.c). An example for the corrected line numbers: drivers/soc/Kconfig:15:source drivers/soc/tegra/Kconfig drivers/soc/tegra/Kconfig:4:if drivers/soc/tegra/Kconfig:6:if changes to: drivers/soc/Kconfig:15:source drivers/soc/tegra/Kconfig drivers/soc/tegra/Kconfig:1:if drivers/soc/tegra/Kconfig:4:if Signed-off-by: Dirk Gouders <dirk@gouders.net> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
1 parent 5391e53 commit b2d00d7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎scripts/kconfig/zconf.y‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct symbol *symbol_hash[SYMBOL_HASHSIZE];
3131
static struct menu *current_menu, *current_entry;
3232

3333
%}
34-
%expect 32
34+
%expect 31
3535

3636
%union
3737
{
@@ -337,7 +337,7 @@ choice_block:
337337

338338
/* if entry */
339339

340-
if_entry: T_IF expr nl
340+
if_entry: T_IF expr T_EOL
341341
{
342342
printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
343343
menu_add_entry(NULL);

0 commit comments

Comments
 (0)