]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
xgettext-perl: detect question mark as operator
authorGuido Flohr <guido.flohr@cantanea.com>
Thu, 24 Nov 2016 14:30:11 +0000 (16:30 +0200)
committerGuido Flohr <guido.flohr@cantanea.com>
Thu, 24 Nov 2016 14:30:11 +0000 (16:30 +0200)
After an explicit function call like "somefunc()" a question mark or
slash cannot be regex delimiters.

gettext-tools/src/x-perl.c
gettext-tools/tests/xgettext-perl-8

index ea903dcc3837f092b40e0fe63476aebdc0bfc3cd..b0704a6a107a50b0585e5f62ec8e36ee95a0d01e 100644 (file)
@@ -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;
 
index b165e09f67005fd5269142be0ce6d475c98e978b..db93b84f3db2bf4823149cbba47ff86e04140cac 100755 (executable)
@@ -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