From: Bruno Haible Date: Sat, 6 Jun 2009 13:23:52 +0000 (+0000) Subject: Support the new perl operator '//'. X-Git-Tag: v0.18~182 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1daaf36e387110fff5082baa1c330b517052eaa6;p=thirdparty%2Fgettext.git Support the new perl operator '//'. --- diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 22b8b4a0e..e917ce604 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,8 @@ +2009-06-06 Bruno Haible + + * x-perl.c (x_perl_prelex): Recognize the perl 5.10 operator '//'. + Reported by Kevin Ryde . + 2009-05-29 Bruno Haible Improve msgfmt error message about format directive mismatches diff --git a/gettext-tools/src/x-perl.c b/gettext-tools/src/x-perl.c index 3f6e5498f..221108dc9 100644 --- a/gettext-tools/src/x-perl.c +++ b/gettext-tools/src/x-perl.c @@ -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 + . */ #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;