carl9170: Update based on commit 467556acea56f361a21b2a3761ca056b9da2d237 dated Nov...
[linux-libre-firmware.git] / carl9170fw / config / zconf.l
index 04ee4431c3fe9d7868b0cdc104eb04bf38cad77d..9720530ed688d1593b2fe1ef72ce7d6b054a6a0d 100644 (file)
@@ -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);
        <<EOF>> {
                BEGIN(INITIAL);
        }