]> git.ipfire.org Git - thirdparty/gettext.git/commit
xgettext: Rust: Support named format string arguments.
authorBruno Haible <bruno@clisp.org>
Tue, 11 Feb 2025 10:37:40 +0000 (11:37 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 11 Feb 2025 10:39:58 +0000 (11:39 +0100)
commit3cbdb13073fbc9eda5753a66ad4c03822722bf5f
treeb34586ae404f2c8df32af444b64ddffd7942e759
parenta24c903f5fb12eac2afcbbbee7f71ed91a04b863
xgettext: Rust: Support named format string arguments.

Reported by Kévin Commaille <zecakeh@tedomum.fr>
in <https://savannah.gnu.org/bugs/?56774>.

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add unictype/property-xid-start,
unictype/property-xid-continue.
(GNULIB_MODULES_LIBGETTEXTPO): Likewise.
* gettext-tools/src/format-rust.c (struct named_arg): New type.
(struct spec): Add fields named_arg_count, named.
(named_arg_compare): New function.
(format_parse): Recognize named arguments.
(format_check): Search for differences also between the named arguments.
(format_print): Print also the named arguments.
* gettext-tools/tests/format-rust-1: Add test cases for named arguments.
* gettext-tools/tests/format-rust-2: Likewise.
* gettext-tools/doc/gettext.texi (rust-format): Describe rust-format in detail.
autogen.sh
gettext-tools/doc/gettext.texi
gettext-tools/src/format-rust.c
gettext-tools/tests/format-rust-1
gettext-tools/tests/format-rust-2