Prepare @$ in %destructor, but currently don't bind it in the

skeleton, as %location use is not cleaned up yet.
* src/scan-gram.l (handle_dollar, handle_destructor_at)
(handle_action_at): New.
(handle_at, handle_action_dollar, handle_destructor_dollar): Take
a braced_code_t and a location as additional arguments.
(handle_destructor_dollar): Instead of requiring `b4_eval', just
unquote one when outputting `b4_dollar_dollar'.
Adjust callers.
* data/bison.simple (b4_eval): Remove.
(b4_symbol_destructor): Adjust.
* tests/input.at (Invalid @n): Adjust.
This commit is contained in:
Akim Demaille
2002-06-19 08:22:49 +00:00
parent c732d2c6dc
commit f25bfb75aa
5 changed files with 237 additions and 105 deletions

View File

@@ -1275,21 +1275,13 @@ yyreturn:
`-------------------------------------------------*/
m4_divert_push([KILL])# M4 code.
# b4_eval
# -------
# FIXME: This is really wrong, we no longer guarantee we don't evaluate
# the user's input. This demonstrates that decoding actions (BRACED_CODE)
# ought to be done when output, not when read.
m4_define([b4_eval],
[$*])
# b4_symbol_destructor(SYMBOL-NUMBER, DESTRUCTOR, TYPE-NAME)
# ----------------------------------------------------------
m4_define([b4_symbol_destructor],
[m4_pushdef([b4_dollar_dollar], [symbol_value.$6])dnl
case $4: /* $3 */
#line $2 "$1"
b4_eval($5);
$5;
#line __oline__ "__ofile__"
break;
m4_popdef([b4_dollar_dollar])])