[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/Pod-Simple-Texinfo lib/Pod/Simple/Texin...
From: |
Patrice Dumas |
Subject: |
texinfo/Pod-Simple-Texinfo lib/Pod/Simple/Texin... |
Date: |
Thu, 09 Feb 2012 21:55:05 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 12/02/09 21:55:05
Modified files:
Pod-Simple-Texinfo/lib/Pod/Simple: Texinfo.pm
Pod-Simple-Texinfo/t: Pod-Simple-Texinfo.t
Log message:
Use @format for Verbatim text to be able to protect cpp lines.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm?cvsroot=texinfo&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/texinfo/Pod-Simple-Texinfo/t/Pod-Simple-Texinfo.t?cvsroot=texinfo&r1=1.7&r2=1.8
Patches:
Index: lib/Pod/Simple/Texinfo.pm
===================================================================
RCS file:
/sources/texinfo/texinfo/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- lib/Pod/Simple/Texinfo.pm 9 Feb 2012 00:05:53 -0000 1.11
+++ lib/Pod/Simple/Texinfo.pm 9 Feb 2012 21:55:05 -0000 1.12
@@ -383,7 +383,8 @@
);
my %environment_commands = (
- 'Verbatim' => 'verbatim',
+# 'Verbatim' => 'verbatim',
+ 'Verbatim' => 'format',
'over-text' => 'table @asis',
'over-bullet' => 'itemize',
'over-number' => 'enumerate',
@@ -540,12 +541,17 @@
}
} elsif ($type eq 'text') {
my $text;
- if (!(@format_stack) or ref($format_stack[-1])
- or ($format_stack[-1] ne 'verbatim'
- and
!$self->{'texinfo_raw_format_commands'}->{$format_stack[-1]})) {
- $text = _protect_text($token->text());
- } else {
+ if (@format_stack and ref($format_stack[-1])
+ and
defined($self->{'texinfo_raw_format_commands'}->{$format_stack[-1]})
+ and !$self->{'texinfo_raw_format_commands'}->{$format_stack[-1]}) {
$text = $token->text();
+ } else {
+ $text = _protect_text($token->text());
+ if (@format_stack and !ref($format_stack[-1])
+ and ($format_stack[-1] eq 'verbatim'
+ or
$self->{'texinfo_raw_format_commands'}->{$format_stack[-1]})) {
+ $text =~ s/^(\s*)#(\s*(line)? (\d+)(
"([^"]+)")?(\s+\d+)*\s*)$/address@hidden/mg;
+ }
}
_output($fh, address@hidden, $text);
} elsif ($type eq 'end') {
Index: t/Pod-Simple-Texinfo.t
===================================================================
RCS file: /sources/texinfo/texinfo/Pod-Simple-Texinfo/t/Pod-Simple-Texinfo.t,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- t/Pod-Simple-Texinfo.t 9 Feb 2012 00:05:54 -0000 1.7
+++ t/Pod-Simple-Texinfo.t 9 Feb 2012 21:55:05 -0000 1.8
@@ -6,7 +6,7 @@
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More;
-BEGIN { plan tests => 13 };
+BEGIN { plan tests => 15 };
use Pod::Simple::Texinfo;
ok(1); # If we made it this far, we're ok.
@@ -207,7 +207,64 @@
@hashchar{} line 4 "bbb"
@hashchar{} 7 "aaaa"
-', 'hash character');
+', 'cpp lines');
+
+run_test('=head1 head
+
+ # line 4 "ggggg"
+ and @
+ # line 5 "fff"
+
+Text
+
+ # line 4 "bbb"
+ # 7 "aaaa"
+', '@chapter head
address@hidden
+
address@hidden
+ @hashchar{} line 4 "ggggg"
+ and @@
+ @hashchar{} line 5 "fff"
address@hidden format
+
+Text
+
address@hidden
+ @hashchar{} line 4 "bbb"
+ @hashchar{} 7 "aaaa"
address@hidden format
+
+', 'cpp lines in verbatim');
+
+run_test('=head1 head
+
+=for html
+ # line 4 "ggggg"
+ <html> @
+
+=begin html
+
+ # line 8 "kkk"
+ and @
+ # line 5 "fff"
+
+=end html
+', '@chapter head
address@hidden
+
address@hidden
+
+ @hashchar{} line 4 "ggggg"
+ <html> @@
address@hidden html
address@hidden
+ @hashchar{} line 8 "kkk"
+ and @@
+ @hashchar{} line 5 "fff"
+
address@hidden html
+','cpp lines in formats');
1;
- texinfo/Pod-Simple-Texinfo lib/Pod/Simple/Texin...,
Patrice Dumas <=