From dda680cb8069f3e383cbc3c140ea59f35bd2c75c Mon Sep 17 00:00:00 2001 From: Pascal Bart Date: Fri, 31 Aug 2001 18:51:06 +0000 Subject: [PATCH] * src/output.c (prepare): Delete the `filename' muscule insertion. * src/reader.c (copy_action): Use `filename' muscule with `#line'. (parse_union_decl): Likewise. * src/macrotab.c (macro_init): Initialize filename by infile. --- ChangeLog | 7 +++++++ src/macrotab.c | 2 +- src/output.c | 2 -- src/reader.c | 6 ++++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2ac2876b..c9a3fece 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-08-31 Pascal Bart + + * src/output.c (prepare): Delete the `filename' muscule insertion. + * src/reader.c (copy_action): Use `filename' muscule with `#line'. + (parse_union_decl): Likewise. + * src/macrotab.c (macro_init): Initialize filename by infile. + 2001-08-31 Marc Autret * src/bison.simple (YYLSP_NEEDED): New definition. diff --git a/src/macrotab.c b/src/macrotab.c index b3693214..137ba8dc 100644 --- a/src/macrotab.c +++ b/src/macrotab.c @@ -53,7 +53,7 @@ macro_init (void) /* Version and input file. */ macro_insert ("version", VERSION); - macro_insert ("filename", "a.y"); + macro_insert ("filename", infile); /* Types. */ macro_insert ("stype", "int"); diff --git a/src/output.c b/src/output.c index 06c7090f..eecb8c68 100644 --- a/src/output.c +++ b/src/output.c @@ -1067,8 +1067,6 @@ prepare (void) MACRO_INSERT_INT ("ntbase", ntokens); MACRO_INSERT_INT ("verbose", 0); - MACRO_INSERT_STRING ("filename", infile); - MACRO_INSERT_INT ("nnts", nvars); MACRO_INSERT_INT ("nrules", nrules); MACRO_INSERT_INT ("nstates", nstates); diff --git a/src/reader.c b/src/reader.c index 22eedc80..feaa3b67 100644 --- a/src/reader.c +++ b/src/reader.c @@ -749,7 +749,8 @@ parse_union_decl (void) if (!no_lines_flag) obstack_fgrow2 (&attrs_obstack, "\n#line %d %s\n", - lineno, quotearg_style (c_quoting_style, infile)); + lineno, quotearg_style (c_quoting_style, + macro_find("filename"))); else obstack_1grow (&attrs_obstack, '\n'); @@ -1111,7 +1112,8 @@ copy_action (symbol_list *rule, int stack_offset) if (!no_lines_flag) { sprintf (buf, "#line %d %s\n", - lineno, quotearg_style (c_quoting_style, infile)); + lineno, quotearg_style (c_quoting_style, + macro_find ("filename"))); obstack_grow (&action_obstack, buf, strlen (buf)); } obstack_1grow (&action_obstack, '{'); -- 2.47.2