kconfig: clean up EOF handling in the lexer
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 11 Dec 2018 11:00:50 +0000 (20:00 +0900)
committerChristian Lamparter <chunkeey@gmail.com>
Sun, 10 Feb 2019 21:31:59 +0000 (22:31 +0100)
A new file should always start in the INITIAL state.

When the lexer bumps into EOF, the lexer must get back to the INITIAL
state anyway. Remove the redundant <<EOF>> pattern in the PARAM state.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
config/zconf.l

index bbbef0c9072c7ff185a6146c83a60b3bff5e489f..5b0188a7e9a6f57272d5914e750c112335dfccca 100644 (file)
@@ -178,9 +178,6 @@ n   [A-Za-z0-9_-]
        \\\n    ;
        [[:blank:]]+
        .       warn_ignored_character(*yytext);
-       <<EOF>> {
-               BEGIN(INITIAL);
-       }
 }
 
 <STRING>{
@@ -262,6 +259,8 @@ n   [A-Za-z0-9_-]
 }
 
 <<EOF>>        {
+       BEGIN(INITIAL);
+
        if (current_file) {
                zconf_endfile();
                return T_EOL;