[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo util/Makefile.am tp/MANIFEST tp/Makefil...
From: |
Patrice Dumas |
Subject: |
texinfo util/Makefile.am tp/MANIFEST tp/Makefil... |
Date: |
Wed, 18 Jan 2012 22:31:16 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 12/01/18 22:31:16
Modified files:
util : Makefile.am
tp : MANIFEST Makefile.am TODO
tp/Texinfo : Parser.pm
tp/t : 02coverage.t test_utils.pl
tp/tests/encodings: Makefile.am
tp/tests/formatting: Makefile.am tests-parser.txt
Added files:
util : texi_sort_elements_count.pl
tp/t/input_files: delcomment.texi
tp/t/results/coverage: delcomment.pl
Removed files:
tp/tests/formatting: delcomment.texi
tp/tests/formatting/res_parser/delcomment: delcomment.1
delcomment.2
delcomment.html
tp/tests/formatting/res_parser/texi_delcomment: delcomment.2
delcomment.texi
Log message:
Move tp/texi_sort_elements_count.pl to util/.
Ameliorate the tests using a file for the texinfo. Move a test from
tests
to t/ (delcomment.texi).
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/util/Makefile.am?cvsroot=texinfo&r1=1.40&r2=1.41
http://cvs.savannah.gnu.org/viewcvs/texinfo/util/texi_sort_elements_count.pl?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/MANIFEST?cvsroot=texinfo&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Makefile.am?cvsroot=texinfo&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.254&r2=1.255
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.353&r2=1.354
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/02coverage.t?cvsroot=texinfo&r1=1.65&r2=1.66
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/test_utils.pl?cvsroot=texinfo&r1=1.107&r2=1.108
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/input_files/delcomment.texi?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/coverage/delcomment.pl?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/tests/encodings/Makefile.am?cvsroot=texinfo&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/tests/formatting/Makefile.am?cvsroot=texinfo&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/tests/formatting/tests-parser.txt?cvsroot=texinfo&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/tests/formatting/delcomment.texi?cvsroot=texinfo&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/tests/formatting/res_parser/delcomment/delcomment.1?cvsroot=texinfo&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/tests/formatting/res_parser/delcomment/delcomment.2?cvsroot=texinfo&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/tests/formatting/res_parser/delcomment/delcomment.html?cvsroot=texinfo&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/tests/formatting/res_parser/texi_delcomment/delcomment.2?cvsroot=texinfo&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/tests/formatting/res_parser/texi_delcomment/delcomment.texi?cvsroot=texinfo&r1=1.1&r2=0
Patches:
Index: util/Makefile.am
===================================================================
RCS file: /sources/texinfo/texinfo/util/Makefile.am,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -b -r1.40 -r1.41
--- util/Makefile.am 16 Jan 2012 22:21:52 -0000 1.40
+++ util/Makefile.am 18 Jan 2012 22:31:12 -0000 1.41
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.40 2012/01/16 22:21:52 pertusus Exp $
+# $Id: Makefile.am,v 1.41 2012/01/18 22:31:12 pertusus Exp $
# Makefile.am for texinfo/util.
# Run automake in .. to produce Makefile.in from this.
#
@@ -42,7 +42,7 @@
fixref.gawk gdoc gen-dir-node gendocs.sh gendocs_template infosrch \
install-info-html outline.gawk pdftexi2dvi \
prepinfo.awk tex3patch texi-docstring-magic.el texi2dvi texi2pdf txitextest \
- $(dist_pkgdata_DATA) texinfo-cat.in
+ $(dist_pkgdata_DATA) texinfo-cat.in texi_sort_elements_count.pl
# We must not stress people's TeX installations.
Index: tp/MANIFEST
===================================================================
RCS file: /sources/texinfo/texinfo/tp/MANIFEST,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- tp/MANIFEST 15 Jan 2012 20:51:14 -0000 1.17
+++ tp/MANIFEST 18 Jan 2012 22:31:13 -0000 1.18
@@ -115,6 +115,7 @@
t/init/t2h_singular.init
t/init/test_directions.init
t/init/test_renamed_nodes.init
+t/input_files/delcomment.texi
t/languages.t
t/manual_tree.pl
t/nodenormalization.t
@@ -260,6 +261,7 @@
t/results/coverage/comment_on_cartouche_line.pl
t/results/coverage/comment_on_group_line.pl
t/results/coverage/def.pl
+t/results/coverage/delcomment.pl
t/results/coverage/empty_w.pl
t/results/coverage/exdent_and_commands.pl
t/results/coverage/exdent_and_formats.pl
@@ -349,6 +351,7 @@
t/results/html_tests/commands_in_alt.pl
t/results/html_tests/commands_in_email.pl
t/results/html_tests/documentdescription.pl
+t/results/html_tests/html_in_copying.pl
t/results/html_tests/index_and_node_same_name.pl
t/results/html_tests/index_below.pl
t/results/html_tests/raw_html.pl
@@ -593,6 +596,7 @@
t/results/macro/unknown_macro_on_line_command.pl
t/results/macro/zero_argument.pl
t/results/menu/bad_beginning.pl
+t/results/menu/block_commands_in_menu_description.pl
t/results/menu/comment_on_menu_line.pl
t/results/menu/dash_in_menu.pl
t/results/menu/detailmenu_in_description.pl
@@ -601,7 +605,9 @@
t/results/menu/direntry_dircategory_after_first_node.pl
t/results/menu/entry_after_detailmenu.pl
t/results/menu/example_in_menu_comment.pl
+t/results/menu/example_in_menu_description.pl
t/results/menu/formats_in_menu.pl
+t/results/menu/inlineraw_in_menu_description.pl
t/results/menu/menu_entry_name_comment.pl
t/results/menu/menu_entry_name.pl
t/results/menu/menu_entry_node_comments.pl
@@ -623,6 +629,7 @@
t/results/menu/sc_in_menu.pl
t/results/menu/simple_no_menu.pl
t/results/menu/simple.pl
+t/results/menu/verb_in_menu_description.pl
t/results/misc_commands/also_not_line.pl
t/results/misc_commands/author_outside_titlepage_quotation.pl
t/results/misc_commands/bad_documentlanguage.pl
@@ -812,6 +819,7 @@
t/results/sectioning/contents_and_shortcontents.pl
t/results/sectioning/contents_in_html_text.pl
t/results/sectioning/contents.pl
+t/results/sectioning/contents_with_only_top_node.pl
t/results/sectioning/double_node_anchor_float.pl
t/results/sectioning/double_part.pl
t/results/sectioning/double_top_in_menu.pl
@@ -827,6 +835,7 @@
t/results/sectioning/explicit_node_directions.pl
t/results/sectioning/hole_in_sectioning.pl
t/results/sectioning/internal_top_node_up.pl
+t/results/sectioning/lone_contents.pl
t/results/sectioning/lone_Top_node.pl
t/results/sectioning/loop_nodes.pl
t/results/sectioning/lowered_subsubsection.pl
Index: tp/Makefile.am
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Makefile.am,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- tp/Makefile.am 15 Jan 2012 23:38:22 -0000 1.27
+++ tp/Makefile.am 18 Jan 2012 22:31:13 -0000 1.28
@@ -1,4 +1,4 @@
-# $Id: Makefile.am,v 1.27 2012/01/15 23:38:22 pertusus Exp $
+# $Id: Makefile.am,v 1.28 2012/01/18 22:31:13 pertusus Exp $
# Makefile.am for texinfo/tp.
#
# Copyright 2011 Free Software Foundation, Inc.
@@ -20,7 +20,6 @@
SUBDIRS = . tests
bin_SCRIPTS = texi2any
-noinst_SCRIPTS = texi_sort_elements_count
do_subst = sed \
-e 's,address@hidden@],$(PACKAGE_VERSION),g' \
@@ -39,10 +38,6 @@
$(do_subst) $(srcdir)/$< >$@
chmod a+x $@
-texi_sort_elements_count: texi_sort_elements_count.pl
$(top_builddir)/config.status
- $(do_subst) $(srcdir)/$< >$@
- chmod a+x $@
-
makeinfo: texi2any
rm -f $@
-$(LN_S) texi2any $@
@@ -129,6 +124,7 @@
t/init/l2h.init \
t/manual_tree.pl \
t/test_utils.pl \
+ t/input_files/delcomment.texi \
#
relative_include_dir = t/include_dir
@@ -173,7 +169,6 @@
EXTRA_DIST = \
texi2any.pl \
- texi_sort_elements_count.pl \
$(test_results) \
$(test_files) \
$(tp_tests) \
@@ -181,7 +176,7 @@
$(perl_specific_files) \
maintain/lib
-MANIFEST: maintain/MANIFEST_generated_files Makefile.am
+MANIFEST: maintain/MANIFEST_generated_files Makefile.am Makefile.tres
echo "$(dist_modules_DATA) $(dist_converters_DATA)
$(dist_debugmodules_DATA) " \
"$(dist_init_DATA) $(test_files) $(tp_tests) $(test_results) " \
"texi2any-perl $(maintainance_files) README TODO COPYING " \
Index: tp/TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.254
retrieving revision 1.255
diff -u -b -r1.254 -r1.255
--- tp/TODO 17 Jan 2012 23:40:05 -0000 1.254
+++ tp/TODO 18 Jan 2012 22:31:13 -0000 1.255
@@ -52,28 +52,27 @@
Missing tests
=============
+Unit test of end_line_count for Texinfo/Convert/Paragraph.pm .... containers.
+
+Test no empty line before and after a sectioning command. With text, but
+also commands.
+
Test for the handling of #line.
-Test tree leading to non empty preamble_before_setfilename. Currently there
-are none in the test suite, maybe require a real file as input.
+Test input file without @setfilename
In html, test
empty lines at the begining,
content ignored before setfilename,
for the different cases of element/no element. This is to be done with
-real input files, or test_utils.pl should be changed to parse entry like
-a file.
+real input files.
+
In html test empty @top for title, with different cases for
setcontentsaftertit* and for anchors.
Test @address@hidden and @sc{@'e} in HTML with 8bit and utf8, with and without
enable encoding and entities.
-Test end_line_count in Texinfo/Convert/ containers.
-
-Test no empty line before and after a sectioning command. With text, but
-also commands.
-
Test character lengths and encoding. For instance tests in
encodings/at_commands_in_refs_utf8.texi
Index: tp/Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.353
retrieving revision 1.354
diff -u -b -r1.353 -r1.354
--- tp/Texinfo/Parser.pm 15 Jan 2012 15:08:00 -0000 1.353
+++ tp/Texinfo/Parser.pm 18 Jan 2012 22:31:13 -0000 1.354
@@ -671,6 +671,7 @@
}
$lines_nr = [] if (!defined($lines_nr));
if (!ref($lines_nr)) {
+ #$file =~ s/^.*\/// if (defined($file) and $self->{'TEST'});
$lines_array = _complete_line_nr($text, $lines_nr, $file,
$macro, $fixed_line_number);
} else {
@@ -723,6 +724,7 @@
}
}
+ $file_name =~ s/^.*\/// if ($self->{'TEST'});
$self = parser() if (!defined($self));
$self->{'input'} = [{
'pending' => [],
@@ -778,6 +780,7 @@
if (!ref($text)) {
$text = _text_to_lines($text);
}
+ #$file =~ s/^.*\/// if (defined($file) and $self->{'TEST'});
my $lines_array = _complete_line_nr($text, $lines_nr, $file,
$macro, $fixed_line_number);
Index: tp/t/02coverage.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/02coverage.t,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -b -r1.65 -r1.66
--- tp/t/02coverage.t 14 Jan 2012 01:11:30 -0000 1.65
+++ tp/t/02coverage.t 18 Jan 2012 22:31:13 -0000 1.66
@@ -541,7 +541,7 @@
'],
);
-my @test_invalid = (
+my @test_tree = (
['arg_in_brace_no_arg_command',
'@TeX{in tex}
'],
@@ -737,6 +737,8 @@
before first multitable
@end multitable
'],
+['delcomment', undef, {'test_file' => 'delcomment.texi'}
+],
);
foreach my $test (@test_cases) {
@@ -748,5 +750,5 @@
our ($arg_test_case, $arg_generate, $arg_debug);
-run_all ('coverage', address@hidden, @test_invalid], $arg_test_case,
+run_all ('coverage', address@hidden, @test_tree], $arg_test_case,
$arg_generate, $arg_debug);
Index: tp/t/test_utils.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/test_utils.pl,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -b -r1.107 -r1.108
--- tp/t/test_utils.pl 25 Dec 2011 10:57:43 -0000 1.107
+++ tp/t/test_utils.pl 18 Jan 2012 22:31:13 -0000 1.108
@@ -58,6 +58,8 @@
}
Locale::Messages::bindtextdomain ('texinfo_document', $localesdir);
+my $input_files_dir = $srcdir."t/input_files/";
+
our $output_files_dir = 't/output_files/';
foreach my $dir ('t', 't/results', $output_files_dir) {
if (! -d $dir) {
@@ -444,7 +446,7 @@
$converter_options = shift @$test_case if (@$test_case);
my $test_file;
if ($parser_options->{'test_file'}) {
- $test_file = $parser_options->{'test_file'};
+ $test_file = $input_files_dir . $parser_options->{'test_file'};
delete $parser_options->{'test_file'};
}
my $split = '';
Index: tp/tests/encodings/Makefile.am
===================================================================
RCS file: /sources/texinfo/texinfo/tp/tests/encodings/Makefile.am,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- tp/tests/encodings/Makefile.am 14 Jan 2012 18:58:21 -0000 1.1
+++ tp/tests/encodings/Makefile.am 18 Jan 2012 22:31:14 -0000 1.2
@@ -5,7 +5,7 @@
at_commands_in_refs_latin1.texi at_commands_in_refs_utf8.texi \
japanese.texi chinese_mixed_with_en.texi documentlanguage_set.texi \
encoding_index-latin1.texi encoding_index.texi encoding_index-utf8.texi \
- japanese_shift_jis.texi sample_utf8.texi formatting_utf8.texi \
+ japanese_shift_jis.texi sample_utf8.texi \
japanese_long_name.texi \
tests-parser.txt res_parser res_parser_info
Index: tp/tests/formatting/Makefile.am
===================================================================
RCS file: /sources/texinfo/texinfo/tp/tests/formatting/Makefile.am,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- tp/tests/formatting/Makefile.am 14 Jan 2012 19:00:32 -0000 1.1
+++ tp/tests/formatting/Makefile.am 18 Jan 2012 22:31:14 -0000 1.2
@@ -3,7 +3,7 @@
block_EOL.texi ignore_and_comments.texi split_nocopying.texi \
cond.texi inc_file.texi test_need.texi \
defxcond.texi lightweight_markups.texi \
-delcomment.texi tex_complex.texi \
+tex_complex.texi \
direntry_dircategory.texi tex_in_copying.texi \
math_not_closed.texi tex_not_closed.texi \
float_copying.texi my-bib-macros.texi tex.texi \
Index: tp/tests/formatting/tests-parser.txt
===================================================================
RCS file: /sources/texinfo/texinfo/tp/tests/formatting/tests-parser.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- tp/tests/formatting/tests-parser.txt 14 Jan 2012 19:00:38 -0000
1.1
+++ tp/tests/formatting/tests-parser.txt 18 Jan 2012 22:31:14 -0000
1.2
@@ -19,8 +19,6 @@
test_redefine_need test_need.texi --init redefine_need.init
# diverse
-texi delcomment.texi
-delcomment delcomment.texi
direntry_dircategory_info_split direntry_dircategory.texi --info --split-size 1
split_nocopying split_nocopying.texi --info
split_nocopying_split split_nocopying.texi --info --split-size 10
Index: util/texi_sort_elements_count.pl
===================================================================
RCS file: util/texi_sort_elements_count.pl
diff -N util/texi_sort_elements_count.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ util/texi_sort_elements_count.pl 18 Jan 2012 22:31:13 -0000 1.1
@@ -0,0 +1,236 @@
+#! /usr/bin/perl -w
+
+# texi_sort_elements_count: sort elements based on words or line counts.
+#
+# Copyright 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License,
+# or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# Original author: Patrice Dumas <address@hidden>
+
+
+use strict;
+
+use Getopt::Long qw(GetOptions);
+# to determine the path separator
+use Config;
+
+Getopt::Long::Configure("gnu_getopt");
+
+BEGIN
+{
+ my $texinfolibdir = '@datadir@/@PACKAGE@';
+ unshift @INC, ($texinfolibdir)
+ if ($texinfolibdir ne ''
+ and $texinfolibdir ne '@' .'datadir@/@PACKAGE'.'@');
+}
+
+use Texinfo::Parser;
+use Texinfo::Structuring;
+use Texinfo::Convert::TextContent;
+
+my $configured_version = '@PACKAGE_VERSION@';
+$configured_version = $Texinfo::Parser::VERSION
+ if ($configured_version eq '@' . 'PACKAGE_VERSION@');
+
+my $real_command_name = $0;
+$real_command_name =~ s/.*\///;
+$real_command_name =~ s/\.pl$//;
+
+# determine the path separators
+my $path_separator = $Config{'path_sep'};
+$path_separator = ':' if (!defined($path_separator));
+my $quoted_path_separator = quotemeta($path_separator);
+
+my $force = 0;
+my $use_sections = 0;
+my $count_words = 0;
+my $no_warn = 0;
+
+# placeholder for future i18n.
+sub __($)
+{
+ return $_[0];
+}
+
+my $format = 'info';
+# this is the format associated with the output format, which is replaced
+# when the output format changes. It may also be removed if there is the
+# corresponding --no-ifformat.
+#my $default_expanded_format = [ $format ];
+my @include_dirs = ();
+my @prepend_dirs = ();
+
+my $parser_default_options = {
+ #'expanded_formats' => [],
+ 'expanded_formats' => [ $format ],
+ 'values' => {},
+ #'gettext' => \&__
+ };
+
+sub set_expansion($$) {
+ my $region = shift;
+ my $set = shift;
+ $set = 1 if (!defined($set));
+ if ($set) {
+ push @{$parser_default_options->{'expanded_formats'}}, $region
+ unless (grep {$_ eq $region}
@{$parser_default_options->{'expanded_formats'}});
+ } else {
+ @{$parser_default_options->{'expanded_formats'}} =
+ grep {$_ ne $region} @{$parser_default_options->{'expanded_formats'}};
+# @{$default_expanded_format}
+# = grep {$_ ne $region} @{$default_expanded_format};
+ }
+}
+
+my $result_options = Getopt::Long::GetOptions (
+ 'help|h' => sub { print help(); exit 0; },
+ 'version|V' => sub {print "$real_command_name $configured_version\n\n";
+ printf __("Copyright (C) %s Free Software Foundation, Inc.
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.\n"), '2012';
+ exit 0;},
+ 'force' => \$force,
+ 'ifhtml!' => sub { set_expansion('html', $_[1]); },
+ 'ifinfo!' => sub { set_expansion('info', $_[1]); },
+ 'ifxml!' => sub { set_expansion('xml', $_[1]); },
+ 'ifdocbook!' => sub { set_expansion('docbook', $_[1]); },
+ 'iftex!' => sub { set_expansion('tex', $_[1]); },
+ 'ifplaintext!' => sub { set_expansion('plaintext', $_[1]); },
+ 'use-sections!' => \$use_sections,
+ 'count-words!' => \$count_words,
+ 'no-warn' => \$no_warn,
+ 'D=s' => sub {$parser_default_options->{'values'}->{$_[1]} = 1;},
+ 'U=s' => sub {delete $parser_default_options->{'values'}->{$_[1]};},
+ 'I=s' => sub {
+ push @include_dirs, split(/$quoted_path_separator/, $_[1]); },
+ 'P=s' => sub { unshift @prepend_dirs, split(/$quoted_path_separator/,
$_[1]); },
+ 'number-sections!' => sub { set_from_cmdline('NUMBER_SECTIONS', $_[1]); },
+);
+
+exit 1 if (!$result_options);
+
+my @input_files = @ARGV;
+# use STDIN if not a tty, like makeinfo does
address@hidden = ('-') if (!scalar(@input_files) and !-t STDIN);
+
+die sprintf(__("%s: missing file argument.\n"), $real_command_name)
+ .sprintf(__("Try `%s --help' for more information.\n"), $real_command_name)
+ unless (scalar(@input_files) >= 1);
+
+
+if (scalar(@input_files) > 1) {
+ warn sprintf(__("%s: superfluous file arguments.\n"), $real_command_name);
+}
+
+my $input_file_name = shift @input_files;
+
+sub help()
+{
+ my $help =
+ sprintf(__("Usage: %s [OPTION]... TEXINFO-FILE...\n"), $real_command_name)
+ ."\n".
+ __("Dump out a list of elements sorted by the number of lines (or words)
+they contain after removal of address@hidden")
+."\n";
+
+ $help .= __("General Options:
+ --count-words count words instead of lines.
+ --force keep on even if the Texinfo file parsing failed.
+ --help display this help and exit.
+ --no-warn suppress warnings (but not errors).
+ --use-sections use sections as elements instead of nodes.
+ --version display version information and exit.\n")
+."\n";
+ $help .= __("Input file options:
+ -D VAR define the variable VAR, as with address@hidden
+ -I DIR append DIR to the address@hidden search path.
+ -P DIR prepend DIR to the address@hidden search path.
+ -U VAR undefine the variable VAR, as with
address@hidden")
+."\n";
+ $help .= __("Conditional processing in input:
+ --ifdocbook process address@hidden and address@hidden
+ --ifhtml process address@hidden and address@hidden
+ --ifinfo process address@hidden
+ --ifplaintext process address@hidden
+ --iftex process address@hidden and address@hidden
+ --ifxml process address@hidden and address@hidden
+ --no-ifdocbook do not process address@hidden and address@hidden text.
+ --no-ifhtml do not process address@hidden and address@hidden text.
+ --no-ifinfo do not process address@hidden text.
+ --no-ifplaintext do not process address@hidden text.
+ --no-iftex do not process address@hidden and address@hidden text.
+ --no-ifxml do not process address@hidden and address@hidden text.
+
+ Also, for the --no-ifFORMAT options, do process address@hidden text.\n");
+ return $help;
+
+}
+
+sub _exit($)
+{
+ my $error_count = shift;
+ exit (1) if ($error_count and !$force);
+}
+
+sub handle_errors($$)
+{
+ my $self = shift;
+ my $error_count = shift;
+ my ($errors, $new_error_count) = $self->errors();
+ $error_count += $new_error_count if ($new_error_count);
+ foreach my $error_message (@$errors) {
+ warn $error_message->{'error_line'} if ($error_message->{'type'} eq 'error'
+ or !$no_warn);
+ }
+
+ _exit($error_count);
+ return $error_count;
+}
+
+my $input_directory = '.';
+if ($input_file_name =~ /(.*\/)/) {
+ $input_directory = $1;
+}
+
+my $parser_options = { %$parser_default_options };
+$parser_options->{'include_directories'} = address@hidden;
+my @prependended_include_directories = ('.');
+push @prependended_include_directories, $input_directory
+ if ($input_directory ne '.');
+unshift @{$parser_options->{'include_directories'}},
+ @prependended_include_directories;
+unshift @{$parser_options->{'include_directories'}}, @prepend_dirs;
+
+my $error_count = 0;
+my $parser = Texinfo::Parser::parser($parser_options);
+my $tree = $parser->parse_texi_file($input_file_name);
+
+if (!defined($tree)) {
+ handle_errors($parser, $error_count);
+ exit (1);
+}
+
+my $converter_options = {};
+$converter_options->{'parser'} = $parser;
+my $converter = Texinfo::Convert::TextContent->converter($converter_options);
+
+my ($sorted_name_counts_array, $formatted_result)
+ = $converter->sort_element_counts($tree, $use_sections,
+ $count_words);
+
+print STDOUT $formatted_result;
+
+1;
Index: tp/t/input_files/delcomment.texi
===================================================================
RCS file: tp/t/input_files/delcomment.texi
diff -N tp/t/input_files/delcomment.texi
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tp/t/input_files/delcomment.texi 18 Jan 2012 22:31:13 -0000 1.1
@@ -0,0 +1,8 @@
+\input texinfo
address@hidden delcomment.info
+
+ this is a comment.
+
+This line is the only output.
+
address@hidden
Index: tp/t/results/coverage/delcomment.pl
===================================================================
RCS file: tp/t/results/coverage/delcomment.pl
diff -N tp/t/results/coverage/delcomment.pl
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tp/t/results/coverage/delcomment.pl 18 Jan 2012 22:31:13 -0000 1.1
@@ -0,0 +1,135 @@
+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{'delcomment'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => '\\input texinfo
+',
+ 'type' => 'preamble_text'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'preamble'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'preamble_before_setfilename'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'extra' => {
+ 'command' => {}
+ },
+ 'parent' => {},
+ 'text' => ' ',
+ 'type' => 'empty_spaces_after_command'
+ },
+ {
+ 'parent' => {},
+ 'text' => 'delcomment.info'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'spaces_at_end'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'misc_line_arg'
+ }
+ ],
+ 'cmdname' => 'setfilename',
+ 'extra' => {
+ 'text_arg' => 'delcomment.info'
+ },
+ 'line_nr' => {
+ 'file_name' => 'delcomment.texi',
+ 'line_nr' => 2,
+ 'macro' => ''
+ },
+ 'parent' => {}
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'parent' => {},
+ 'text' => 'This line is the only output.
+'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'paragraph'
+ },
+ {
+ 'parent' => {},
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'cmdname' => 'bye',
+ 'parent' => {}
+ }
+ ],
+ 'type' => 'text_root'
+};
+$result_trees{'delcomment'}{'contents'}[0]{'contents'}[0]{'parent'} =
$result_trees{'delcomment'}{'contents'}[0];
+$result_trees{'delcomment'}{'contents'}[0]{'parent'} =
$result_trees{'delcomment'};
+$result_trees{'delcomment'}{'contents'}[1]{'args'}[0]{'contents'}[0]{'extra'}{'command'}
= $result_trees{'delcomment'}{'contents'}[1];
+$result_trees{'delcomment'}{'contents'}[1]{'args'}[0]{'contents'}[0]{'parent'}
= $result_trees{'delcomment'}{'contents'}[1]{'args'}[0];
+$result_trees{'delcomment'}{'contents'}[1]{'args'}[0]{'contents'}[1]{'parent'}
= $result_trees{'delcomment'}{'contents'}[1]{'args'}[0];
+$result_trees{'delcomment'}{'contents'}[1]{'args'}[0]{'contents'}[2]{'parent'}
= $result_trees{'delcomment'}{'contents'}[1]{'args'}[0];
+$result_trees{'delcomment'}{'contents'}[1]{'args'}[0]{'parent'} =
$result_trees{'delcomment'}{'contents'}[1];
+$result_trees{'delcomment'}{'contents'}[1]{'parent'} =
$result_trees{'delcomment'};
+$result_trees{'delcomment'}{'contents'}[2]{'parent'} =
$result_trees{'delcomment'};
+$result_trees{'delcomment'}{'contents'}[3]{'parent'} =
$result_trees{'delcomment'};
+$result_trees{'delcomment'}{'contents'}[4]{'contents'}[0]{'parent'} =
$result_trees{'delcomment'}{'contents'}[4];
+$result_trees{'delcomment'}{'contents'}[4]{'parent'} =
$result_trees{'delcomment'};
+$result_trees{'delcomment'}{'contents'}[5]{'parent'} =
$result_trees{'delcomment'};
+$result_trees{'delcomment'}{'contents'}[6]{'parent'} =
$result_trees{'delcomment'};
+
+$result_texis{'delcomment'} = '\\input texinfo
address@hidden delcomment.info
+
+
+This line is the only output.
+
address@hidden
+';
+
+
+$result_texts{'delcomment'} = '
+
+This line is the only output.
+
+';
+
+$result_errors{'delcomment'} = [];
+
+
+1;
Index: tp/tests/formatting/delcomment.texi
===================================================================
RCS file: tp/tests/formatting/delcomment.texi
diff -N tp/tests/formatting/delcomment.texi
--- tp/tests/formatting/delcomment.texi 14 Jan 2012 19:00:34 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,8 +0,0 @@
-\input texinfo
address@hidden delcomment.info
-
- this is a comment.
-
-This line is the only output.
-
address@hidden
Index: tp/tests/formatting/res_parser/delcomment/delcomment.1
===================================================================
RCS file: tp/tests/formatting/res_parser/delcomment/delcomment.1
diff -N tp/tests/formatting/res_parser/delcomment/delcomment.1
Index: tp/tests/formatting/res_parser/delcomment/delcomment.2
===================================================================
RCS file: tp/tests/formatting/res_parser/delcomment/delcomment.2
diff -N tp/tests/formatting/res_parser/delcomment/delcomment.2
--- tp/tests/formatting/res_parser/delcomment/delcomment.2 14 Jan 2012
19:00:48 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1 +0,0 @@
-warning: Must specify a title with a title command or @top
Index: tp/tests/formatting/res_parser/delcomment/delcomment.html
===================================================================
RCS file: tp/tests/formatting/res_parser/delcomment/delcomment.html
diff -N tp/tests/formatting/res_parser/delcomment/delcomment.html
--- tp/tests/formatting/res_parser/delcomment/delcomment.html 14 Jan 2012
19:00:49 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,56 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
-<head>
-<title>Untitled Document</title>
-
-<meta name="description" content="Untitled Document">
-<meta name="keywords" content="Untitled Document">
-<meta name="resource-type" content="document">
-<meta name="distribution" content="global">
-<meta name="Generator" content="texi2any">
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<style type="text/css">
-<!--
-a.summary-letter {text-decoration: none}
-blockquote.smallquotation {font-size: smaller}
-div.display {margin-left: 3.2em}
-div.example {margin-left: 3.2em}
-div.lisp {margin-left: 3.2em}
-div.smalldisplay {margin-left: 3.2em}
-div.smallexample {margin-left: 3.2em}
-div.smalllisp {margin-left: 3.2em}
-pre.display {font-family: serif}
-pre.format {font-family: serif}
-pre.menu-comment {font-family: serif}
-pre.menu-preformatted {font-family: serif}
-pre.smalldisplay {font-family: serif; font-size: smaller}
-pre.smallexample {font-size: smaller}
-pre.smallformat {font-family: serif; font-size: smaller}
-pre.smalllisp {font-size: smaller}
-span.nocodebreak {white-space:pre}
-span.nolinebreak {white-space:pre}
-span.roman {font-family:serif; font-weight:normal}
-span.sansserif {font-family:sans-serif; font-weight:normal}
-ul.no-bullet {list-style: none}
--->
-</style>
-
-
-</head>
-
-<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF"
vlink="#800080" alink="#FF0000">
-
-
-<p>This line is the only output.
-</p>
-<hr>
-<p>
- <font size="-1">
- This document was generated on <em>a sunny day</em> using <a
href="http://www.gnu.org/software/texinfo/"><em>texi2any</em></a>.
- </font>
- <br>
-
-</p>
-</body>
-</html>
Index: tp/tests/formatting/res_parser/texi_delcomment/delcomment.2
===================================================================
RCS file: tp/tests/formatting/res_parser/texi_delcomment/delcomment.2
diff -N tp/tests/formatting/res_parser/texi_delcomment/delcomment.2
Index: tp/tests/formatting/res_parser/texi_delcomment/delcomment.texi
===================================================================
RCS file: tp/tests/formatting/res_parser/texi_delcomment/delcomment.texi
diff -N tp/tests/formatting/res_parser/texi_delcomment/delcomment.texi
--- tp/tests/formatting/res_parser/texi_delcomment/delcomment.texi 14 Jan
2012 19:01:34 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,7 +0,0 @@
-\input texinfo
address@hidden delcomment.info
-
-
-This line is the only output.
-
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo util/Makefile.am tp/MANIFEST tp/Makefil...,
Patrice Dumas <=