[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Sun, 19 Nov 2023 06:02:17 -0500 (EST) |
branch: master
commit 35163783cbe8b12cae1406c9f805426ae5b15db3
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Nov 19 11:34:31 2023 +0100
* tp/Texinfo/Convert/ConvertXS.pm, tp/Texinfo/Convert/Converter.pm,
tp/Texinfo/Convert/HTML.pm, tp/Texinfo/Convert/PlainTexinfo.pm,
tp/Texinfo/Convert/Texinfo.pm, tp/Texinfo/Convert/Text.pm: load XS
related to conversion only if structure is also done by XS.
---
ChangeLog | 7 +++++++
tp/Texinfo/Convert/ConvertXS.pm | 13 +++++++++++--
tp/Texinfo/Convert/Converter.pm | 11 ++++++++++-
tp/Texinfo/Convert/HTML.pm | 11 ++++++++++-
tp/Texinfo/Convert/PlainTexinfo.pm | 11 ++++++++++-
tp/Texinfo/Convert/Texinfo.pm | 16 ++++++++++++++--
tp/Texinfo/Convert/Text.pm | 11 ++++++++++-
7 files changed, 72 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 96a115d12f..343447d0a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,13 @@
* tp/texi2any.supp: Add variant suppression specification
for setenv error.
+2023-11-19 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/ConvertXS.pm, tp/Texinfo/Convert/Converter.pm,
+ tp/Texinfo/Convert/HTML.pm, tp/Texinfo/Convert/PlainTexinfo.pm,
+ tp/Texinfo/Convert/Texinfo.pm, tp/Texinfo/Convert/Text.pm: load XS
+ related to conversion only if structure is also done by XS.
+
2023-11-19 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Document.pm ($XS_parser, $XS_structuring, %XS_overrides)
diff --git a/tp/Texinfo/Convert/ConvertXS.pm b/tp/Texinfo/Convert/ConvertXS.pm
index e06f76f3a6..d0ea373e2d 100644
--- a/tp/Texinfo/Convert/ConvertXS.pm
+++ b/tp/Texinfo/Convert/ConvertXS.pm
@@ -27,9 +27,18 @@ our $VERSION = '7.1dev';
use Texinfo::XSLoader;
BEGIN {
+ # XS parser and not explicitely unset
+ my $XS_structuring = ((not defined($ENV{TEXINFO_XS})
+ or $ENV{TEXINFO_XS} ne 'omit')
+ and (not defined($ENV{TEXINFO_XS_PARSER})
+ or $ENV{TEXINFO_XS_PARSER} eq '1')
+ and (not defined($ENV{TEXINFO_XS_STRUCTURE})
+ or $ENV{TEXINFO_XS_STRUCTURE} ne '0'));
+
my $XS_convert = 0;
- $XS_convert = 1 if (defined $ENV{TEXINFO_XS_CONVERT}
- and $ENV{TEXINFO_XS_CONVERT} eq '1');
+ $XS_convert = 1 if ($XS_structuring
+ and defined $ENV{TEXINFO_XS_CONVERT}
+ and $ENV{TEXINFO_XS_CONVERT} eq '1');
if ($XS_convert) {
Texinfo::XSLoader::init (
diff --git a/tp/Texinfo/Convert/Converter.pm b/tp/Texinfo/Convert/Converter.pm
index 2a6e6d2403..2867a8bddc 100644
--- a/tp/Texinfo/Convert/Converter.pm
+++ b/tp/Texinfo/Convert/Converter.pm
@@ -69,8 +69,17 @@ xml_accents
$VERSION = '7.1dev';
+# XS parser and not explicitely unset
+my $XS_structuring = ((not defined($ENV{TEXINFO_XS})
+ or $ENV{TEXINFO_XS} ne 'omit')
+ and (not defined($ENV{TEXINFO_XS_PARSER})
+ or $ENV{TEXINFO_XS_PARSER} eq '1')
+ and (not defined($ENV{TEXINFO_XS_STRUCTURE})
+ or $ENV{TEXINFO_XS_STRUCTURE} ne '0'));
+
my $XS_convert = 0;
-$XS_convert = 1 if (defined $ENV{TEXINFO_XS_CONVERT}
+$XS_convert = 1 if ($XS_structuring
+ and defined $ENV{TEXINFO_XS_CONVERT}
and $ENV{TEXINFO_XS_CONVERT} eq '1');
our $module_loaded = 0;
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index d4fc249714..4796a66d04 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -89,8 +89,17 @@ use vars qw($VERSION @ISA);
$VERSION = '7.1dev';
+# XS parser and not explicitely unset
+my $XS_structuring = ((not defined($ENV{TEXINFO_XS})
+ or $ENV{TEXINFO_XS} ne 'omit')
+ and (not defined($ENV{TEXINFO_XS_PARSER})
+ or $ENV{TEXINFO_XS_PARSER} eq '1')
+ and (not defined($ENV{TEXINFO_XS_STRUCTURE})
+ or $ENV{TEXINFO_XS_STRUCTURE} ne '0'));
+
my $XS_convert = 0;
-$XS_convert = 1 if (defined $ENV{TEXINFO_XS_CONVERT}
+$XS_convert = 1 if ($XS_structuring
+ and defined $ENV{TEXINFO_XS_CONVERT}
and $ENV{TEXINFO_XS_CONVERT} eq '1');
my %XS_overrides = (
diff --git a/tp/Texinfo/Convert/PlainTexinfo.pm
b/tp/Texinfo/Convert/PlainTexinfo.pm
index cfca126e8b..898e6aa676 100644
--- a/tp/Texinfo/Convert/PlainTexinfo.pm
+++ b/tp/Texinfo/Convert/PlainTexinfo.pm
@@ -37,8 +37,17 @@ use vars qw($VERSION @ISA);
$VERSION = '7.1dev';
+# XS parser and not explicitely unset
+my $XS_structuring = ((not defined($ENV{TEXINFO_XS})
+ or $ENV{TEXINFO_XS} ne 'omit')
+ and (not defined($ENV{TEXINFO_XS_PARSER})
+ or $ENV{TEXINFO_XS_PARSER} eq '1')
+ and (not defined($ENV{TEXINFO_XS_STRUCTURE})
+ or $ENV{TEXINFO_XS_STRUCTURE} ne '0'));
+
my $XS_convert = 0;
-$XS_convert = 1 if (defined $ENV{TEXINFO_XS_CONVERT}
+$XS_convert = 1 if ($XS_structuring
+ and defined $ENV{TEXINFO_XS_CONVERT}
and $ENV{TEXINFO_XS_CONVERT} eq '1');
our $module_loaded = 0;
diff --git a/tp/Texinfo/Convert/Texinfo.pm b/tp/Texinfo/Convert/Texinfo.pm
index 64001b754d..18eed237f2 100644
--- a/tp/Texinfo/Convert/Texinfo.pm
+++ b/tp/Texinfo/Convert/Texinfo.pm
@@ -53,11 +53,23 @@ use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
$VERSION = '7.1dev';
+# XS parser and not explicitely unset
+my $XS_structuring = ((not defined($ENV{TEXINFO_XS})
+ or $ENV{TEXINFO_XS} ne 'omit')
+ and (not defined($ENV{TEXINFO_XS_PARSER})
+ or $ENV{TEXINFO_XS_PARSER} eq '1')
+ and (not defined($ENV{TEXINFO_XS_STRUCTURE})
+ or $ENV{TEXINFO_XS_STRUCTURE} ne '0'));
+
+my $XS_convert = 0;
+$XS_convert = 1 if ($XS_structuring
+ and defined $ENV{TEXINFO_XS_CONVERT}
+ and $ENV{TEXINFO_XS_CONVERT} eq '1');
+
our $module_loaded = 0;
sub import {
if (!$module_loaded) {
- if (defined $ENV{TEXINFO_XS_CONVERT}
- and $ENV{TEXINFO_XS_CONVERT} eq '1') {
+ if ($XS_convert) {
# We do not simply override, we must check at runtime
# that the document tree was stored by the XS parser.
Texinfo::XSLoader::override(
diff --git a/tp/Texinfo/Convert/Text.pm b/tp/Texinfo/Convert/Text.pm
index 4ef9c3e978..04ccab3df1 100644
--- a/tp/Texinfo/Convert/Text.pm
+++ b/tp/Texinfo/Convert/Text.pm
@@ -57,8 +57,17 @@ use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
$VERSION = '7.1dev';
+# XS parser and not explicitely unset
+my $XS_structuring = ((not defined($ENV{TEXINFO_XS})
+ or $ENV{TEXINFO_XS} ne 'omit')
+ and (not defined($ENV{TEXINFO_XS_PARSER})
+ or $ENV{TEXINFO_XS_PARSER} eq '1')
+ and (not defined($ENV{TEXINFO_XS_STRUCTURE})
+ or $ENV{TEXINFO_XS_STRUCTURE} ne '0'));
+
my $XS_convert = 0;
-$XS_convert = 1 if (defined $ENV{TEXINFO_XS_CONVERT}
+$XS_convert = 1 if ($XS_structuring
+ and defined $ENV{TEXINFO_XS_CONVERT}
and $ENV{TEXINFO_XS_CONVERT} eq '1');
our $module_loaded = 0;