[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp Texinfo/Parser.pm t/80include.t t/re...
From: |
Patrice Dumas |
Subject: |
texinfo/tp Texinfo/Parser.pm t/80include.t t/re... |
Date: |
Thu, 12 Apr 2012 17:30:14 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 12/04/12 17:30:14
Modified files:
tp/Texinfo : Parser.pm
tp/t : 80include.t
Added files:
tp/t/results/include: simple_no_eol.pl
Log message:
Test and handle more simply @include not followed by an end of line.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.370&r2=1.371
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/80include.t?cvsroot=texinfo&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/include/simple_no_eol.pl?cvsroot=texinfo&rev=1.1
Patches:
Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.370
retrieving revision 1.371
diff -u -b -r1.370 -r1.371
--- Texinfo/Parser.pm 11 Apr 2012 23:19:58 -0000 1.370
+++ Texinfo/Parser.pm 12 Apr 2012 17:30:12 -0000 1.371
@@ -3497,7 +3497,6 @@
'parent' => $current };
}
-
while (1) {
# in a raw or ignored conditional block command
if ($current->{'cmdname'} and
@@ -3641,19 +3640,17 @@
# this mostly happens in the following cases:
# after expansion of user defined macro that doesn't end with EOL
# after a protection of @\n in @def* line
+ # at the end of an expanded Texinfo fragment
while ($line eq '') {
- print STDERR "END OF TEXT not at end of line\n"
+ print STDERR "EMPTY TEXT\n"
if ($self->{'DEBUG'});
($line, $line_nr) = _next_text($self, $line_nr, $current);
if (!defined($line)) {
- # end of the file. It may happen that there is an included file
- # not followed by EOL, so @{$self->{'input'}} has to be checked.
- # FIXME is there a corresponding test case?
+ # end of the file or of a text fragment.
$current = _end_line ($self, $current, $line_nr);
- if (scalar(@{$self->{'input'}}) == 0) {
- $current = _close_commands($self, $current, $line_nr);
- return $root;
- }
+ # It may happen that there is an @include file on the line, it
+ # will be picked up at NEXT_LINE
+ next NEXT_LINE;
}
}
Index: t/80include.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/80include.t,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- t/80include.t 11 Feb 2012 22:35:52 -0000 1.12
+++ t/80include.t 12 Apr 2012 17:30:14 -0000 1.13
@@ -6,6 +6,9 @@
[ 'simple',
'@include inc_file.texi
'],
+['simple_no_eol',
+'@include inc_file.texi'
+],
['macro_definition_in_include',
'@include macro_included.texi
Index: t/results/include/simple_no_eol.pl
===================================================================
RCS file: t/results/include/simple_no_eol.pl
diff -N t/results/include/simple_no_eol.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ t/results/include/simple_no_eol.pl 12 Apr 2012 17:30:14 -0000 1.1
@@ -0,0 +1,37 @@
+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{'simple_no_eol'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'In included file.
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'paragraph'
+ }
+ ],
+ 'type' => 'text_root'
+};
+$result_trees{'simple_no_eol'}{'contents'}[0]{'contents'}[0]{'parent'} =
$result_trees{'simple_no_eol'}{'contents'}[0];
+$result_trees{'simple_no_eol'}{'contents'}[0]{'parent'} =
$result_trees{'simple_no_eol'};
+
+$result_texis{'simple_no_eol'} = 'In included file.
+';
+
+
+$result_texts{'simple_no_eol'} = 'In included file.
+';
+
+$result_errors{'simple_no_eol'} = [];
+
+
+1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/tp Texinfo/Parser.pm t/80include.t t/re...,
Patrice Dumas <=