[latex3-commits] [latex3/tagpdf] faster-ref: replace local property_gset and property_ref (b08d036)

github at latex-project.org github at latex-project.org
Wed Sep 11 19:44:50 CEST 2024


Repository : https://github.com/latex3/tagpdf
On branch  : faster-ref
Link       : https://github.com/latex3/tagpdf/commit/b08d036792b02b47d5344e353080bc3560cf6470

>---------------------------------------------------------------

commit b08d036792b02b47d5344e353080bc3560cf6470
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Wed Sep 11 19:44:50 2024 +0200

    replace local property_gset and property_ref


>---------------------------------------------------------------

b08d036792b02b47d5344e353080bc3560cf6470
 tagpdf-checks.dtx     |  6 +++---
 tagpdf-mc-generic.dtx |  4 ++--
 tagpdf-mc-shared.dtx  |  2 +-
 tagpdf-struct.dtx     | 16 ++++++++--------
 tagpdf-tree.dtx       |  4 ++--
 tagpdf.dtx            | 17 ++++-------------
 6 files changed, 20 insertions(+), 29 deletions(-)

diff --git a/tagpdf-checks.dtx b/tagpdf-checks.dtx
index f838836..1128663 100644
--- a/tagpdf-checks.dtx
+++ b/tagpdf-checks.dtx
@@ -765,7 +765,7 @@
 \cs_new_protected:Npn \@@_check_struct_used:n #1 %#1 label
   {
     \prop_get:cnNT
-      {g_@@_struct_\@@_property_ref:enn{tagpdfstruct-#1}{tagstruct}{unknown}_prop}
+      {g_@@_struct_\property_ref:enn{tagpdfstruct-#1}{tagstruct}{unknown}_prop}
       {P}
       \l_@@_tmpa_tl
       {
@@ -953,7 +953,7 @@
           {
             \int_compare:nT
               {
-                \@@_property_ref:enn
+                \property_ref:enn
                   {mcid-####1}
                   {tagabspage}
                   {-1}
@@ -964,7 +964,7 @@
                \seq_gput_right:Ne \l_tmpa_seq
                  {
                    Page##1-####1-
-                   \@@_property_ref:enn
+                   \property_ref:enn
                      {mcid-####1}
                      {tagmcid}
                      {-1}
diff --git a/tagpdf-mc-generic.dtx b/tagpdf-mc-generic.dtx
index ff036b5..4093e3a 100644
--- a/tagpdf-mc-generic.dtx
+++ b/tagpdf-mc-generic.dtx
@@ -573,14 +573,14 @@
 %    \end{macrocode}
 % revert the attribute:
 %    \begin{macrocode}
-   \@@_property_gset:nnnn {tagmcid } { now }
+   \property_gset:nnnn {tagmcid } { now }
        {0}  { \int_use:N \g_@@_MCID_tmp_bypage_int }
    \cs_new_protected:Npn \@@_mc_bdc_mcid:nn #1 #2
      {
        \int_gincr:N \c at g_@@_MCID_abs_int
        \tl_set:Ne \l_@@_mc_ref_abspage_tl
          {
-           \@@_property_ref:enn %3 args
+           \property_ref:enn %3 args
              {
                mcid-\int_use:N \c at g_@@_MCID_abs_int
              }
diff --git a/tagpdf-mc-shared.dtx b/tagpdf-mc-shared.dtx
index 5bfe065..7e577e4 100644
--- a/tagpdf-mc-shared.dtx
+++ b/tagpdf-mc-shared.dtx
@@ -328,7 +328,7 @@
   {
     \@@_check_if_active_struct:T
       {
-        \tl_set:Ne  \l_@@_tmpa_tl { \@@_property_ref:nnn{tagpdf-#1}{tagmcabs}{} }
+        \tl_set:Ne  \l_@@_tmpa_tl { \property_ref:nnn{tagpdf-#1}{tagmcabs}{} }
         \tl_if_empty:NTF\l_@@_tmpa_tl
           {
             \msg_warning:nnn {tag} {mc-label-unknown} {#1}
diff --git a/tagpdf-struct.dtx b/tagpdf-struct.dtx
index 52e1e2a..4257acf 100644
--- a/tagpdf-struct.dtx
+++ b/tagpdf-struct.dtx
@@ -712,8 +712,8 @@
       /Type \c_space_tl /MCR \c_space_tl
       /Pg
         \c_space_tl
-      \pdf_pageobject_ref:n { \@@_property_ref:enn{mcid-#1}{tagabspage}{1} }
-       /MCID \c_space_tl \@@_property_ref:enn{mcid-#1}{tagmcid}{1}
+      \pdf_pageobject_ref:n { \property_ref:enn{mcid-#1}{tagabspage}{1} }
+       /MCID \c_space_tl \property_ref:enn{mcid-#1}{tagmcid}{1}
      >>
   }
 %</package>  
@@ -1057,7 +1057,7 @@
             #1 %
           }
           {
-            \pdf_pageobject_ref:n { \@@_property_ref:nnn {@tag at objr@page@#2 }{ tagabspage }{1} }
+            \pdf_pageobject_ref:n { \property_ref:nnn {@tag at objr@page@#2 }{ tagabspage }{1} }
           }
         % add the parent obj number to the parent tree:
         \exp_args:Nne
@@ -1792,16 +1792,16 @@
     \@@_check_if_active_struct:T
       {
         \prop_if_exist:cTF
-          { g_@@_struct_\@@_property_ref:enn{tagpdfstruct-#1}{tagstruct}{unknown}_prop } %
+          { g_@@_struct_\property_ref:enn{tagpdfstruct-#1}{tagstruct}{unknown}_prop } %
           {
             \@@_check_struct_used:n {#1}
             %add the label structure as kid to the current structure (can be the root)
             \@@_struct_kid_struct_gput_right:ee
               { \g_@@_struct_stack_current_tl }
-              { \@@_property_ref:enn{tagpdfstruct-#1}{tagstruct}{1} }
+              { \property_ref:enn{tagpdfstruct-#1}{tagstruct}{1} }
             %add the current structure to the labeled one as parents
             \@@_prop_gput:cne
-              { g_@@_struct_\@@_property_ref:enn{tagpdfstruct-#1}{tagstruct}{1}_prop }
+              { g_@@_struct_\property_ref:enn{tagpdfstruct-#1}{tagstruct}{1}_prop }
               { P }
               {
                 \pdf_object_ref_indexed:nn { @@/struct } { \g_@@_struct_stack_current_tl }
@@ -1810,7 +1810,7 @@
 % debug code
 %    \begin{macrocode}
 %<debug>           \prop_gput:cne
-%<debug>             { g_@@_struct_debug_\@@_property_ref:enn{tagpdfstruct-#1}{tagstruct}{1}_prop }
+%<debug>             { g_@@_struct_debug_\property_ref:enn{tagpdfstruct-#1}{tagstruct}{1}_prop }
 %<debug>             { P }
 %<debug>             { 
 %<debug>               parent~structure:~\g_@@_struct_stack_current_tl\c_space_tl=~
@@ -1822,7 +1822,7 @@
 %   the global tl-vars:
 %    \begin{macrocode}
              \@@_struct_get_parentrole:eNN  
-              {\@@_property_ref:enn{tagpdfstruct-#1}{tagstruct}{1}}
+              {\property_ref:enn{tagpdfstruct-#1}{tagstruct}{1}}
               \l_@@_tmpa_tl
               \l_@@_tmpb_tl
             \@@_check_parent_child:VVVVN
diff --git a/tagpdf-tree.dtx b/tagpdf-tree.dtx
index e5c702f..3b17dae 100644
--- a/tagpdf-tree.dtx
+++ b/tagpdf-tree.dtx
@@ -367,11 +367,11 @@
           {
             %mcid####1
             \int_compare:nT
-              {\@@_property_ref:enn{mcid-####1}{tagabspage}{-1}=##1} %mcid is on current page
+              {\property_ref:enn{mcid-####1}{tagabspage}{-1}=##1} %mcid is on current page
               {% yes
                 \prop_put:Nee
                   \l_@@_tmpa_prop
-                  {\@@_property_ref:enn{mcid-####1}{tagmcid}{-1}}
+                  {\property_ref:enn{mcid-####1}{tagmcid}{-1}}
                   {\prop_item:Nn \g_@@_mc_parenttree_prop {####1}}
               }
           }
diff --git a/tagpdf.dtx b/tagpdf.dtx
index fbddd94..d4f40a7 100644
--- a/tagpdf.dtx
+++ b/tagpdf.dtx
@@ -384,16 +384,7 @@
 % To ease transition to properties we setup internal definition. They can be replaced
 % by the property definitions once that is released.
 % %** do it!
-% \begin{macro}{\@@_property_gset:nnnn,\@@_property_ref:nnn}
-% For the non-shipout code we need also the option to reset property
-%    \begin{macrocode}
-    \cs_new_eq:NN \@@_property_gset:nnnn \property_gset:nnnn
-%    \end{macrocode}
-% The command to reference while giving a local default.
-%    \begin{macrocode}
-    \cs_new_eq:NN \@@_property_ref:nnn \property_ref:nnn 
-    \cs_new_eq:NN \@@_property_ref:nn \property_ref:nn 
-%    \end{macrocode}
+% \begin{macro}{}
 % The command to record     
 %    \begin{macrocode}
     \cs_new_protected:Npn \@@_property_record:nn #1#2
@@ -406,8 +397,8 @@
 %    \end{macrocode}
 % And a few variants
 %    \begin{macrocode}
-\cs_generate_variant:Nn \@@_property_ref:nnn {enn}
-\cs_generate_variant:Nn \@@_property_ref:nn {en}
+\cs_generate_variant:Nn \property_ref:nnn {enn}
+\cs_generate_variant:Nn \property_ref:nn  {en}
 \cs_generate_variant:Nn \@@_property_record:nn {en,eV}
 %    \end{macrocode}
 % \end{macro}
@@ -418,7 +409,7 @@
 %    \begin{macrocode}
 \cs_new:Npn \@@_property_ref_lastpage:nn #1 #2
   {
-    \@@_property_ref:nnn {@tag at LastPage}{#1}{#2}
+    \property_ref:nnn {@tag at LastPage}{#1}{#2}
   }
 %    \end{macrocode}
 %\end{macro}





More information about the latex3-commits mailing list.