[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Fix output of copyright years.
From: |
Akim Demaille |
Subject: |
[PATCH] Fix output of copyright years. |
Date: |
Tue, 04 Nov 2008 20:21:45 -0000 |
* data/bison.m4 (b4_copyright): Fix the indentation of the
copyright year paragraph.
Use b4_copyright_years when no years are given.
* data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
(b4_copyright_years): New.
Use it.
---
ChangeLog | 10 ++++++++++
data/bison.m4 | 9 ++++++---
data/lalr1-fusion.cc | 13 +++++++------
data/lalr1.cc | 13 +++++++------
data/location.cc | 10 ++++++----
5 files changed, 36 insertions(+), 19 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index bbc793b..9acf6fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2008-11-04 Akim Demaille <address@hidden>
+ Fix output of copyright years.
+ * data/bison.m4 (b4_copyright): Fix the indentation of the
+ copyright year paragraph.
+ Use b4_copyright_years when no years are given.
+ * data/lalr1.cc, data/lalr1-fusion.cc, data/location.cc
+ (b4_copyright_years): New.
+ Use it.
+
+2008-11-04 Akim Demaille <address@hidden>
+
Avoid the spurious initial empty line.
* data/lalr1-fusion.cc, data/location.cc: Put a trailing "@" at
the end of @output request to suppress the empty line that
diff --git a/data/bison.m4 b/data/bison.m4
index bad6296..31f7818 100644
--- a/data/bison.m4
+++ b/data/bison.m4
@@ -22,14 +22,17 @@
## Identification. ##
## ---------------- ##
-# b4_copyright(TITLE, YEARS)
-# --------------------------
+# b4_copyright(TITLE, [YEARS])
+# ----------------------------
+# If YEARS are not defined, use b4_copyright_years.
m4_define([b4_copyright],
[b4_comment([A Bison parser, made by GNU Bison b4_version.])
b4_comment([$1
-m4_text_wrap([Copyright (C) $2 Free Software Foundation, Inc.], [ ])
+]m4_dquote(m4_text_wrap([Copyright (C)
+]m4_ifval([$2], [[$2]], [m4_defn([b4_copyright_years])])[
+Free Software Foundation, Inc.]))[
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/data/lalr1-fusion.cc b/data/lalr1-fusion.cc
index 48cefdd..fd8c79a 100644
--- a/data/lalr1-fusion.cc
+++ b/data/lalr1-fusion.cc
@@ -132,6 +132,9 @@ m4_define([b4_char_sizeof],
])
+m4_pushdef([b4_copyright_years],
+ [2002, 2003, 2004, 2005, 2006, 2007, 2008])
+
m4_define([b4_parser_class_name],
[b4_percent_define_get([[parser_class_name]])])
@@ -148,8 +151,7 @@ m4_changecom()
m4_divert_push(0)dnl
b4_defines_if(
address@hidden(b4_spec_defines_file@)@
-b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++],
- [2002, 2003, 2004, 2005, 2006, 2007, 2008])
+b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++])
dnl FIXME: This is wrong, we want computed header guards.
[
/* C++ LALR(1) parser skeleton written by Akim Demaille. */
@@ -479,8 +481,7 @@ b4_percent_code_get([[provides]])[]dnl
[#endif /* ! defined PARSER_HEADER_H */]
])dnl
@output(b4_parser_file_name@)@
-b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++],
- [2002, 2003, 2004, 2005, 2006, 2007, 2008])
+b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++])
b4_percent_code_get([[top]])[]dnl
m4_if(b4_prefix, [yy], [],
[
@@ -1213,8 +1214,7 @@ b4_error_verbose_if([ tok])[)
]b4_epilogue
dnl
@output(b4_dir_prefix[]stack.hh@)@
-b4_copyright([Stack handling for Bison parsers in C++],
- [2002, 2003, 2004, 2005, 2006, 2007, 2008])[
+b4_copyright([Stack handling for Bison parsers in C++])[
#ifndef BISON_STACK_HH
# define BISON_STACK_HH
@@ -1312,3 +1312,4 @@ b4_copyright([Stack handling for Bison parsers in C++],
#endif // not BISON_STACK_HH[]dnl
]
m4_divert_pop(0)
+m4_popdef([b4_copyright_years])dnl
diff --git a/data/lalr1.cc b/data/lalr1.cc
index 7195c28..ae5beac 100644
--- a/data/lalr1.cc
+++ b/data/lalr1.cc
@@ -18,6 +18,9 @@
m4_include(b4_pkgdatadir/[c++.m4])
+m4_pushdef([b4_copyright_years],
+ [2002, 2003, 2004, 2005, 2006, 2007, 2008])
+
# How the semantic value is extracted when using variants.
b4_variant_if([
# b4_symbol_value(VAL, [TYPE])
@@ -122,8 +125,7 @@ m4_changecom()
m4_divert_push(0)dnl
b4_defines_if(
address@hidden(b4_spec_defines_file@)
-b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++],
- [2002, 2003, 2004, 2005, 2006, 2007, 2008])
+b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++])
dnl FIXME: This is wrong, we want computed header guards.
[
/* C++ LALR(1) parser skeleton written by Akim Demaille. */
@@ -444,8 +446,7 @@ b4_percent_code_get([[provides]])[]dnl
[#endif /* ! defined PARSER_HEADER_H */]
])dnl
@output(b4_parser_file_name@)
-b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++],
- [2002, 2003, 2004, 2005, 2006, 2007, 2008])
+b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++])
b4_percent_code_get([[top]])[]dnl
m4_if(b4_prefix, [yy], [],
[
@@ -1209,8 +1210,7 @@ b4_error_verbose_if([, int tok])[)
]b4_epilogue
dnl
@output(b4_dir_prefix[]stack.hh@)
-b4_copyright([Stack handling for Bison parsers in C++],
- [2002, 2003, 2004, 2005, 2006, 2007, 2008])[
+b4_copyright([Stack handling for Bison parsers in C++])[
#ifndef BISON_STACK_HH
# define BISON_STACK_HH
@@ -1308,3 +1308,4 @@ b4_copyright([Stack handling for Bison parsers in C++],
#endif // not BISON_STACK_HH[]dnl
]
m4_divert_pop(0)
+m4_popdef([b4_copyright_years])dnl
diff --git a/data/location.cc b/data/location.cc
index e69e707..39c7ca9 100644
--- a/data/location.cc
+++ b/data/location.cc
@@ -16,12 +16,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+m4_pushdef([b4_copyright_years],
+ [2002, 2003, 2004, 2005, 2006, 2007, 2008])
+
# We do want M4 expansion after # for CPP macros.
m4_changecom()
m4_divert_push(0)dnl
@output(b4_dir_prefix[]position.hh@)@
-b4_copyright([Positions for Bison parsers in C++],
- [2002, 2003, 2004, 2005, 2006, 2008])[
+b4_copyright([Positions for Bison parsers in C++])[
/**
** \file position.hh
@@ -144,8 +146,7 @@ b4_copyright([Positions for Bison parsers in C++],
]b4_namespace_close[
#endif // not BISON_POSITION_HH]
@output(b4_dir_prefix[]location.hh@)@
-b4_copyright([Locations for Bison parsers in C++],
- [2002, 2003, 2004, 2005, 2006, 2008])[
+b4_copyright([Locations for Bison parsers in C++])[
/**
** \file location.hh
@@ -272,4 +273,5 @@ b4_copyright([Locations for Bison parsers in C++],
#endif // not BISON_LOCATION_HH]
m4_divert_pop(0)
+m4_popdef([b4_copyright_years])dnl
m4_changecom([#])
--
1.6.0.2.588.g3102
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] Fix output of copyright years.,
Akim Demaille <=