• Masahiro Yamada's avatar
    kconfig: remove grammatically ambiguous option_error · 2f60e46e
    Masahiro Yamada authored
    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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
    2f60e46e
zconf.y 15.9 KB