projects
/
carl9170fw.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
kconfig: warn of unhandled characters in Kconfig commands
[carl9170fw.git]
/
config
/
zconf.l
diff --git
a/config/zconf.l
b/config/zconf.l
index 020c099a3a6568190a5584db7245e8f53a1f3760..9720530ed688d1593b2fe1ef72ce7d6b054a6a0d 100644
(file)
--- a/
config/zconf.l
+++ b/
config/zconf.l
@@
-66,9
+66,16
@@
static void alloc_string(const char *str, int size)
memcpy(text, str, size);
text[size] = 0;
}
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;
%%
int str = 0;
@@
-106,7
+113,7
@@
n [A-Za-z0-9_]
zconflval.string = text;
return T_WORD;
}
zconflval.string = text;
return T_WORD;
}
- .
+ .
warn_ignored_character(*yytext);
\n {
BEGIN(INITIAL);
current_file->lineno++;
\n {
BEGIN(INITIAL);
current_file->lineno++;
@@
-132,8
+139,7
@@
n [A-Za-z0-9_]
BEGIN(STRING);
}
\n BEGIN(INITIAL); current_file->lineno++; return T_EOL;
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;
const struct kconf_id *id = kconf_id_lookup(yytext, yyleng);
if (id && id->flags & TF_PARAM) {
zconflval.id = id;
@@
-146,11
+152,7
@@
n [A-Za-z0-9_]
#.* /* comment */
\\\n current_file->lineno++;
[[:blank:]]+
#.* /* comment */
\\\n current_file->lineno++;
[[:blank:]]+
- . {
- fprintf(stderr,
- "%s:%d:warning: ignoring unsupported character '%c'\n",
- zconf_curname(), zconf_lineno(), *yytext);
- }
+ . warn_ignored_character(*yytext);
<<EOF>> {
BEGIN(INITIAL);
}
<<EOF>> {
BEGIN(INITIAL);
}