Implement @gettext<...@> directive to call gettext from skeletons. It

can be used anywhere including inside arguments of directives of the
form @foo(...@).  Eventually, it should be possible to write an
xgettext-like utility to extract @gettext<...@> text from skeletons.
* data/bison.m4 (b4_check_user_names): Use @gettext<...@> when invoking
b4_warn_at since b4_warn_at doesn't invoke gettext anymore.
* data/glr.cc, data/lalr1.cc: Likewise but for b4_fatal and
b4_complain reporting a push-parsing request or a missing %defines.
* src/scan-skel.l (INITIAL): Recognize `@gettext<' to start...
(SC_AT_GETTEXT_ARG): ... this new start condition where gettext is
invoked.
(SC_AT_DIRECTIVE_ARG): Rename to...
(SC_AT_DIRECTIVE_ARGS): ... this, and recognize `@gettext<' to start
SC_AT_GETTEXT_ARG.
(at_directive_perform): Don't invoke gettext for @warn(...@),
@warn_at(...@), etc.  Instead, let the skeletons decide what should be
passed to @gettext<...@>.
* tests/skeletons.at (@gettext<...@>): New test case.

* tests/skeletons.at (installed skeleton file name): Rename to...
(installed skeleton file names): ... this.
This commit is contained in:
Joel E. Denny
2007-01-18 05:14:59 +00:00
parent a7867f53b3
commit d4bdb91677
8 changed files with 132 additions and 32 deletions

View File

@@ -328,7 +328,7 @@ m4_pushdef([b4_start], m4_car(m4_shift(b4_occurrence)))dnl
m4_pushdef([b4_end], m4_shift(m4_shift(b4_occurrence)))dnl
m4_ifndef($3[(]m4_quote(b4_user_name)[)],
[b4_warn_at([b4_start], [b4_end],
[[%s `%s' is not used]],
[[@gettext<%s `%s' is not used@>]],
[$1], [b4_user_name])])[]dnl
m4_popdef([b4_occurrence])dnl
m4_popdef([b4_user_name])dnl

View File

@@ -21,7 +21,7 @@
b4_glr_if( [m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.cc]])])
b4_nondeterministic_if([m4_define([b4_used_skeleton], [b4_pkgdatadir/[glr.cc]])])
b4_push_if([b4_complain([[C++ push parsers are not supported]])])
b4_push_if([b4_complain([[@gettext<C++ push parsers are not supported@>]])])
m4_define_default([b4_used_skeleton], [b4_pkgdatadir/[lalr1.cc]])
m4_define_default([b4_skeleton], ["b4_basename(b4_used_skeleton)"])

View File

@@ -23,7 +23,7 @@
m4_include(b4_pkgdatadir/[c.m4])
b4_push_if([
b4_complain([[non-deterministic push parsers are not yet supported]])])
b4_complain([[@gettext<non-deterministic push parsers are not yet supported@>]])])
## ---------------- ##
## Default values. ##

View File

@@ -53,7 +53,7 @@ m4_define([b4_pure_flag], [1])
# The header is mandatory.
b4_defines_if([],
[b4_fatal([b4_skeleton[: using %%defines is mandatory]])])
[b4_fatal([b4_skeleton[: @gettext<using %%defines is mandatory@>]])])
m4_include(b4_pkgdatadir/[c++.m4])
m4_include(b4_pkgdatadir/[location.cc])

View File

@@ -27,7 +27,7 @@ m4_define([b4_namespace],
# The header is mandatory.
b4_defines_if([],
[b4_fatal([b4_skeleton[: using %%defines is mandatory]])])
[b4_fatal([b4_skeleton[: @gettext<using %%defines is mandatory@>]])])
# Backward compatibility.
m4_define([b4_location_constructors])