diff options
author | Karl Berry <karl@freefriends.org> | 2019-03-27 21:53:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-03-27 21:53:40 +0000 |
commit | f163f9fe30ea30e94aac851cc8ecac09eeec84d0 (patch) | |
tree | 1bedbdc1b29e9ea9d69058ba3b4e66b9197cc0e1 /Master/texmf-dist/source/latex/l3kernel/l3file.dtx | |
parent | fdf72eb7326451df89152180380aeea978386658 (diff) |
l3kernel (27mar19)
git-svn-id: svn://tug.org/texlive/trunk@50620 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3file.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3file.dtx | 54 |
1 files changed, 43 insertions, 11 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx index f81f3a488b5..16e6dde1214 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3file.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3file.dtx @@ -44,7 +44,7 @@ % }^^A % } % -% \date{Released 2019-03-05} +% \date{Released 2019-03-26} % % \maketitle % @@ -164,15 +164,18 @@ % % \subsection{Reading from files} % -% \begin{function}[noTF, added = 2012-06-24, updated = 2019-02-17]{\ior_get:NN} +% Reading from files and reading from the terminal are separate processes in +% \pkg{expl3}. The functions \cs{ior_get:NN} and \cs{ior_str_get:NN}, and their +% branching equivalents, are designed to work with files. +% +% \begin{function}[noTF, added = 2012-06-24, updated = 2019-03-23]{\ior_get:NN} % \begin{syntax} % \cs{ior_get:NN} \meta{stream} \meta{token list variable} % \cs{ior_get:NNTF} \meta{stream} \meta{token list variable} \meta{true code} \meta{false code} % \end{syntax} % Function that reads one or more lines (until an equal number of left % and right braces are found) from the input \meta{stream} and stores -% the result locally in the \meta{token list} variable. If the -% \meta{stream} is not open, input is requested from the terminal. +% the result locally in the \meta{token list} variable. % The material read from the \meta{stream} is tokenized by \TeX{} % according to the category codes and \tn{endlinechar} in force when % the function is used. Assuming normal settings, any lines which do @@ -192,8 +195,8 @@ % \end{verbatim} % Also notice that if multiple lines are read to match braces % then the resulting token list can contain \cs{par} tokens. -% In the non-branching version, where the file is not found the \meta{tl var} -% is set to \cs{q_no_value}. +% In the non-branching version, where the \meta{stream} is not open +% the \meta{tl var} is set to \cs{q_no_value}. % \begin{texnote} % This protected macro is a wrapper around the \TeX{} primitive % \tn{read}. Regardless of settings, \TeX{} replaces trailing space @@ -206,15 +209,14 @@ % \end{texnote} % \end{function} % -% \begin{function}[noTF, added = 2016-12-04, updated = 2019-02-17] +% \begin{function}[noTF, added = 2016-12-04, updated = 2019-03-23] % {\ior_str_get:NN} % \begin{syntax} % \cs{ior_str_get:NN} \meta{stream} \meta{token list variable} % \cs{ior_str_get:NNTF} \meta{stream} \meta{token list variable} \meta{true code} \meta{false code} % \end{syntax} % Function that reads one line from the input \meta{stream} and stores -% the result locally in the \meta{token list} variable. If the -% \meta{stream} is not open, input is requested from the terminal. +% the result locally in the \meta{token list} variable. % The material is read from the \meta{stream} as a series of tokens with % category code $12$ (other), with the exception of space % characters which are given category code $10$ (space). @@ -228,8 +230,8 @@ % \end{verbatim} % results in a token list |a b c| with the letters |a|, |b|, and |c| % having category code~12. -% In the non-branching version, where the file is not found the \meta{tl var} -% is set to \cs{q_no_value}. +% In the non-branching version, where the\meta{stream} is not open +% the \meta{tl var} is set to \cs{q_no_value}. % \begin{texnote} % This protected macro is a wrapper around the \eTeX{} primitive % \tn{readline}. Regardless of settings, \TeX{} removes trailing @@ -1012,6 +1014,36 @@ % \end{macro} % \end{macro} % +% \begin{variable}{\c_@@_term_ior} +% For reading without a prompt. +% \begin{macrocode} +\int_const:Nn \c_@@_term_ior { -1 } +% \end{macrocode} +% \end{variable} +% +% \begin{macro}{\ior_get_term:nN, \ior_str_get_term:nN} +% \begin{macro}{\@@_get_term:NnN} +% Getting from the terminal is better with pretty-printing. +% \begin{macrocode} +\cs_new_protected:Npn \ior_get_term:nN #1#2 + { \@@_get_term:NnN \@@_get:NN {#1} #2 } +\cs_new_protected:Npn \ior_str_get_term:nN #1#2 + { \@@_get_term:NnN \@@_str_get:NN {#1} #2 } +\cs_new_protected:Npn \@@_get_term:NnN #1#2#3 + { + \group_begin: + \tex_escapechar:D = -1 \scan_stop: + \tl_if_blank:nTF {#2} + { \exp_args:NNc #1 \c_@@_term_ior } + { \exp_args:NNc #1 \c_term_ior } + {#2} + \exp_args:NNNv \group_end: + \tl_set:Nn #3 {#2} + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \begin{macro}[EXP]{\ior_map_break:, \ior_map_break:n} % Usual map breaking functions. % \begin{macrocode} |