Skip to content

Commit

Permalink
remove genericmode/luamode option, WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
u-fischer committed Feb 12, 2025
1 parent 0a17694 commit b5509a6
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 68 deletions.
4 changes: 2 additions & 2 deletions tagpdf-struct.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_struct_fill_kid_key:n #1 %#1 is the struct num
{
\bool_if:NF\g_@@_mode_lua_bool
\sys_if_engine_luatex:TF
{
\seq_clear:N \l_@@_tmpa_seq
\seq_map_inline:cn { g_@@_struct_kids_#1_seq }
Expand All @@ -904,7 +904,7 @@
{
% in this case we need a special command in
% luamode to get the array right. See issue #13
\bool_if:NTF\g_@@_mode_lua_bool
\sys_if_engine_luatex:TF
{
\@@_struct_exchange_kid_command:c
{g_@@_struct_kids_#1_seq}
Expand Down
2 changes: 1 addition & 1 deletion tagpdf-tree.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_tree_write_parenttree:
{
\bool_if:NTF \g_@@_mode_lua_bool
\sys_if_engine_luatex:TF
{
\@@_tree_lua_fill_parenttree:
}
Expand Down
115 changes: 56 additions & 59 deletions tagpdf-user.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -556,60 +556,57 @@
\keys_define:nn { @@ / show }
{ mc-current .code:n =
{
\bool_if:NTF \g_@@_mode_lua_bool
{
\sys_if_engine_luatex:T
{
\int_compare:nNnTF
{ -2147483647 }
=
{
\lua_now:e
{
tex.print
(tex.getattribute
(luatexbase.attributes.g_@@_mc_cnt_attr))
}
}
{
\lua_now:e
{
ltx.@@.trace.log
(
"mc-current:~no~MC~open,~current~abscnt
=\@@_get_mc_abs_cnt:"
,0
)
texio.write_nl("")
}
}
{
\lua_now:e
{
ltx.@@.trace.log
(
"mc-current:~abscnt=\@@_get_mc_abs_cnt:=="
..
tex.getattribute(luatexbase.attributes.g_@@_mc_cnt_attr)
..
"~=>tag="
..
tostring
(ltx.@@.func.get_tag_from
(tex.getattribute
(luatexbase.attributes.g_@@_mc_type_attr)))
..
"="
..
tex.getattribute
(luatexbase.attributes.g_@@_mc_type_attr)
,0
)
texio.write_nl("")
}
}
}
}
\sys_if_engine_luatex:TF
{
\int_compare:nNnTF
{ -2147483647 }
=
{
\lua_now:e
{
tex.print
(tex.getattribute
(luatexbase.attributes.g_@@_mc_cnt_attr))
}
}
{
\lua_now:e
{
ltx.@@.trace.log
(
"mc-current:~no~MC~open,~current~abscnt
=\@@_get_mc_abs_cnt:"
,0
)
texio.write_nl("")
}
}
{
\lua_now:e
{
ltx.@@.trace.log
(
"mc-current:~abscnt=\@@_get_mc_abs_cnt:=="
..
tex.getattribute(luatexbase.attributes.g_@@_mc_cnt_attr)
..
"~=>tag="
..
tostring
(ltx.@@.func.get_tag_from
(tex.getattribute
(luatexbase.attributes.g_@@_mc_type_attr)))
..
"="
..
tex.getattribute
(luatexbase.attributes.g_@@_mc_type_attr)
,0
)
texio.write_nl("")
}
}
}
{
\msg_note:nn{ tag }{ mc-current }
}
Expand Down Expand Up @@ -1165,7 +1162,7 @@

\AddToHook{begindocument/before}
{
\bool_if:NF \g_@@_mode_lua_bool
\sys_if_engine_luatex:F
{
\cs_if_exist:NT \@kernel@before@footins
{
Expand Down Expand Up @@ -1258,7 +1255,7 @@
\cs_new_protected:Npn \@@_exclude_headfoot_begin:
{
\bool_set_false:N \l_@@_para_bool
\bool_if:NTF \g_@@_mode_lua_bool
\sys_if_engine_luatex:TF
{
\tag_mc_end_push:
}
Expand All @@ -1273,7 +1270,7 @@
{
\tag_resume:n{headfoot}
\tag_mc_end:
\bool_if:NTF \g_@@_mode_lua_bool
\sys_if_engine_luatex:TF
{
\tag_mc_begin_pop:n{}
}
Expand All @@ -1288,7 +1285,7 @@
\cs_new_protected:Npn \@@_exclude_struct_headfoot_begin:n #1
{
\bool_set_false:N \l_@@_para_bool
\bool_if:NTF \g_@@_mode_lua_bool
\sys_if_engine_luatex:TF
{
\tag_mc_end_push:
}
Expand All @@ -1306,7 +1303,7 @@
\tag_resume:n{headfoot}
\tag_mc_end:
\tag_struct_end:
\bool_if:NTF \g_@@_mode_lua_bool
\sys_if_engine_luatex:TF
{
\tag_mc_begin_pop:n{}
}
Expand Down
10 changes: 4 additions & 6 deletions tagpdf.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,8 @@
%\section{Package options}
% \begin{macrocode}
%<*package>
\bool_new:N\g_@@_mode_lua_bool
\DeclareOption {luamode} { \sys_if_engine_luatex:T { \bool_gset_true:N \g__tag_mode_lua_bool } }
\DeclareOption {genericmode}{ \bool_gset_false:N\g__tag_mode_lua_bool }
\ExecuteOptions{luamode}
\DeclareOption {luamode} { }
\DeclareOption {genericmode}{ }
\ProcessOptions
% \end{macrocode}
% \section{Packages}
Expand Down Expand Up @@ -746,7 +744,7 @@
% \end{macrocode}
% \begin{macrocode}
%<*mcloading>
\bool_if:NTF \g_@@_mode_lua_bool
\sys_if_engine_luatex:TF
{
\RequirePackage {tagpdf-mc-code-lua}
}
Expand All @@ -755,7 +753,7 @@
}
%</mcloading>
%<*debug>
\bool_if:NTF \g_@@_mode_lua_bool
\sys_if_engine_luatex:TF
{
\RequirePackage {tagpdf-debug-lua}
}
Expand Down

0 comments on commit b5509a6

Please sign in to comment.