support $<tag>$ in printers and destructors

* src/scan-code.l (SC_SYMBOL_ACTION): Accept $<tag>$, not just $$.
* data/c.m4 (b4_dollar_dollar_): New.
(b4_symbol_actions): Let b4_dollar_dollar use b4_dollar_dollar_.
* NEWS, doc/bison.texi: Document it.
* tests/actions.at: Check this for C and C++.
This commit is contained in:
Akim Demaille
2012-07-26 16:52:35 +02:00
parent 65a99eca25
commit 4982f078bf
6 changed files with 182 additions and 15 deletions

View File

@@ -264,8 +264,12 @@ ref -?[0-9]+|{id}|"["{id}"]"|"$"
<SC_SYMBOL_ACTION>
{
"$$" {
obstack_sgrow (&obstack_for_string, "]b4_dollar_dollar[");
"$"("<"{tag}">")?"$" {
const char *type_name = NULL;
fetch_type_name (yytext + 1, &type_name, *loc)[-1] = 0;
obstack_sgrow (&obstack_for_string, "]b4_dollar_dollar(");
obstack_quote (&obstack_for_string, type_name);
obstack_sgrow (&obstack_for_string, ")[");
self->is_value_used = true;
}
"@$" {