kconfig: remove grammatically ambiguous option_error
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 11 Dec 2018 11:00:53 +0000 (20:00 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Sat, 15 Dec 2018 08:45:20 +0000 (17:45 +0900)
commit2f60e46e605a9bcd8dc4fe7745b5576084900850
treeb65340cd102494113ba4931c2837e914454a660d
parent6900ae9eeee397436df25ef51835a8b27865d46d
kconfig: remove grammatically ambiguous option_error

This commit decreases 6 shift/reduce conflicts, and finally achieves
conflict-free parser.

Since Kconfig has no terminator for a config block, detecting the end
of config_stmt is not easy.

For example, there are two ways for handling the error in the following
code:

  1 config FOO
  2         =

 [A] Print "unknown option" error, assuming the line 2 is a part of
     config_option_list

 [B] Print "invalid statement", assuming the line 1 is reduced into
     a config_stmt by itself

Bison actually chooses [A] because it performs the shift rather than
the reduction where both are possible.

However, there is no reason to choose one over the other.

Let's remove the option_error, and let it fall back to [B].

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
scripts/kconfig/zconf.y