summaryrefslogtreecommitdiff
path: root/kconfig/zconf.y
diff options
context:
space:
mode:
authorBryan Hundven <bryanhundven@gmail.com>2018-02-01 00:39:45 (GMT)
committerBryan Hundven <bryanhundven@gmail.com>2018-02-01 00:39:45 (GMT)
commit59b08f8d06700770cf1105269acb2ec2460e2a34 (patch)
tree7e26466ff1bdcb344d223d27c24a2014ff54a38f /kconfig/zconf.y
parentba165ed4c0bfa8a83e61a2efd1ad205777978486 (diff)
Sync kconfig files with upstream 4.15
Last updated with 4.9-rc7. This commit introduces the following upstream changes: 9059a3493efe kconfig: fix relational operators for bool and tristate symbols 88127dae6ed9 kconfig/symbol.c: use correct pointer type argument for sizeof b24413180f56 License cleanup: add SPDX GPL-2.0 license identifier to files with no license bb3290d91695 Remove gperf usage from toolchain ad8181060788 kconfig: fix sparse warnings in nconfig ff85a1a80e00 kconfig: Check for libncurses before menuconfig 9be3213b14d4 gconfig: remove misleading parentheses around a condition 83c3a1bad224 xconfig: fix missing suboption and help panels on first run e039303ff71a xconfig: fix 'Show Debug' functionality 79e51b5c2dee kconfig/nconf: Fix hang when editing symbol with a long prompt 0eb47346968f Scripts: kconfig: nconf: fix _GNU_SOURCE redefined warning 237e3ad0f195 Kconfig: Introduce the "imply" keyword Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
Diffstat (limited to 'kconfig/zconf.y')
-rw-r--r--kconfig/zconf.y26
1 files changed, 19 insertions, 7 deletions
diff --git a/kconfig/zconf.y b/kconfig/zconf.y
index c3f9a5f..5edf50c 100644
--- a/kconfig/zconf.y
+++ b/kconfig/zconf.y
@@ -31,7 +31,7 @@ struct symbol *symbol_hash[SYMBOL_HASHSIZE];
static struct menu *current_menu, *current_entry;
%}
-%expect 30
+%expect 32
%union
{
@@ -62,6 +62,7 @@ static struct menu *current_menu, *current_entry;
%token <id>T_TYPE
%token <id>T_DEFAULT
%token <id>T_SELECT
+%token <id>T_IMPLY
%token <id>T_RANGE
%token <id>T_VISIBLE
%token <id>T_OPTION
@@ -100,8 +101,8 @@ static struct menu *current_menu, *current_entry;
} if_entry menu_entry choice_entry
%{
-/* Include zconf.hash.c here so it can see the token constants. */
-#include "zconf.hash.c"
+/* Include zconf_id.c here so it can see the token constants. */
+#include "kconf_id.c"
%}
%%
@@ -118,13 +119,13 @@ stmt_list:
| stmt_list T_WORD error T_EOL { zconf_error("unknown statement \"%s\"", $2); }
| stmt_list option_name error T_EOL
{
- zconf_error("unexpected option \"%s\"", kconf_id_strings + $2->name);
+ zconf_error("unexpected option \"%s\"", $2->name);
}
| stmt_list error T_EOL { zconf_error("invalid statement"); }
;
option_name:
- T_DEPENDS | T_PROMPT | T_TYPE | T_SELECT | T_OPTIONAL | T_RANGE | T_DEFAULT | T_VISIBLE
+ T_DEPENDS | T_PROMPT | T_TYPE | T_SELECT | T_IMPLY | T_OPTIONAL | T_RANGE | T_DEFAULT | T_VISIBLE
;
common_stmt:
@@ -216,6 +217,12 @@ config_option: T_SELECT T_WORD if_expr T_EOL
printd(DEBUG_PARSE, "%s:%d:select\n", zconf_curname(), zconf_lineno());
};
+config_option: T_IMPLY T_WORD if_expr T_EOL
+{
+ menu_add_symbol(P_IMPLY, sym_lookup($2, 0), $3);
+ printd(DEBUG_PARSE, "%s:%d:imply\n", zconf_curname(), zconf_lineno());
+};
+
config_option: T_RANGE symbol symbol if_expr T_EOL
{
menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,$2, $3), $4);
@@ -546,13 +553,13 @@ static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtok
{
if (id->token != endtoken) {
zconf_error("unexpected '%s' within %s block",
- kconf_id_strings + id->name, zconf_tokenname(starttoken));
+ id->name, zconf_tokenname(starttoken));
zconfnerrs++;
return false;
}
if (current_menu->file != current_file) {
zconf_error("'%s' in different file than '%s'",
- kconf_id_strings + id->name, zconf_tokenname(starttoken));
+ id->name, zconf_tokenname(starttoken));
fprintf(stderr, "%s:%d: location of the '%s'\n",
current_menu->file->name, current_menu->lineno,
zconf_tokenname(starttoken));
@@ -666,6 +673,11 @@ static void print_symbol(FILE *out, struct menu *menu)
expr_fprint(prop->expr, out);
fputc('\n', out);
break;
+ case P_IMPLY:
+ fputs( " imply ", out);
+ expr_fprint(prop->expr, out);
+ fputc('\n', out);
+ break;
case P_RANGE:
fputs( " range ", out);
expr_fprint(prop->expr, out);