texinfo-commits
[Top][All Lists]
Advanced

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

[8064] parsetexi fix cyclic dependency problem


From: gavinsmith0123
Subject: [8064] parsetexi fix cyclic dependency problem
Date: Tue, 14 Aug 2018 16:15:00 -0400 (EDT)

Revision: 8064
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8064
Author:   gavin
Date:     2018-08-14 16:15:00 -0400 (Tue, 14 Aug 2018)
Log Message:
-----------
parsetexi fix cyclic dependency problem

Modified Paths:
--------------
    trunk/tp/parsetexi/Parsetexi.pm

Modified: trunk/tp/parsetexi/Parsetexi.pm
===================================================================
--- trunk/tp/parsetexi/Parsetexi.pm     2018-08-14 12:38:36 UTC (rev 8063)
+++ trunk/tp/parsetexi/Parsetexi.pm     2018-08-14 20:15:00 UTC (rev 8064)
@@ -25,7 +25,6 @@
 
 require Exporter;
 
-use Texinfo::Report;
 use Texinfo::Common;
 use Texinfo::Encoding;
 use Texinfo::Convert::NodeNameNormalization;
@@ -124,6 +123,10 @@
   return $parser;
 }
 
+sub simple_parser {
+  goto &parser;
+}
+
 # Stub for Texinfo::Parser::parser (line 574)
 sub parser (;$$)
 {
@@ -502,9 +505,20 @@
     undef,
     "Parsetexi",
     1);
-
 } # end BEGIN
 
+# This "use" statement is all the way down here because Texinfo::Report
+# and Texinfo::Parser both "use" each other.  If we "use Texinfo::Report"
+# at the top of the file, this has the problem that the symbol table
+# for the Texinfo::Parser namespace, %Texinfo::Parser::, is a different
+# hash (i.e. it has a different address) from what it ends up with by the
+# end of this module.  Once the Perl interpreter has read in a module and 
+# interpreted variables in terms of a given symbol table, it does not 
+# do so them again.  Hence, use of subroutines in the Texinfo::Parser 
namespace 
+# fails.  This remains the case even if we arrange for the symbol table hash 
+# to remain at the same address, because is empty while the file is being read.
+use Texinfo::Report;
+
 # NB Don't add more functions down here, because this can cause an error
 # with some versions of Perl, connected with the typeglob assignment just
 # above.  ("Can't call mro_method_changed_in() on anonymous symbol table").




reply via email to

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