mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
c++: use // comments in the output
This is mostly used for the license header, the synclines, and the generated tables: - /* STOS_[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + // STOS_[STATE-NUM] -- The (internal number of the) accessing + // symbol of state STATE-NUM. static const unsigned char yystos_[]; * data/c.m4: Comment changes. (b4_comment_): Expand the text argument. Before this change, we were actually formatting M4 code as a C comment, and then expand it. (b4_comment): Fix the closing of comments: there is no reason to add the (line) prefix before the closing "*/". * data/c++.m4 (b4_comment): New.
This commit is contained in:
@@ -19,6 +19,13 @@
|
||||
|
||||
m4_include(b4_pkgdatadir/[c.m4])
|
||||
|
||||
# b4_comment(TEXT, [PREFIX])
|
||||
# --------------------------
|
||||
# Put TEXT in comment. Prefix all the output lines with PREFIX.
|
||||
m4_define([b4_comment],
|
||||
[b4_comment_([$1], [$2// ], [$2// ])])
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
## Default values. ##
|
||||
## ---------------- ##
|
||||
|
||||
11
data/c.m4
11
data/c.m4
@@ -58,20 +58,17 @@ m4_define([b4_cpp_guard_close],
|
||||
# from OPEN. That's why we don't patsubst([$1], [^\(.\)], [ \1]).
|
||||
#
|
||||
# Prefix all the output lines with PREFIX.
|
||||
m4_define([b4_comment_], [$2[]m4_bpatsubst([$1], [
|
||||
m4_define([b4_comment_],
|
||||
[$2[]m4_bpatsubst(m4_expand([$1]), [
|
||||
\(.\)], [
|
||||
$3\1])$4])
|
||||
|
||||
|
||||
# b4_comment(TEXT, [PREFIX])
|
||||
# --------------------------
|
||||
# Put TEXT in comment. Avoid trailing spaces: don't indent empty lines.
|
||||
# Avoid adding indentation to the first line, as the indentation comes
|
||||
# from "/*". That's why we don't patsubst([$1], [^\(.\)], [ \1]).
|
||||
#
|
||||
# Prefix all the output lines with PREFIX.
|
||||
# Put TEXT in comment. Prefix all the output lines with PREFIX.
|
||||
m4_define([b4_comment],
|
||||
[b4_comment_([$1], [$2/* ], [$2 ], [$2 */])])
|
||||
[b4_comment_([$1], [$2/* ], [$2 ], [ */])])
|
||||
|
||||
|
||||
# b4_identification
|
||||
|
||||
Reference in New Issue
Block a user