projects
/
carl9170fw.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[carl9170fw.git]
/
config
/
zconf.y
diff --git
a/config/zconf.y
b/config/zconf.y
index efa93e9d030a6b24f4a475c1669a167efad45c55..79c4f04f72fa819bfdb7548a736f1c16fcf37ec8 100644
(file)
--- a/
config/zconf.y
+++ b/
config/zconf.y
@@
-31,7
+31,7
@@
struct symbol *symbol_hash[SYMBOL_HASHSIZE];
static struct menu *current_menu, *current_entry;
%}
static struct menu *current_menu, *current_entry;
%}
-%expect 3
0
+%expect 3
2
%union
{
%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_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
%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
%{
} 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
{
| 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:
}
| 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:
;
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());
};
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);
config_option: T_RANGE symbol symbol if_expr T_EOL
{
menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,$2, $3), $4);
@@
-544,13
+551,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",
{
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'",
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));
fprintf(stderr, "%s:%d: location of the '%s'\n",
current_menu->file->name, current_menu->lineno,
zconf_tokenname(starttoken));
@@
-664,6
+671,11
@@
static void print_symbol(FILE *out, struct menu *menu)
expr_fprint(prop->expr, out);
fputc('\n', out);
break;
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);
case P_RANGE:
fputs( " range ", out);
expr_fprint(prop->expr, out);