[Po4a-commits] "po4a/lib/Locale/Po4a Texinfo.pm,1.6,1.7"
Nicolas FRANCOIS
nekral-guest at alioth.debian.org
Sun Sep 16 13:53:07 UTC 2007
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory alioth:/tmp/cvs-serv21809/lib/Locale/Po4a
Modified Files:
Texinfo.pm
Log Message:
The header uses the @c comment, it must not be included before the
definition of this @c command. Include the header after the first \input
or before the first @c comment.
Index: Texinfo.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Texinfo.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- Texinfo.pm 9 Sep 2007 14:17:52 -0000 1.6
+++ Texinfo.pm 16 Sep 2007 13:53:05 -0000 1.7
@@ -136,10 +136,24 @@
$break_line{$_} = 1;
}
-# TODO: Header shall be put after any \input
+my $docheader_pushed = 0;
+# The header shall not be written before the Texinfo header (which include
+# the \input command that define the texinfo macros)
sub docheader {
- return "\@c This file was generated with po4a. Translate the source file.\n".
- "\@c\n";
+ return "";
+}
+
+sub push_docheader {
+ return if $docheader_pushed;
+ my $self = shift;
+ $self->pushline(<<END);
+\@c ===========================================================================
+\@c
+\@c This file was generated with po4a. Translate the source file.
+\@c
+\@c ===========================================================================
+END
+ $docheader_pushed = 1;
}
sub parse {
@@ -148,6 +162,7 @@
my $paragraph = ""; # Buffer where we put the paragraph while building
my @env = (); # environment stack
my $t = "";
+ $docheader_pushed = 0;
LINE:
undef $self->{type};
@@ -186,7 +201,9 @@
$paragraph="";
}
$self->pushline($line."\n");
+ $self->push_docheader();
} elsif ($line =~ m/^$RE_COMMENT/) {
+ $self->push_docheader();
$self->pushline($line."\n");
} elsif ( $closed
and ($line =~ /^@([^ ]*?)(?: +(.*))?$/)
More information about the Po4a-commits
mailing list