aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/expr.c
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2008-01-13 22:50:23 -0500
committerSam Ravnborg <sam@ravnborg.org>2008-01-28 17:14:39 -0500
commit7a962923359768e04137125bd479fd0dfa6117d3 (patch)
tree9da466ba7ee1806bd40a53496533fc1f0ddd6cc2 /scripts/kconfig/expr.c
parent0ffce8d94487abbd332cd36f98db61b7c8a3db3c (diff)
kconfig: explicitly introduce expression list
Rename E_CHOICE to E_LIST to explicitly add support for expression lists. Add a helper macro expr_list_for_each_sym to more easily iterate over the list. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/kconfig/expr.c')
-rw-r--r--scripts/kconfig/expr.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c
index c8793d1d908f..13788ada5228 100644
--- a/scripts/kconfig/expr.c
+++ b/scripts/kconfig/expr.c
@@ -87,7 +87,7 @@ struct expr *expr_copy(struct expr *org)
87 break; 87 break;
88 case E_AND: 88 case E_AND:
89 case E_OR: 89 case E_OR:
90 case E_CHOICE: 90 case E_LIST:
91 e->left.expr = expr_copy(org->left.expr); 91 e->left.expr = expr_copy(org->left.expr);
92 e->right.expr = expr_copy(org->right.expr); 92 e->right.expr = expr_copy(org->right.expr);
93 break; 93 break;
@@ -217,7 +217,7 @@ int expr_eq(struct expr *e1, struct expr *e2)
217 expr_free(e2); 217 expr_free(e2);
218 trans_count = old_count; 218 trans_count = old_count;
219 return res; 219 return res;
220 case E_CHOICE: 220 case E_LIST:
221 case E_RANGE: 221 case E_RANGE:
222 case E_NONE: 222 case E_NONE:
223 /* panic */; 223 /* panic */;
@@ -648,7 +648,7 @@ struct expr *expr_transform(struct expr *e)
648 case E_EQUAL: 648 case E_EQUAL:
649 case E_UNEQUAL: 649 case E_UNEQUAL:
650 case E_SYMBOL: 650 case E_SYMBOL:
651 case E_CHOICE: 651 case E_LIST:
652 break; 652 break;
653 default: 653 default:
654 e->left.expr = expr_transform(e->left.expr); 654 e->left.expr = expr_transform(e->left.expr);
@@ -932,7 +932,7 @@ struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symb
932 break; 932 break;
933 case E_SYMBOL: 933 case E_SYMBOL:
934 return expr_alloc_comp(type, e->left.sym, sym); 934 return expr_alloc_comp(type, e->left.sym, sym);
935 case E_CHOICE: 935 case E_LIST:
936 case E_RANGE: 936 case E_RANGE:
937 case E_NONE: 937 case E_NONE:
938 /* panic */; 938 /* panic */;
@@ -1000,9 +1000,9 @@ int expr_compare_type(enum expr_type t1, enum expr_type t2)
1000 if (t2 == E_OR) 1000 if (t2 == E_OR)
1001 return 1; 1001 return 1;
1002 case E_OR: 1002 case E_OR:
1003 if (t2 == E_CHOICE) 1003 if (t2 == E_LIST)
1004 return 1; 1004 return 1;
1005 case E_CHOICE: 1005 case E_LIST:
1006 if (t2 == 0) 1006 if (t2 == 0)
1007 return 1; 1007 return 1;
1008 default: 1008 default:
@@ -1053,11 +1053,11 @@ void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *
1053 fn(data, NULL, " && "); 1053 fn(data, NULL, " && ");
1054 expr_print(e->right.expr, fn, data, E_AND); 1054 expr_print(e->right.expr, fn, data, E_AND);
1055 break; 1055 break;
1056 case E_CHOICE: 1056 case E_LIST:
1057 fn(data, e->right.sym, e->right.sym->name); 1057 fn(data, e->right.sym, e->right.sym->name);
1058 if (e->left.expr) { 1058 if (e->left.expr) {
1059 fn(data, NULL, " ^ "); 1059 fn(data, NULL, " ^ ");
1060 expr_print(e->left.expr, fn, data, E_CHOICE); 1060 expr_print(e->left.expr, fn, data, E_LIST);
1061 } 1061 }
1062 break; 1062 break;
1063 case E_RANGE: 1063 case E_RANGE: