]> git.ipfire.org Git - thirdparty/gettext.git/commit
xgettext: PHP: Support heredoc and nowdoc strings.
authorBruno Haible <bruno@clisp.org>
Sat, 21 Sep 2024 11:05:16 +0000 (13:05 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 21 Sep 2024 11:05:16 +0000 (13:05 +0200)
commit9d4340a78812fad9d69a40b43fdac03417db4c8c
treebf56f89182bf681d46329ab3953490bc5250b94c
parent4df2df7213075afefe4c28132dcc1f97b6e99aa5
xgettext: PHP: Support heredoc and nowdoc strings.

Reported:
by Bodo Graumann <mail@bodograumann.de> at <https://savannah.gnu.org/bugs/?27740>,
at <https://savannah.gnu.org/bugs/?35944>,
by Cédric Anne <canne@teclib.com> at <https://savannah.gnu.org/bugs/?62158>.

* gettext-tools/src/x-php.c (TAB_WIDTH): New macro.
(process_heredoc): New function.
(phase4_get): Process the heredoc or nowdoc string, instead of blindly skipping
it.
* gettext-tools/tests/xgettext-php-1: Add tests of heredoc strings with embedded
expressions.
* gettext-tools/tests/xgettext-php-2: Expect spaces before a heredoc end label
to be eaten. Add tests of heredoc strings and nowdoc strings.
* NEWS: Mention the improvement.
NEWS
gettext-tools/src/x-php.c
gettext-tools/tests/xgettext-php-1
gettext-tools/tests/xgettext-php-2