]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Support the new perl operator '//'.
authorBruno Haible <bruno@clisp.org>
Sat, 6 Jun 2009 13:23:52 +0000 (13:23 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:16:07 +0000 (12:16 +0200)
gettext-tools/src/ChangeLog
gettext-tools/src/x-perl.c

index 22b8b4a0ef9083ad1f1f0625ac1046bb6a6603a6..e917ce6043a672f8281aca614863857395885167 100644 (file)
@@ -1,3 +1,8 @@
+2009-06-06  Bruno Haible  <bruno@clisp.org>
+
+       * x-perl.c (x_perl_prelex): Recognize the perl 5.10 operator '//'.
+       Reported by Kevin Ryde <user42@zip.com.au>.
+
 2009-05-29  Bruno Haible  <bruno@clisp.org>
 
        Improve msgfmt error message about format directive mismatches
index 3f6e5498f17b41242ba68bb5d53d949b0d5b9bf5..221108dc999525adde15a526a6393caaa371a0d3 100644 (file)
@@ -44,7 +44,9 @@
 /* The Perl syntax is defined in perlsyn.pod.  Try the command
    "man perlsyn" or "perldoc perlsyn".
    Also, the syntax after the 'sub' keyword is specified in perlsub.pod.
-   Try the command "man perlsub" or "perldoc perlsub".  */
+   Try the command "man perlsub" or "perldoc perlsub".
+   Perl 5.10 has new operators '//' and '//=', see
+   <http://perldoc.perl.org/perldelta.html#Defined-or-operator>.  */
 
 #define DEBUG_PERL 0
 
@@ -2524,12 +2526,20 @@ x_perl_prelex (message_list_ty *mlp, token_ty *tp)
              phase1_ungetc (c);
              return;
            }
+         /* Recognize operator '//'.  */
+         if (c == '/')
+           {
+             c = phase1_getc ();
+             if (c != '/')
+               phase1_ungetc (c);
+           }
          /* FALLTHROUGH */
 
        default:
          /* We could carefully recognize each of the 2 and 3 character
-            operators, but it is not necessary, as we only need to recognize
-            gettext invocations.  Don't bother.  */
+            operators, but it is not necessary, except for the '//' operator,
+            as we only need to recognize gettext invocations.  Don't
+            bother.  */
          tp->type = token_type_other;
          prefer_division_over_regexp = false;
          return;