X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/e54ec80c0c163e7a9e24fc2eee6c42a61cbe4316..933ec5449fc9b8a831d6afe67535d2c2bdc528d2:/src/parse-gram.y diff --git a/src/parse-gram.y b/src/parse-gram.y index eb034b08..02af75e2 100644 --- a/src/parse-gram.y +++ b/src/parse-gram.y @@ -347,17 +347,27 @@ grammar_declaration: } | "%destructor" "{...}" generic_symlist { - symbol_list *list; - for (list = $3; list; list = list->next) - symbol_list_destructor_set (list, $2, @2); - symbol_list_free ($3); + code_props code; + code_props_symbol_action_init (&code, $2, @2); + code_props_translate_code (&code); + { + symbol_list *list; + for (list = $3; list; list = list->next) + symbol_list_destructor_set (list, &code); + symbol_list_free ($3); + } } | "%printer" "{...}" generic_symlist { - symbol_list *list; - for (list = $3; list; list = list->next) - symbol_list_printer_set (list, $2, @2); - symbol_list_free ($3); + code_props code; + code_props_symbol_action_init (&code, $2, @2); + code_props_translate_code (&code); + { + symbol_list *list; + for (list = $3; list; list = list->next) + symbol_list_printer_set (list, &code); + symbol_list_free ($3); + } } | "%default-prec" { @@ -724,11 +734,13 @@ add_param (char const *type, char *decl, location loc) /* Strip the surrounding '{' and '}', and any blanks just inside the braces. */ - while (*--p == ' ' || *p == '\t') - continue; + --p; + while (isspace ((unsigned char) *p)) + --p; p[1] = '\0'; - while (*++decl == ' ' || *decl == '\t') - continue; + ++decl; + while (isspace ((unsigned char) *decl)) + ++decl; if (! name_start) complain_at (loc, _("missing identifier in parameter declaration"));