Merge branch 'for-2.6.30' into for-2.6.31
[pandora-kernel.git] / scripts / kconfig / zconf.y
index 92eb02b..9710b82 100644 (file)
@@ -64,7 +64,6 @@ static struct menu *current_menu, *current_entry;
 %token <id>T_IF
 %token <id>T_ENDIF
 %token <id>T_DEPENDS
-%token <id>T_REQUIRES
 %token <id>T_OPTIONAL
 %token <id>T_PROMPT
 %token <id>T_TYPE
@@ -92,7 +91,7 @@ static struct menu *current_menu, *current_entry;
 %type <id> end
 %type <id> option_name
 %type <menu> if_entry menu_entry choice_entry
-%type <string> symbol_option_arg
+%type <string> symbol_option_arg word_opt
 
 %destructor {
        fprintf(stderr, "%s:%d: missing end statement for this entry\n",
@@ -240,10 +239,10 @@ symbol_option_arg:
 
 /* choice entry */
 
-choice: T_CHOICE T_EOL
+choice: T_CHOICE word_opt T_EOL
 {
-       struct symbol *sym = sym_lookup(NULL, 0);
-       sym->flags |= SYMBOL_CHOICE;
+       struct symbol *sym = sym_lookup($2, SYMBOL_CHOICE);
+       sym->flags |= SYMBOL_AUTO;
        menu_add_entry(sym);
        menu_add_expr(P_CHOICE, NULL, NULL);
        printd(DEBUG_PARSE, "%s:%d:choice\n", zconf_curname(), zconf_lineno());
@@ -402,7 +401,7 @@ help_start: T_HELP T_EOL
 
 help: help_start T_HELPTEXT
 {
-       current_entry->sym->help = $2;
+       current_entry->help = $2;
 };
 
 /* depends option */
@@ -418,16 +417,6 @@ depends: T_DEPENDS T_ON expr T_EOL
 {
        menu_add_dep($3);
        printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno());
-}
-       | T_DEPENDS expr T_EOL
-{
-       menu_add_dep($2);
-       printd(DEBUG_PARSE, "%s:%d:depends\n", zconf_curname(), zconf_lineno());
-}
-       | T_REQUIRES expr T_EOL
-{
-       menu_add_dep($2);
-       printd(DEBUG_PARSE, "%s:%d:requires\n", zconf_curname(), zconf_lineno());
 };
 
 /* prompt statement */
@@ -467,9 +456,12 @@ expr:        symbol                                { $$ = expr_alloc_symbol($1); }
 ;
 
 symbol:          T_WORD        { $$ = sym_lookup($1, 0); free($1); }
-       | T_WORD_QUOTE  { $$ = sym_lookup($1, 1); free($1); }
+       | T_WORD_QUOTE  { $$ = sym_lookup($1, SYMBOL_CONST); free($1); }
 ;
 
+word_opt: /* empty */                  { $$ = NULL; }
+       | T_WORD
+
 %%
 
 void conf_parse(const char *name)
@@ -649,11 +641,11 @@ void print_symbol(FILE *out, struct menu *menu)
                        break;
                }
        }
-       if (sym->help) {
-               int len = strlen(sym->help);
-               while (sym->help[--len] == '\n')
-                       sym->help[len] = 0;
-               fprintf(out, "  help\n%s\n", sym->help);
+       if (menu->help) {
+               int len = strlen(menu->help);
+               while (menu->help[--len] == '\n')
+                       menu->help[len] = 0;
+               fprintf(out, "  help\n%s\n", menu->help);
        }
        fputc('\n', out);
 }