[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp TODO Texinfo/Parser.pm Texinfo/Conve...
From: |
Patrice Dumas |
Subject: |
texinfo/tp TODO Texinfo/Parser.pm Texinfo/Conve... |
Date: |
Fri, 15 Jun 2012 00:37:22 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 12/06/15 00:37:22
Modified files:
tp : TODO
tp/Texinfo : Parser.pm
tp/Texinfo/Convert: HTML.pm Plaintext.pm
tp/t : 20preformatted.t
Added files:
tp/t/results/preformatted: insertcopying_in_example.pl
page_in_example.pl
Log message:
Correctly restart preformatted after a skipline/noarg/special/... misc
command.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.278&r2=1.279
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.377&r2=1.378
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/HTML.pm?cvsroot=texinfo&r1=1.235&r2=1.236
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.211&r2=1.212
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/20preformatted.t?cvsroot=texinfo&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/preformatted/insertcopying_in_example.pl?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/preformatted/page_in_example.pl?cvsroot=texinfo&rev=1.1
Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.278
retrieving revision 1.279
diff -u -b -r1.278 -r1.279
--- TODO 13 Apr 2012 20:26:56 -0000 1.278
+++ TODO 15 Jun 2012 00:37:21 -0000 1.279
@@ -15,6 +15,8 @@
Delayed bugs
============
+Text after @bye should be kept as is when redoing Texinfo.
+
@-commands in index entries are transliterated when sorting, they should
certainly be converted to unicode instead.
Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.377
retrieving revision 1.378
diff -u -b -r1.377 -r1.378
--- Texinfo/Parser.pm 26 Apr 2012 17:36:25 -0000 1.377
+++ Texinfo/Parser.pm 15 Jun 2012 00:37:21 -0000 1.378
@@ -2944,6 +2944,7 @@
and
$current->{'contents'}->[-1]->{'extra'}->{'command'}->{'cmdname'} eq
'verbatim') {
$current = $self->_begin_preformatted($current);
# misc command line arguments
+ # Never go here if skipline/noarg/...
} elsif ($current->{'type'}
and $current->{'type'} eq 'misc_line_arg') {
my $context = pop @{$self->{'context_stack'}};
@@ -4133,6 +4134,9 @@
$misc->{'extra'}->{'invalid_nesting'} = 1 if ($only_in_headings);
$self->_register_global_command($command, $misc, $line_nr);
+ $current = $self->_begin_preformatted($current)
+ if ($close_preformatted_commands{$command});
+
# all the cases using the raw line
} elsif ($arg_spec eq 'skipline' or $arg_spec eq 'lineraw'
or $arg_spec eq 'special') {
@@ -4170,6 +4174,9 @@
$current = _end_line ($self, $current, $line_nr);
last NEXT_LINE if ($command eq 'bye');
+ # This is not done in _end_line is there is no misc_line_arg
+ $current = $self->_begin_preformatted($current)
+ if ($close_preformatted_commands{$command});
last;
} else {
# $arg_spec is text, line, skipspace or a number
Index: Texinfo/Convert/HTML.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/HTML.pm,v
retrieving revision 1.235
retrieving revision 1.236
diff -u -b -r1.235 -r1.236
--- Texinfo/Convert/HTML.pm 26 May 2012 09:47:38 -0000 1.235
+++ Texinfo/Convert/HTML.pm 15 Jun 2012 00:37:21 -0000 1.236
@@ -4634,7 +4634,6 @@
and $self->get_conf('SPLIT') ne 'node') {
$self->force_conf('SPLIT', 'node');
}
- #$self->_translate_names();
return $self;
}
@@ -6790,6 +6789,12 @@
return undef if (!$status);
}
+ # FIXME here call _unset_global_multiple_commands? Problem is
+ # that some conversion, for instance for page header requires
+ # that the correct language is set, for instance. The @-command
+ # will necessarily appear later on -- even if it appears a the
+ # beginning of the file.
+ #
# Now do the output
my $fh;
my $output = '';
Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.211
retrieving revision 1.212
diff -u -b -r1.211 -r1.212
--- Texinfo/Convert/Plaintext.pm 27 May 2012 11:31:36 -0000 1.211
+++ Texinfo/Convert/Plaintext.pm 15 Jun 2012 00:37:21 -0000 1.212
@@ -1331,7 +1331,7 @@
return $root->{'text'};
# ignore text outside of any format, but warn if ignored text not empty
} elsif ($root->{'text'} =~ /\S/) {
- warn "BUG: ignored text not empty `$root->{'text'}'\n";
+ $self->_bug_message("ignored text not empty `$root->{'text'}'", $root);
return '';
}
}
Index: t/20preformatted.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/20preformatted.t,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- t/20preformatted.t 11 Jan 2012 22:45:42 -0000 1.13
+++ t/20preformatted.t 15 Jun 2012 00:37:21 -0000 1.14
@@ -145,6 +145,18 @@
@end example
Para.
'],
+['page_in_example',
+'@example
address@hidden
+text
address@hidden example
+'],
+['insertcopying_in_example',
+'@example
address@hidden
+text
address@hidden example
+'],
);
my @test_invalid = (
Index: t/results/preformatted/insertcopying_in_example.pl
===================================================================
RCS file: t/results/preformatted/insertcopying_in_example.pl
diff -N t/results/preformatted/insertcopying_in_example.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/results/preformatted/insertcopying_in_example.pl 15 Jun 2012 00:37:22
-0000 1.1
@@ -0,0 +1,155 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors
+ %result_elements %result_directions_text);
+
+use utf8;
+
+$result_trees{'insertcopying_in_example'} = {
+ 'contents' => [
+ {
+ 'cmdname' => 'example',
+ 'contents' => [
+ {
+ 'extra' => {
+ 'command' => {}
+ },
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line_after_command'
+ },
+ {
+ 'cmdname' => 'insertcopying',
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 2,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => '
+'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'text
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'preformatted'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'command' => {}
+ },
+ 'parent' => {},
+ 'text' => ' ',
+ 'type' => 'empty_spaces_after_command'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'example'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'spaces_at_end'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'misc_line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'command' => {},
+ 'command_argument' => 'example',
+ 'text_arg' => 'example'
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 4,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ }
+ ],
+ 'extra' => {
+ 'end_command' => {}
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ }
+ ],
+ 'type' => 'text_root'
+};
+$result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[0]{'extra'}{'command'}
= $result_trees{'insertcopying_in_example'}{'contents'}[0];
+$result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[0]{'parent'}
= $result_trees{'insertcopying_in_example'}{'contents'}[0];
+$result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[1]{'parent'}
= $result_trees{'insertcopying_in_example'}{'contents'}[0];
+$result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[2]{'contents'}[0]{'parent'}
= $result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[2];
+$result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[2]{'contents'}[1]{'parent'}
= $result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[2];
+$result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[2]{'parent'}
= $result_trees{'insertcopying_in_example'}{'contents'}[0];
+$result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[3]{'args'}[0]{'contents'}[0]{'extra'}{'command'}
= $result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[3];
+$result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[3]{'args'}[0]{'contents'}[0]{'parent'}
=
$result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[3]{'args'}[0];
+$result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[3]{'args'}[0]{'contents'}[1]{'parent'}
=
$result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[3]{'args'}[0];
+$result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[3]{'args'}[0]{'contents'}[2]{'parent'}
=
$result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[3]{'args'}[0];
+$result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[3]{'args'}[0]{'parent'}
= $result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[3];
+$result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[3]{'extra'}{'command'}
= $result_trees{'insertcopying_in_example'}{'contents'}[0];
+$result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[3]{'parent'}
= $result_trees{'insertcopying_in_example'}{'contents'}[0];
+$result_trees{'insertcopying_in_example'}{'contents'}[0]{'extra'}{'end_command'}
= $result_trees{'insertcopying_in_example'}{'contents'}[0]{'contents'}[3];
+$result_trees{'insertcopying_in_example'}{'contents'}[0]{'parent'} =
$result_trees{'insertcopying_in_example'};
+
+$result_texis{'insertcopying_in_example'} = '@example
address@hidden
+text
address@hidden example
+';
+
+
+$result_texts{'insertcopying_in_example'} = '
+text
+';
+
+$result_errors{'insertcopying_in_example'} = [];
+
+
+
+$result_converted{'plaintext'}->{'insertcopying_in_example'} = '
+ text
+';
+
+
+$result_converted{'html_text'}->{'insertcopying_in_example'} = '<div
class="example">
+<pre class="example">
+text
+</pre></div>
+';
+
+
+$result_converted{'docbook'}->{'insertcopying_in_example'} = '<screen>
+text
+</screen>';
+
+
+$result_converted{'xml'}->{'insertcopying_in_example'} = '<example>
+<insertcopying></insertcopying><pre xml:space="preserve">
+text
+</pre></example>
+';
+
+1;
Index: t/results/preformatted/page_in_example.pl
===================================================================
RCS file: t/results/preformatted/page_in_example.pl
diff -N t/results/preformatted/page_in_example.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/results/preformatted/page_in_example.pl 15 Jun 2012 00:37:22 -0000
1.1
@@ -0,0 +1,140 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors
+ %result_elements %result_directions_text);
+
+use utf8;
+
+$result_trees{'page_in_example'} = {
+ 'contents' => [
+ {
+ 'cmdname' => 'example',
+ 'contents' => [
+ {
+ 'extra' => {
+ 'command' => {}
+ },
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line_after_command'
+ },
+ {
+ 'cmdname' => 'page',
+ 'parent' => {}
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'text
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'preformatted'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'command' => {}
+ },
+ 'parent' => {},
+ 'text' => ' ',
+ 'type' => 'empty_spaces_after_command'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'example'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'spaces_at_end'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'misc_line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'command' => {},
+ 'command_argument' => 'example',
+ 'text_arg' => 'example'
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 4,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ }
+ ],
+ 'extra' => {
+ 'end_command' => {}
+ },
+ 'line_nr' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ }
+ ],
+ 'type' => 'text_root'
+};
+$result_trees{'page_in_example'}{'contents'}[0]{'contents'}[0]{'extra'}{'command'}
= $result_trees{'page_in_example'}{'contents'}[0];
+$result_trees{'page_in_example'}{'contents'}[0]{'contents'}[0]{'parent'} =
$result_trees{'page_in_example'}{'contents'}[0];
+$result_trees{'page_in_example'}{'contents'}[0]{'contents'}[1]{'parent'} =
$result_trees{'page_in_example'}{'contents'}[0];
+$result_trees{'page_in_example'}{'contents'}[0]{'contents'}[2]{'contents'}[0]{'parent'}
= $result_trees{'page_in_example'}{'contents'}[0]{'contents'}[2];
+$result_trees{'page_in_example'}{'contents'}[0]{'contents'}[2]{'parent'} =
$result_trees{'page_in_example'}{'contents'}[0];
+$result_trees{'page_in_example'}{'contents'}[0]{'contents'}[3]{'args'}[0]{'contents'}[0]{'extra'}{'command'}
= $result_trees{'page_in_example'}{'contents'}[0]{'contents'}[3];
+$result_trees{'page_in_example'}{'contents'}[0]{'contents'}[3]{'args'}[0]{'contents'}[0]{'parent'}
= $result_trees{'page_in_example'}{'contents'}[0]{'contents'}[3]{'args'}[0];
+$result_trees{'page_in_example'}{'contents'}[0]{'contents'}[3]{'args'}[0]{'contents'}[1]{'parent'}
= $result_trees{'page_in_example'}{'contents'}[0]{'contents'}[3]{'args'}[0];
+$result_trees{'page_in_example'}{'contents'}[0]{'contents'}[3]{'args'}[0]{'contents'}[2]{'parent'}
= $result_trees{'page_in_example'}{'contents'}[0]{'contents'}[3]{'args'}[0];
+$result_trees{'page_in_example'}{'contents'}[0]{'contents'}[3]{'args'}[0]{'parent'}
= $result_trees{'page_in_example'}{'contents'}[0]{'contents'}[3];
+$result_trees{'page_in_example'}{'contents'}[0]{'contents'}[3]{'extra'}{'command'}
= $result_trees{'page_in_example'}{'contents'}[0];
+$result_trees{'page_in_example'}{'contents'}[0]{'contents'}[3]{'parent'} =
$result_trees{'page_in_example'}{'contents'}[0];
+$result_trees{'page_in_example'}{'contents'}[0]{'extra'}{'end_command'} =
$result_trees{'page_in_example'}{'contents'}[0]{'contents'}[3];
+$result_trees{'page_in_example'}{'contents'}[0]{'parent'} =
$result_trees{'page_in_example'};
+
+$result_texis{'page_in_example'} = '@example
address@hidden
+text
address@hidden example
+';
+
+
+$result_texts{'page_in_example'} = 'text
+';
+
+$result_errors{'page_in_example'} = [];
+
+
+
+$result_converted{'plaintext'}->{'page_in_example'} = ' text
+';
+
+
+$result_converted{'html_text'}->{'page_in_example'} = '<div class="example">
+<pre class="example">text
+</pre></div>
+';
+
+
+$result_converted{'docbook'}->{'page_in_example'} = '<screen>text
+</screen>';
+
+
+$result_converted{'xml'}->{'page_in_example'} = '<example>
+<page></page>
+<pre xml:space="preserve">text
+</pre></example>
+';
+
+1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/tp TODO Texinfo/Parser.pm Texinfo/Conve...,
Patrice Dumas <=