[Po4a-commits] po4a/lib/Locale/Po4a TeX.pm,1.34,1.35
Nicolas FRAN??OIS
po4a-devel@lists.alioth.debian.org
Fri, 25 Feb 2005 20:01:45 +0000
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv27264/lib/Locale/Po4a
Modified Files:
TeX.pm
Log Message:
Do not count { and } in comments.
Index: TeX.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/TeX.pm,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- TeX.pm 25 Feb 2005 19:35:17 -0000 1.34
+++ TeX.pm 25 Feb 2005 20:01:39 -0000 1.35
@@ -883,11 +883,16 @@
my $tmp = $paragraph;
my $closing = 0;
my $opening = 0;
+ # FIXME: { and } should not be counted in verbatim blocks
+ # Remove comments
+ $tmp =~ s/(?<!\\)(?:\\\\)*%.*//mg;
while ($tmp =~ /^.*?(?<!\\)(?:\\\\)*\{(.*)$/s) {
$opening += 1;
$tmp = $1;
}
$tmp = $paragraph;
+ # Remove comments
+ $tmp =~ s/(?<!\\)(?:\\\\)*%.*//mg;
while ($tmp =~ /^.*?(?<!\\)(?:\\\\)*\}(.*)$/s) {
$closing += 1;
$tmp = $1;