[Po4a-commits] po4a/lib/Locale/Po4a Man.pm,1.63,1.64

Nicolas FRAN??OIS po4a-devel@lists.alioth.debian.org
Sat, 13 Nov 2004 17:11:43 +0000


Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv21166/lib/Locale/Po4a

Modified Files:
	Man.pm 
Log Message:
Better support for some groff's escapes (\\, \.).


Index: Man.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Man.pm,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- Man.pm	12 Nov 2004 18:04:18 -0000	1.63
+++ Man.pm	13 Nov 2004 17:11:41 -0000	1.64
@@ -276,6 +276,19 @@
         return ($line,$ref);
     }
 
+    # Handle some escapes
+    #   * reduce the number of \ in macros
+    if ($line =~ /^\\?[.']/) {
+        # The first backslash is consumed while the macro is read.
+        $line =~ s/\\\\/\\/g;
+    }
+    #   * \\ is equivalent to \e, which is less error prone for the rest
+    #     of the module (e.g. when searching for a font : \f, whe don't
+    #     want to match \\f)
+    $line =~ s/\\\\/\\e/g;
+    #   * \. is just a dot (this can even be use to introduce a macro)
+    $line =~ s/\\\././g;
+
     chomp $line;
     while ($line =~ /^\..*\\$/ || $line =~ /^(\.[BI])\s*$/) {
         my ($l2,$r2)=$self->SUPER::shiftline();