From: Guido Flohr Date: Thu, 24 Nov 2016 14:30:11 +0000 (+0200) Subject: xgettext-perl: detect question mark as operator X-Git-Tag: v0.20~497 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2390c4941469196a649df594931a9a7405f720bd;p=thirdparty%2Fgettext.git xgettext-perl: detect question mark as operator After an explicit function call like "somefunc()" a question mark or slash cannot be regex delimiters. --- diff --git a/gettext-tools/src/x-perl.c b/gettext-tools/src/x-perl.c index ea903dcc3..b0704a6a1 100644 --- a/gettext-tools/src/x-perl.c +++ b/gettext-tools/src/x-perl.c @@ -2399,12 +2399,6 @@ x_perl_prelex (message_list_ty *mlp, token_ty *tp) return; case '(': - c = phase2_getc (); - if (c == ')') - /* Ignore empty list. */ - continue; - else - phase2_ungetc (c); tp->type = token_type_lparen; return; diff --git a/gettext-tools/tests/xgettext-perl-8 b/gettext-tools/tests/xgettext-perl-8 index b165e09f6..db93b84f3 100755 --- a/gettext-tools/tests/xgettext-perl-8 +++ b/gettext-tools/tests/xgettext-perl-8 @@ -57,6 +57,11 @@ $foo = $Some->thing->method ? 1 : 0; print __"Chained method calls without parentheses do not accept arguments!"; # ?; Re-sync. +condition() ? 1 : 0; + +print __"Question mark after an explicit function call is always an operator!"; +# ?; + print __"Synching works."; EOF @@ -112,7 +117,11 @@ msgstr "" msgid "Chained method calls without parentheses do not accept arguments!" msgstr "" -#: xg-pl-8.pl:51 +#: xg-pl-8.pl:53 +msgid "Question mark after an explicit function call is always an operator!" +msgstr "" + +#: xg-pl-8.pl:56 msgid "Synching works." msgstr "" EOF