]> git.saurik.com Git - bison.git/commitdiff
lalrl1.cc: give a chance to user defined YYLLOC_DEFAULT.
authorAkim Demaille <demaille@gostai.com>
Tue, 11 May 2010 21:51:59 +0000 (23:51 +0200)
committerAkim Demaille <demaille@gostai.com>
Wed, 12 May 2010 08:27:17 +0000 (10:27 +0200)
* data/lalr1.cc (YYLLOC_DEFAULT): Move its definition from the
header file to the implementation file, after the user %code
sections.
* NEWS: Document it.

ChangeLog
data/lalr1.cc

index 9cef074e8fdb25ef8fa12cc28fc4b874508ab2a3..071a754c7bd850a14ca96a32ef3d963010c8f6cf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-05-11  Akim Demaille  <demaille@gostai.com>
+
+       lalrl1.cc: give a chance to user defined YYLLOC_DEFAULT.
+       * data/lalr1.cc (YYLLOC_DEFAULT): Move its definition from the
+       header file to the implementation file, after the user %code
+       sections.
+       * NEWS (2.5): Document this.
+
 2010-05-11  Akim Demaille  <demaille@gostai.com>
 
        doc: please Emacs.
index 8094cccffd08a4decc34aa29e2919ce0511f6ea4..646ee904bebaab3720b3d38ade71aa80bd1d03c7 100644 (file)
@@ -175,27 +175,6 @@ b4_namespace_close])[
 # define YYTOKEN_TABLE ]b4_token_table[
 #endif
 
-]b4_locations_if([dnl
-[/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
-   If N is 0, then set CURRENT to the empty location which ends
-   the previous symbol: RHS[0] (always defined).  */
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N)                               \
- do                                                                    \
-   if (N)                                                              \
-     {                                                                 \
-       (Current).begin = YYRHSLOC (Rhs, 1).begin;                      \
-       (Current).end   = YYRHSLOC (Rhs, N).end;                        \
-     }                                                                 \
-   else                                                                \
-     {                                                                 \
-       (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end;        \
-     }                                                                 \
- while (false)
-#endif]])[
-
 ]b4_namespace_open[
 
   /// A Bison parser.
@@ -407,6 +386,27 @@ b4_percent_code_get[]dnl
 # endif
 #endif
 
+]b4_locations_if([dnl
+[/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+   If N is 0, then set CURRENT to the empty location which ends
+   the previous symbol: RHS[0] (always defined).  */
+
+#define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N)                               \
+ do                                                                    \
+   if (N)                                                              \
+     {                                                                 \
+       (Current).begin = YYRHSLOC (Rhs, 1).begin;                      \
+       (Current).end   = YYRHSLOC (Rhs, N).end;                        \
+     }                                                                 \
+   else                                                                \
+     {                                                                 \
+       (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end;        \
+     }                                                                 \
+ while (false)
+#endif]])[
+
 /* Suppress unused-variable warnings by "using" E.  */
 #define YYUSE(e) ((void) (e))