[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Further reducing special case code for XS structuring
From: |
Patrice Dumas |
Subject: |
Re: Further reducing special case code for XS structuring |
Date: |
Wed, 3 Apr 2024 23:53:09 +0200 |
On Wed, Apr 03, 2024 at 09:23:28PM +0100, Gavin Smith wrote:
> This does appear to make texi2any work with TEXINFO_XS_STRUCTURE=0, although
> there are various test failures that I haven't investigated properly
> It appears that the failures are to do with @item; e.g. for
> "converters_tests.t indices_in_begin_tables_lists_entries_after_item", the
> diff includes
To avoid that, you could change the special call to $document->tree
with an argument, like $document->tree(1) to be $document->tree(), as
the argument, which is only taken in into account in XS is such that an
handler only is returned, similar to calling get_document instead of
build_document, while it is not what you want, you want the tree to be
built at that point such that Texinfo::Transformations has a real tree
to work with and not hash reference containing only the information to
retrieve the tree in XS/C.
Only doing that is likely to lead to the Perl tree being incorrectly
built if TEXINFO_XS_CONVERT is set to 1, while we want the tree not
to be built at that point in that case. So probably, $XS_convert need to be
determined as in Texinfo/Convert/HTML.pm and be passed to
$document->tree where a 1 is passed currently, so something like l 1528
of texi2any.pl (and similar in test_utils.pl)
my $tree = $document->tree($XS_convert);
I have not tested that part, so I may be wrong.
--
Pat