Skip Menu |

This queue is for tickets about the LaTeX-Decode CPAN distribution.

Report information
The Basics
Id: 110678
Status: open
Priority: 0/
Queue: LaTeX-Decode

People
Owner: Nobody in particular
Requestors: ntyni [...] iki.fi
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.04
Fixed in: (no value)



Subject: Unescaped left brace in regex is deprecated
This module warns when used with Perl 5.22. % perl -w -e 'use LaTeX::Decode' Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\\dings{ <-- HERE ([2-9AF][0-9A-F])}/ at /usr/share/perl5/LaTeX/Decode.pm line 133. Proposed patch attached.
Subject: 0001-Fix-regexp-syntax-for-Perl-5.22.patch
From 03561b7d0364c17896ee2cc6de22734e70788093 Mon Sep 17 00:00:00 2001 From: Niko Tyni <ntyni@debian.org> Date: Sun, 27 Dec 2015 22:23:19 +0200 Subject: [PATCH] Fix regexp syntax for Perl 5.22 Unescaped left brace in regex is deprecated, passed through in regex Bug-Debian: https://bugs.debian.org/809098 --- lib/LaTeX/Decode.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/LaTeX/Decode.pm b/lib/LaTeX/Decode.pm index 7741405..92fef90 100644 --- a/lib/LaTeX/Decode.pm +++ b/lib/LaTeX/Decode.pm @@ -130,7 +130,7 @@ sub latex_decode { $text =~ s/\\not\\($NEG_SYMB_RE)/$NEGATEDSYMBOLS{$1}/ge; $text =~ s/\\textsuperscript{($SUPER_RE)}/$SUPERSCRIPTS{$1}/ge; $text =~ s/\\textsuperscript{\\($SUPERCMD_RE)}/$CMDSUPERSCRIPTS{$1}/ge; - $text =~ s/\\dings{([2-9AF][0-9A-F])}/$DINGS{$1}/ge; + $text =~ s/\\dings\{([2-9AF][0-9A-F])}/$DINGS{$1}/ge; } $text =~ s/(\\[a-zA-Z]+)\\(\s+)/$1\{\}$2/g; # \foo\ bar -> \foo{} bar -- 2.6.4
On Sun Dec 27 15:26:26 2015, ntyni@iki.fi wrote: Show quoted text
> This module warns when used with Perl 5.22. > > % perl -w -e 'use LaTeX::Decode' > Unescaped left brace in regex is deprecated, passed through in regex; > marked by <-- HERE in m/\\dings{ <-- HERE ([2-9AF][0-9A-F])}/ at > /usr/share/perl5/LaTeX/Decode.pm line 133. > > Proposed patch attached.
Dear François, Any chance you can apply this patch? I would like to propose some other enhancements, but looking to this issue hanging here for six months I am not sure you have still interest in this module. Please let me know if you need help maintaining it. If you could put up a GIT repo or the like, and give me commaintainership for it, I would be very glad to help. Thanks, ambs
On 2015-12-27 15:26:26, ntyni@iki.fi wrote: Show quoted text
> This module warns when used with Perl 5.22. > > % perl -w -e 'use LaTeX::Decode' > Unescaped left brace in regex is deprecated, passed through in regex; > marked by <-- HERE in m/\\dings{ <-- HERE ([2-9AF][0-9A-F])}/ at > /usr/share/perl5/LaTeX/Decode.pm line 133. > > Proposed patch attached.
Starting with perl 5.25.1, this is a fatal error. See also http://matrix.cpantesters.org/?dist=LaTeX-Decode%200.04 for an overview of test reports.
On Fri Aug 26 01:32:33 2016, SREZIC wrote: Show quoted text
> On 2015-12-27 15:26:26, ntyni@iki.fi wrote:
> > This module warns when used with Perl 5.22. > > > > % perl -w -e 'use LaTeX::Decode' > > Unescaped left brace in regex is deprecated, passed through in regex; > > marked by <-- HERE in m/\\dings{ <-- HERE ([2-9AF][0-9A-F])}/ at > > /usr/share/perl5/LaTeX/Decode.pm line 133. > > > > Proposed patch attached.
> > Starting with perl 5.25.1, this is a fatal error. See also > http://matrix.cpantesters.org/?dist=LaTeX-Decode%200.04 for an > overview of test reports.
A patch along the lines of the attached should fix the problem. Thank you very much. Jim Keenan
Subject: LaTeX-Decode-unescaped-left-regex.diff
diff -u -r lib/LaTeX/Decode.pm blib/lib/LaTeX/Decode.pm --- lib/LaTeX/Decode.pm 2016-12-20 10:04:56.139716732 -0500 +++ blib/lib/LaTeX/Decode.pm 2016-12-20 10:06:01.182852065 -0500 @@ -130,12 +130,12 @@ $text =~ s/\\not\\($NEG_SYMB_RE)/$NEGATEDSYMBOLS{$1}/ge; $text =~ s/\\textsuperscript{($SUPER_RE)}/$SUPERSCRIPTS{$1}/ge; $text =~ s/\\textsuperscript{\\($SUPERCMD_RE)}/$CMDSUPERSCRIPTS{$1}/ge; - $text =~ s/\\dings{([2-9AF][0-9A-F])}/$DINGS{$1}/ge; + $text =~ s/\\dings\{([2-9AF][0-9A-F])}/$DINGS{$1}/ge; } $text =~ s/(\\[a-zA-Z]+)\\(\s+)/$1\{\}$2/g; # \foo\ bar -> \foo{} bar $text =~ s/([^{]\\\w)([;,.:%])/$1\{\}$2/g; #} Aaaa\o, -> Aaaa\o{}, - $text =~ s/(\\(?:$DIAC_RE_BASE|$ACCENTS_RE)){\\i}/$1\{i\}/g; + $text =~ s/(\\(?:$DIAC_RE_BASE|$ACCENTS_RE))\{\\i}/$1\{i\}/g; # special cases such as '\={\i}' -> '\={i}' -> "i\x{304}" ## remove {} around macros that print one character
Subject: [rt.cpan.org #110678]
Date: Mon, 24 Apr 2017 18:11:34 +0200
To: bug-LaTeX-Decode [...] rt.cpan.org
From: Elias Pipping <pipping.elias [...] icloud.com>
Hi, I'm also seeing the warning with perl 5.24.1. To me, it seems the patch falls a little short of its purpose, though. For one, it seems to me you've only tested with the default, 'base' scheme. If you instead set $LaTeX::Decode::DefaultScheme = 'full'; you'll see quite a few additional warnings: Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\\dings{ <-- HERE ([2-9AF][0-9A-F])}/ at .../LaTeX/Decode.pm line 133. Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\\textsuperscript{ <-- HERE ((?^:5|h|w|n|9|=|\)|\-|j|4|\(|6|SM|8|i|0|y|\+|7|r))}/ at .../LaTeX/Decode.pm line 131. Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\\textsuperscript{ <-- HERE \\((?^:textinvscr|texthth|textturnr|textturnrrtail))}/ at .../LaTeX/Decode.pm line 132. Moreover: wouldn't it make the resulting regex a bit easier to read (because of the symmetry) if one also escaped the closing curly brace? I'd thus like to propose the following patch: (please find it attached). Elias

Message body is not shown because sender requested not to inline it.