diff options
author | Karl Berry <karl@freefriends.org> | 2019-11-17 22:34:27 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-11-17 22:34:27 +0000 |
commit | 23ef0a47d81811188819422f09392e5220e96b59 (patch) | |
tree | 17a6d6fc7d95bd2889038db33bb55b1b8c920bd8 /Master/texmf-dist/tex/context | |
parent | 59dc3a32912329f9a44b04a5bd4df8bde04e383e (diff) |
scontents (17nov19)
git-svn-id: svn://tug.org/texlive/trunk@52841 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context')
-rw-r--r-- | Master/texmf-dist/tex/context/third/scontents/t-scontents.mkiv | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/context/third/scontents/t-scontents.mkiv b/Master/texmf-dist/tex/context/third/scontents/t-scontents.mkiv index 8f336482dad..944ff08225a 100644 --- a/Master/texmf-dist/tex/context/third/scontents/t-scontents.mkiv +++ b/Master/texmf-dist/tex/context/third/scontents/t-scontents.mkiv @@ -33,16 +33,16 @@ %% scontents.dtx (with options: `loader,context') %D \module %D [ file=t-scontents, -%D version=1.7, +%D version=1.8, %D title=\CONTEXT\ User Module, %D subtitle=Storing Contents, %D author=Pablo González, -%D date=2019-10-29, +%D date=2019-11-18, %D copyright=Pablo González, %D email=pablgonz@educarchile.cl, %D license=LPPL] -\def\ScontentsFileDate{2019-10-29}% -\def\ScontentsFileVersion{1.7}% +\def\ScontentsFileDate{2019-11-18}% +\def\ScontentsFileVersion{1.8}% \def\ScontentsFileDescription{Stores LaTeX contents in memory or files}% \writestatus{loading}{User Module scontents v\ScontentsFileVersion} \unprotect @@ -62,7 +62,7 @@ { \c_backslash_str stop - scontents + \exp_not:N \l__scontents_env_name_tl } \file_input:n { scontents-code.tex } \cs_new:Npn \__scontents_format_case:nnn #1 #2 #3 @@ -106,9 +106,12 @@ \clist_map_function:NN \l__scontents_temp_tl \__scontents_require_auxiii:n } \cs_new_protected:Npn \__scontents_require_auxiii:n #1 - { \str_if_eq:eeF {expl3} {#1} { \msg_error:nnn { scontents } { invalid-package } {#1} } } + { + \str_if_eq:eeF {expl3} {#1} + { \msg_error:nnn { scontents } { invalid-package } {#1} } + } \msg_new:nnn { scontents } { invalid-package } - { Package~`#1'~invalid~in~scontents.~This~is~an~error~in~scontents. } + { Package~'#1'~invalid~in~scontents.~This~is~an~error~in~scontents. } \__scontents_compat_redefine:cpn { @ifpackagelater } #1 { \exp_args:Nc \__scontents_package_later_aux:Nn { ver@#1.sty } } \cs_new_protected:Npn \__scontents_package_later_aux:Nn #1 #2 @@ -123,7 +126,7 @@ \cs_new:Npn \__scontents_parse_version_auxii:w #1-#2-#3#4#5 \q_mark { \tl_if_blank:nF {#2} {#1} #2 #3 #4 } \__scontents_compat_redefine:Npn \ProvidesExplPackage #1 #2 #3 #4 - { \__scontents_provides_aux:nn {#1} { #2 \ifx\relax#3\relax\else v#3\space\fi #4 } } + { \__scontents_provides_aux:nn {#1} { #2 \tl_if_empty:nF {#3} {#3~} #4 } } \cs_new_protected:Npn \__scontents_provides_aux:nn #1 #2 { \tl_gset:cx { ver@#1.sty } {#2} @@ -142,18 +145,30 @@ \ExplSyntaxOn \char_set_catcode:nn { `\@ } { \l__scontents_tmpa_int } \__scontents_compat_restore: -\cs_new_protected:Npn \startscontents +\NewDocumentCommand { \newenvsc } { m O{} } { - \group_begin: - \__scontents_scontents_env_begin: + \cs_if_exist:cTF { start #1 } + { \msg_error:nnn { scontents } { env-already-defined } {#1} } + { \__scontents_scontents_setenv:nn {#1} {#2} } } -\cs_new_protected:Npn \stopscontents +\cs_new_protected:Npn \__scontents_env_define:nnn #1 #2 #3 { - \__scontents_scontents_env_end: - \group_end: + \cs_new_protected:cpn { start #1 } + { + \group_begin: + #2 + } + \cs_new_protected:cpn { stop #1 } + { + #3 + \group_end: + } } +\newenvsc{scontents} \NewDocumentCommand \__scontents_grab_optional:w { r[] } { \__scontents_grab_optional:n {#1} } +\cs_new_protected:Npn \__scontents_analyse_nesting_format:n + { \__scontents_analyse_nesting_generic:nn { start } } \cs_if_exist:NF \dospecials { \cs_new:Npn \dospecials @@ -163,7 +178,7 @@ { \__scontents_Scontents_internal:nn {#1} {#2} } \NewDocumentCommand { \__scontents_verb_arg:w } { +v } { \__scontents_verb_arg_internal:n {#1} } -\NewDocumentCommand { \getstored } { O{1} m } +\NewDocumentCommand { \getstored } { O{-1} m } { \__scontents_getstored_internal:nn {#1} {#2} } \NewDocumentCommand { \foreachsc } { o m } { \__scontents_foreachsc_internal:nn {#1} {#2} } |