X-Git-Url: https://jxself.org/git/?p=linux-libre-firmware.git;a=blobdiff_plain;f=carl9170fw%2Fconfig%2Fzconf.l;fp=carl9170fw%2Fconfig%2Fzconf.l;h=9720530ed688d1593b2fe1ef72ce7d6b054a6a0d;hp=04ee4431c3fe9d7868b0cdc104eb04bf38cad77d;hb=4d82a54061be75c0bf489026aad55821bc9c61c7;hpb=1ba1a88647bfe113c885f985d6e383790dec2a1f diff --git a/carl9170fw/config/zconf.l b/carl9170fw/config/zconf.l index 04ee443..9720530 100644 --- a/carl9170fw/config/zconf.l +++ b/carl9170fw/config/zconf.l @@ -27,8 +27,8 @@ static char *text; static int text_size, text_asize; struct buffer { - struct buffer *parent; - YY_BUFFER_STATE state; + struct buffer *parent; + YY_BUFFER_STATE state; }; struct buffer *current_buf; @@ -66,10 +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); +} %} -ws [ \n\t] -n [A-Za-z0-9_] +n [A-Za-z0-9_-] %% int str = 0; @@ -107,7 +113,7 @@ n [A-Za-z0-9_] zconflval.string = text; return T_WORD; } - . + . warn_ignored_character(*yytext); \n { BEGIN(INITIAL); current_file->lineno++; @@ -123,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; @@ -142,7 +151,8 @@ n [A-Za-z0-9_] } #.* /* comment */ \\\n current_file->lineno++; - . + [[:blank:]]+ + . warn_ignored_character(*yytext); <> { BEGIN(INITIAL); }