diff options
author | Karl Berry <karl@freefriends.org> | 2022-02-12 21:18:16 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-02-12 21:18:16 +0000 |
commit | 37427a439f796a7ef14eb367dcced3cf4898442c (patch) | |
tree | 3c8c75c4d5c6d3cff3d2c8cb6d4089d38e732c3d /Master/texmf-dist/tex/latex/zref-clever | |
parent | 2233f3aaaa222731e5a13bbc44d4c64958838137 (diff) |
zref-clever (12feb22)
git-svn-id: svn://tug.org/texlive/trunk@61994 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/zref-clever')
-rw-r--r-- | Master/texmf-dist/tex/latex/zref-clever/zref-clever.sty | 1017 |
1 files changed, 532 insertions, 485 deletions
diff --git a/Master/texmf-dist/tex/latex/zref-clever/zref-clever.sty b/Master/texmf-dist/tex/latex/zref-clever/zref-clever.sty index 072951bb14e..e858e351280 100644 --- a/Master/texmf-dist/tex/latex/zref-clever/zref-clever.sty +++ b/Master/texmf-dist/tex/latex/zref-clever/zref-clever.sty @@ -53,7 +53,7 @@ }% \endinput }% -\ProvidesExplPackage {zref-clever} {2022-02-07} {0.2.1-alpha} +\ProvidesExplPackage {zref-clever} {2022-02-11} {0.2.2-alpha} {Clever LaTeX cross-references based on zref} \RequirePackage { zref-base } \RequirePackage { zref-user } @@ -285,6 +285,11 @@ Option~'check'~requested~\msg_line_context:.~ But~package~'zref-check'~is~not~loaded,~can't~run~the~checks. } +\msg_new:nnn { zref-clever } { zref-check-too-old } + { + Option~'check'~requested~\msg_line_context:.~ + But~'zref-check'~newer~than~'#1'~is~required,~can't~run~the~checks. + } \msg_new:nnn { zref-clever } { missing-type } { Reference~type~undefined~for~label~'#1'~\msg_line_context:. } \msg_new:nnn { zref-clever } { missing-property } @@ -357,26 +362,87 @@ \__zrefclever_opt_varname_lang_type:nnnn { eenn , eeen } \cs_new:Npn \__zrefclever_opt_varname_fallback:nn #1#2 { c__zrefclever_opt_fallback_ #1 _ #2 } +\cs_new:Npn \__zrefclever_opt_var_set_bool:n #1 + { \cs_to_str:N #1 _is_set_bool } +\cs_new_protected:Npn \__zrefclever_opt_tl_set:Nn #1#2 + { + \tl_if_exist:NF #1 + { \tl_new:N #1 } + \tl_set:Nn #1 {#2} + \bool_if_exist:cF { \__zrefclever_opt_var_set_bool:n {#1} } + { \bool_new:c { \__zrefclever_opt_var_set_bool:n {#1} } } + \bool_set_true:c { \__zrefclever_opt_var_set_bool:n {#1} } + } +\cs_generate_variant:Nn \__zrefclever_opt_tl_set:Nn { cn } +\cs_new_protected:Npn \__zrefclever_opt_tl_clear:N #1 + { + \tl_if_exist:NF #1 + { \tl_new:N #1 } + \tl_clear:N #1 + \bool_if_exist:cF { \__zrefclever_opt_var_set_bool:n {#1} } + { \bool_new:c { \__zrefclever_opt_var_set_bool:n {#1} } } + \bool_set_true:c { \__zrefclever_opt_var_set_bool:n {#1} } + } +\cs_generate_variant:Nn \__zrefclever_opt_tl_clear:N { c } +\cs_new_protected:Npn \__zrefclever_opt_tl_gset:Nn #1#2 + { + \tl_if_exist:NF #1 + { \tl_new:N #1 } + \tl_gset:Nn #1 {#2} + } +\cs_generate_variant:Nn \__zrefclever_opt_tl_gset:Nn { cn } +\cs_new_protected:Npn \__zrefclever_opt_tl_gclear:N #1 + { + \tl_if_exist:NF #1 + { \tl_new:N #1 } + \tl_gclear:N #1 + } +\cs_generate_variant:Nn \__zrefclever_opt_tl_gclear:N { c } \cs_new_protected:Npn \__zrefclever_opt_tl_unset:N #1 - { \tl_set_eq:NN #1 \c_novalue_tl } -\cs_new_protected:Npn \__zrefclever_opt_tl_gunset:N #1 - { \tl_gset_eq:NN #1 \c_novalue_tl } + { + \tl_if_exist:NT #1 + { + \tl_clear:N #1 % ? + \bool_if_exist:cTF { \__zrefclever_opt_var_set_bool:n {#1} } + { \bool_set_false:c { \__zrefclever_opt_var_set_bool:n {#1} } } + { \bool_new:c { \__zrefclever_opt_var_set_bool:n {#1} } } + } + } \cs_generate_variant:Nn \__zrefclever_opt_tl_unset:N { c } -\cs_generate_variant:Nn \__zrefclever_opt_tl_gunset:N { c } \prg_new_conditional:Npnn \__zrefclever_opt_tl_if_set:N #1 { F , TF } { - \bool_lazy_and:nnTF - { \tl_if_exist_p:N #1 } - { ! \tl_if_novalue_p:n {#1} } - { \prg_return_true: } + \tl_if_exist:NTF #1 + { + \bool_if_exist:cTF { \__zrefclever_opt_var_set_bool:n {#1} } + { + \bool_if:cTF { \__zrefclever_opt_var_set_bool:n {#1} } + { \prg_return_true: } + { \prg_return_false: } + } + { \prg_return_true: } + } { \prg_return_false: } } \cs_new_protected:Npn \__zrefclever_opt_tl_gset_if_new:Nn #1#2 { \__zrefclever_opt_tl_if_set:NF #1 - { \tl_gset:Nn #1 {#2} } + { + \tl_if_exist:NF #1 + { \tl_new:N #1 } + \tl_gset:Nn #1 {#2} + } } \cs_generate_variant:Nn \__zrefclever_opt_tl_gset_if_new:Nn { cn } +\cs_new_protected:Npn \__zrefclever_opt_tl_gclear_if_new:N #1 + { + \__zrefclever_opt_tl_if_set:NF #1 + { + \tl_if_exist:NF #1 + { \tl_new:N #1 } + \tl_gclear:N #1 + } + } +\cs_generate_variant:Nn \__zrefclever_opt_tl_gclear_if_new:N { c } \prg_new_protected_conditional:Npnn \__zrefclever_opt_tl_get:NN #1#2 { F } { \__zrefclever_opt_tl_if_set:NTF #1 @@ -392,14 +458,48 @@ { \seq_set_split:Nnn #1 { , } {#2} } \cs_new_protected:Npn \__zrefclever_opt_seq_gset_clist_split:Nn #1#2 { \seq_gset_split:Nnn #1 { , } {#2} } +\cs_new_protected:Npn \__zrefclever_opt_seq_set_eq:NN #1#2 + { + \seq_if_exist:NF #1 + { \seq_new:N #1 } + \seq_set_eq:NN #1 #2 + \bool_if_exist:cF { \__zrefclever_opt_var_set_bool:n {#1} } + { \bool_new:c { \__zrefclever_opt_var_set_bool:n {#1} } } + \bool_set_true:c { \__zrefclever_opt_var_set_bool:n {#1} } + } +\cs_generate_variant:Nn \__zrefclever_opt_seq_set_eq:NN { cN } +\cs_new_protected:Npn \__zrefclever_opt_seq_gset_eq:NN #1#2 + { + \seq_if_exist:NF #1 + { \seq_new:N #1 } + \seq_gset_eq:NN #1 #2 + } +\cs_generate_variant:Nn \__zrefclever_opt_seq_gset_eq:NN { cN } \cs_new_protected:Npn \__zrefclever_opt_seq_unset:N #1 - { \cs_set_eq:NN #1 \scan_stop: } -\cs_new_protected:Npn \__zrefclever_opt_seq_gunset:N #1 - { \cs_gset_eq:NN #1 \scan_stop: } + { + \seq_if_exist:NT #1 + { + \seq_clear:N #1 % ? + \bool_if_exist:cTF { \__zrefclever_opt_var_set_bool:n {#1} } + { \bool_set_false:c { \__zrefclever_opt_var_set_bool:n {#1} } } + { \bool_new:c { \__zrefclever_opt_var_set_bool:n {#1} } } + } + } \cs_generate_variant:Nn \__zrefclever_opt_seq_unset:N { c } -\cs_generate_variant:Nn \__zrefclever_opt_seq_gunset:N { c } \prg_new_conditional:Npnn \__zrefclever_opt_seq_if_set:N #1 { F , TF } - { \seq_if_exist:NTF #1 { \prg_return_true: } { \prg_return_false: } } + { + \seq_if_exist:NTF #1 + { + \bool_if_exist:cTF { \__zrefclever_opt_var_set_bool:n {#1} } + { + \bool_if:cTF { \__zrefclever_opt_var_set_bool:n {#1} } + { \prg_return_true: } + { \prg_return_false: } + } + { \prg_return_true: } + } + { \prg_return_false: } + } \prg_generate_conditional_variant:Nnn \__zrefclever_opt_seq_if_set:N { c } { F , TF } \prg_new_protected_conditional:Npnn \__zrefclever_opt_seq_get:NN #1#2 { F } @@ -414,15 +514,66 @@ \prg_generate_conditional_variant:Nnn \__zrefclever_opt_seq_get:NN { cN } { F } \cs_new_protected:Npn \__zrefclever_opt_bool_unset:N #1 - { \cs_set_eq:NN #1 \scan_stop: } -\cs_new_protected:Npn \__zrefclever_opt_bool_gunset:N #1 - { \cs_gset_eq:NN #1 \scan_stop: } + { + \bool_if_exist:NT #1 + { + % \bool_set_false:N #1 % ? + \bool_if_exist:cTF { \__zrefclever_opt_var_set_bool:n {#1} } + { \bool_set_false:c { \__zrefclever_opt_var_set_bool:n {#1} } } + { \bool_new:c { \__zrefclever_opt_var_set_bool:n {#1} } } + } + } \cs_generate_variant:Nn \__zrefclever_opt_bool_unset:N { c } -\cs_generate_variant:Nn \__zrefclever_opt_bool_gunset:N { c } \prg_new_conditional:Npnn \__zrefclever_opt_bool_if_set:N #1 { F , TF } - { \bool_if_exist:NTF #1 { \prg_return_true: } { \prg_return_false: } } + { + \bool_if_exist:NTF #1 + { + \bool_if_exist:cTF { \__zrefclever_opt_var_set_bool:n {#1} } + { + \bool_if:cTF { \__zrefclever_opt_var_set_bool:n {#1} } + { \prg_return_true: } + { \prg_return_false: } + } + { \prg_return_true: } + } + { \prg_return_false: } + } \prg_generate_conditional_variant:Nnn \__zrefclever_opt_bool_if_set:N { c } { F , TF } +\cs_new_protected:Npn \__zrefclever_opt_bool_set_true:N #1 + { + \bool_if_exist:NF #1 + { \bool_new:N #1 } + \bool_set_true:N #1 + \bool_if_exist:cF { \__zrefclever_opt_var_set_bool:n {#1} } + { \bool_new:c { \__zrefclever_opt_var_set_bool:n {#1} } } + \bool_set_true:c { \__zrefclever_opt_var_set_bool:n {#1} } + } +\cs_generate_variant:Nn \__zrefclever_opt_bool_set_true:N { c } +\cs_new_protected:Npn \__zrefclever_opt_bool_set_false:N #1 + { + \bool_if_exist:NF #1 + { \bool_new:N #1 } + \bool_set_false:N #1 + \bool_if_exist:cF { \__zrefclever_opt_var_set_bool:n {#1} } + { \bool_new:c { \__zrefclever_opt_var_set_bool:n {#1} } } + \bool_set_true:c { \__zrefclever_opt_var_set_bool:n {#1} } + } +\cs_generate_variant:Nn \__zrefclever_opt_bool_set_false:N { c } +\cs_new_protected:Npn \__zrefclever_opt_bool_gset_true:N #1 + { + \bool_if_exist:NF #1 + { \bool_new:N #1 } + \bool_gset_true:N #1 + } +\cs_generate_variant:Nn \__zrefclever_opt_bool_gset_true:N { c } +\cs_new_protected:Npn \__zrefclever_opt_bool_gset_false:N #1 + { + \bool_if_exist:NF #1 + { \bool_new:N #1 } + \bool_gset_false:N #1 + } +\cs_generate_variant:Nn \__zrefclever_opt_bool_gset_false:N { c } \prg_new_protected_conditional:Npnn \__zrefclever_opt_bool_get:NN #1#2 { F } { \__zrefclever_opt_bool_if_set:NTF #1 @@ -447,16 +598,18 @@ \tl_new:N \l__zrefclever_lang_decl_case_tl \seq_new:N \l__zrefclever_lang_declension_seq \seq_new:N \l__zrefclever_lang_gender_seq -\seq_const_from_clist:Nn - \c__zrefclever_rf_opts_tl_not_type_specific_seq +\seq_new:N \g__zrefclever_rf_opts_tl_not_type_specific_seq +\seq_gset_from_clist:Nn + \g__zrefclever_rf_opts_tl_not_type_specific_seq { tpairsep , tlistsep , tlastsep , notesep , } -\seq_const_from_clist:Nn - \c__zrefclever_rf_opts_tl_maybe_type_specific_seq +\seq_new:N \g__zrefclever_rf_opts_tl_maybe_type_specific_seq +\seq_gset_from_clist:Nn + \g__zrefclever_rf_opts_tl_maybe_type_specific_seq { namesep , pairsep , @@ -466,8 +619,9 @@ namefont , reffont , } -\seq_const_from_clist:Nn - \c__zrefclever_rf_opts_seq_refbounds_seq +\seq_new:N \g__zrefclever_rf_opts_seq_refbounds_seq +\seq_gset_from_clist:Nn + \g__zrefclever_rf_opts_seq_refbounds_seq { refbounds-first , refbounds-first-sg , @@ -480,15 +634,17 @@ refbounds-last-pe , refbounds-last-re , } -\seq_const_from_clist:Nn - \c__zrefclever_rf_opts_bool_maybe_type_specific_seq +\seq_new:N \g__zrefclever_rf_opts_bool_maybe_type_specific_seq +\seq_gset_from_clist:Nn + \g__zrefclever_rf_opts_bool_maybe_type_specific_seq { cap , abbrev , rangetopair , } -\seq_const_from_clist:Nn - \c__zrefclever_rf_opts_tl_type_names_seq +\seq_new:N \g__zrefclever_rf_opts_tl_type_names_seq +\seq_gset_from_clist:Nn + \g__zrefclever_rf_opts_tl_type_names_seq { Name-sg , name-sg , @@ -499,14 +655,14 @@ Name-pl-ab , name-pl-ab , } -\seq_new:N \c__zrefclever_rf_opts_tl_typesetup_seq -\seq_gconcat:NNN \c__zrefclever_rf_opts_tl_typesetup_seq - \c__zrefclever_rf_opts_tl_maybe_type_specific_seq - \c__zrefclever_rf_opts_tl_type_names_seq -\seq_new:N \c__zrefclever_rf_opts_tl_reference_seq -\seq_gconcat:NNN \c__zrefclever_rf_opts_tl_reference_seq - \c__zrefclever_rf_opts_tl_not_type_specific_seq - \c__zrefclever_rf_opts_tl_maybe_type_specific_seq +\seq_new:N \g__zrefclever_rf_opts_tl_typesetup_seq +\seq_gconcat:NNN \g__zrefclever_rf_opts_tl_typesetup_seq + \g__zrefclever_rf_opts_tl_maybe_type_specific_seq + \g__zrefclever_rf_opts_tl_type_names_seq +\seq_new:N \g__zrefclever_rf_opts_tl_reference_seq +\seq_gconcat:NNN \g__zrefclever_rf_opts_tl_reference_seq + \g__zrefclever_rf_opts_tl_not_type_specific_seq + \g__zrefclever_rf_opts_tl_maybe_type_specific_seq \clist_map_inline:nn { reference , @@ -524,44 +680,76 @@ refbounds-first-pb = {##1} , refbounds-first-rb = {##1} , } , - +refbounds-first .default:x = \c_novalue_tl , +refbounds-mid .meta:n = { refbounds-mid = {##1} , refbounds-mid-rb = {##1} , refbounds-mid-re = {##1} , } , - +refbounds-mid .default:x = \c_novalue_tl , +refbounds-last .meta:n = { refbounds-last = {##1} , refbounds-last-pe = {##1} , refbounds-last-re = {##1} , } , - +refbounds-last .default:x = \c_novalue_tl , +refbounds-rb .meta:n = { refbounds-first-rb = {##1} , refbounds-mid-rb = {##1} , } , - +refbounds-rb .default:x = \c_novalue_tl , +refbounds-re .meta:n = { refbounds-mid-re = {##1} , refbounds-last-re = {##1} , } , - +refbounds-re .default:x = \c_novalue_tl , +refbounds .meta:n = { +refbounds-first = {##1} , +refbounds-mid = {##1} , +refbounds-last = {##1} , } , - +refbounds .default:x = \c_novalue_tl , refbounds .meta:n = { +refbounds = {##1} } , - refbounds .default:x = \c_novalue_tl , } } +\clist_map_inline:nn + { + reference , + typesetup , + } + { + \keys_define:nn { zref-clever/ #1 } + { + +refbounds-first .default:o = \c_novalue_tl , + +refbounds-mid .default:o = \c_novalue_tl , + +refbounds-last .default:o = \c_novalue_tl , + +refbounds-rb .default:o = \c_novalue_tl , + +refbounds-re .default:o = \c_novalue_tl , + +refbounds .default:o = \c_novalue_tl , + refbounds .default:o = \c_novalue_tl , + } + } +\clist_map_inline:nn + { + langsetup , + langfile , + } + { + \keys_define:nn { zref-clever/ #1 } + { + +refbounds-first .value_required:n = true , + +refbounds-mid .value_required:n = true , + +refbounds-last .value_required:n = true , + +refbounds-rb .value_required:n = true , + +refbounds-re .value_required:n = true , + +refbounds .value_required:n = true , + refbounds .value_required:n = true , + } + } +\tl_new:N \l__zrefclever_ref_language_tl +\tl_new:N \l__zrefclever_current_language_tl +\tl_new:N \l__zrefclever_main_language_tl +\tl_new:N \l_zrefclever_ref_language_tl +\tl_set:Nn \l_zrefclever_ref_language_tl { \l__zrefclever_ref_language_tl } \cs_new:Npn \__zrefclever_language_varname:n #1 { g__zrefclever_declared_language_ #1 _tl } \cs_set_eq:NN \zrefclever_language_varname:n @@ -599,6 +787,7 @@ { \__zrefclever_language_if_declared:nTF {#2} { + \tl_new:c { \__zrefclever_language_varname:n {#1} } \tl_gset:cx { \__zrefclever_language_varname:n {#1} } { \tl_use:c { \__zrefclever_language_varname:n {#2} } } } @@ -610,6 +799,11 @@ { declension .code:n = { + \seq_new:c + { + \__zrefclever_opt_varname_language:enn + { \l__zrefclever_setup_language_tl } { declension } { seq } + } \seq_gset_from_clist:cn { \__zrefclever_opt_varname_language:enn @@ -620,6 +814,11 @@ declension .value_required:n = true , gender .code:n = { + \seq_new:c + { + \__zrefclever_opt_varname_language:enn + { \l__zrefclever_setup_language_tl } { gender } { seq } + } \seq_gset_from_clist:cn { \__zrefclever_opt_varname_language:enn @@ -631,6 +830,11 @@ allcaps .choices:nn = { true , false } { + \bool_new:c + { + \__zrefclever_opt_varname_language:enn + { \l__zrefclever_setup_language_tl } { allcaps } { bool } + } \use:c { bool_gset_ \l_keys_choice_tl :c } { \__zrefclever_opt_varname_language:enn @@ -827,7 +1031,7 @@ } , case .value_required:n = true , - gender .default:x = \c_novalue_tl , + gender .value_required:n = true , gender .code:n = { \seq_if_empty:NTF \l__zrefclever_lang_gender_seq @@ -842,20 +1046,27 @@ { option-only-type-specific } { gender } } { - \tl_if_novalue:nF {#1} + \seq_clear:N \l_tmpa_seq + \clist_map_inline:nn {#1} { - \seq_clear:N \l_tmpa_seq - \clist_map_inline:nn {#1} + \seq_if_in:NnTF \l__zrefclever_lang_gender_seq {##1} + { \seq_put_right:Nn \l_tmpa_seq {##1} } { - \seq_if_in:NnTF \l__zrefclever_lang_gender_seq {##1} - { \seq_put_right:Nn \l_tmpa_seq {##1} } - { - \msg_info:nnxx { zref-clever } - { gender-not-declared } - { \l__zrefclever_setup_language_tl } {##1} - } + \msg_info:nnxx { zref-clever } + { gender-not-declared } + { \l__zrefclever_setup_language_tl } {##1} } - \__zrefclever_opt_seq_if_set:cF + } + \__zrefclever_opt_seq_if_set:cF + { + \__zrefclever_opt_varname_lang_type:eenn + { \l__zrefclever_setup_language_tl } + { \l__zrefclever_setup_type_tl } + { gender } + { seq } + } + { + \seq_new:c { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } @@ -863,42 +1074,37 @@ { gender } { seq } } + \seq_gset_eq:cN { - \seq_gset_eq:cN - { - \__zrefclever_opt_varname_lang_type:eenn - { \l__zrefclever_setup_language_tl } - { \l__zrefclever_setup_type_tl } - { gender } - { seq } - } - \l_tmpa_seq + \__zrefclever_opt_varname_lang_type:eenn + { \l__zrefclever_setup_language_tl } + { \l__zrefclever_setup_type_tl } + { gender } + { seq } } + \l_tmpa_seq } } } } , } \seq_map_inline:Nn - \c__zrefclever_rf_opts_tl_not_type_specific_seq + \g__zrefclever_rf_opts_tl_not_type_specific_seq { \keys_define:nn { zref-clever/langfile } { - #1 .default:x = \c_novalue_tl , + #1 .value_required:n = true , #1 .code:n = { \tl_if_empty:NTF \l__zrefclever_setup_type_tl { - \tl_if_novalue:nF {##1} + \__zrefclever_opt_tl_gset_if_new:cn { - \__zrefclever_opt_tl_gset_if_new:cn - { - \__zrefclever_opt_varname_lang_default:enn - { \l__zrefclever_setup_language_tl } - {#1} { tl } - } - {##1} + \__zrefclever_opt_varname_lang_default:enn + { \l__zrefclever_setup_language_tl } + {#1} { tl } } + {##1} } { \msg_info:nnn { zref-clever } @@ -908,44 +1114,39 @@ } } \seq_map_inline:Nn - \c__zrefclever_rf_opts_tl_maybe_type_specific_seq + \g__zrefclever_rf_opts_tl_maybe_type_specific_seq { \keys_define:nn { zref-clever/langfile } { - #1 .default:x = \c_novalue_tl , + #1 .value_required:n = true , #1 .code:n = { \tl_if_empty:NTF \l__zrefclever_setup_type_tl { - \tl_if_novalue:nF {##1} + \__zrefclever_opt_tl_gset_if_new:cn { - \__zrefclever_opt_tl_gset_if_new:cn - { - \__zrefclever_opt_varname_lang_default:enn - { \l__zrefclever_setup_language_tl } - {#1} { tl } - } - {##1} + \__zrefclever_opt_varname_lang_default:enn + { \l__zrefclever_setup_language_tl } + {#1} { tl } } + {##1} } { - \tl_if_novalue:nF {##1} + \__zrefclever_opt_tl_gset_if_new:cn { - \__zrefclever_opt_tl_gset_if_new:cn - { - \__zrefclever_opt_varname_lang_type:eenn - { \l__zrefclever_setup_language_tl } - { \l__zrefclever_setup_type_tl } - {#1} { tl } - } - {##1} + \__zrefclever_opt_varname_lang_type:eenn + { \l__zrefclever_setup_language_tl } + { \l__zrefclever_setup_type_tl } + {#1} { tl } } + {##1} } } , } } \keys_define:nn { zref-clever/langfile } { + endrange .value_required:n = true , endrange .code:n = { \str_case:nnF {#1} @@ -954,38 +1155,34 @@ { \tl_if_empty:NTF \l__zrefclever_setup_type_tl { - \__zrefclever_opt_tl_gset_if_new:cn + \__zrefclever_opt_tl_gclear_if_new:c { \__zrefclever_opt_varname_lang_default:enn { \l__zrefclever_setup_language_tl } { endrangefunc } { tl } } - { } - \__zrefclever_opt_tl_gset_if_new:cn + \__zrefclever_opt_tl_gclear_if_new:c { \__zrefclever_opt_varname_lang_default:enn { \l__zrefclever_setup_language_tl } { endrangeprop } { tl } } - { } } { - \__zrefclever_opt_tl_gset_if_new:cn + \__zrefclever_opt_tl_gclear_if_new:c { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } { \l__zrefclever_setup_type_tl } { endrangefunc } { tl } } - { } - \__zrefclever_opt_tl_gset_if_new:cn + \__zrefclever_opt_tl_gclear_if_new:c { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } { \l__zrefclever_setup_type_tl } { endrangeprop } { tl } } - { } } } @@ -1000,13 +1197,12 @@ { endrangefunc } { tl } } { __zrefclever_get_endrange_stripprefix } - \__zrefclever_opt_tl_gset_if_new:cn + \__zrefclever_opt_tl_gclear_if_new:c { \__zrefclever_opt_varname_lang_default:enn { \l__zrefclever_setup_language_tl } { endrangeprop } { tl } } - { } } { \__zrefclever_opt_tl_gset_if_new:cn @@ -1017,14 +1213,13 @@ { endrangefunc } { tl } } { __zrefclever_get_endrange_stripprefix } - \__zrefclever_opt_tl_gset_if_new:cn + \__zrefclever_opt_tl_gclear_if_new:c { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } { \l__zrefclever_setup_type_tl } { endrangeprop } { tl } } - { } } } @@ -1039,13 +1234,12 @@ { endrangefunc } { tl } } { __zrefclever_get_endrange_pagecomp } - \__zrefclever_opt_tl_gset_if_new:cn + \__zrefclever_opt_tl_gclear_if_new:c { \__zrefclever_opt_varname_lang_default:enn { \l__zrefclever_setup_language_tl } { endrangeprop } { tl } } - { } } { \__zrefclever_opt_tl_gset_if_new:cn @@ -1056,14 +1250,13 @@ { endrangefunc } { tl } } { __zrefclever_get_endrange_pagecomp } - \__zrefclever_opt_tl_gset_if_new:cn + \__zrefclever_opt_tl_gclear_if_new:c { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } { \l__zrefclever_setup_type_tl } { endrangeprop } { tl } } - { } } } @@ -1078,13 +1271,12 @@ { endrangefunc } { tl } } { __zrefclever_get_endrange_pagecomptwo } - \__zrefclever_opt_tl_gset_if_new:cn + \__zrefclever_opt_tl_gclear_if_new:c { \__zrefclever_opt_varname_lang_default:enn { \l__zrefclever_setup_language_tl } { endrangeprop } { tl } } - { } } { \__zrefclever_opt_tl_gset_if_new:cn @@ -1095,19 +1287,15 @@ { endrangefunc } { tl } } { __zrefclever_get_endrange_pagecomptwo } - \__zrefclever_opt_tl_gset_if_new:cn + \__zrefclever_opt_tl_gclear_if_new:c { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } { \l__zrefclever_setup_type_tl } { endrangeprop } { tl } } - { } } } - - { unset } - { } } { \tl_if_empty:nTF {#1} @@ -1161,14 +1349,13 @@ } } } , - endrange .value_required:n = true , } \seq_map_inline:Nn - \c__zrefclever_rf_opts_tl_type_names_seq + \g__zrefclever_rf_opts_tl_type_names_seq { \keys_define:nn { zref-clever/langfile } { - #1 .default:x = \c_novalue_tl , + #1 .value_required:n = true , #1 .code:n = { \tl_if_empty:NTF \l__zrefclever_setup_type_tl @@ -1179,113 +1366,101 @@ { \tl_if_empty:NTF \l__zrefclever_lang_decl_case_tl { - \tl_if_novalue:nF {##1} + \__zrefclever_opt_tl_gset_if_new:cn { - \__zrefclever_opt_tl_gset_if_new:cn - { - \__zrefclever_opt_varname_lang_type:eenn - { \l__zrefclever_setup_language_tl } - { \l__zrefclever_setup_type_tl } - {#1} { tl } - } - {##1} + \__zrefclever_opt_varname_lang_type:eenn + { \l__zrefclever_setup_language_tl } + { \l__zrefclever_setup_type_tl } + {#1} { tl } } + {##1} } { - \tl_if_novalue:nF {##1} + \__zrefclever_opt_tl_gset_if_new:cn { - \__zrefclever_opt_tl_gset_if_new:cn - { - \__zrefclever_opt_varname_lang_type:eeen - { \l__zrefclever_setup_language_tl } - { \l__zrefclever_setup_type_tl } - { \l__zrefclever_lang_decl_case_tl - #1 } { tl } - } - {##1} + \__zrefclever_opt_varname_lang_type:eeen + { \l__zrefclever_setup_language_tl } + { \l__zrefclever_setup_type_tl } + { \l__zrefclever_lang_decl_case_tl - #1 } { tl } } + {##1} } } } , } } \seq_map_inline:Nn - \c__zrefclever_rf_opts_seq_refbounds_seq + \g__zrefclever_rf_opts_seq_refbounds_seq { \keys_define:nn { zref-clever/langfile } { - #1 .default:x = \c_novalue_tl , + #1 .value_required:n = true , #1 .code:n = { \tl_if_empty:NTF \l__zrefclever_setup_type_tl { - \tl_if_novalue:nF {##1} + \__zrefclever_opt_seq_if_set:cF + { + \__zrefclever_opt_varname_lang_default:enn + { \l__zrefclever_setup_language_tl } {#1} { seq } + } { - \__zrefclever_opt_seq_if_set:cF + \seq_gclear:N \g_tmpa_seq + \__zrefclever_opt_seq_gset_clist_split:Nn + \g_tmpa_seq {##1} + \bool_lazy_or:nnTF + { \tl_if_empty_p:n {##1} } { - \__zrefclever_opt_varname_lang_default:enn - { \l__zrefclever_setup_language_tl } {#1} { seq } + \int_compare_p:nNn + { \seq_count:N \g_tmpa_seq } = { 4 } } { - \seq_gclear:N \g_tmpa_seq - \__zrefclever_opt_seq_gset_clist_split:Nn - \g_tmpa_seq {##1} - \bool_lazy_or:nnTF - { \tl_if_empty_p:n {##1} } - { - \int_compare_p:nNn - { \seq_count:N \g_tmpa_seq } = { 4 } - } + \__zrefclever_opt_seq_gset_eq:cN { - \seq_gset_eq:cN - { - \__zrefclever_opt_varname_lang_default:enn - { \l__zrefclever_setup_language_tl } - {#1} { seq } - } - \g_tmpa_seq - } - { - \msg_info:nnxx { zref-clever } - { refbounds-must-be-four } - {#1} { \seq_count:N \g_tmpa_seq } + \__zrefclever_opt_varname_lang_default:enn + { \l__zrefclever_setup_language_tl } + {#1} { seq } } + \g_tmpa_seq + } + { + \msg_info:nnxx { zref-clever } + { refbounds-must-be-four } + {#1} { \seq_count:N \g_tmpa_seq } } } } { - \tl_if_novalue:nF {##1} + \__zrefclever_opt_seq_if_set:cF + { + \__zrefclever_opt_varname_lang_type:eenn + { \l__zrefclever_setup_language_tl } + { \l__zrefclever_setup_type_tl } {#1} { seq } + } { - \__zrefclever_opt_seq_if_set:cF + \seq_gclear:N \g_tmpa_seq + \__zrefclever_opt_seq_gset_clist_split:Nn + \g_tmpa_seq {##1} + \bool_lazy_or:nnTF + { \tl_if_empty_p:n {##1} } { - \__zrefclever_opt_varname_lang_type:eenn - { \l__zrefclever_setup_language_tl } - { \l__zrefclever_setup_type_tl } {#1} { seq } + \int_compare_p:nNn + { \seq_count:N \g_tmpa_seq } = { 4 } } { - \seq_gclear:N \g_tmpa_seq - \__zrefclever_opt_seq_gset_clist_split:Nn - \g_tmpa_seq {##1} - \bool_lazy_or:nnTF - { \tl_if_empty_p:n {##1} } - { - \int_compare_p:nNn - { \seq_count:N \g_tmpa_seq } = { 4 } - } - { - \seq_gset_eq:cN - { - \__zrefclever_opt_varname_lang_type:eenn - { \l__zrefclever_setup_language_tl } - { \l__zrefclever_setup_type_tl } - {#1} { seq } - } - \g_tmpa_seq - } + \__zrefclever_opt_seq_gset_eq:cN { - \msg_info:nnxx { zref-clever } - { refbounds-must-be-four } - {#1} { \seq_count:N \g_tmpa_seq } + \__zrefclever_opt_varname_lang_type:eenn + { \l__zrefclever_setup_language_tl } + { \l__zrefclever_setup_type_tl } + {#1} { seq } } + \g_tmpa_seq + } + { + \msg_info:nnxx { zref-clever } + { refbounds-must-be-four } + {#1} { \seq_count:N \g_tmpa_seq } } } } @@ -1293,7 +1468,7 @@ } } \seq_map_inline:Nn - \c__zrefclever_rf_opts_bool_maybe_type_specific_seq + \g__zrefclever_rf_opts_bool_maybe_type_specific_seq { \keys_define:nn { zref-clever/langfile } { @@ -1309,7 +1484,7 @@ {#1} { bool } } { - \bool_gset_true:c + \__zrefclever_opt_bool_gset_true:c { \__zrefclever_opt_varname_lang_default:enn { \l__zrefclever_setup_language_tl } @@ -1326,7 +1501,7 @@ {#1} { bool } } { - \bool_gset_true:c + \__zrefclever_opt_bool_gset_true:c { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } @@ -1347,7 +1522,7 @@ {#1} { bool } } { - \bool_gset_false:c + \__zrefclever_opt_bool_gset_false:c { \__zrefclever_opt_varname_lang_default:enn { \l__zrefclever_setup_language_tl } @@ -1364,7 +1539,7 @@ {#1} { bool } } { - \bool_gset_false:c + \__zrefclever_opt_bool_gset_false:c { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } @@ -1374,7 +1549,6 @@ } } } , - #1 / unset .code:n = { } , #1 .default:n = true , no #1 .meta:n = { #1 = false } , no #1 .value_forbidden:n = true , @@ -1501,12 +1675,12 @@ { { ref } { - \tl_clear:c + \__zrefclever_opt_tl_clear:c { \__zrefclever_opt_varname_general:nn { endrangefunc } { tl } } - \tl_clear:c + \__zrefclever_opt_tl_clear:c { \__zrefclever_opt_varname_general:nn { endrangeprop } { tl } @@ -1515,13 +1689,13 @@ { stripprefix } { - \tl_set:cn + \__zrefclever_opt_tl_set:cn { \__zrefclever_opt_varname_general:nn { endrangefunc } { tl } } { __zrefclever_get_endrange_stripprefix } - \tl_clear:c + \__zrefclever_opt_tl_clear:c { \__zrefclever_opt_varname_general:nn { endrangeprop } { tl } @@ -1530,13 +1704,13 @@ { pagecomp } { - \tl_set:cn + \__zrefclever_opt_tl_set:cn { \__zrefclever_opt_varname_general:nn { endrangefunc } { tl } } { __zrefclever_get_endrange_pagecomp } - \tl_clear:c + \__zrefclever_opt_tl_clear:c { \__zrefclever_opt_varname_general:nn { endrangeprop } { tl } @@ -1545,13 +1719,13 @@ { pagecomp2 } { - \tl_set:cn + \__zrefclever_opt_tl_set:cn { \__zrefclever_opt_varname_general:nn { endrangefunc } { tl } } { __zrefclever_get_endrange_pagecomptwo } - \tl_clear:c + \__zrefclever_opt_tl_clear:c { \__zrefclever_opt_varname_general:nn { endrangeprop } { tl } @@ -1585,13 +1759,13 @@ { endrange-property-undefined } {#1} } { - \tl_set:cn + \__zrefclever_opt_tl_set:cn { \__zrefclever_opt_varname_general:nn { endrangefunc } { tl } } { __zrefclever_get_endrange_property } - \tl_set:cn + \__zrefclever_opt_tl_set:cn { \__zrefclever_opt_varname_general:nn { endrangeprop } { tl } @@ -1931,10 +2105,6 @@ { preposinlink } { refbounds } } , } - -\tl_new:N \l__zrefclever_ref_language_tl -\tl_new:N \l__zrefclever_current_language_tl -\tl_new:N \l__zrefclever_main_language_tl \AddToHook { begindocument } { \__zrefclever_if_package_loaded:nTF { babel } @@ -1954,7 +2124,6 @@ } } } -\tl_set:Nn \l_zrefclever_ref_language_tl { \l__zrefclever_ref_language_tl } \keys_define:nn { zref-clever/reference } { lang .code:n = @@ -2160,22 +2329,35 @@ { \__zrefclever_if_package_loaded:nTF { zref-check } { - \bool_set_true:N \l__zrefclever_zrefcheck_available_bool - \keys_define:nn { zref-clever/reference } + \IfPackageAtLeastTF { zref-check } { 2021-09-16 } { - check .code:n = + \bool_set_true:N \l__zrefclever_zrefcheck_available_bool + \keys_define:nn { zref-clever/reference } { - \bool_set_true:N \l__zrefclever_zcref_with_check_bool - \keys_set:nn { zref-check / zcheck } {#1} - } , - check .value_required:n = true , + check .code:n = + { + \bool_set_true:N \l__zrefclever_zcref_with_check_bool + \keys_set:nn { zref-check / zcheck } {#1} + } , + check .value_required:n = true , + } + } + { + \bool_set_false:N \l__zrefclever_zrefcheck_available_bool + \keys_define:nn { zref-clever/reference } + { + check .code:n = + { + \msg_warning:nnn { zref-clever } + { zref-check-too-old } { 2021-09-16~v0.2.1 } + } , + } } } { \bool_set_false:N \l__zrefclever_zrefcheck_available_bool \keys_define:nn { zref-clever/reference } { - check .value_forbidden:n = false , check .code:n = { \msg_warning:nn { zref-clever } { missing-zref-check } } , } @@ -2316,11 +2498,11 @@ } } \seq_map_inline:Nn - \c__zrefclever_rf_opts_tl_reference_seq + \g__zrefclever_rf_opts_tl_reference_seq { \keys_define:nn { zref-clever/reference } { - #1 .default:x = \c_novalue_tl , + #1 .default:o = \c_novalue_tl , #1 .code:n = { \tl_if_novalue:nTF {##1} @@ -2329,7 +2511,7 @@ { \__zrefclever_opt_varname_general:nn {#1} { tl } } } { - \tl_set:cn + \__zrefclever_opt_tl_set:cn { \__zrefclever_opt_varname_general:nn {#1} { tl } } {##1} } @@ -2364,11 +2546,11 @@ } , } \seq_map_inline:Nn - \c__zrefclever_rf_opts_seq_refbounds_seq + \g__zrefclever_rf_opts_seq_refbounds_seq { \keys_define:nn { zref-clever/reference } { - #1 .default:x = \c_novalue_tl , + #1 .default:o = \c_novalue_tl , #1 .code:n = { \tl_if_novalue:nTF {##1} @@ -2384,7 +2566,7 @@ { \tl_if_empty_p:n {##1} } { \int_compare_p:nNn { \seq_count:N \l_tmpa_seq } = { 4 } } { - \seq_set_eq:cN + \__zrefclever_opt_seq_set_eq:cN { \__zrefclever_opt_varname_general:nn {#1} { seq } } \l_tmpa_seq } @@ -2398,19 +2580,19 @@ } } \seq_map_inline:Nn - \c__zrefclever_rf_opts_bool_maybe_type_specific_seq + \g__zrefclever_rf_opts_bool_maybe_type_specific_seq { \keys_define:nn { zref-clever/reference } { #1 .choice: , #1 / true .code:n = { - \bool_set_true:c + \__zrefclever_opt_bool_set_true:c { \__zrefclever_opt_varname_general:nn {#1} { bool } } } , #1 / false .code:n = { - \bool_set_false:c + \__zrefclever_opt_bool_set_false:c { \__zrefclever_opt_varname_general:nn {#1} { bool } } } , #1 / unset .code:n = @@ -2444,7 +2626,7 @@ \tl_clear:N \l__zrefclever_setup_type_tl } \seq_map_inline:Nn - \c__zrefclever_rf_opts_tl_not_type_specific_seq + \g__zrefclever_rf_opts_tl_not_type_specific_seq { \keys_define:nn { zref-clever/typesetup } { @@ -2456,11 +2638,11 @@ } } \seq_map_inline:Nn - \c__zrefclever_rf_opts_tl_typesetup_seq + \g__zrefclever_rf_opts_tl_typesetup_seq { \keys_define:nn { zref-clever/typesetup } { - #1 .default:x = \c_novalue_tl , + #1 .default:o = \c_novalue_tl , #1 .code:n = { \tl_if_novalue:nTF {##1} @@ -2472,7 +2654,7 @@ } } { - \tl_set:cn + \__zrefclever_opt_tl_set:cn { \__zrefclever_opt_varname_type:enn { \l__zrefclever_setup_type_tl } {#1} { tl } @@ -2490,12 +2672,12 @@ { { ref } { - \tl_clear:c + \__zrefclever_opt_tl_clear:c { \__zrefclever_opt_varname_type:enn { \l__zrefclever_setup_type_tl } { endrangefunc } { tl } } - \tl_clear:c + \__zrefclever_opt_tl_clear:c { \__zrefclever_opt_varname_type:enn { \l__zrefclever_setup_type_tl } { endrangeprop } { tl } @@ -2504,13 +2686,13 @@ { stripprefix } { - \tl_set:cn + \__zrefclever_opt_tl_set:cn { \__zrefclever_opt_varname_type:enn { \l__zrefclever_setup_type_tl } { endrangefunc } { tl } } { __zrefclever_get_endrange_stripprefix } - \tl_clear:c + \__zrefclever_opt_tl_clear:c { \__zrefclever_opt_varname_type:enn { \l__zrefclever_setup_type_tl } { endrangeprop } { tl } @@ -2519,13 +2701,13 @@ { pagecomp } { - \tl_set:cn + \__zrefclever_opt_tl_set:cn { \__zrefclever_opt_varname_type:enn { \l__zrefclever_setup_type_tl } { endrangefunc } { tl } } { __zrefclever_get_endrange_pagecomp } - \tl_clear:c + \__zrefclever_opt_tl_clear:c { \__zrefclever_opt_varname_type:enn { \l__zrefclever_setup_type_tl } { endrangeprop } { tl } @@ -2534,13 +2716,13 @@ { pagecomp2 } { - \tl_set:cn + \__zrefclever_opt_tl_set:cn { \__zrefclever_opt_varname_type:enn { \l__zrefclever_setup_type_tl } { endrangefunc } { tl } } { __zrefclever_get_endrange_pagecomptwo } - \tl_clear:c + \__zrefclever_opt_tl_clear:c { \__zrefclever_opt_varname_type:enn { \l__zrefclever_setup_type_tl } { endrangeprop } { tl } @@ -2574,14 +2756,14 @@ { endrange-property-undefined } {#1} } { - \tl_set:cn + \__zrefclever_opt_tl_set:cn { \__zrefclever_opt_varname_type:enn { \l__zrefclever_setup_type_tl } { endrangefunc } { tl } } { __zrefclever_get_endrange_property } - \tl_set:cn + \__zrefclever_opt_tl_set:cn { \__zrefclever_opt_varname_type:enn { \l__zrefclever_setup_type_tl } @@ -2622,11 +2804,11 @@ } , } \seq_map_inline:Nn - \c__zrefclever_rf_opts_seq_refbounds_seq + \g__zrefclever_rf_opts_seq_refbounds_seq { \keys_define:nn { zref-clever/typesetup } { - #1 .default:x = \c_novalue_tl , + #1 .default:o = \c_novalue_tl , #1 .code:n = { \tl_if_novalue:nTF {##1} @@ -2645,7 +2827,7 @@ { \tl_if_empty_p:n {##1} } { \int_compare_p:nNn { \seq_count:N \l_tmpa_seq } = { 4 } } { - \seq_set_eq:cN + \__zrefclever_opt_seq_set_eq:cN { \__zrefclever_opt_varname_type:enn { \l__zrefclever_setup_type_tl } {#1} { seq } @@ -2662,14 +2844,14 @@ } } \seq_map_inline:Nn - \c__zrefclever_rf_opts_bool_maybe_type_specific_seq + \g__zrefclever_rf_opts_bool_maybe_type_specific_seq { \keys_define:nn { zref-clever/typesetup } { #1 .choice: , #1 / true .code:n = { - \bool_set_true:c + \__zrefclever_opt_bool_set_true:c { \__zrefclever_opt_varname_type:enn { \l__zrefclever_setup_type_tl } @@ -2678,7 +2860,7 @@ } , #1 / false .code:n = { - \bool_set_false:c + \__zrefclever_opt_bool_set_false:c { \__zrefclever_opt_varname_type:enn { \l__zrefclever_setup_type_tl } @@ -2761,7 +2943,7 @@ } , case .value_required:n = true , - gender .default:x = \c_novalue_tl , + gender .value_required:n = true , gender .code:n = { \seq_if_empty:NTF \l__zrefclever_lang_gender_seq @@ -2776,69 +2958,46 @@ { option-only-type-specific } { gender } } { - \tl_if_novalue:nTF {#1} + \seq_clear:N \l_tmpa_seq + \clist_map_inline:nn {#1} { - \__zrefclever_opt_seq_gunset:c + \seq_if_in:NnTF \l__zrefclever_lang_gender_seq {##1} + { \seq_put_right:Nn \l_tmpa_seq {##1} } { - \__zrefclever_opt_varname_lang_type:eenn - { \l__zrefclever_setup_language_tl } - { \l__zrefclever_setup_type_tl } - { gender } - { seq } + \msg_warning:nnxx { zref-clever } + { gender-not-declared } + { \l__zrefclever_setup_language_tl } {##1} } } + \__zrefclever_opt_seq_gset_eq:cN { - \seq_clear:N \l_tmpa_seq - \clist_map_inline:nn {#1} - { - \seq_if_in:NnTF \l__zrefclever_lang_gender_seq {##1} - { \seq_put_right:Nn \l_tmpa_seq {##1} } - { - \msg_warning:nnxx { zref-clever } - { gender-not-declared } - { \l__zrefclever_setup_language_tl } {##1} - } - } - \seq_gset_eq:cN - { - \__zrefclever_opt_varname_lang_type:eenn - { \l__zrefclever_setup_language_tl } - { \l__zrefclever_setup_type_tl } - { gender } - { seq } - } - \l_tmpa_seq + \__zrefclever_opt_varname_lang_type:eenn + { \l__zrefclever_setup_language_tl } + { \l__zrefclever_setup_type_tl } + { gender } + { seq } } + \l_tmpa_seq } } } , } \seq_map_inline:Nn - \c__zrefclever_rf_opts_tl_not_type_specific_seq + \g__zrefclever_rf_opts_tl_not_type_specific_seq { \keys_define:nn { zref-clever/langsetup } { - #1 .default:x = \c_novalue_tl , + #1 .value_required:n = true , #1 .code:n = { \tl_if_empty:NTF \l__zrefclever_setup_type_tl { - \tl_if_novalue:nTF {##1} + \__zrefclever_opt_tl_gset:cn { - \__zrefclever_opt_tl_gunset:c - { - \__zrefclever_opt_varname_lang_default:enn - { \l__zrefclever_setup_language_tl } {#1} { tl } - } - } - { - \tl_gset:cn - { - \__zrefclever_opt_varname_lang_default:enn - { \l__zrefclever_setup_language_tl } {#1} { tl } - } - {##1} + \__zrefclever_opt_varname_lang_default:enn + { \l__zrefclever_setup_language_tl } {#1} { tl } } + {##1} } { \msg_warning:nnn { zref-clever } @@ -2848,7 +3007,7 @@ } } \seq_map_inline:Nn - \c__zrefclever_rf_opts_tl_maybe_type_specific_seq + \g__zrefclever_rf_opts_tl_maybe_type_specific_seq { \keys_define:nn { zref-clever/langsetup } { @@ -2857,50 +3016,29 @@ { \tl_if_empty:NTF \l__zrefclever_setup_type_tl { - \tl_if_novalue:nTF {##1} - { - \__zrefclever_opt_tl_gunset:c - { - \__zrefclever_opt_varname_lang_default:enn - { \l__zrefclever_setup_language_tl } {#1} { tl } - } - } + \__zrefclever_opt_tl_gset:cn { - \tl_gset:cn - { - \__zrefclever_opt_varname_lang_default:enn - { \l__zrefclever_setup_language_tl } {#1} { tl } - } - {##1} + \__zrefclever_opt_varname_lang_default:enn + { \l__zrefclever_setup_language_tl } {#1} { tl } } + {##1} } { - \tl_if_novalue:nTF {##1} - { - \__zrefclever_opt_tl_gunset:c - { - \__zrefclever_opt_varname_lang_type:eenn - { \l__zrefclever_setup_language_tl } - { \l__zrefclever_setup_type_tl } - {#1} { tl } - } - } + \__zrefclever_opt_tl_gset:cn { - \tl_gset:cn - { - \__zrefclever_opt_varname_lang_type:eenn - { \l__zrefclever_setup_language_tl } - { \l__zrefclever_setup_type_tl } - {#1} { tl } - } - {##1} + \__zrefclever_opt_varname_lang_type:eenn + { \l__zrefclever_setup_language_tl } + { \l__zrefclever_setup_type_tl } + {#1} { tl } } + {##1} } } , } } \keys_define:nn { zref-clever/langsetup } { + endrange .value_required:n = true , endrange .code:n = { \str_case:nnF {#1} @@ -2909,13 +3047,13 @@ { \tl_if_empty:NTF \l__zrefclever_setup_type_tl { - \tl_gclear:c + \__zrefclever_opt_tl_gclear:c { \__zrefclever_opt_varname_lang_default:enn { \l__zrefclever_setup_language_tl } { endrangefunc } { tl } } - \tl_gclear:c + \__zrefclever_opt_tl_gclear:c { \__zrefclever_opt_varname_lang_default:enn { \l__zrefclever_setup_language_tl } @@ -2923,14 +3061,14 @@ } } { - \tl_gclear:c + \__zrefclever_opt_tl_gclear:c { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } { \l__zrefclever_setup_type_tl } { endrangefunc } { tl } } - \tl_gclear:c + \__zrefclever_opt_tl_gclear:c { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } @@ -2944,14 +3082,14 @@ { \tl_if_empty:NTF \l__zrefclever_setup_type_tl { - \tl_gset:cn + \__zrefclever_opt_tl_gset:cn { \__zrefclever_opt_varname_lang_default:enn { \l__zrefclever_setup_language_tl } { endrangefunc } { tl } } { __zrefclever_get_endrange_stripprefix } - \tl_gclear:c + \__zrefclever_opt_tl_gclear:c { \__zrefclever_opt_varname_lang_default:enn { \l__zrefclever_setup_language_tl } @@ -2959,7 +3097,7 @@ } } { - \tl_gset:cn + \__zrefclever_opt_tl_gset:cn { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } @@ -2967,7 +3105,7 @@ { endrangefunc } { tl } } { __zrefclever_get_endrange_stripprefix } - \tl_gclear:c + \__zrefclever_opt_tl_gclear:c { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } @@ -2981,14 +3119,14 @@ { \tl_if_empty:NTF \l__zrefclever_setup_type_tl { - \tl_gset:cn + \__zrefclever_opt_tl_gset:cn { \__zrefclever_opt_varname_lang_default:enn { \l__zrefclever_setup_language_tl } { endrangefunc } { tl } } { __zrefclever_get_endrange_pagecomp } - \tl_gclear:c + \__zrefclever_opt_tl_gclear:c { \__zrefclever_opt_varname_lang_default:enn { \l__zrefclever_setup_language_tl } @@ -2996,7 +3134,7 @@ } } { - \tl_gset:cn + \__zrefclever_opt_tl_gset:cn { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } @@ -3004,7 +3142,7 @@ { endrangefunc } { tl } } { __zrefclever_get_endrange_pagecomp } - \tl_gclear:c + \__zrefclever_opt_tl_gclear:c { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } @@ -3018,14 +3156,14 @@ { \tl_if_empty:NTF \l__zrefclever_setup_type_tl { - \tl_gset:cn + \__zrefclever_opt_tl_gset:cn { \__zrefclever_opt_varname_lang_default:enn { \l__zrefclever_setup_language_tl } { endrangefunc } { tl } } { __zrefclever_get_endrange_pagecomptwo } - \tl_gclear:c + \__zrefclever_opt_tl_gclear:c { \__zrefclever_opt_varname_lang_default:enn { \l__zrefclever_setup_language_tl } @@ -3033,7 +3171,7 @@ } } { - \tl_gset:cn + \__zrefclever_opt_tl_gset:cn { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } @@ -3041,42 +3179,7 @@ { endrangefunc } { tl } } { __zrefclever_get_endrange_pagecomptwo } - \tl_gclear:c - { - \__zrefclever_opt_varname_lang_type:eenn - { \l__zrefclever_setup_language_tl } - { \l__zrefclever_setup_type_tl } - { endrangeprop } { tl } - } - } - } - - { unset } - { - \tl_if_empty:NTF \l__zrefclever_setup_type_tl - { - \__zrefclever_opt_tl_gunset:c - { - \__zrefclever_opt_varname_lang_default:enn - { \l__zrefclever_setup_language_tl } - { endrangefunc } { tl } - } - \__zrefclever_opt_tl_gunset:c - { - \__zrefclever_opt_varname_lang_default:enn - { \l__zrefclever_setup_language_tl } - { endrangeprop } { tl } - } - } - { - \__zrefclever_opt_tl_gunset:c - { - \__zrefclever_opt_varname_lang_type:eenn - { \l__zrefclever_setup_language_tl } - { \l__zrefclever_setup_type_tl } - { endrangefunc } { tl } - } - \__zrefclever_opt_tl_gunset:c + \__zrefclever_opt_tl_gclear:c { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } @@ -3101,14 +3204,14 @@ { \tl_if_empty:NTF \l__zrefclever_setup_type_tl { - \tl_gset:cn + \__zrefclever_opt_tl_gset:cn { \__zrefclever_opt_varname_lang_default:enn { \l__zrefclever_setup_language_tl } { endrangefunc } { tl } } { __zrefclever_get_endrange_property } - \tl_gset:cn + \__zrefclever_opt_tl_gset:cn { \__zrefclever_opt_varname_lang_default:enn { \l__zrefclever_setup_language_tl } @@ -3117,7 +3220,7 @@ {#1} } { - \tl_gset:cn + \__zrefclever_opt_tl_gset:cn { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } @@ -3125,7 +3228,7 @@ { endrangefunc } { tl } } { __zrefclever_get_endrange_property } - \tl_gset:cn + \__zrefclever_opt_tl_gset:cn { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } @@ -3138,7 +3241,6 @@ } } } , - endrange .value_required:n = true , } \keys_define:nn { zref-clever/langsetup } { @@ -3168,7 +3270,7 @@ } , } \seq_map_inline:Nn - \c__zrefclever_rf_opts_tl_type_names_seq + \g__zrefclever_rf_opts_tl_type_names_seq { \keys_define:nn { zref-clever/langsetup } { @@ -3181,130 +3283,96 @@ { option-only-type-specific } {#1} } { - \tl_if_novalue:nTF {##1} + \tl_if_empty:NTF \l__zrefclever_lang_decl_case_tl { - \__zrefclever_opt_tl_gunset:c + \__zrefclever_opt_tl_gset:cn { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } { \l__zrefclever_setup_type_tl } {#1} { tl } } + {##1} } { - \tl_if_empty:NTF \l__zrefclever_lang_decl_case_tl - { - \tl_gset:cn - { - \__zrefclever_opt_varname_lang_type:eenn - { \l__zrefclever_setup_language_tl } - { \l__zrefclever_setup_type_tl } - {#1} { tl } - } - {##1} - } + \__zrefclever_opt_tl_gset:cn { - \tl_gset:cn - { - \__zrefclever_opt_varname_lang_type:eeen - { \l__zrefclever_setup_language_tl } - { \l__zrefclever_setup_type_tl } - { \l__zrefclever_lang_decl_case_tl - #1 } - { tl } - } - {##1} + \__zrefclever_opt_varname_lang_type:eeen + { \l__zrefclever_setup_language_tl } + { \l__zrefclever_setup_type_tl } + { \l__zrefclever_lang_decl_case_tl - #1 } + { tl } } + {##1} } } } , } } \seq_map_inline:Nn - \c__zrefclever_rf_opts_seq_refbounds_seq + \g__zrefclever_rf_opts_seq_refbounds_seq { \keys_define:nn { zref-clever/langsetup } { - #1 .default:x = \c_novalue_tl , + #1 .value_required:n = true , #1 .code:n = { \tl_if_empty:NTF \l__zrefclever_setup_type_tl { - \tl_if_novalue:nTF {##1} + \seq_gclear:N \g_tmpa_seq + \__zrefclever_opt_seq_gset_clist_split:Nn + \g_tmpa_seq {##1} + \bool_lazy_or:nnTF + { \tl_if_empty_p:n {##1} } + { + \int_compare_p:nNn + { \seq_count:N \g_tmpa_seq } = { 4 } + } { - \__zrefclever_opt_seq_gunset:c + \__zrefclever_opt_seq_gset_eq:cN { \__zrefclever_opt_varname_lang_default:enn { \l__zrefclever_setup_language_tl } {#1} { seq } } + \g_tmpa_seq } { - \seq_gclear:N \g_tmpa_seq - \__zrefclever_opt_seq_gset_clist_split:Nn - \g_tmpa_seq {##1} - \bool_lazy_or:nnTF - { \tl_if_empty_p:n {##1} } - { - \int_compare_p:nNn - { \seq_count:N \g_tmpa_seq } = { 4 } - } - { - \seq_gset_eq:cN - { - \__zrefclever_opt_varname_lang_default:enn - { \l__zrefclever_setup_language_tl } - {#1} { seq } - } - \g_tmpa_seq - } - { - \msg_warning:nnxx { zref-clever } - { refbounds-must-be-four } - {#1} { \seq_count:N \g_tmpa_seq } - } + \msg_warning:nnxx { zref-clever } + { refbounds-must-be-four } + {#1} { \seq_count:N \g_tmpa_seq } } } { - \tl_if_novalue:nTF {##1} + \seq_gclear:N \g_tmpa_seq + \__zrefclever_opt_seq_gset_clist_split:Nn + \g_tmpa_seq {##1} + \bool_lazy_or:nnTF + { \tl_if_empty_p:n {##1} } + { + \int_compare_p:nNn + { \seq_count:N \g_tmpa_seq } = { 4 } + } { - \__zrefclever_opt_seq_gunset:c + \__zrefclever_opt_seq_gset_eq:cN { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } { \l__zrefclever_setup_type_tl } {#1} { seq } } + \g_tmpa_seq } { - \seq_gclear:N \g_tmpa_seq - \__zrefclever_opt_seq_gset_clist_split:Nn - \g_tmpa_seq {##1} - \bool_lazy_or:nnTF - { \tl_if_empty_p:n {##1} } - { - \int_compare_p:nNn - { \seq_count:N \g_tmpa_seq } = { 4 } - } - { - \seq_gset_eq:cN - { - \__zrefclever_opt_varname_lang_type:eenn - { \l__zrefclever_setup_language_tl } - { \l__zrefclever_setup_type_tl } {#1} { seq } - } - \g_tmpa_seq - } - { - \msg_warning:nnxx { zref-clever } - { refbounds-must-be-four } - {#1} { \seq_count:N \g_tmpa_seq } - } + \msg_warning:nnxx { zref-clever } + { refbounds-must-be-four } + {#1} { \seq_count:N \g_tmpa_seq } } } } , } } \seq_map_inline:Nn - \c__zrefclever_rf_opts_bool_maybe_type_specific_seq + \g__zrefclever_rf_opts_bool_maybe_type_specific_seq { \keys_define:nn { zref-clever/langsetup } { @@ -3313,7 +3381,7 @@ { \tl_if_empty:NTF \l__zrefclever_setup_type_tl { - \bool_gset_true:c + \__zrefclever_opt_bool_gset_true:c { \__zrefclever_opt_varname_lang_default:enn { \l__zrefclever_setup_language_tl } @@ -3321,7 +3389,7 @@ } } { - \bool_gset_true:c + \__zrefclever_opt_bool_gset_true:c { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } @@ -3334,28 +3402,7 @@ { \tl_if_empty:NTF \l__zrefclever_setup_type_tl { - \bool_gset_false:c - { - \__zrefclever_opt_varname_lang_default:enn - { \l__zrefclever_setup_language_tl } - {#1} { bool } - } - } - { - \bool_gset_false:c - { - \__zrefclever_opt_varname_lang_type:eenn - { \l__zrefclever_setup_language_tl } - { \l__zrefclever_setup_type_tl } - {#1} { bool } - } - } - } , - #1 / unset .code:n = - { - \tl_if_empty:NTF \l__zrefclever_setup_type_tl - { - \__zrefclever_opt_bool_gunset:c + \__zrefclever_opt_bool_gset_false:c { \__zrefclever_opt_varname_lang_default:enn { \l__zrefclever_setup_language_tl } @@ -3363,7 +3410,7 @@ } } { - \__zrefclever_opt_bool_gunset:c + \__zrefclever_opt_bool_gset_false:c { \__zrefclever_opt_varname_lang_type:eenn { \l__zrefclever_setup_language_tl } |