summary refs log tree commit diff
path: root/scripts/kconfig
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2021-09-27 21:54:37 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2021-09-30 02:08:59 +0900
commit6988f70cf105e70b4ea424d320521a9ed452fe46 (patch)
tree13c96992a542a303fb91c51de9cc7725da289a16 /scripts/kconfig
parent65017d8381e2425a1b4cdc4681fadc179635c000 (diff)
downloadlinux-6988f70cf105e70b4ea424d320521a9ed452fe46.tar.gz
kconfig: rename a variable in the lexer to a clearer name
In Kconfig, like Python, you can enclose a string by double-quotes or
single-quotes. So, both "foo" and 'foo' are allowed.

The variable, "str", is used to remember whether the string started with
a double-quote or a single-quote because open/closing quotation marks
must match.

The name "str" is too generic to understand the intent. Rename it to
"open_quote", which is easier to understand. The type should be 'char'.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Boris Kolpackov <boris@codesynthesis.com>
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/lexer.l6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/kconfig/lexer.l b/scripts/kconfig/lexer.l
index efe487859308..cc386e443683 100644
--- a/scripts/kconfig/lexer.l
+++ b/scripts/kconfig/lexer.l
@@ -84,7 +84,7 @@ static void warn_ignored_character(char chr)
 n	[A-Za-z0-9_-]
 
 %%
-	int str = 0;
+	char open_quote = 0;
 
 #.*			/* ignore comment */
 [ \t]*			/* whitespaces */
@@ -133,7 +133,7 @@ n	[A-Za-z0-9_-]
 ":="			return T_COLON_EQUAL;
 "+="			return T_PLUS_EQUAL;
 \"|\'			{
-				str = yytext[0];
+				open_quote = yytext[0];
 				new_string();
 				BEGIN(STRING);
 			}
@@ -170,7 +170,7 @@ n	[A-Za-z0-9_-]
 		append_string(yytext + 1, yyleng - 1);
 	}
 	\'|\"	{
-		if (str == yytext[0]) {
+		if (open_quote == yytext[0]) {
 			BEGIN(INITIAL);
 			yylval.string = text;
 			return T_WORD_QUOTE;