summaryrefslogtreecommitdiff
path: root/scripts/kconfig/zconf.y
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-05-28 18:21:50 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-05-29 03:31:19 +0900
commit1175c02506ffc9cef9f3c520249d8740a3174b1f (patch)
tree4d95574d080570461e3483ec3b916b867463c6f3 /scripts/kconfig/zconf.y
parent9ced3bddec080e974e910bf887715540a8d9d96b (diff)
downloadlinux-rt-1175c02506ffc9cef9f3c520249d8740a3174b1f.tar.gz
kconfig: support simply expanded variable
The previous commit added variable and user-defined function. They work similarly in the sense that the evaluation is deferred until they are used. This commit adds another type of variable, simply expanded variable, as we see in Make. The := operator defines a simply expanded variable, expanding the righthand side immediately. This works like traditional programming language variables. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/kconfig/zconf.y')
-rw-r--r--scripts/kconfig/zconf.y5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index e15e8c7063e0..6f9b0aa32a82 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -41,6 +41,7 @@ static struct menu *current_menu, *current_entry;
struct expr *expr;
struct menu *menu;
const struct kconf_id *id;
+ enum variable_flavor flavor;
}
%token <id>T_MAINMENU
@@ -78,7 +79,7 @@ static struct menu *current_menu, *current_entry;
%token T_OPEN_PAREN
%token T_EOL
%token <string> T_VARIABLE
-%token T_ASSIGN
+%token <flavor> T_ASSIGN
%token <string> T_ASSIGN_VAL
%left T_OR
@@ -517,7 +518,7 @@ word_opt: /* empty */ { $$ = NULL; }
/* assignment statement */
-assignment_stmt: T_VARIABLE T_ASSIGN assign_val T_EOL { variable_add($1, $3); free($1); free($3); }
+assignment_stmt: T_VARIABLE T_ASSIGN assign_val T_EOL { variable_add($1, $3, $2); free($1); free($3); }
assign_val:
/* empty */ { $$ = xstrdup(""); };