[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/1] maint: code factorization for %printer & %destructor
From: |
Akim Demaille |
Subject: |
Re: [PATCH 1/1] maint: code factorization for %printer & %destructor |
Date: |
Mon, 25 Jun 2012 09:51:10 +0200 |
Le 22 juin 2012 à 14:54, Akim Demaille a écrit :
> I have installed this, on top of your patch.
>
> * src/symtab.h, src/symtab.c (code_props_type_string): No longer static.
> * src/output.c (CODE_PROPS): Remove, we can now iterate on both the
> destructor and the printer.
> (SET_KEY2): New.
This was very wrong, and for bad reasons (related to having
skipped broken dependencies due to the y.tab.h bug in Automake),
I was running the test suite with an old Bison.
My bad.
The problem:
> -#define CODE_PROP(PropName) \
> - do { \
> - code_props const *p = symbol_code_props_get (sym, PropName); \
> + {
> + int j;
> + for (j = 0; j < CODE_PROPS_SIZE; ++j)
> + {
> + char const *pname = code_props_type_string (j);
is that now pname includes the %.
Fixed as follows. Sorry about that. I will also adjust bison
to the fact that ylwrap destroys the #include from y.tab.c to
y.tab.h.
From 423ca9b50e4321c078cc6fe7903b10ed4907d269 Mon Sep 17 00:00:00 2001
From: Akim Demaille <address@hidden>
Date: Mon, 25 Jun 2012 09:49:04 +0200
Subject: [PATCH] fix for printers and destructors.
The previous "code_props: factor more" patch sends has_%printer
etc. to m4, instead of has_printer.
* src/output.c (prepare_symbol_definitions): Fix value of pname.
---
src/output.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/output.c b/src/output.c
index 6ff6a9b..4fe11cc 100644
--- a/src/output.c
+++ b/src/output.c
@@ -447,7 +447,8 @@ prepare_symbol_definitions (void)
int j;
for (j = 0; j < CODE_PROPS_SIZE; ++j)
{
- char const *pname = code_props_type_string (j);
+ /* "printer", not "%printer". */
+ char const *pname = code_props_type_string (j) + 1;
code_props const *p = symbol_code_props_get (sym, j);
SET_KEY2("has", pname);
MUSCLE_INSERT_INT (key, !!p->code);
--
1.7.10.4