summaryrefslogtreecommitdiff
path: root/scripts/kconfig/zconf.l
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-02-11 12:39:54 +0900
committerTom Rini <trini@konsulko.com>2017-02-12 14:31:25 -0500
commitbf7ab1e70fd7621fea5dea07b6975c576119b86e (patch)
tree8d857c342799d9d75d704fd87ea29e42ce0454b6 /scripts/kconfig/zconf.l
parent554c73c0256c9e22af1b89e842a310b73b5eb657 (diff)
downloadu-boot-imx-bf7ab1e70fd7621fea5dea07b6975c576119b86e.zip
u-boot-imx-bf7ab1e70fd7621fea5dea07b6975c576119b86e.tar.gz
u-boot-imx-bf7ab1e70fd7621fea5dea07b6975c576119b86e.tar.bz2
kconfig: re-sync with Linux 4.10
Re-sync all files under the scripts/kconfig directory with Linux 4.10. Some parts include U-Boot own modification. I made sure to not revert the following commits: 5b8031ccb4ed ("Add more SPDX-License-Identifier tags") 192bc6948b02 ("Fix GCC format-security errors and convert sprintfs.") da58dec86616 ("Various Makefiles: Add SPDX-License-Identifier tags") 20c20826efab ("Kconfig: Enable usage of escape char '\' in string values") Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/kconfig/zconf.l')
-rw-r--r--scripts/kconfig/zconf.l21
1 files changed, 16 insertions, 5 deletions
diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l
index 6c62d93..c410d25 100644
--- a/scripts/kconfig/zconf.l
+++ b/scripts/kconfig/zconf.l
@@ -66,9 +66,16 @@ static void alloc_string(const char *str, int size)
memcpy(text, str, size);
text[size] = 0;
}
+
+static void warn_ignored_character(char chr)
+{
+ fprintf(stderr,
+ "%s:%d:warning: ignoring unsupported character '%c'\n",
+ zconf_curname(), zconf_lineno(), chr);
+}
%}
-n [A-Za-z0-9_]
+n [A-Za-z0-9_-]
%%
int str = 0;
@@ -106,7 +113,7 @@ n [A-Za-z0-9_]
zconflval.string = text;
return T_WORD;
}
- .
+ . warn_ignored_character(*yytext);
\n {
BEGIN(INITIAL);
current_file->lineno++;
@@ -122,14 +129,17 @@ n [A-Za-z0-9_]
"!" return T_NOT;
"=" return T_EQUAL;
"!=" return T_UNEQUAL;
+ "<=" return T_LESS_EQUAL;
+ ">=" return T_GREATER_EQUAL;
+ "<" return T_LESS;
+ ">" return T_GREATER;
\"|\' {
str = yytext[0];
new_string();
BEGIN(STRING);
}
\n BEGIN(INITIAL); current_file->lineno++; return T_EOL;
- --- /* ignore */
- ({n}|[-/.])+ {
+ ({n}|[/.])+ {
const struct kconf_id *id = kconf_id_lookup(yytext, yyleng);
if (id && id->flags & TF_PARAM) {
zconflval.id = id;
@@ -141,7 +151,8 @@ n [A-Za-z0-9_]
}
#.* /* comment */
\\\n current_file->lineno++;
- .
+ [[:blank:]]+
+ . warn_ignored_character(*yytext);
<<EOF>> {
BEGIN(INITIAL);
}