aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/config/zconf.l
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/config/zconf.l')
-rw-r--r--scripts/config/zconf.l21
1 files changed, 16 insertions, 5 deletions
diff --git a/scripts/config/zconf.l b/scripts/config/zconf.l
index 7c7baefda7..44d895fb24 100644
--- a/scripts/config/zconf.l
+++ b/scripts/config/zconf.l
@@ -68,9 +68,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;
@@ -108,7 +115,7 @@ n [A-Za-z0-9_]
zconflval.string = text;
return T_WORD;
}
- .
+ . warn_ignored_character(*yytext);
\n {
BEGIN(INITIAL);
current_file->lineno++;
@@ -124,14 +131,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;
@@ -143,7 +153,8 @@ n [A-Za-z0-9_]
}
#.* /* comment */
\\\n current_file->lineno++;
- .
+ [[:blank:]]+
+ . warn_ignored_character(*yytext);
<<EOF>> {
BEGIN(INITIAL);
}