bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 0/3] RFC: update %define variable diagnostics


From: Akim Demaille
Subject: [PATCH 0/3] RFC: update %define variable diagnostics
Date: Fri, 21 Dec 2012 16:13:45 +0100

Hi!

In the process of preparing the implementation of variants for the
next release, I am preparing the migration from "%define variant" to
"%define api.value.type variant".

This is new: Bison was equipped with %define variables begin renamed,
but no %define variables being both renamed, and having value changed.

The patches generalize the routine that was used to support
%define-variable renaming easily so that now values are also taken
into account.  

But I have also changed the message to make it more uniform: instead
of

  warning: deprecated %define variable name: 'namespace', use 'api.namespace' 
[-Wdeprecated]

we now display (in -fno-caret mode):

  warning: deprecated directive: '%define namespace foo', use '%define 
api.namespace foo' [-Wdeprecated]

and (in -fcaret mode):

  warning: deprecated directive, use '%define api.namespace toto' [-Wdeprecated]
   %define namespace toto
           ^^^^^^^^^

The "deprecative directive" message was already used elsewhere, so I
actually reuse an existing message.  

Does someone think the previous messages (deprecated directive) are a
regression compared to what we had (deprecated %define variable name)?

I can preserve the former message in case of a simple variable
renaming if people think the message was better before.  But the
generalization here requires the "invalid directive" style of message:

$ LC_ALL=C bison -fcaret /tmp/foo.yy
/tmp/foo.yy:1.9-15: warning: deprecated directive, use '%define api.value.type 
variant' [-Wdeprecated]
 %define variant
         ^^^^^^^
/tmp/foo.yy:1.9-15: error: %define variable 'api.value.type' is not used
 %define variant
         ^^^^^^^

Pushed in branch api.value.type.c:

Akim Demaille (3):
  diagnostics: factor the deprecated directive message
  diagnostics: treat obsolete %define variable names as obsolete
    directives
  %define variables: support value changes in deprecation

 src/complain.c   | 15 ++++++++++
 src/complain.h   |  4 +++
 src/muscle-tab.c | 88 +++++++++++++++++++++++++++++++++++++++++++++-----------
 src/scan-gram.l  |  4 +--
 tests/input.at   |  8 +++---
 5 files changed, 95 insertions(+), 24 deletions(-)

-- 
1.8.0.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]