Skip to content

Commit

Permalink
add test for para sockets
Browse files Browse the repository at this point in the history
  • Loading branch information
u-fischer committed Sep 23, 2024
1 parent db3e619 commit 52e1006
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 63 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
### Fixed
- corrected a few temp variables
### Changed
- make para-sockets optional so that they can move to lttagging.

## [2024-09-16]
### Added
Expand Down
131 changes: 68 additions & 63 deletions tagpdf-user.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -976,83 +976,88 @@
% at some time) and a more sophisticated one that must
% be used if the block code is used.
% It is possible that we will need more variants, so
% we setup a socket so that the code can be easily switched.
% we setup a socket so that the code can be easily switched.
% This code should move into lttagging, so we add a test for
% the transition.
% \begin{macrocode}
\socket_new:nn {tagsupport/para/begin}{0}
\socket_new:nn {tagsupport/para/end}{0}

\socket_new_plug:nnn{tagsupport/para/begin}{plain}
\str_if_exist:cF { l__socket_tagsupport/para/begin_plug_str }
{
\bool_if:NT \l_@@_para_bool
\socket_new:nn {tagsupport/para/begin}{0}
\socket_new:nn {tagsupport/para/end}{0}

\socket_new_plug:nnn{tagsupport/para/begin}{plain}
{
\bool_if:NF \l_@@_para_flattened_bool
{
\@@_gincr_para_main_begin_int:
\tag_struct_begin:n
\bool_if:NT \l_@@_para_bool
{
\bool_if:NF \l_@@_para_flattened_bool
{
tag=\l_@@_para_main_tag_tl,
\@@_gincr_para_main_begin_int:
\tag_struct_begin:n
{
tag=\l_@@_para_main_tag_tl,
}
\@@_para_main_store_struct:
}
\@@_para_main_store_struct:
}
\@@_gincr_para_begin_int:
\tag_struct_begin:n {tag=\l_@@_para_tag_tl}
\@@_check_para_begin_show:nn {green}{}
\tag_mc_begin:n {}
}
}
\socket_new_plug:nnn{tagsupport/para/begin}{block}
{
\bool_if:NT \l_@@_para_bool
\@@_gincr_para_begin_int:
\tag_struct_begin:n {tag=\l_@@_para_tag_tl}
\@@_check_para_begin_show:nn {green}{}
\tag_mc_begin:n {}
}
}
\socket_new_plug:nnn{tagsupport/para/begin}{block}
{
\legacy_if:nF { @inlabel }
\bool_if:NT \l_@@_para_bool
{
\@@_check_typeout_v:n
{==>~ @endpe = \legacy_if:nTF { @endpe }{true}{false} \on@line }
\legacy_if:nF { @endpe }
{
\bool_if:NF \l_@@_para_flattened_bool
{
\@@_gincr_para_main_begin_int:
\tag_struct_begin:n
{
tag=\l_@@_para_main_tag_tl,
attribute-class=\l_@@_para_main_attr_class_tl,
}
\@@_para_main_store_struct:
\legacy_if:nF { @inlabel }
{
\@@_check_typeout_v:n
{==>~ @endpe = \legacy_if:nTF { @endpe }{true}{false} \on@line }
\legacy_if:nF { @endpe }
{
\bool_if:NF \l_@@_para_flattened_bool
{
\@@_gincr_para_main_begin_int:
\tag_struct_begin:n
{
tag=\l_@@_para_main_tag_tl,
attribute-class=\l_@@_para_main_attr_class_tl,
}
\@@_para_main_store_struct:
}
}
}
\@@_gincr_para_begin_int:
\@@_check_typeout_v:n {==>~increment~ P \on@line }
\tag_struct_begin:n
{
tag=\l_@@_para_tag_tl
,attribute-class=\l_@@_para_attr_class_tl
}
\@@_check_para_begin_show:nn {green}{\PARALABEL}
\tag_mc_begin:n {}
}
}
}
\@@_gincr_para_begin_int:
\@@_check_typeout_v:n {==>~increment~ P \on@line }
\tag_struct_begin:n
{
tag=\l_@@_para_tag_tl
,attribute-class=\l_@@_para_attr_class_tl
}
\@@_check_para_begin_show:nn {green}{\PARALABEL}
\tag_mc_begin:n {}
}
}
}
% \end{macrocode}
% there was no real difference between the original and
% in the block variant, only a debug message. We therefore
% define only a plain variant.
% \begin{macrocode}
\socket_new_plug:nnn{tagsupport/para/end}{plain}
{
\bool_if:NT \l_@@_para_bool
\socket_new_plug:nnn{tagsupport/para/end}{plain}
{
\@@_gincr_para_end_int:
\@@_check_typeout_v:n {==>~increment~ /P \on@line }
\tag_mc_end:
\@@_check_para_end_show:nn {red}{}
\tag_struct_end:
\bool_if:NF \l_@@_para_flattened_bool
{
\@@_gincr_para_main_end_int:
\tag_struct_end:
}
}
\bool_if:NT \l_@@_para_bool
{
\@@_gincr_para_end_int:
\@@_check_typeout_v:n {==>~increment~ /P \on@line }
\tag_mc_end:
\@@_check_para_end_show:nn {red}{}
\tag_struct_end:
\bool_if:NF \l_@@_para_flattened_bool
{
\@@_gincr_para_main_end_int:
\tag_struct_end:
}
}
}
}
% \end{macrocode}
% By default we assign the plain plug:
Expand Down

0 comments on commit 52e1006

Please sign in to comment.