[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[5295] * tp/Texinfo/Parser.pm(_next_text): add a end of line at
From: |
Patrice Dumas |
Subject: |
[5295] * tp/Texinfo/Parser.pm(_next_text): add a end of line at the end of |
Date: |
Sat, 10 Aug 2013 15:33:49 +0000 |
Revision: 5295
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5295
Author: pertusus
Date: 2013-08-10 15:33:48 +0000 (Sat, 10 Aug 2013)
Log Message:
-----------
* tp/Texinfo/Parser.pm(_next_text): add a end of line at the end of
files when there is one missing. Found out in
https://bugzilla.redhat.com/show_bug.cgi?id=950644
* tp/Makefile.am: reorder alphabetically test input files.
Distribute missing test files.
Modified Paths:
--------------
trunk/ChangeLog
trunk/tp/MANIFEST
trunk/tp/Makefile.am
trunk/tp/Texinfo/Parser.pm
trunk/tp/t/80include.t
Added Paths:
-----------
trunk/tp/t/include/include_noeol.texi
trunk/tp/t/results/include/no_eol_in_included_file.pl
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2013-08-10 15:30:19 UTC (rev 5294)
+++ trunk/ChangeLog 2013-08-10 15:33:48 UTC (rev 5295)
@@ -7,6 +7,11 @@
with a =back, as reported by newer Pod::Simple. Report by Karl.
Mark as TODO the test that changes depending on Pod::Simple version.
Report by Karl.
+ * tp/Texinfo/Parser.pm(_next_text): add a end of line at the end of
+ files when there is one missing. Found out in
+ https://bugzilla.redhat.com/show_bug.cgi?id=950644
+ * tp/Makefile.am: reorder alphabetically test input files.
+ Distribute missing test files.
2013-08-09 Patrice Dumas <address@hidden>
Modified: trunk/tp/MANIFEST
===================================================================
--- trunk/tp/MANIFEST 2013-08-10 15:30:19 UTC (rev 5294)
+++ trunk/tp/MANIFEST 2013-08-10 15:33:48 UTC (rev 5295)
@@ -188,6 +188,7 @@
t/include/image.txt
t/include/image_encoded.txt
t/include/address@hidden
+t/include/include_noeol.texi
t/include/included_file_with_setfilename.texi
t/include/this_is_a_long_unknown_file.png
t/include/verbatim_encoded.texi
@@ -221,6 +222,7 @@
t/init/t2h_singular.init
t/init/test_directions.init
t/init/test_renamed_nodes.init
+t/input_files/all_spaces.texi
t/input_files/char_latin1_latin1_in_refs.texi
t/input_files/char_latin1_utf8_in_refs.texi
t/input_files/char_latin2_latin2_in_refs.texi
@@ -236,6 +238,7 @@
t/input_files/empty_lines_at_beginning_no_setfilename_no_element.texi
t/input_files/japanese_shift_jis.texi
t/input_files/japanese_utf8.texi
+t/input_files/non_break_spaces.texi
t/input_files/sample_utf8.texi
t/input_files/things_before_setfilename.texi
t/input_files/things_before_setfilename_no_element.texi
@@ -631,6 +634,7 @@
t/results/include/macro_and_commands_in_early_commands.pl
t/results/include/macro_definition_in_include.pl
t/results/include/macro_in_early_commands.pl
+t/results/include/no_eol_in_included_file.pl
t/results/include/simple.pl
t/results/include/simple_no_eol.pl
t/results/include/test_include_directories.pl
@@ -1015,6 +1019,8 @@
t/results/plaintext_tests/accent_command_punctuation.pl
t/results/plaintext_tests/accents_in_var_enable_encoding.pl
t/results/plaintext_tests/after_punctuation_character_in_command.pl
+t/results/plaintext_tests/all_spaces.pl
+t/results/plaintext_tests/all_spaces/res_plaintext/all_spaces.txt
t/results/plaintext_tests/anchor_and_empty_lines.pl
t/results/plaintext_tests/at_commands_glued_in_example.pl
t/results/plaintext_tests/at_commands_glued_in_paragraph.pl
@@ -1052,6 +1058,8 @@
t/results/plaintext_tests/no_empty_line_after_section.pl
t/results/plaintext_tests/no_punctuation_commands.pl
t/results/plaintext_tests/no_punctuation_commands_frenchspacing.pl
+t/results/plaintext_tests/non_break_spaces.pl
+t/results/plaintext_tests/non_break_spaces/res_plaintext/non_break_spaces.txt
t/results/plaintext_tests/paragraphindent.pl
t/results/plaintext_tests/protect_spaces_on_line.pl
t/results/plaintext_tests/protected_space_end_line.pl
Modified: trunk/tp/Makefile.am
===================================================================
--- trunk/tp/Makefile.am 2013-08-10 15:30:19 UTC (rev 5294)
+++ trunk/tp/Makefile.am 2013-08-10 15:33:48 UTC (rev 5295)
@@ -112,6 +112,7 @@
t/include/fextext \
t/include/file_with_cpp_lines.texi \
t/include/file_with_xml_chars.texi \
+ t/include/include_noeol.texi \
t/include/image.txt \
t/include/image_encoded.txt \
t/include/address@hidden \
@@ -133,24 +134,26 @@
t/init/l2h.init \
t/manual_tree.pl \
t/test_utils.pl \
- t/input_files/delcomment.texi \
+ t/input_files/all_spaces.texi \
t/input_files/char_latin1_utf8_in_refs.texi \
t/input_files/char_latin1_latin1_in_refs.texi \
t/input_files/char_latin2_latin2_in_refs.texi \
- t/input_files/sample_utf8.texi \
- t/input_files/japanese_utf8.texi \
- t/input_files/japanese_shift_jis.texi \
t/input_files/chinese_mixed_with_en.texi \
- t/input_files/things_before_setfilename_no_element.texi \
- t/input_files/empty_lines_at_beginning_no_setfilename.texi \
- t/input_files/empty_lines_at_beginning_no_setfilename_no_element.texi \
- t/input_files/things_before_setfilename.texi \
t/input_files/contents_at_document_begin.texi \
t/input_files/contents_at_end_document_after_node.texi \
t/input_files/contents_at_end_document.texi \
t/input_files/contents_in_document.texi \
t/input_files/contents_no_section.texi \
t/input_files/cpp_lines.texi \
+ t/input_files/delcomment.texi \
+ t/input_files/empty_lines_at_beginning_no_setfilename.texi \
+ t/input_files/empty_lines_at_beginning_no_setfilename_no_element.texi \
+ t/input_files/japanese_utf8.texi \
+ t/input_files/japanese_shift_jis.texi \
+ t/input_files/non_break_spaces.texi \
+ t/input_files/sample_utf8.texi \
+ t/input_files/things_before_setfilename_no_element.texi \
+ t/input_files/things_before_setfilename.texi \
#
document_domain = $(PACKAGE)_document
Modified: trunk/tp/Texinfo/Parser.pm
===================================================================
--- trunk/tp/Texinfo/Parser.pm 2013-08-10 15:30:19 UTC (rev 5294)
+++ trunk/tp/Texinfo/Parser.pm 2013-08-10 15:33:48 UTC (rev 5295)
@@ -1910,6 +1910,10 @@
my $fh = $input->{'fh'};
my $line = <$fh>;
while (defined($line)) {
+ # add an end of line if there is none at the end of file
+ if (eof($fh) and $line !~ /\n/) {
+ $line .= "\n";
+ }
$line =~ s/\x{7F}.*\s*//;
if ($self->{'CPP_LINE_DIRECTIVES'}
# no cpp directives in ignored/macro/verbatim
Modified: trunk/tp/t/80include.t
===================================================================
--- trunk/tp/t/80include.t 2013-08-10 15:30:19 UTC (rev 5294)
+++ trunk/tp/t/80include.t 2013-08-10 15:33:48 UTC (rev 5295)
@@ -12,6 +12,11 @@
['simple_no_eol',
'@include inc_file.texi'
],
+['no_eol_in_included_file',
+'Some thing.
address@hidden include_noeol.texi
+Following
+'],
['macro_definition_in_include',
'@include macro_included.texi
Added: trunk/tp/t/include/include_noeol.texi
===================================================================
--- trunk/tp/t/include/include_noeol.texi (rev 0)
+++ trunk/tp/t/include/include_noeol.texi 2013-08-10 15:33:48 UTC (rev
5295)
@@ -0,0 +1 @@
+AA
\ No newline at end of file
Added: trunk/tp/t/results/include/no_eol_in_included_file.pl
===================================================================
--- trunk/tp/t/results/include/no_eol_in_included_file.pl
(rev 0)
+++ trunk/tp/t/results/include/no_eol_in_included_file.pl 2013-08-10
15:33:48 UTC (rev 5295)
@@ -0,0 +1,53 @@
+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{'no_eol_in_included_file'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'Some thing.
+'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'AA
+'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'Following
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'paragraph'
+ }
+ ],
+ 'type' => 'text_root'
+};
+$result_trees{'no_eol_in_included_file'}{'contents'}[0]{'contents'}[0]{'parent'}
= $result_trees{'no_eol_in_included_file'}{'contents'}[0];
+$result_trees{'no_eol_in_included_file'}{'contents'}[0]{'contents'}[1]{'parent'}
= $result_trees{'no_eol_in_included_file'}{'contents'}[0];
+$result_trees{'no_eol_in_included_file'}{'contents'}[0]{'contents'}[2]{'parent'}
= $result_trees{'no_eol_in_included_file'}{'contents'}[0];
+$result_trees{'no_eol_in_included_file'}{'contents'}[0]{'parent'} =
$result_trees{'no_eol_in_included_file'};
+
+$result_texis{'no_eol_in_included_file'} = 'Some thing.
+AA
+Following
+';
+
+
+$result_texts{'no_eol_in_included_file'} = 'Some thing.
+AA
+Following
+';
+
+$result_errors{'no_eol_in_included_file'} = [];
+
+
+1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [5295] * tp/Texinfo/Parser.pm(_next_text): add a end of line at the end of,
Patrice Dumas <=