kconfig: expand lefthand side of assignment statement
[carl9170fw.git] / config / zconf.l
index f1add9536c029ec77b01361dc8c4ac92265cd02b..d2d9d87bea6ea63bcfa6dec6b33b06ce4fad5289 100644 (file)
@@ -114,7 +114,16 @@ n  [A-Za-z0-9_-]
                yylval.string = text;
                return T_VARIABLE;
        }
-       "="     { BEGIN(ASSIGN_VAL); return T_ASSIGN; }
+       ({n}|$)+        {
+               /* this token includes at least one '$' */
+               yylval.string = expand_token(yytext, yyleng);
+               if (strlen(yylval.string))
+                       return T_VARIABLE;
+               free(yylval.string);
+       }
+       "="     { BEGIN(ASSIGN_VAL); yylval.flavor = VAR_RECURSIVE; return T_ASSIGN; }
+       ":="    { BEGIN(ASSIGN_VAL); yylval.flavor = VAR_SIMPLE; return T_ASSIGN; }
+       "+="    { BEGIN(ASSIGN_VAL); yylval.flavor = VAR_APPEND; return T_ASSIGN; }
        [[:blank:]]+
        .       warn_ignored_character(*yytext);
        \n      {