diff mbox series

[07/27] kconfig: clean up EOF handling in the lexer

Message ID 1544526070-16690-8-git-send-email-yamada.masahiro@socionext.com
State Accepted
Commit 0bcc547ec4b03a0b66615694561cce9c5a9a1014
Headers show
Series kconfig: remove all reduce/shift conflicts, refactor lexer, fix various issues | expand

Commit Message

Masahiro Yamada Dec. 11, 2018, 11 a.m. UTC
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 | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

-- 
2.7.4
diff mbox series

Patch

diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index 847ba42..9038e97 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -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;