current_menu = current_menu->parent;
}
-struct expr *menu_check_dep(struct expr *e)
-{
- if (!e)
- return e;
-
- switch (e->type) {
- case E_NOT:
- e->left.expr = menu_check_dep(e->left.expr);
- break;
- case E_OR:
- case E_AND:
- e->left.expr = menu_check_dep(e->left.expr);
- e->right.expr = menu_check_dep(e->right.expr);
- break;
- case E_SYMBOL:
- /* change 'm' into 'm' && MODULES */
- if (e->left.sym == &symbol_mod)
- return expr_alloc_and(e, expr_alloc_symbol(modules_sym));
- break;
- default:
- break;
- }
- return e;
-}
-
void menu_add_dep(struct expr *dep)
{
- current_entry->dep = expr_alloc_and(current_entry->dep, menu_check_dep(dep));
+ current_entry->dep = expr_alloc_and(current_entry->dep, dep);
}
void menu_set_type(int type)
prop->menu = current_entry;
prop->text = prompt;
prop->expr = expr;
- prop->visible.expr = menu_check_dep(dep);
+ prop->visible.expr = dep;
if (prompt) {
if (current_entry->prompt)
"accept arguments of boolean and "
"tristate type", sym2->name);
break;
+ case P_DESELECT:
+ sym2 = prop_get_symbol(prop);
+ if (sym->type != S_BOOLEAN && sym->type != S_TRISTATE)
+ prop_warn(prop,
+ "config symbol '%s' uses deselect, but is "
+ "not boolean or tristate", sym->name);
+ else if (sym2->type == S_UNKNOWN)
+ prop_warn(prop,
+ "'deselect' used by config symbol '%s' "
+ "refer to undefined symbol '%s'",
+ sym->name, sym2->name);
+ else if (sym2->type != S_BOOLEAN && sym2->type != S_TRISTATE)
+ prop_warn(prop,
+ "'%s' has wrong type. 'deselect' only "
+ "accept arguments of boolean and "
+ "tristate type", sym2->name);
+ break;
case P_RANGE:
if (sym->type != S_INT && sym->type != S_HEX)
prop_warn(prop, "range is only allowed "
prop = menu->sym->prop;
else
prop = menu->prompt;
+
for (; prop; prop = prop->next) {
if (prop->menu != menu)
continue;
dep = expr_transform(prop->visible.expr);
- dep = expr_alloc_and(expr_copy(basedep), dep);
+ dep = expr_alloc_and(expr_copy(menu->dep), dep);
dep = expr_eliminate_dups(dep);
if (menu->sym && menu->sym->type != S_TRISTATE)
dep = expr_trans_bool(dep);
es->rev_dep.expr = expr_alloc_or(es->rev_dep.expr,
expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep)));
}
+ if (prop->type == P_DESELECT) {
+ struct symbol *es = prop_get_symbol(prop);
+ es->rev_dep_inv.expr = expr_alloc_or(es->rev_dep_inv.expr,
+ expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep)));
+ }
}
}
for (menu = parent->list; menu; menu = menu->next)
"currently only support a "
"single prompt");
}
- if (prop->type == P_DEFAULT)
- prop_warn(prop, "defaults for choice "
- "values not supported");
}
current_entry = menu;
menu_set_type(sym->type);