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)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 12 Dec 2018 15:20:09 +0000 (00:20 +0900)
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>
scripts/kconfig/zconf.l

index 847ba4248092854c48bcada6fc4a30c3af26665b..9038e9736bf03cf489ab50d1348e429d3885268a 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;