texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[7090] commit diff for testing parsetexi module


From: Gavin D. Smith
Subject: [7090] commit diff for testing parsetexi module
Date: Sun, 03 Apr 2016 14:32:55 +0000

Revision: 7090
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7090
Author:   gavin
Date:     2016-04-03 14:32:49 +0000 (Sun, 03 Apr 2016)
Log Message:
-----------
commit diff for testing parsetexi module

Modified Paths:
--------------
    trunk/tp/parsetexi/README

Added Paths:
-----------
    trunk/tp/diff-for-test-parsetexi.diff

Added: trunk/tp/diff-for-test-parsetexi.diff
===================================================================
--- trunk/tp/diff-for-test-parsetexi.diff                               (rev 0)
+++ trunk/tp/diff-for-test-parsetexi.diff       2016-04-03 14:32:49 UTC (rev 
7090)
@@ -0,0 +1,168 @@
+Index: Texinfo/Convert/Converter.pm
+===================================================================
+--- Texinfo/Convert/Converter.pm       (revision 7025)
++++ Texinfo/Convert/Converter.pm       (working copy)
+@@ -1134,6 +1134,8 @@ sub _collect_leading_trailing_spaces_arg($$)
+   return @result;
+ }
+ 
++use Parsetexi;
++
+ sub _table_item_content_tree($$$)
+ {
+   my $self = shift;
+@@ -1158,7 +1160,8 @@ sub _table_item_content_tree($$$)
+                'contents' => $contents,
+                'parent' => $command,};
+     $command->{'args'} = [$arg];
+-    $self->Texinfo::Parser::_register_command_arg($arg, 
'brace_command_contents');
++    #$self->Parsetexi::_register_command_arg($arg, 'brace_command_contents');
++    #$self->Texinfo::Parser::_register_command_arg($arg, 
'brace_command_contents');
+     $contents = [$command];
+   }
+   $converted_tree->{'contents'} = $contents;
+Index: Texinfo/ModulePath.pm.in
+===================================================================
+--- Texinfo/ModulePath.pm.in   (revision 7006)
++++ Texinfo/ModulePath.pm.in   (working copy)
+@@ -19,6 +19,8 @@ sub init (;$$) {
+ 
+   if (defined($ENV{'top_builddir'}) and !defined($ENV{'top_srcdir'})) {
+     $ENV{'top_srcdir'} = $ENV{'top_builddir'};
++  } elsif (defined($ENV{'top_srcdir'}) and !defined($ENV{'top_builddir'})) {
++    $ENV{'top_builddir'} = $ENV{'top_srcdir'};
+   }
+    
+   if (!$lib_dir) {
+@@ -46,6 +48,7 @@ sub init (;$$) {
+     if ('@USE_EXTERNAL_UNIDECODE@' ne 'yes') {
+       unshift @INC, (File::Spec->catdir($lib_dir, 'lib', 'Text-Unidecode', 
'lib'));
+     }
++    unshift @INC, (File::Spec->catdir($lib_dir, '..', 'parsetexi'));
+   }
+ 
+   if (!$libexec_dir) {
+Index: Texinfo/Parser.pm
+===================================================================
+--- Texinfo/Parser.pm  (revision 7080)
++++ Texinfo/Parser.pm  (working copy)
+@@ -32,6 +32,9 @@ package Texinfo::Parser;
+ use 5.006;
+ use strict;
+ 
++# make sure we don't load this module for testing XS
++#die;
++
+ # debug
+ use Carp qw(cluck);
+ 
+Index: Texinfo/Report.pm
+===================================================================
+--- Texinfo/Report.pm  (revision 7061)
++++ Texinfo/Report.pm  (working copy)
+@@ -48,7 +48,8 @@ use File::Basename;
+ 
+ use Locale::Messages;
+ # to be able to load a parser if none was given to gdt.
+-use Texinfo::Parser;
++#use Texinfo::Parser;
++use Parsetexi;
+ 
+ # return the errors and warnings
+ sub errors($)
+@@ -404,7 +405,8 @@ sub gdt($$;$$)
+     }
+   }
+   #my $parser = Texinfo::Parser::parser($parser_conf);
+-  my $parser = Texinfo::Parser::simple_parser($parser_conf);
++  #my $parser = Texinfo::Parser::simple_parser($parser_conf);
++  my $parser = Parsetexi::parser($parser_conf);
+   if ($parser->{'DEBUG'}) {
+     print STDERR "GDT $translation_result\n";
+   }
+Index: Texinfo/Structuring.pm
+===================================================================
+--- Texinfo/Structuring.pm     (revision 7080)
++++ Texinfo/Structuring.pm     (working copy)
+@@ -578,7 +578,7 @@ sub nodes_tree($)
+   my $check_menu_entries = (!$self->{'novalidate'} and $self->{'SHOW_MENU'});
+ 
+   foreach my $node (@{$self->{'nodes'}}) {
+-    if ($node->{'extra'}->{'normalized'} eq 'Top') {
++    if (0 and $node->{'extra'}->{'normalized'} eq 'Top') {
+       $top_node = $node;
+       my $top_node_up_content_tree = Texinfo::Parser::parse_texi_line($self, 
+                                                     $self->{'TOP_NODE_UP'});
+@@ -802,7 +802,7 @@ sub nodes_tree($)
+                                               'extra' => $node_direction };
+               $node->{'node_'.$direction}->{'extra'}->{'top_node_up'} 
+                 = $node;
+-            } else {
++            } elsif (0) {
+               $self->line_error(sprintf($self->
+                                   __("%s reference to nonexistent `%s'"),
+                     $direction_texts{$direction},
+Index: t/test_utils.pl
+===================================================================
+--- t/test_utils.pl    (revision 7026)
++++ t/test_utils.pl    (working copy)
+@@ -43,7 +43,8 @@ Texinfo::ModulePath::init();
+ 
+ use Test::More;
+ 
+-use Texinfo::Parser;
++#use Texinfo::Parser;
++use Parsetexi;
+ use Texinfo::Convert::Text;
+ use Texinfo::Convert::Texinfo;
+ use Texinfo::Structuring;
+@@ -374,7 +375,7 @@ sub cmp_trimmed($$$$)
+   my $test_name = shift;
+   my $trimmed = remove_keys($compared, $deleted_keys);
+ no warnings 'recursion';
+-  cmp_deeply($trimmed, $reference, $test_name);
++  Test::Deep::cmp_deeply($trimmed, $reference, $test_name);
+ }
+ 
+ sub new_test($;$$$)
+@@ -722,7 +723,8 @@ sub test($$)
+   #  push @tested_formats, @{$self->{'test_formats'}};
+   }
+ 
+-  my $parser = Texinfo::Parser->parser({'TEST' => 1,
++  #my $parser = Texinfo::Parser->parser({'TEST' => 1,
++  my $parser = Parsetexi::parser({'TEST' => 1,
+                                         'include_directories' => [
+                                           't/include_dir/',
+                                           't/include/',
+Index: texi2any.pl
+===================================================================
+--- texi2any.pl        (revision 7033)
++++ texi2any.pl        (working copy)
+@@ -275,8 +275,8 @@ if ($configured_version eq '@' . 'PACKAGE_VERSION@
+   } else {
+     # used in the standalone perl module, as $hardcoded_version is undef
+     # and it should never be configured in that setup
+-    require Texinfo::Parser;
+-    $configured_version = $Texinfo::Parser::VERSION;
++    ## require Texinfo::Parser;
++    ## $configured_version = $Texinfo::Parser::VERSION;
+   }
+ }
+ my $configured_package = '@PACKAGE@';
+@@ -1071,7 +1071,14 @@ if ($call_texi2dvi) {
+   document_warn(__('--Xopt option without printed output')); 
+ }
+ 
+-require Texinfo::Parser;
++#require Texinfo::Parser;
++BEGIN {
++require Parsetexi;
++*Texinfo::Parser:: = \%Parsetexi::;
++}
++
++print *Parsetexi::{PACKAGE};
++
+ require Texinfo::Structuring;
+ # Avoid loading these modules until down here to speed up the case
+ # when they are not needed.

Modified: trunk/tp/parsetexi/README
===================================================================
--- trunk/tp/parsetexi/README   2016-04-03 14:05:16 UTC (rev 7089)
+++ trunk/tp/parsetexi/README   2016-04-03 14:32:49 UTC (rev 7090)
@@ -1,6 +1,10 @@
 This is an experimental program intended to replicate the functionality 
 in tp/Texinfo/Parser.pm.
 
+
+some modifications needed to run at the moment.  diff in 
+tp/diff-for-test-parsetexi.diff
+
 =====================================================================
 Notes -
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]