summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/l3experimental
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-03-08 23:01:35 +0000
committerKarl Berry <karl@freefriends.org>2017-03-08 23:01:35 +0000
commit6fca20c09474a7f6a3559af1c984243a83669f61 (patch)
treecbfda048c91853241ef903a84a088c1e3a66fd50 /Master/texmf-dist/source/latex/l3experimental
parentddbc1f2a5f193876d6f1df544e286029c6d671f8 (diff)
l3 (8mar17)
git-svn-id: svn://tug.org/texlive/trunk@43432 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/l3experimental')
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3str/l3flag.dtx306
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3str/l3regex.dtx470
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx124
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx31
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3str/l3str.ins1
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx53
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-build.dtx12
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx145
-rw-r--r--Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx12
9 files changed, 478 insertions, 676 deletions
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3flag.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3flag.dtx
deleted file mode 100644
index ef80dc1a7ba..00000000000
--- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3flag.dtx
+++ /dev/null
@@ -1,306 +0,0 @@
-% \iffalse meta-comment
-%
-%% File: l3flag.dtx Copyright (C) 2011-2012,2014-2016 The LaTeX3 Project
-%
-% It may be distributed and/or modified under the conditions of the
-% LaTeX Project Public License (LPPL), either version 1.3c of this
-% license or (at your option) any later version. The latest version
-% of this license is in the file
-%
-% http://www.latex-project.org/lppl.txt
-%
-% This file is part of the "l3experimental bundle" (The Work in LPPL)
-% and all files in that bundle must be distributed together.
-%
-% -----------------------------------------------------------------------
-%
-% The development version of the bundle can be found at
-%
-% https://github.com/latex3/latex3
-%
-% for those people who are interested.
-%
-%<*driver|package>
-% The version of expl3 required is tested as early as possible, as
-% some really old versions do not define \ProvidesExplPackage.
-\RequirePackage{expl3}[2017/02/10]
-%<package>\@ifpackagelater{expl3}{2017/02/10}
-%<package> {}
-%<package> {%
-%<package> \PackageError{l3flag}{Support package l3kernel too old}
-%<package> {%
-%<package> Please install an up to date version of l3kernel\MessageBreak
-%<package> using your TeX package manager or from CTAN.\MessageBreak
-%<package> \MessageBreak
-%<package> Loading l3flag will abort!%
-%<package> }%
-%<package> \endinput
-%<package> }
-\GetIdInfo$Id: l3flag.dtx 6878 2017-02-10 07:40:59Z joseph $
- {L3 Experimental flags}
-%</driver|package>
-%<*driver>
-\documentclass[full]{l3doc}
-\usepackage{amsmath}
-\begin{document}
- \DocInput{\jobname.dtx}
-\end{document}
-%</driver>
-% \fi
-%
-%
-% \title{^^A
-% The \textsf{l3flag} package: expandable flags^^A
-% \thanks{This file describes v\ExplFileVersion,
-% last revised \ExplFileDate.}^^A
-% }
-%
-% \author{^^A
-% The \LaTeX3 Project\thanks
-% {^^A
-% E-mail:
-% \href{mailto:latex-team@latex-project.org}
-% {latex-team@latex-project.org}^^A
-% }^^A
-% }
-%
-% \date{Released \ExplFileDate}
-%
-% \maketitle
-%
-% \begin{documentation}
-%
-% Flags are the only data-type on which \TeX{} can perform
-% assignments in expansion-only contexts. This module is meant mostly
-% for kernel use: in almost all cases, booleans or integers should be
-% preferred to flags, because they are faster.
-%
-% A flag can hold any non-negative value, which we call its
-% \meta{height}. In expansion-only contexts, a flag can only be
-% \enquote{raised}: this normally increases the \meta{height} by $1$,
-% but can be configured by defining specific traps. The \meta{height}
-% can also be queried expandably. However, decreasing it, or setting it
-% to zero requires non-expandable assignments.
-%
-% Flag variables are always local. They are referenced by a \meta{name}
-% of the form \meta{package}\texttt{_}\meta{flag name}, for instance,
-% \texttt{str_missing}.
-%
-% \section{Setting up flags}
-%
-% \begin{function}{\flag_new:n}
-% \begin{syntax}
-% \cs{flag_new:n} \Arg{flag name}
-% \end{syntax}
-% Creates a new \meta{flag} with a name given by \meta{flag name}, or
-% raises an error if the name is already taken. The \meta{flag name}
-% must consist of character tokens only. The declaration is global,
-% but flags are always local variables. The \meta{flag} will initially
-% have zero height.
-% \end{function}
-%
-% \begin{function}{\flag_clear:n}
-% \begin{syntax}
-% \cs{flag_clear:n} \Arg{flag name}
-% \end{syntax}
-% The \meta{flag}'s height is set to zero. The assignment is local.
-% \end{function}
-%
-% \begin{function}{\flag_clear_new:n}
-% \begin{syntax}
-% \cs{flag_clear_new:n} \Arg{flag name}
-% \end{syntax}
-% Ensures that the \meta{flag} exists globally by applying
-% \cs{flag_new:n} if necessary, then applies \cs{flag_zero:n}, setting
-% the height to zero locally.
-% \end{function}
-%
-% \begin{function}{\flag_set_trap:nn}
-% \begin{syntax}
-% \cs{flag_set_trap:nn} \Arg{flag name} \Arg{inline function}
-% \end{syntax}
-% Changes the action that is taken when the \meta{flag} is raised
-% using \cs{flag_raise:n}. Instead of the default action which is to
-% increase the \meta{flag}'s height by $1$, the \meta{inline function}
-% will be called, receiving the current flag's height as |#1|. The
-% \meta{inline function} should expand to nothing; \emph{e.g.}, it
-% could call \cs{msg_expandable_error:n}. This function is very
-% experimental.
-% \end{function}
-%
-% \section{Expandable flag commands}
-%
-% \begin{function}[EXP,pTF]{\flag_if_exist:n}
-% \begin{syntax}
-% \cs{flag_if_exist:n} \Arg{flag name}
-% \end{syntax}
-% This function returns \texttt{true} if the \meta{flag name}
-% references a flag that has been defined previously, and
-% \texttt{false} otherwise.
-% \end{function}
-%
-% \begin{function}[EXP,pTF]{\flag_if_raised:n}
-% \begin{syntax}
-% \cs{flag_if_raised:n} \Arg{flag name}
-% \end{syntax}
-% This function returns \texttt{true} if the \meta{flag} has non-zero
-% height, and \texttt{false} if the \meta{flag} has zero height.
-% \end{function}
-%
-% \begin{function}[EXP]{\flag_height:n}
-% \begin{syntax}
-% \cs{flag_height:n} \Arg{flag name}
-% \end{syntax}
-% Expands to the height of the \meta{flag} as an integer denotation.
-% \end{function}
-%
-% \begin{function}[EXP]{\flag_raise:n}
-% \begin{syntax}
-% \cs{flag_raise:n} \Arg{flag name}
-% \end{syntax}
-% The \meta{flag}'s trap is performed, taking the current height as
-% its argument. The default behaviour is to increase the \meta{flag}'s
-% height by $1$ locally. This function is expandable, as long as the
-% trap is expandable (the default trap is expandable, despite being an
-% assignment).
-% \end{function}
-%
-% \end{documentation}
-%
-% \begin{implementation}
-%
-% \section{\pkg{l3flag} implementation}
-%
-% \begin{macrocode}
-%<*initex|package>
-% \end{macrocode}
-%
-% \begin{macrocode}
-%<@@=flag>
-% \end{macrocode}
-%
-% \begin{macrocode}
-\ProvidesExplPackage
- {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-% \end{macrocode}
-%
-% \subsection{Non-expandable flag commands}
-%
-% \begin{macro}{\flag_new:n}
-% For each flag, we define a \enquote{trap} function, which by default
-% simply increases the flag by $1$.
-% \begin{macrocode}
-\cs_new_protected:Npn \flag_new:n #1
- {
- \cs_new:cpn { @@_trap_#1:w } ##1 ;
- { \exp_after:wN \use_none:n \cs:w @@_#1_##1: \cs_end: }
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\flag_clear:n}
-% \begin{macro}[aux]{\@@_clear:ww}
-% Undefine control sequences, starting from the |_0| flag, upwards,
-% until reaching an undefined control sequence.
-% \begin{macrocode}
-\cs_new_protected:Npn \flag_clear:n #1
- { \@@_clear:ww 0 ; #1 \q_stop }
-\cs_new_protected:Npn \@@_clear:ww #1 ; #2 \q_stop
- {
- \if_cs_exist:w @@_#2_#1: \cs_end:
- \else:
- \exp_after:wN \use_none_delimit_by_q_stop:w
- \fi:
- \cs_set_eq:cN { @@_#2_#1: } \tex_undefined:D
- \exp_after:wN \@@_clear:ww
- \__int_value:w \__int_eval:w \c_one + #1 ;
- #2 \q_stop
- }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\flag_clear_new:n}
-% As for other datatypes, clear the \meta{flag} or create a new one,
-% as appropriate.
-% \begin{macrocode}
-\cs_new_protected:Npn \flag_clear_new:n #1
- { \flag_if_exist:nTF {#1} { \flag_clear:n } { \flag_new:n } {#1} }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\flag_set_trap:nn}
-% ^^A todo: check that the flag exists.
-% Redefine the trap.
-% \begin{macrocode}
-\cs_new_protected:Npn \flag_set_trap:nn #1#2
- { \cs_set:cpn { @@_trap_#1:w } ##1 ; {#2} }
-% \end{macrocode}
-% \end{macro}
-%
-% \subsection{Expandable flag commands}
-%
-% \begin{macro}[EXP, pTF]{\flag_if_exist:n}
-% A flag exist if the corresponding trap \cs{@@_trap_\meta{flag
-% name}:n} is defined.
-% \begin{macrocode}
-\prg_new_conditional:Npnn \flag_if_exist:n #1 { p , T , F , TF }
- {
- \cs_if_exist:cTF { @@_trap_#1:w }
- { \prg_return_true: } { \prg_return_false: }
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}[EXP, pTF]{\flag_if_raised:n}
-% Test if the flag is non-zero, by checking the |_0| control sequence.
-% \begin{macrocode}
-\prg_new_conditional:Npnn \flag_if_raised:n #1 { p , T , F , TF }
- {
- \if_cs_exist:w @@_#1_0: \cs_end:
- \prg_return_true:
- \else:
- \prg_return_false:
- \fi:
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}[EXP]{\flag_height:n}
-% \begin{macro}[EXP, aux]{\@@_height_loop:ww, \@@_height_end:ww}
-% Extract the value of the flag by going through all of the
-% |_|\meta{integer} control sequences starting from $0$.
-% \begin{macrocode}
-\cs_new:Npn \flag_height:n #1 { \@@_height_loop:ww 0; #1 \q_stop }
-\cs_new:Npn \@@_height_loop:ww #1 ; #2 \q_stop
- {
- \if_cs_exist:w @@_#2_#1: \cs_end:
- \exp_after:wN \@@_height_loop:ww \__int_value:w \__int_eval:w \c_one +
- \else:
- \exp_after:wN \@@_height_end:ww
- \fi:
- #1 ; #2 \q_stop
- }
-\cs_new:Npn \@@_height_end:ww #1 ; #2 \q_stop { #1 }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}[EXP]{\flag_raise:n}
-% Simply apply the trap to the height, after expanding the latter.
-% \begin{macrocode}
-\cs_new:Npn \flag_raise:n #1
- {
- \cs:w @@_trap_#1:w \exp_after:wN \cs_end:
- \__int_value:w \flag_height:n {#1} ;
- }
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macrocode}
-%</initex|package>
-% \end{macrocode}
-%
-% \end{implementation}
-%
-% \PrintIndex
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3regex.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3regex.dtx
index 548486edcd5..9586e3f57d1 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3regex.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3regex.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3regex.dtx Copyright (C) 2011-2016 The LaTeX3 Project
+%% File: l3regex.dtx Copyright (C) 2011-2017 The LaTeX3 Project
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -23,8 +23,8 @@
%<*driver|package>
% The version of expl3 required is tested as early as possible, as
% some really old versions do not define \ProvidesExplPackage.
-\RequirePackage{expl3}[2017/02/10]
-%<package>\@ifpackagelater{expl3}{2017/02/10}
+\RequirePackage{expl3}[2017/03/07]
+%<package>\@ifpackagelater{expl3}{2017/03/07}
%<package> {}
%<package> {%
%<package> \PackageError{l3regex}{Support package l3kernel too old}
@@ -36,7 +36,7 @@
%<package> }%
%<package> \endinput
%<package> }
-\GetIdInfo$Id: l3regex.dtx 6878 2017-02-10 07:40:59Z joseph $
+\GetIdInfo$Id: l3regex.dtx 6984 2017-03-07 20:53:23Z joseph $
{L3 Experimental regular expressions}
%</driver|package>
%<*driver>
@@ -740,7 +740,7 @@
%<*package>
\ProvidesExplPackage
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\RequirePackage{l3tl-build, l3tl-analysis, l3flag, l3str-convert}
+\RequirePackage{l3tl-build, l3tl-analysis, l3str-convert}
%</package>
% \end{macrocode}
%
@@ -1028,17 +1028,15 @@
\cs_new_protected:Npn \@@_compute_case_changed_char:
{
\int_set_eq:NN \l_@@_case_changed_char_int \l_@@_current_char_int
- \if_int_compare:w \l_@@_current_char_int < \c_ninety_one
- \if_int_compare:w \l_@@_current_char_int < \c_sixty_five
- \else:
- \int_add:Nn \l_@@_case_changed_char_int { \c_thirty_two }
+ \if_int_compare:w \l_@@_current_char_int > `Z \exp_stop_f:
+ \if_int_compare:w \l_@@_current_char_int > `z \exp_stop_f: \else:
+ \if_int_compare:w \l_@@_current_char_int < `a \exp_stop_f: \else:
+ \int_sub:Nn \l_@@_case_changed_char_int { \c__str_ascii_lower_int }
+ \fi:
\fi:
\else:
- \if_int_compare:w \l_@@_current_char_int < \c_one_hundred_twenty_three
- \if_int_compare:w \l_@@_current_char_int < \c_ninety_seven
- \else:
- \int_sub:Nn \l_@@_case_changed_char_int { \c_thirty_two }
- \fi:
+ \if_int_compare:w \l_@@_current_char_int < `A \exp_stop_f: \else:
+ \int_add:Nn \l_@@_case_changed_char_int { \c__str_ascii_lower_int }
\fi:
\fi:
}
@@ -1071,7 +1069,7 @@
1 \or: 4 \or: 10 \or: 40
\or: 100 \or: \or: 1000 \or: 4000
\or: 10000 \or: \or: 100000 \or: 400000
- \or: 1000000 \or: 4000000 \else: 1*\c_zero
+ \or: 1000000 \or: 4000000 \else: 1*0
\fi:
}
\cs_new_protected:Npn \@@_item_catcode:nT #1
@@ -1088,9 +1086,9 @@
% \end{macro}
% \end{macro}
%
-% \begin{macro}[int]{\@@_item_exact:nn, \@@_item_exact_cs:c}
+% \begin{macro}[int]{\@@_item_exact:nn, \@@_item_exact_cs:n}
% This matches an exact \meta{category}-\meta{character code} pair, or
-% an exact control sequence.
+% an exact control sequence, more precisely one of several possible control sequences.
% \begin{macrocode}
\cs_new_protected:Npn \@@_item_exact:nn #1#2
{
@@ -1100,16 +1098,18 @@
\fi:
\fi:
}
-\cs_new_protected:Npn \@@_item_exact_cs:c #1
+\cs_new_protected:Npn \@@_item_exact_cs:n #1
{
- \int_compare:nNnTF \l_@@_current_catcode_int = \c_zero
+ \int_compare:nNnTF \l_@@_current_catcode_int = 0
{
- \str_if_eq_x:nnTF
+ \tl_set:Nx \l_@@_internal_a_tl
{
+ \scan_stop:
\exp_after:wN \exp_after:wN \exp_after:wN \cs_to_str:N
\tex_the:D \tex_toks:D \l_@@_current_pos_int
+ \scan_stop:
}
- { #1 }
+ \tl_if_in:noTF { \scan_stop: #1 \scan_stop: } \l_@@_internal_a_tl
{ \@@_break_true:w } { }
}
{ }
@@ -1129,7 +1129,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_item_cs:n #1
{
- \int_compare:nNnT \l_@@_current_catcode_int = \c_zero
+ \int_compare:nNnT \l_@@_current_catcode_int = 0
{
\group_begin:
\tl_set:Nx \l_@@_cs_name_tl
@@ -1170,31 +1170,34 @@
% mostly lower case letter text.
% \begin{macrocode}
\cs_new_protected:Npn \@@_prop_d:
- { \@@_item_caseful_range:nn \c_forty_eight { 57 } } % 0--9
+ { \@@_item_caseful_range:nn { `0 } { `9 } }
\cs_new_protected:Npn \@@_prop_h:
{
- \@@_item_caseful_equal:n \c_thirty_two % space
- \@@_item_caseful_equal:n \c_nine % tab
+ \@@_item_caseful_equal:n { `\ }
+ \@@_item_caseful_equal:n { `\^^I }
}
\cs_new_protected:Npn \@@_prop_s:
{
- \@@_item_caseful_equal:n \c_thirty_two % space
- \@@_item_caseful_equal:n \c_nine % tab
- \@@_item_caseful_equal:n \c_ten % lf
- \@@_item_caseful_equal:n \c_twelve % ff
- \@@_item_caseful_equal:n \c_thirteen % cr
+ \@@_item_caseful_equal:n { `\ }
+ \@@_item_caseful_equal:n { `\^^I }
+ \@@_item_caseful_equal:n { `\^^J }
+ \@@_item_caseful_equal:n { `\^^L }
+ \@@_item_caseful_equal:n { `\^^M }
}
\cs_new_protected:Npn \@@_prop_v:
- { \@@_item_caseful_range:nn \c_ten \c_thirteen } % lf, vtab, ff, cr
+ { \@@_item_caseful_range:nn { `\^^J } { `\^^M } } % lf, vtab, ff, cr
\cs_new_protected:Npn \@@_prop_w:
{
- \@@_item_caseful_range:nn \c_ninety_seven { 122 } % a--z
- \@@_item_caseful_range:nn \c_sixty_five { 90 } % A--Z
- \@@_item_caseful_range:nn \c_forty_eight { 57 } % 0--9
- \@@_item_caseful_equal:n { 95 } % _
+ \@@_item_caseful_range:nn { `a } { `z }
+ \@@_item_caseful_range:nn { `A } { `Z }
+ \@@_item_caseful_range:nn { `0 } { `9 }
+ \@@_item_caseful_equal:n { `_ }
}
\cs_new_protected:Npn \@@_prop_N:
- { \@@_item_reverse:n { \@@_item_caseful_equal:n \c_ten } }
+ {
+ \@@_item_reverse:n
+ { \@@_item_caseful_equal:n { `\^^J } }
+ }
% \end{macrocode}
% \end{macro}
%
@@ -1213,40 +1216,46 @@
\cs_new_protected:Npn \@@_posix_alpha:
{ \@@_posix_lower: \@@_posix_upper: }
\cs_new_protected:Npn \@@_posix_ascii:
- { \@@_item_caseful_range:nn \c_zero \c_one_hundred_twenty_seven }
+ {
+ \@@_item_caseful_range:nn
+ \c__str_ascii_min_int
+ \c__str_ascii_max_int
+ }
\cs_new_eq:NN \@@_posix_blank: \@@_prop_h:
\cs_new_protected:Npn \@@_posix_cntrl:
{
- \@@_item_caseful_range:nn \c_zero { 31 }
- \@@_item_caseful_equal:n \c_one_hundred_twenty_seven
+ \@@_item_caseful_range:nn
+ \c__str_ascii_min_int
+ \c__str_ascii_max_control_int
+ \@@_item_caseful_equal:n \c__str_ascii_max_int
}
\cs_new_eq:NN \@@_posix_digit: \@@_prop_d:
\cs_new_protected:Npn \@@_posix_graph:
- { \@@_item_caseful_range:nn { 33 } { 126 } }
+ { \@@_item_caseful_range:nn { `! } { `\~ } }
\cs_new_protected:Npn \@@_posix_lower:
- { \@@_item_caseful_range:nn \c_ninety_seven { 122 } }
+ { \@@_item_caseful_range:nn { `a } { `z } }
\cs_new_protected:Npn \@@_posix_print:
- { \@@_item_caseful_range:nn \c_thirty_two { 126 } }
+ { \@@_item_caseful_range:nn { `\ } { `\~ } }
\cs_new_protected:Npn \@@_posix_punct:
{
- \@@_item_caseful_range:nn { 33 } { 47 }
- \@@_item_caseful_range:nn { 58 } { 64 }
- \@@_item_caseful_range:nn { 91 } { 96 }
- \@@_item_caseful_range:nn { 123 } { 126 }
+ \@@_item_caseful_range:nn { `! } { `/ }
+ \@@_item_caseful_range:nn { `: } { `@ }
+ \@@_item_caseful_range:nn { `[ } { `` }
+ \@@_item_caseful_range:nn { `\{ } { `\~ }
}
\cs_new_protected:Npn \@@_posix_space:
{
- \@@_item_caseful_equal:n \c_thirty_two
- \@@_item_caseful_range:nn \c_nine \c_thirteen
+ \@@_item_caseful_equal:n { `\ }
+ \@@_item_caseful_range:nn { `\^^I } { `\^^M }
}
\cs_new_protected:Npn \@@_posix_upper:
- { \@@_item_caseful_range:nn \c_sixty_five { 90 } }
+ { \@@_item_caseful_range:nn { `A } { `Z } }
\cs_new_eq:NN \@@_posix_word: \@@_prop_w:
\cs_new_protected:Npn \@@_posix_xdigit:
{
\@@_posix_digit:
- \@@_item_caseful_range:nn \c_sixty_five { 70 }
- \@@_item_caseful_range:nn \c_ninety_seven { 102 }
+ \@@_item_caseful_range:nn { `A } { `F }
+ \@@_item_caseful_range:nn { `a } { `f }
}
% \end{macrocode}
% \end{macro}
@@ -1296,7 +1305,7 @@
\cs_set:Npn \@@_escape_unescaped:N ##1 { #1 }
\cs_set:Npn \@@_escape_escaped:N ##1 { #2 }
\cs_set:Npn \@@_escape_raw:N ##1 { #3 }
- \int_set:Nn \tex_escapechar:D { 92 }
+ \int_set:Nn \tex_escapechar:D { `\\ }
\__str_gset_other:Nn \g_@@_internal_tl { #4 }
\tl_set:Nx \l_@@_internal_b_tl
{
@@ -1398,12 +1407,12 @@
}
\cs_new:Npn \@@_escape_x_end:w #1 ;
{
- \int_compare:nNnTF {#1} < \c_two_hundred_fifty_six
+ \int_compare:nNnTF {#1} > \c__str_max_byte_int
+ { \@@_escape_x_large:n {#1} }
{
\exp_last_unbraced:Nf \@@_escape_raw:N
{ \__str_output_byte:n {#1} }
}
- { \@@_escape_x_large:n {#1} }
}
\group_begin:
\char_set_catcode_other:n { 0 }
@@ -1418,7 +1427,7 @@
{ \if_false: } \fi:
}
{
- \char_set_lccode:nn { \c_zero } {#1}
+ \char_set_lccode:nn { 0 } {#1}
\tex_lowercase:D
{
\tl_set:Nx \l_@@_internal_b_tl
@@ -1542,42 +1551,42 @@
% \begin{macrocode}
\prg_new_conditional:Npnn \@@_char_if_special:N #1 { TF }
{
- \if_int_compare:w `#1 < \c_ninety_one
- \if_int_compare:w `#1 < \c_fifty_eight
- \if_int_compare:w `#1 < \c_forty_eight
- \if_int_compare:w `#1 < \c_thirty_two
- \prg_return_false: \else: \prg_return_true: \fi:
- \else: \prg_return_false: \fi:
+ \if_int_compare:w `#1 > `Z \exp_stop_f:
+ \if_int_compare:w `#1 > `z \exp_stop_f:
+ \if_int_compare:w `#1 < \c__str_ascii_max_int
+ \prg_return_true: \else: \prg_return_false: \fi:
\else:
- \if_int_compare:w `#1 < \c_sixty_five
+ \if_int_compare:w `#1 < `a \exp_stop_f:
\prg_return_true: \else: \prg_return_false: \fi:
\fi:
\else:
- \if_int_compare:w `#1 < \c_one_hundred_twenty_three
- \if_int_compare:w `#1 < \c_ninety_seven
+ \if_int_compare:w `#1 > `9 \exp_stop_f:
+ \if_int_compare:w `#1 < `A \exp_stop_f:
\prg_return_true: \else: \prg_return_false: \fi:
\else:
- \if_int_compare:w `#1 < \c_one_hundred_twenty_seven
- \prg_return_true: \else: \prg_return_false: \fi:
+ \if_int_compare:w `#1 < `0 \exp_stop_f:
+ \if_int_compare:w `#1 < `\ \exp_stop_f:
+ \prg_return_false: \else: \prg_return_true: \fi:
+ \else: \prg_return_false: \fi:
\fi:
\fi:
}
\prg_new_conditional:Npnn \@@_char_if_alphanumeric:N #1 { TF }
{
- \if_int_compare:w `#1 < \c_ninety_one
- \if_int_compare:w `#1 < \c_fifty_eight
- \if_int_compare:w `#1 < \c_forty_eight
- \prg_return_false: \else: \prg_return_true: \fi:
+ \if_int_compare:w `#1 > `Z \exp_stop_f:
+ \if_int_compare:w `#1 > `z \exp_stop_f:
+ \prg_return_false:
\else:
- \if_int_compare:w `#1 < \c_sixty_five
+ \if_int_compare:w `#1 < `a \exp_stop_f:
\prg_return_false: \else: \prg_return_true: \fi:
\fi:
\else:
- \if_int_compare:w `#1 < \c_one_hundred_twenty_three
- \if_int_compare:w `#1 < \c_ninety_seven
+ \if_int_compare:w `#1 > `9 \exp_stop_f:
+ \if_int_compare:w `#1 < `A \exp_stop_f:
\prg_return_false: \else: \prg_return_true: \fi:
\else:
- \prg_return_false:
+ \if_int_compare:w `#1 < `0 \exp_stop_f:
+ \prg_return_false: \else: \prg_return_true: \fi:
\fi:
\fi:
}
@@ -1613,7 +1622,9 @@
% \item \cs{@@_item_catcode_reverse:nT} \Arg{catcode bitmap} \Arg{tests}
% \item \cs{@@_item_reverse:n} \Arg{tests}
% \item \cs{@@_item_exact:nn} \Arg{catcode} \Arg{char code}
-% \item \cs{@@_item_exact_cs:c} \Arg{csname}
+% \item \cs{@@_item_exact_cs:n} \Arg{csnames}, more precisely given as
+% \meta{csname} \cs{scan_stop:} \meta{csname} \cs{scan_stop:}
+% \meta{csname} and so on in a brace group.
% \item \cs{@@_item_cs:n} \Arg{compiled regex}
% \end{itemize}
%
@@ -1627,13 +1638,30 @@
% \end{variable}
%
% \begin{variable}{\l_@@_mode_int}
+% \begin{variable}
+% {
+% \c_@@_cs_in_class_mode_int,
+% \c_@@_cs_mode_int,
+% \c_@@_outer_mode_int,
+% \c_@@_catcode_mode_int,
+% \c_@@_class_mode_int,
+% \c_@@_catcode_in_class_mode_int
+% }
% While compiling, ten modes are recognized, labelled $-63$, $-23$,
% $-6$, $-2$, $0$, $2$, $3$, $6$, $23$, $63$. See
-% section~\ref{sec:regex-modes}.
+% section~\ref{sec:regex-modes}. We only define some of these as
+% constants.
% \begin{macrocode}
\int_new:N \l_@@_mode_int
+\int_const:Nn \c_@@_cs_in_class_mode_int { -6 }
+\int_const:Nn \c_@@_cs_mode_int { -2 }
+\int_const:Nn \c_@@_outer_mode_int { 0 }
+\int_const:Nn \c_@@_catcode_mode_int { 2 }
+\int_const:Nn \c_@@_class_mode_int { 3 }
+\int_const:Nn \c_@@_catcode_in_class_mode_int { 6 }
% \end{macrocode}
% \end{variable}
+% \end{variable}
%
% \begin{variable}{\l_@@_catcodes_int, \l_@@_default_catcodes_int}
% \begin{variable}{\l_@@_catcodes_bool}
@@ -1738,7 +1766,7 @@
\prg_new_conditional:Npnn \@@_if_raw_digit:NN #1#2 { TF }
{
\if_meaning:w \@@_compile_raw:N #1
- \if_int_compare:w \c_one < 1 #2 \exp_stop_f:
+ \if_int_compare:w 1 < 1 #2 \exp_stop_f:
\prg_return_true:
\else:
\prg_return_false:
@@ -1763,7 +1791,7 @@
% \item[6] |[\c...]| catcode test in a class,
% \item[-63] |[\c{[...]}]| class inside mode $-6$,
% \item[-23] |\c{[...]}| class inside mode $-2$,
-% \item[3] |[...]| class inside mode $-3$,
+% \item[3] |[...]| class inside mode $0$,
% \item[23] |\c[...]| class inside mode $2$,
% \item[63] |[\c[...]]| class inside mode $6$.
% \end{itemize}
@@ -1819,7 +1847,7 @@
\if_int_odd:w \l_@@_mode_int
\exp_after:wN \use_ii:nn
\else:
- \if_int_compare:w \l_@@_mode_int < \c_zero
+ \if_int_compare:w \l_@@_mode_int < \c_@@_outer_mode_int
\exp_after:wN \exp_after:wN \exp_after:wN \use_i:nn
\else:
\exp_after:wN \exp_after:wN \exp_after:wN \use_ii:nn
@@ -1838,7 +1866,7 @@
\if_int_odd:w \l_@@_mode_int
\exp_after:wN \use_i:nn
\else:
- \if_int_compare:w \l_@@_mode_int > \c_zero
+ \if_int_compare:w \l_@@_mode_int > \c_@@_outer_mode_int
\exp_after:wN \exp_after:wN \exp_after:wN \use_i:nn
\else:
\exp_after:wN \exp_after:wN \exp_after:wN \use_ii:nn
@@ -1856,7 +1884,7 @@
% \begin{macrocode}
\cs_new:Npn \@@_if_within_catcode:TF
{
- \if_int_compare:w \l_@@_mode_int > \c_zero
+ \if_int_compare:w \l_@@_mode_int > \c_@@_outer_mode_int
\exp_after:wN \use_i:nn
\else:
\exp_after:wN \use_ii:nn
@@ -1871,10 +1899,10 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_chk_c_allowed:T
{
- \if_int_compare:w \l_@@_mode_int = \c_zero
+ \if_int_compare:w \l_@@_mode_int = \c_@@_outer_mode_int
\exp_after:wN \use:n
\else:
- \if_int_compare:w \l_@@_mode_int = \c_three
+ \if_int_compare:w \l_@@_mode_int = \c_@@_class_mode_int
\exp_after:wN \exp_after:wN \exp_after:wN \use:n
\else:
\__msg_kernel_error:nn { regex } { c-bad-mode }
@@ -1891,11 +1919,11 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_mode_quit_c:
{
- \if_int_compare:w \l_@@_mode_int = \c_two
- \l_@@_mode_int = \c_zero
+ \if_int_compare:w \l_@@_mode_int = \c_@@_catcode_mode_int
+ \int_set_eq:NN \l_@@_mode_int \c_@@_outer_mode_int
\else:
- \if_int_compare:w \l_@@_mode_int = \c_six
- \l_@@_mode_int = \c_three
+ \if_int_compare:w \l_@@_mode_int = \c_@@_catcode_in_class_mode_int
+ \int_set_eq:NN \l_@@_mode_int \c_@@_class_mode_int
\fi:
\fi:
}
@@ -1931,7 +1959,7 @@
\prg_do_nothing: \prg_do_nothing:
}
{ }
- \if_int_compare:w \l_@@_group_level_int > \c_zero
+ \if_int_compare:w \l_@@_group_level_int > 0 \exp_stop_f:
\__msg_kernel_error:nnx { regex } { missing-rparen }
{ \int_use:N \l_@@_group_level_int }
\prg_replicate:nn
@@ -1967,8 +1995,8 @@
\cs_new_protected:Npn \@@_compile:n #1
{
\@@_compile:w
- \int_set:Nn \tex_escapechar:D { 92 }
- \int_set_eq:NN \l_@@_mode_int \c_zero
+ \int_set:Nn \tex_escapechar:D { `\\ }
+ \int_set_eq:NN \l_@@_mode_int \c_@@_outer_mode_int
\@@_escape_use:nnnn
{
\@@_char_if_special:NTF ##1
@@ -1982,14 +2010,12 @@
{ #1 }
\prg_do_nothing: \prg_do_nothing:
\prg_do_nothing: \prg_do_nothing:
- \int_compare:nNnT \l_@@_mode_int = \c_two
+ \int_compare:nNnT \l_@@_mode_int = \c_@@_catcode_mode_int
{ \__msg_kernel_error:nn { regex } { c-trailing } }
- \int_compare:nNnT \l_@@_mode_int < \c_zero
+ \int_compare:nNnT \l_@@_mode_int < \c_@@_outer_mode_int
{
\__msg_kernel_error:nn { regex } { c-missing-rbrace }
- \@@_compile_end:
- \@@_compile_one:x
- { \@@_item_cs:n { \exp_not:o \l_@@_internal_regex } }
+ \@@_compile_end_cs:
\prg_do_nothing: \prg_do_nothing:
\prg_do_nothing: \prg_do_nothing:
}
@@ -2343,7 +2369,7 @@
}
\cs_new_protected:cpn { @@_prop_.: }
{
- \if_int_compare:w \l_@@_current_char_int > - \c_two
+ \if_int_compare:w \l_@@_current_char_int > - 2 \exp_stop_f:
\exp_after:wN \@@_break_true:w
\fi:
}
@@ -2467,11 +2493,11 @@
{
\@@_if_in_class:TF
{
- \if_int_compare:w \l_@@_mode_int > \c_sixteen
+ \if_int_compare:w \l_@@_mode_int > \c_@@_catcode_in_class_mode_int
\__tl_build_one:n { \if_false: { \fi: } }
\fi:
- \tex_advance:D \l_@@_mode_int - \c_fifteen
- \tex_divide:D \l_@@_mode_int \c_thirteen
+ \tex_advance:D \l_@@_mode_int - 15 \exp_stop_f:
+ \tex_divide:D \l_@@_mode_int 13 \exp_stop_f:
\if_int_odd:w \l_@@_mode_int \else:
\exp_after:wN \@@_compile_quantifier:w
\fi:
@@ -2531,7 +2557,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_compile_class_catcode:w #1;
{
- \if_int_compare:w \l_@@_mode_int = \c_two
+ \if_int_compare:w \l_@@_mode_int = \c_@@_catcode_mode_int
\__tl_build_one:n
{ \@@_class:NnnnN \c_true_bool { \if_false: } \fi: }
\fi:
@@ -2678,7 +2704,7 @@
}
\cs_new_protected:Npn \@@_compile_group_end:
{
- \if_int_compare:w \l_@@_group_level_int > \c_zero
+ \if_int_compare:w \l_@@_group_level_int > 0 \exp_stop_f:
\__tl_build_one:n { \if_false: { \fi: } }
\__tl_build_end:
\int_set_eq:NN \l_@@_catcodes_int \l_@@_default_catcodes_int
@@ -2821,7 +2847,11 @@
{
\int_set_eq:Nc \l_@@_catcodes_int { c_@@_catcode_#2_int }
\l_@@_mode_int
- = \if_case:w \l_@@_mode_int \c_two \else: \c_six \fi:
+ = \if_case:w \l_@@_mode_int
+ \c_@@_catcode_mode_int
+ \else:
+ \c_@@_catcode_in_class_mode_int
+ \fi:
}
}
{ \cs_if_exist_use:cF { @@_compile_c_#2:w } }
@@ -2847,7 +2877,11 @@
\cs_new_protected:cpn { @@_compile_c_[:w } #1#2
{
\l_@@_mode_int
- = \if_case:w \l_@@_mode_int \c_two \else: \c_six \fi:
+ = \if_case:w \l_@@_mode_int
+ \c_@@_catcode_mode_int
+ \else:
+ \c_@@_catcode_in_class_mode_int
+ \fi:
\int_zero:N \l_@@_catcodes_int
\str_if_eq:nnTF { #1 #2 } { \@@_compile_special:N ^ }
{
@@ -2909,32 +2943,93 @@
\@@_compile:w
\@@_disable_submatches:
\l_@@_mode_int
- = - \if_case:w \l_@@_mode_int \c_two \else: \c_six \fi:
+ = \if_case:w \l_@@_mode_int
+ \c_@@_cs_mode_int
+ \else:
+ \c_@@_cs_in_class_mode_int
+ \fi:
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}+\@@_compile_}:+
+% \begin{macro}{\@@_compile_end_cs:}
+% \begin{macro}[EXP,aux]{\@@_compile_cs_aux:Nn, \@@_compile_cs_aux:NNnnnN}
% Non-escaped right braces are only special if they appear when
% compiling the regular expression for a csname, but not within a
-% class: |\c{[}{]}| matches the control sequences |\}| and
-% |\{|\ldots{} Admittedly, that would be better done as
-% |\c{[{}]}|. So, end compiling the inner regex (this closes any
-% dangling class or group). Then insert the corresponding test in the
-% outer regex.
-% \begin{macrocode}
+% class: |\c{[{}]}| matches the control sequences |\{| and |\}|. So,
+% end compiling the inner regex (this closes any dangling class or
+% group). Then insert the corresponding test in the outer regex. As
+% an optimization, if the control sequence test simply consists of
+% several explicit possibilities (branches) then use
+% \cs{@@_item_exact_cs:n} with an argument consisting of all
+% possibilities separated by \cs{scan_stop:}.
+% \begin{macrocode}
+\flag_new:n { @@_cs }
\cs_new_protected:cpn { @@_compile_ \c_right_brace_str : }
{
\@@_if_in_cs:TF
+ { \@@_compile_end_cs: }
+ { \exp_after:wN \@@_compile_raw:N \c_right_brace_str }
+ }
+\cs_new_protected:Npn \@@_compile_end_cs:
+ {
+ \@@_compile_end:
+ \flag_clear:n { @@_cs }
+ \tl_set:Nx \l_@@_internal_a_tl
{
- \@@_compile_end:
- \@@_compile_one:x
+ \exp_after:wN \@@_compile_cs_aux:Nn \l_@@_internal_regex
+ \q_nil \q_nil \q_recursion_stop
+ }
+ \exp_args:Nx \@@_compile_one:x
+ {
+ \flag_if_raised:nTF { @@_cs }
{ \@@_item_cs:n { \exp_not:o \l_@@_internal_regex } }
+ { \@@_item_exact_cs:n { \tl_tail:N \l_@@_internal_a_tl } }
+ }
+ }
+\cs_new:Npn \@@_compile_cs_aux:Nn #1#2
+ {
+ \cs_if_eq:NNTF #1 \@@_branch:n
+ {
+ \scan_stop:
+ \@@_compile_cs_aux:NNnnnN #2
+ \q_nil \q_nil \q_nil \q_nil \q_nil \q_nil \q_recursion_stop
+ \@@_compile_cs_aux:Nn
+ }
+ {
+ \quark_if_nil:NF #1 { \flag_raise:n { @@_cs } }
+ \use_none_delimit_by_q_recursion_stop:w
+ }
+ }
+\cs_new:Npn \@@_compile_cs_aux:NNnnnN #1#2#3#4#5#6
+ {
+ \bool_lazy_all:nTF
+ {
+ { \cs_if_eq_p:NN #1 \@@_class:NnnnN }
+ {#2}
+ { \tl_if_head_eq_meaning_p:nN {#3} \@@_item_caseful_equal:n }
+ { \int_compare_p:nNn { \tl_count:n {#3} } = { 2 } }
+ { \int_compare_p:nNn {#5} = { 0 } }
+ }
+ {
+ \prg_replicate:nn {#4}
+ { \char_generate:nn { \use_ii:nn #3 } {12} }
+ \@@_compile_cs_aux:NNnnnN
+ }
+ {
+ \quark_if_nil:NF #1
+ {
+ \flag_raise:n { @@_cs }
+ \use_i_delimit_by_q_recursion_stop:nw
+ }
+ \use_none_delimit_by_q_recursion_stop:w
}
- { \exp_after:wN \@@_compile_raw:N \c_right_brace_str }
}
% \end{macrocode}
% \end{macro}
+% \end{macro}
+% \end{macro}
%
% \subsubsection{Raw token lists with \cs{u}}
%
@@ -2998,7 +3093,7 @@
\cs_new_protected:Npn \@@_compile_u_end:
{
\tl_set:Nv \l_@@_internal_a_tl { \l_@@_internal_a_tl }
- \if_int_compare:w \l_@@_mode_int = \c_zero
+ \if_int_compare:w \l_@@_mode_int = \c_@@_outer_mode_int
\@@_compile_u_not_cs:
\else:
\@@_compile_u_in_cs:
@@ -3045,8 +3140,8 @@
{
\@@_class:NnnnN \c_true_bool
{
- \if_int_compare:w "##2 = \c_zero
- \@@_item_exact_cs:c { \exp_after:wN \cs_to_str:N ##1 }
+ \if_int_compare:w "##2 = 0 \exp_stop_f:
+ \@@_item_exact_cs:n { \exp_after:wN \cs_to_str:N ##1 }
\else:
\@@_item_exact:nn { \__int_value:w "##2 } { ##3 }
\fi:
@@ -3068,7 +3163,7 @@
% \begin{macrocode}
\cs_new_protected:cpn { @@_compile_/K: }
{
- \int_compare:nNnTF \l_@@_mode_int = \c_zero
+ \int_compare:nNnTF \l_@@_mode_int = \c_@@_outer_mode_int
{ \__tl_build_one:n { \@@_command_K: } }
{ \@@_compile_raw_error:N K }
}
@@ -3077,12 +3172,12 @@
%
% \subsubsection{Showing regexes}
%
-% \begin{macro}[aux]{\@@_show:Nx}
+% \begin{macro}[aux]{\@@_show:Nn}
% Within a \cs{__tl_build:Nw} \ldots{} \cs{__tl_build_end:} group, we
% redefine all the function that can appear in a compiled regex, then
% run the regex. The result is then shown.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_show:Nx #1#2
+\cs_new_protected:Npn \@@_show:Nn #1#2
{
\__tl_build:Nw \l_@@_internal_a_tl
\cs_set_protected:Npn \@@_branch:n
@@ -3124,16 +3219,16 @@
{ \@@_show_scope:nn { Reversed~match } }
\cs_set_protected:Npn \@@_item_exact:nn ##1##2
{ \@@_show_one:n { char~##2,~catcode~##1 } }
- \cs_set_protected:Npn \@@_item_exact_cs:c ##1
- { \@@_show_one:n { control~sequence~\iow_char:N\\##1 } }
+ \cs_set_eq:NN \@@_item_exact_cs:n \@@_show_item_exact_cs:n
\cs_set_protected:Npn \@@_item_cs:n
{ \@@_show_scope:nn { control~sequence } }
\cs_set:cpn { @@_prop_.: } { \@@_show_one:n { any~token } }
\seq_clear:N \l_@@_show_prefix_seq
\@@_show_push:n { ~ }
- #1
+ \cs_if_exist_use:N #1
\__tl_build_end:
- \__msg_show_wrap:n { >~Compiled~regex~#2: \l_@@_internal_a_tl }
+ \__msg_show_variable:NNNnn #1 \cs_if_exist:NTF ? { }
+ { >~Compiled~regex~#2: \l_@@_internal_a_tl }
}
% \end{macrocode}
% \end{macro}
@@ -3285,6 +3380,19 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}[aux]{\@@_show_item_exact_cs:n}
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_show_item_exact_cs:n #1
+ {
+ \seq_set_split:Nnn \l_@@_internal_seq { \scan_stop: } {#1}
+ \seq_set_map:NNn \l_@@_internal_seq
+ \l_@@_internal_seq { \iow_char:N\\##1 }
+ \@@_show_one:n
+ { control~sequence~ \seq_use:Nn \l_@@_internal_seq { ~or~ } }
+ }
+% \end{macrocode}
+% \end{macro}
+%
% \subsection{Building}
%
% \subsubsection{Variables used while building}
@@ -3385,7 +3493,7 @@
\cs_new_protected:Npn \@@_build:N #1
{
%<trace> \trace_push:nnn { regex } { 1 } { @@_build }
- \int_set:Nn \tex_escapechar:D { 92 }
+ \int_set:Nn \tex_escapechar:D { `\\ }
\int_zero:N \l_@@_capturing_group_int
\int_set_eq:NN \l_@@_max_state_int \l_@@_min_state_int
\@@_build_new_state:
@@ -3513,7 +3621,7 @@
L=\int_use:N \l_@@_left_state_int ~ -> ~
R=\int_use:N \l_@@_right_state_int ~ -> ~
M=\int_use:N \l_@@_max_state_int ~ -> ~
- \int_eval:n { \l_@@_max_state_int + \c_one }
+ \int_eval:n { \l_@@_max_state_int + 1 }
}
%</trace>
\tex_toks:D \l_@@_max_state_int { }
@@ -3610,7 +3718,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_class_repeat:nN #1#2
{
- \if_int_compare:w #1 = \c_zero
+ \if_int_compare:w #1 = 0 \exp_stop_f:
\@@_build_transitions_lazyness:NNNNN #2
\@@_action_free:n \l_@@_right_state_int
\@@_tests_action_cost:n \l_@@_left_state_int
@@ -3638,7 +3746,7 @@
{
\@@_class_repeat:n {#1}
\int_set:Nn \l_@@_internal_a_int
- { \l_@@_max_state_int + #2 - \c_one }
+ { \l_@@_max_state_int + #2 - 1 }
\prg_replicate:nn { #2 }
{
\@@_build_transitions_lazyness:NNNNN #3
@@ -3671,7 +3779,7 @@
\cs_new_protected:Npn \@@_group_aux:nnnnN #1#2#3#4#5
{
%<trace> \trace_push:nnn { regex } { 1 } { @@_group }
- \if_int_compare:w #3 = \c_zero
+ \if_int_compare:w #3 = 0 \exp_stop_f:
\@@_build_new_state:
%<assert>\assert_int:n { \l_@@_max_state_int = \l_@@_right_state_int + 1 }
\@@_build_transition_right:nNn \@@_action_free_group:n
@@ -3779,9 +3887,9 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_group_repeat:nn #1#2
{
- \if_int_compare:w #2 = \c_zero
+ \if_int_compare:w #2 = 0 \exp_stop_f:
\int_set:Nn \l_@@_max_state_int
- { \l_@@_left_state_int - \c_one }
+ { \l_@@_left_state_int - 1 }
\@@_build_new_state:
\else:
\@@_group_repeat_aux:n {#2}
@@ -3799,7 +3907,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_group_submatches:nNN #1#2#3
{
- \if_int_compare:w #1 > - \c_one
+ \if_int_compare:w #1 > - 1 \exp_stop_f:
\@@_toks_put_left:Nx #2 { \@@_action_submatch:n { #1 < } }
\@@_toks_put_left:Nx #3 { \@@_action_submatch:n { #1 > } }
\fi:
@@ -3823,10 +3931,10 @@
\l_@@_right_state_int \l_@@_max_state_int
\int_set_eq:NN \l_@@_internal_a_int \l_@@_left_state_int
\int_set_eq:NN \l_@@_internal_b_int \l_@@_max_state_int
- \if_int_compare:w \__int_eval:w #1 > \c_one
+ \if_int_compare:w \__int_eval:w #1 > 1 \exp_stop_f:
\int_set:Nn \l_@@_internal_c_int
{
- ( #1 - \c_one )
+ ( #1 - 1 )
* ( \l_@@_internal_b_int - \l_@@_internal_a_int )
}
\tex_advance:D \l_@@_right_state_int \l_@@_internal_c_int
@@ -3835,8 +3943,8 @@
{
\tex_toks:D \l_@@_internal_b_int
= \tex_toks:D \l_@@_internal_a_int
- \tex_advance:D \l_@@_internal_a_int \c_one
- \tex_advance:D \l_@@_internal_b_int \c_one
+ \int_incr:N \l_@@_internal_a_int
+ \int_incr:N \l_@@_internal_b_int
}
\fi:
}
@@ -3865,11 +3973,11 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_group_repeat:nnN #1#2#3
{
- \if_int_compare:w #2 = \c_zero
+ \if_int_compare:w #2 = 0 \exp_stop_f:
\@@_group_submatches:nNN {#1}
\l_@@_left_state_int \l_@@_right_state_int
\int_set:Nn \l_@@_internal_a_int
- { \l_@@_left_state_int - \c_one }
+ { \l_@@_left_state_int - 1 }
\@@_build_transition_right:nNn \@@_action_free:n
\l_@@_right_state_int \l_@@_internal_a_int
\@@_build_new_state:
@@ -3929,16 +4037,16 @@
\l_@@_left_state_int \l_@@_max_state_int
}
\else:
- \prg_replicate:nn { #3 - \c_one }
+ \prg_replicate:nn { #3 - 1 }
{
\int_sub:Nn \l_@@_right_state_int
{ \l_@@_internal_b_int - \l_@@_internal_a_int }
\@@_build_transition_right:nNn \@@_action_free:n
\l_@@_right_state_int \l_@@_max_state_int
}
- \if_int_compare:w #2 = \c_zero
+ \if_int_compare:w #2 = 0 \exp_stop_f:
\int_set:Nn \l_@@_right_state_int
- { \l_@@_left_state_int - \c_one }
+ { \l_@@_left_state_int - 1 }
\else:
\int_sub:Nn \l_@@_right_state_int
{ \l_@@_internal_b_int - \l_@@_internal_a_int }
@@ -4243,7 +4351,7 @@
%<trace> \trace_push:nnx { regex } { 1 } { @@_match }
%<trace> \trace:nnx { regex } { 1 } { analyzing~query~token~list }
\int_zero:N \l_@@_balance_int
- \int_set:Nn \l_@@_current_pos_int { \c_two * \l_@@_max_state_int }
+ \int_set:Nn \l_@@_current_pos_int { 2 * \l_@@_max_state_int }
\@@_query_set:nnn { } { -1 } { -2 }
\int_set_eq:NN \l_@@_min_pos_int \l_@@_current_pos_int
\__tl_analysis_map_inline:nn {#1}
@@ -4253,13 +4361,13 @@
%<trace> \trace:nnx { regex } { 1 } { initializing }
\bool_gset_false:N \g_@@_success_bool
\int_step_inline:nnnn
- \l_@@_min_state_int \c_one { \l_@@_max_state_int - \c_one }
- { \tex_dimen:D ##1 \c_one sp \scan_stop: }
+ \l_@@_min_state_int { 1 } { \l_@@_max_state_int - 1 }
+ { \tex_dimen:D ##1 ~ 1 sp \scan_stop: }
\int_set_eq:NN \l_@@_min_active_int \l_@@_max_state_int
- \int_set_eq:NN \l_@@_step_int \c_zero
+ \int_zero:N \l_@@_step_int
\int_set_eq:NN \l_@@_success_pos_int \l_@@_min_pos_int
\int_set:Nn \l_@@_submatch_int
- { \c_two * \l_@@_max_state_int }
+ { 2 * \l_@@_max_state_int }
\bool_set_false:N \l_@@_empty_success_bool
\@@_match_once:
%<trace> \trace_pop:nnx { regex } { 1 } { @@_match }
@@ -4295,7 +4403,7 @@
\int_set_eq:NN \l_@@_max_active_int \l_@@_min_active_int
\@@_store_state:n { \l_@@_min_state_int }
\int_set:Nn \l_@@_current_pos_int
- { \l_@@_start_pos_int - \c_one }
+ { \l_@@_start_pos_int - 1 }
\@@_query_get:
\@@_match_loop:
\l_@@_every_match_tl
@@ -4344,7 +4452,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_match_loop:
{
- \tex_advance:D \l_@@_step_int \c_two
+ \tex_advance:D \l_@@_step_int 2 \exp_stop_f:
\int_incr:N \l_@@_current_pos_int
\int_set_eq:NN \l_@@_last_char_int \l_@@_current_char_int
\int_set_eq:NN \l_@@_case_changed_char_int \c_max_int
@@ -4370,7 +4478,7 @@
{ \__int_value:w \tex_skip:D #1 }
{ \tex_the:D \tex_toks:D #1 }
\exp_after:wN \@@_match_one_active:w
- \__int_value:w \__int_eval:w #1 + \c_one \exp_after:wN ;
+ \__int_value:w \__int_eval:w #1 + 1 \exp_after:wN ;
\fi:
}
% \end{macrocode}
@@ -4437,7 +4545,7 @@
= \l_@@_step_int sp \scan_stop:
\tex_the:D \tex_toks:D \l_@@_current_state_int
\tex_dimen:D \l_@@_current_state_int
- = \__int_eval:w \l_@@_step_int + \c_one \__int_eval_end: sp \scan_stop:
+ = \__int_eval:w \l_@@_step_int + 1 \__int_eval_end: sp \scan_stop:
}
% \end{macrocode}
% \end{macro}
@@ -4714,7 +4822,7 @@
\fi:
\tex_the:D \tex_toks:D #1 \exp_stop_f:
\exp_after:wN \@@_query_range_loop:ww
- \__int_value:w \__int_eval:w #1 + \c_one ; #2 ;
+ \__int_value:w \__int_eval:w #1 + 1 ; #2 ;
}
% \end{macrocode}
% \end{macro}
@@ -4788,7 +4896,7 @@
{ \__tl_build_one:n ##1 }
{#1}
\prg_do_nothing: \prg_do_nothing:
- \if_int_compare:w \l_@@_replacement_csnames_int > \c_zero
+ \if_int_compare:w \l_@@_replacement_csnames_int > 0 \exp_stop_f:
\__msg_kernel_error:nnx { regex } { replacement-missing-rbrace }
{ \int_use:N \l_@@_replacement_csnames_int }
\__tl_build_one:x
@@ -4828,7 +4936,7 @@
{
\cs_if_exist_use:cF { @@_replacement_#1:w }
{
- \if_int_compare:w \c_one < 1#1 \exp_stop_f:
+ \if_int_compare:w 1 < 1#1 \exp_stop_f:
\@@_replacement_put_submatch:n {#1}
\else:
\__tl_build_one:o { \token_to_str:N #1 }
@@ -4854,7 +4962,7 @@
{
\if_int_compare:w #1 < \l_@@_capturing_group_int
\__tl_build_one:n { \@@_query_submatch:n { #1 + ##1 } }
- \if_int_compare:w \l_@@_replacement_csnames_int = \c_zero
+ \if_int_compare:w \l_@@_replacement_csnames_int = 0 \exp_stop_f:
\tl_put_right:Nn \l_@@_balance_tl
{ + \@@_submatch_balance:n { \__int_eval:w #1+##1 \__int_eval_end: } }
\fi:
@@ -4880,9 +4988,9 @@
{
\token_if_eq_meaning:NNTF #1 \__tl_build_one:n
{
- \if_int_compare:w \c_one < 1#2 \exp_stop_f:
+ \if_int_compare:w 1 < 1#2 \exp_stop_f:
\int_set:Nn \l_@@_internal_a_int
- { \c_ten * \l_@@_internal_a_int + #2 }
+ { 10 * \l_@@_internal_a_int + #2 }
\exp_after:wN \use_i:nnn
\exp_after:wN \@@_replacement_g_digits:NN
\else:
@@ -4968,7 +5076,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_replacement_rbrace:N #1
{
- \if_int_compare:w \l_@@_replacement_csnames_int > \c_zero
+ \if_int_compare:w \l_@@_replacement_csnames_int > 0 \exp_stop_f:
\__tl_build_one:n \cs_end:
\int_decr:N \l_@@_replacement_csnames_int
\else:
@@ -5002,7 +5110,7 @@
\if_meaning:w \prg_do_nothing: #3
\__msg_kernel_error:nn { regex } { replacement-catcode-end }
\else:
- \tex_lccode:D \c_zero = `#3 \scan_stop:
+ \tex_lccode:D 0 = `#3 \scan_stop:
\tex_lowercase:D { \__tl_build_one:n {#1} }
\fi:
}
@@ -5032,7 +5140,7 @@
\char_set_catcode_group_begin:N \^^@
\cs_new_protected:Npn \@@_replacement_c_B:w
{
- \if_int_compare:w \l_@@_replacement_csnames_int = \c_zero
+ \if_int_compare:w \l_@@_replacement_csnames_int = 0 \exp_stop_f:
\int_incr:N \l_@@_balance_int
\fi:
\@@_replacement_char:nNN
@@ -5069,7 +5177,7 @@
\char_set_catcode_group_end:N \^^@
\cs_new_protected:Npn \@@_replacement_c_E:w
{
- \if_int_compare:w \l_@@_replacement_csnames_int = \c_zero
+ \if_int_compare:w \l_@@_replacement_csnames_int = 0 \exp_stop_f:
\int_decr:N \l_@@_balance_int
\fi:
\@@_replacement_char:nNN
@@ -5133,10 +5241,10 @@
\if_meaning:w \prg_do_nothing: #2
\__msg_kernel_error:nn { regex } { replacement-catcode-end }
\else:
- \if_int_compare:w `#2 = \c_zero
+ \if_int_compare:w `#2 = 0 \exp_stop_f:
\__msg_kernel_error:nn { regex } { replacement-null-space }
\fi:
- \tex_lccode:D 32 = `#2 \scan_stop:
+ \tex_lccode:D `\ = `#2 \scan_stop:
\tex_lowercase:D { \__tl_build_one:n {~} }
\fi:
}
@@ -5225,11 +5333,11 @@
\cs_new_protected:Npn \regex_show:n #1
{
\@@_compile:n {#1}
- \@@_show:Nx \l_@@_internal_regex
+ \@@_show:Nn \l_@@_internal_regex
{ { \tl_to_str:n {#1} } }
}
\cs_new_protected:Npn \regex_show:N #1
- { \@@_show:Nx #1 { variable~\token_to_str:N #1 } }
+ { \@@_show:Nn #1 { variable~\token_to_str:N #1 } }
% \end{macrocode}
% \end{macro}
%
@@ -5489,14 +5597,14 @@
{
\s__seq
\int_step_function:nnnN
- { \c_two * \l_@@_max_state_int }
- \c_one
- { \l_@@_submatch_int - \c_one }
+ { 2 * \l_@@_max_state_int }
+ { 1 }
+ { \l_@@_submatch_int - 1 }
\@@_extract_seq_aux:n
}
\int_compare:nNnF
{ \flag_height:n { @@_begin } + \flag_height:n { @@_end } }
- = \c_zero
+ = 0
{
\__msg_kernel_error:nnxxx { regex } { result-unbalanced }
{ splitting~or~extracting~submatches }
@@ -5528,12 +5636,12 @@
}
\cs_new:Npn \@@_extract_seq_aux:ww #1; #2;
{
- \if_int_compare:w #1 < \c_zero
+ \if_int_compare:w #1 < 0 \exp_stop_f:
\flag_raise:n { @@_end }
\prg_replicate:nn {-#1} { \exp_not:n { { \if_false: } \fi: } }
\fi:
\@@_query_submatch:n {#2}
- \if_int_compare:w #1 > \c_zero
+ \if_int_compare:w #1 > 0 \exp_stop_f:
\flag_raise:n { @@_begin }
\prg_replicate:nn {#1} { \exp_not:n { \if_false: { \fi: } } }
\fi:
@@ -5560,12 +5668,12 @@
\int_set_eq:NN \l_@@_zeroth_submatch_int \l_@@_submatch_int
\prg_replicate:nn \l_@@_capturing_group_int
{
- \tex_skip:D \l_@@_submatch_int \c_zero sp \scan_stop:
+ \tex_skip:D \l_@@_submatch_int 0 sp \scan_stop:
\int_incr:N \l_@@_submatch_int
}
\prop_map_inline:Nn \l_@@_success_submatches_prop
{
- \if_int_compare:w ##1 - \c_one
+ \if_int_compare:w ##1 - 1 \exp_stop_f:
\exp_after:wN \@@_extract_e:wn \__int_value:w
\else:
\exp_after:wN \@@_extract_b:wn \__int_value:w
@@ -5659,17 +5767,17 @@
{
0
\int_step_function:nnnN
- { \c_two * \l_@@_max_state_int }
+ { 2 * \l_@@_max_state_int }
\l_@@_capturing_group_int
- { \l_@@_submatch_int - \c_one }
+ { \l_@@_submatch_int - 1 }
\@@_replacement_balance_one_match:n
}
\tl_set:Nx \l_@@_internal_a_tl
{
\int_step_function:nnnN
- { \c_two * \l_@@_max_state_int }
+ { 2 * \l_@@_max_state_int }
\l_@@_capturing_group_int
- { \l_@@_submatch_int - \c_one }
+ { \l_@@_submatch_int - 1 }
\@@_replacement_do_one_match:n
\@@_query_range:nn
\l_@@_start_pos_int \l_@@_max_pos_int
@@ -5687,24 +5795,24 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_group_end_replace:N #1
{
- \if_int_compare:w \l_@@_balance_int = \c_zero
+ \if_int_compare:w \l_@@_balance_int = 0 \exp_stop_f:
\else:
\__msg_kernel_error:nnxxx { regex } { result-unbalanced }
{ replacing }
- { \int_max:nn { - \l_@@_balance_int } { \c_zero } }
- { \int_max:nn { \l_@@_balance_int } { \c_zero } }
+ { \int_max:nn { - \l_@@_balance_int } { 0 } }
+ { \int_max:nn { \l_@@_balance_int } { 0 } }
\fi:
\use:x
{
\group_end:
\tl_set:Nn \exp_not:N #1
{
- \if_int_compare:w \l_@@_balance_int < \c_zero
+ \if_int_compare:w \l_@@_balance_int < 0 \exp_stop_f:
\prg_replicate:nn { - \l_@@_balance_int }
{ { \if_false: } \fi: }
\fi:
\l_@@_internal_a_tl
- \if_int_compare:w \l_@@_balance_int > \c_zero
+ \if_int_compare:w \l_@@_balance_int > 0 \exp_stop_f:
\prg_replicate:nn { \l_@@_balance_int }
{ \if_false: { \fi: } }
\fi:
@@ -6028,7 +6136,7 @@
{
\int_step_inline:nnnn
\l_@@_min_state_int
- \c_one
+ { 1 }
{ \l_@@_max_state_int - 1 }
{
\trace:nnx { regex } { #1 }
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx
index 7e43d73d790..ad0dad50e0d 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-convert.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-%% File: l3str-convert.dtx Copyright (C) 2013-2016 The LaTeX3 Project
+%% File: l3str-convert.dtx Copyright (C) 2013-2017 The LaTeX3 Project
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -22,7 +22,7 @@
%
%<*driver|package>
\RequirePackage{expl3}
-\GetIdInfo$Id: l3str-convert.dtx 6805 2016-12-28 22:15:52Z joseph $
+\GetIdInfo$Id: l3str-convert.dtx 6969 2017-02-20 18:32:23Z bruno $
{L3 Experimental string encoding conversions}
%</driver|package>
%<*driver>
@@ -278,7 +278,7 @@
% \begin{macrocode}
\ProvidesExplPackage
{\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
-\RequirePackage{l3tl-analysis,l3tl-build,l3flag}
+\RequirePackage{l3tl-analysis,l3tl-build}
% \end{macrocode}
%
% \subsection{Helpers}
@@ -327,25 +327,27 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}
-% {
-% \c_forty_eight, \c_fifty_eight, \c_sixty_five, \c_ninety_one,
-% \c_ninety_seven, \c_one_hundred_twenty_three,
-% \c_one_hundred_twenty_seven
-% }
-% We declare here some integer values which delimit ranges of \textsc{ascii}
-% characters of various types. This is mostly used in \pkg{l3regex}.
+% \begin{variable}{\c_@@_max_byte_int}
+% The maximal byte number.
% \begin{macrocode}
-\int_const:Nn \c_forty_eight { 48 }
-\int_const:Nn \c_fifty_eight { 58 }
-\int_const:Nn \c_sixty_five { 65 }
-\int_const:Nn \c_ninety_one { 91 }
-\int_const:Nn \c_ninety_seven { 97 }
-\int_const:Nn \c_one_hundred_twenty_three { 123 }
-\int_const:Nn \c_one_hundred_twenty_seven { 127 }
+\int_const:Nn \c_@@_max_byte_int { 255 }
% \end{macrocode}
% \end{variable}
%
+% \begin{macro}{\c_@@_ascii_min_int, \c_@@_ascii_max_control_int, \c_@@_ascii_max_int}
+% \begin{macrocode}
+\int_const:Nn \c_@@_ascii_min_int { 0 }
+\int_const:Nn \c_@@_ascii_max_control_int { 31 }
+\int_const:Nn \c_@@_ascii_max_int { 127 }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[aux]{\c_@@_ascii_lower_int}
+% \begin{macrocode}
+\int_const:Nn \c_@@_ascii_lower_int { `a - `A }
+% \end{macrocode}
+% \end{macro}
+%
% \begin{variable}{\g_@@_alias_prop}
% To avoid needing one file per encoding/escaping alias, we keep track
% of those in a property list.
@@ -494,7 +496,7 @@
% \begin{macrocode}
\prg_new_conditional:Npnn \@@_octal_use:N #1 { TF }
{
- \if_int_compare:w \c_one < '1 \token_to_str:N #1 \exp_stop_f:
+ \if_int_compare:w 1 < '1 \token_to_str:N #1 \exp_stop_f:
#1 \prg_return_true:
\else:
\prg_return_false:
@@ -510,7 +512,7 @@
% \begin{macrocode}
\prg_new_conditional:Npnn \@@_hexadecimal_use:N #1 { TF }
{
- \if_int_compare:w \c_two < "1 \token_to_str:N #1 \exp_stop_f:
+ \if_int_compare:w 1 < "1 \token_to_str:N #1 \exp_stop_f:
#1 \prg_return_true:
\else:
\if_case:w \__int_eval:w
@@ -941,20 +943,19 @@
\cs_new:Npn \@@_convert_lowercase_alphanum_loop:N #1
{
\use_none:n #1
- \if_int_compare:w `#1 < \c_ninety_one
- \if_int_compare:w `#1 < \c_sixty_five
- \if_int_compare:w \c_one < 1#1 \exp_stop_f:
+ \if_int_compare:w `#1 > `Z \exp_stop_f:
+ \if_int_compare:w `#1 > `z \exp_stop_f: \else:
+ \if_int_compare:w `#1 < `a \exp_stop_f: \else:
#1
\fi:
- \else:
- \@@_output_byte:n { `#1 + \c_thirty_two }
\fi:
\else:
- \if_int_compare:w `#1 < \c_one_hundred_twenty_three
- \if_int_compare:w `#1 < \c_ninety_seven
- \else:
+ \if_int_compare:w `#1 < `A \exp_stop_f:
+ \if_int_compare:w 1 < 1#1 \exp_stop_f:
#1
\fi:
+ \else:
+ \@@_output_byte:n { `#1 + \c_@@_ascii_lower_int }
\fi:
\fi:
\@@_convert_lowercase_alphanum_loop:N
@@ -1003,9 +1004,9 @@
% to raise the flag \texttt{str_byte}. Spaces have already been given
% the correct category code when this function is called.
% \begin{macrocode}
-\bool_if:nTF
+\bool_lazy_any:nTF
{
- \sys_if_engine_luatex_p: ||
+ \sys_if_engine_luatex_p:
\sys_if_engine_xetex_p:
}
{
@@ -1036,9 +1037,9 @@
% The simplest unescaping method removes non-bytes from
% \cs{g_@@_result_tl}.
% \begin{macrocode}
-\bool_if:nTF
+\bool_lazy_any:nTF
{
- \sys_if_engine_luatex_p: ||
+ \sys_if_engine_luatex_p:
\sys_if_engine_xetex_p:
}
{
@@ -1089,9 +1090,9 @@
% \begin{macrocode}
\group_begin:
\char_set_catcode_other:n { 0 }
- \bool_if:nTF
+ \bool_lazy_any:nTF
{
- \sys_if_engine_luatex_p: ||
+ \sys_if_engine_luatex_p:
\sys_if_engine_xetex_p:
}
% \end{macrocode}
@@ -1146,11 +1147,11 @@
}
\cs_new:Npn \@@_encode_native_char:n #1
{
- \if_int_compare:w #1 < \c_two_hundred_fifty_six
- \@@_output_byte:n {#1}
- \else:
+ \if_int_compare:w #1 > \c_@@_max_byte_int
\flag_raise:n { str_error }
?
+ \else:
+ \@@_output_byte:n {#1}
\fi:
}
\__msg_kernel_new:nnnn { str } { pdfTeX-native-overflow }
@@ -1292,7 +1293,7 @@
\tex_dimen:D "#1 = \l_@@_internal_int sp \scan_stop:
\tex_skip:D \l_@@_internal_int = "#1 sp \scan_stop:
\tex_toks:D \l_@@_internal_int \exp_after:wN { \__int_value:w "#2 }
- \tex_advance:D \l_@@_internal_int \c_one
+ \int_incr:N \l_@@_internal_int
\@@_decode_eight_bit_load:nn
}
\cs_new_protected:Npn \@@_decode_eight_bit_load_missing:n #1
@@ -1302,7 +1303,7 @@
\tex_skip:D \l_@@_internal_int = "#1 sp \scan_stop:
\tex_toks:D \l_@@_internal_int \exp_after:wN
{ \int_use:N \c_@@_replacement_char_int }
- \tex_advance:D \l_@@_internal_int \c_one
+ \int_incr:N \l_@@_internal_int
\@@_decode_eight_bit_load_missing:n
}
\cs_new:Npn \@@_decode_eight_bit_char:N #1
@@ -1347,7 +1348,7 @@
\tex_skip:D \l_@@_internal_int = "#2 sp \scan_stop:
\exp_args:NNf \tex_toks:D \l_@@_internal_int
{ \@@_output_byte:n { "#1 } }
- \tex_advance:D \l_@@_internal_int \c_one
+ \int_incr:N \l_@@_internal_int
\@@_encode_eight_bit_load:nn
}
\cs_new:Npn \@@_encode_eight_bit_char:n #1
@@ -1366,10 +1367,10 @@
}
\cs_new:Npn \@@_encode_eight_bit_char_aux:n #1
{
- \if_int_compare:w #1 < \c_two_hundred_fifty_six
- \@@_output_byte:n {#1}
- \else:
+ \if_int_compare:w #1 > \c_@@_max_byte_int
\flag_raise:n { str_error }
+ \else:
+ \@@_output_byte:n {#1}
\fi:
}
% \end{macrocode}
@@ -1404,9 +1405,9 @@
% Messages used for other escapings and
% encodings are defined in each definition file.
% \begin{macrocode}
-\bool_if:nT
+\bool_lazy_any:nT
{
- \sys_if_engine_luatex_p: ||
+ \sys_if_engine_luatex_p:
\sys_if_engine_xetex_p:
}
{
@@ -1485,7 +1486,7 @@
\@@_output_byte:w "
\exp_last_unbraced:Nf \@@_unescape_hex_auxi:N
{ \tl_to_str:N \g_@@_result_tl }
- 0 { ? 0 - \c_one \__prg_break: }
+ 0 { ? 0 - 1 \__prg_break: }
\__prg_break_point:
\@@_output_end:
}
@@ -1582,7 +1583,7 @@
{ }
{
\flag_raise:n { str_error }
- * \c_zero + `#1 \use_i:nn
+ * 0 + `#1 \use_i:nn
}
}
{
@@ -1683,7 +1684,7 @@
{
\@@_octal_use:NTF #4
{
- \if_int_compare:w #2 > \c_three
+ \if_int_compare:w #2 > 3 \exp_stop_f:
- 256
\fi:
\@@_unescape_string_repeat:NNNNNN
@@ -1703,11 +1704,11 @@
{ n } { 12 }
{ t } { 11 }
{ b } { 10 }
- { ^^J } { 0 - \c_one }
+ { ^^J } { 0 - 1 }
}
{
\flag_raise:n { str_error }
- 0 - \c_one \use_i:nn
+ 0 - 1 \use_i:nn
}
}
\@@_output_end:
@@ -1825,8 +1826,8 @@
{
\c_backslash_str
\int_div_truncate:nn {`#1} {64}
- \int_mod:nn { \int_div_truncate:nn {`#1} \c_eight } \c_eight
- \int_mod:nn {`#1} \c_eight
+ \int_mod:nn { \int_div_truncate:nn {`#1} { 8 } } { 8 }
+ \int_mod:nn {`#1} { 8 }
}
}
\prg_new_conditional:Npnn \@@_if_escape_string:N #1 { TF }
@@ -1936,15 +1937,15 @@
% step: use the quotient of |#1| by $64$, and |#1| as arguments for
% the looping auxiliary, and output the continuation byte
% corresponding to the remainder $|#2|-64|#1|+128$. The bizarre
-% construction |- \c_one + \c_zero *| removes the spurious initial
+% construction |- 1 + 0 *| removes the spurious initial
% continuation byte (better methods welcome).
% \begin{macrocode}
\cs_new_protected:cpn { @@_convert_encode_utf8: }
{ \@@_convert_gmap_internal:N \@@_encode_utf_viii_char:n }
\cs_new:Npn \@@_encode_utf_viii_char:n #1
{
- \@@_encode_utf_viii_loop:wwnnw #1 ; - \c_one + \c_zero * ;
- { 128 } { \c_zero }
+ \@@_encode_utf_viii_loop:wwnnw #1 ; - 1 + 0 * ;
+ { 128 } { 0 }
{ 32 } { 192 }
{ 16 } { 224 }
{ 8 } { 240 }
@@ -1959,7 +1960,7 @@
\exp_after:wN \@@_encode_utf_viii_loop:wwnnw
\__int_value:w \int_div_truncate:nn {#1} {64} ; #1 ;
#5 \q_stop
- \@@_output_byte:n { #2 - 64 * ( #1 - \c_two ) }
+ \@@_output_byte:n { #2 - 64 * ( #1 - 2 ) }
}
% \end{macrocode}
% \end{macro}
@@ -2478,7 +2479,7 @@
\@@_decode_utf_xvi_pair_end:Nw #1
\fi:
\if_case:w
- \__int_eval:w ( \@@_tmp:w #1#2 - "D6 ) / \c_four \__int_eval_end:
+ \__int_eval:w ( \@@_tmp:w #1#2 - "D6 ) / 4 \__int_eval_end:
\or: \exp_after:wN \@@_decode_utf_xvi_quad:NNwNN
\or: \exp_after:wN \@@_decode_utf_xvi_extra:NNw
\fi:
@@ -2495,10 +2496,11 @@
\fi:
\if_int_compare:w
\if_int_compare:w \@@_tmp:w #4#5 < "DC \exp_stop_f:
- \c_zero = \c_one
+ 0 = 1
\else:
- \@@_tmp:w #4#5 < "E0 \exp_stop_f:
+ \@@_tmp:w #4#5 < "E0
\fi:
+ \exp_stop_f:
#1 #2 #4 #5 \s__tl
\int_eval:n
{
@@ -2714,12 +2716,12 @@
\exp_after:wN \@@_decode_utf_xxxii_end:w
\fi:
#1#2#3#4 \s__tl
- \if_int_compare:w \@@_tmp:w #1#4 > \c_zero
+ \if_int_compare:w \@@_tmp:w #1#4 > 0 \exp_stop_f:
\flag_raise:n { str_overflow }
\flag_raise:n { str_error }
\int_use:N \c_@@_replacement_char_int
\else:
- \if_int_compare:w \@@_tmp:w #2#3 > \c_sixteen
+ \if_int_compare:w \@@_tmp:w #2#3 > 16 \exp_stop_f:
\flag_raise:n { str_overflow }
\flag_raise:n { str_error }
\int_use:N \c_@@_replacement_char_int
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx
index c8dd27cd1e4..4244d7ae570 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str-format.dtx
@@ -22,7 +22,7 @@
%
%<*driver|package>
\RequirePackage{expl3}
-\GetIdInfo$Id: l3str-format.dtx 6805 2016-12-28 22:15:52Z joseph $
+\GetIdInfo$Id: l3str-format.dtx 6948 2017-02-18 14:50:25Z bruno $
{L3 Experimental string formatting}
%</driver|package>
%<*driver>
@@ -196,7 +196,7 @@
% \begin{macrocode}
\prg_new_conditional:Npnn \@@_if_digit:N #1 { TF }
{
- \if_int_compare:w \c_nine < 1 #1 \exp_stop_f:
+ \if_int_compare:w 9 < 1 #1 \exp_stop_f:
\prg_return_true: \else: \prg_return_false: \fi:
}
% \end{macrocode}
@@ -385,9 +385,9 @@
{
\prg_replicate:nn
{
- \int_max:nn \c_zero
- { #3 - \__str_count:n { #2 #1 } - \c_one }
- / \c_two
+ \int_max:nn { 0 }
+ { #3 - \__str_count:n { #2 #1 } - 1 }
+ / 2
}
{#4}
}
@@ -395,9 +395,9 @@
{
\prg_replicate:nn
{
- \int_max:nn \c_zero
+ \int_max:nn { 0 }
{ #3 - \__str_count:n { #2 #1 } }
- / \c_two
+ / 2
}
{#4}
}
@@ -632,7 +632,7 @@
\token_if_eq_charcode:NNTF #2 ?
{ \@@_put:nw { #1 > } }
{ \@@_put:nw { #1 #2 } }
- \int_compare:nNnTF {#7} < \c_zero
+ \int_compare:nNnTF {#7} < 0
{ \@@_put:nw { - } }
{
\str_case:nnF {#3}
@@ -831,9 +831,9 @@
{
\@@_put:fw { \int_eval:n { #3 - 1 } }
\@@_put:nw { e }
- \int_compare:nNnTF {#8} > \c_sixteen
+ \int_compare:nNnTF {#8} > \c__fp_prec_int
{
- \@@_put:fw { \prg_replicate:nn { #8 - \c_fifteen } {0} }
+ \@@_put:fw { \prg_replicate:nn { #8 - \c__fp_prec_int + 1 } {0} }
\@@_put:fw { \use_none:n #4#5#6#7 }
}
{
@@ -881,6 +881,7 @@
%
% \begin{macro}[aux, EXP]{\@@_fp_g:wn}
% \begin{macro}[aux, EXP]{\@@_fp_g_aux:wn}
+% \begin{macro}[aux, EXP]{\@@_fp_to_scientific:n, \@@_fp_trim:w}
% With the |g| type, first filter out special cases. In the normal
% case, round to |#4| significant figures, then test the exponent: if
% $-4\leq \meta{exponent} < \meta{precision}$, use the presentation
@@ -909,14 +910,20 @@
\cs_new:Npn \@@_fp_g_aux:wn #1; #2
{
\int_compare:nNnTF { \__fp_exponent:w #1; } < { -3 }
- { \fp_to_scientific:n }
+ { \@@_to_scientific:n }
{
\int_compare:nNnTF { \__fp_exponent:w #1; } > {#2}
- { \fp_to_scientific:n }
+ { \@@_to_scientific:n }
{ \fp_to_decimal:n }
}
{ \__fp_set_sign_o:w 0 #1; @ \prg_do_nothing: }
}
+\cs_new:Npn \@@_to_scientific:n
+ {
+ \exp_after:wN \@@_fp_trim:w
+ \exp:w \exp_end_continue_f:w \fp_to_scientific:n
+ }
+\cs_new:Npn \@@_fp_trim:w #1 e { \__fp_trim_zeros:w #1 ; e }
% \end{macrocode}
% \end{macro}
% \end{macro}
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str.ins b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str.ins
index 524d98947e3..56c80ce4992 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3str.ins
+++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3str.ins
@@ -51,7 +51,6 @@ and all files in that bundle must be distributed together.
\keepsilent
-\generate{\file{l3flag.sty} {\from{l3flag.dtx} {package}}}
\generate{\file{l3regex.sty} {\from{l3regex.dtx} {package}}}
\generate{\file{l3str-convert.sty} {\from{l3str-convert.dtx} {package}}}
\generate{\file{l3str-format.sty} {\from{l3str-format.dtx} {package}}}
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx
index 340125f1313..f08009cbb24 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-analysis.dtx
@@ -22,7 +22,7 @@
%
%<*driver|package>
\RequirePackage{expl3}
-\GetIdInfo$Id: l3tl-analysis.dtx 6805 2016-12-28 22:15:52Z joseph $
+\GetIdInfo$Id: l3tl-analysis.dtx 6948 2017-02-18 14:50:25Z bruno $
{L3 Experimental token lists analysis}
%</driver|package>
%<*driver>
@@ -289,7 +289,7 @@
\cs_new:Npn \@@_cs_space_count:NN #1 #2
{
\exp_after:wN #1
- \__int_value:w \__int_eval:w \c_zero
+ \__int_value:w \__int_eval:w 0
\exp_after:wN \@@_cs_space_count:w
\token_to_str:N #2
\fi: \@@_cs_space_count_end:w ; ~ !
@@ -297,7 +297,7 @@
\cs_new:Npn \@@_cs_space_count:w #1 ~
{
\if_false: #1 #1 \fi:
- + \c_one
+ + 1
\@@_cs_space_count:w
}
\cs_new:Npn \@@_cs_space_count_end:w ; #1 \fi: #2 !
@@ -399,7 +399,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_setup:n #1
{
- \int_set:Nn \tex_escapechar:D { - \c_one }
+ \int_set:Nn \tex_escapechar:D { -1 }
\exp_after:wN \@@_disable_loop:N
\tl_to_str:n {#1} { ~ } { ? ~ \__prg_break: }
\__prg_break_point:
@@ -408,7 +408,7 @@
\char_set_catcode_active:N \^^@
\cs_new_protected:Npn \@@_disable_loop:N #1
{
- \tex_lccode:D \c_zero `#1 ~
+ \tex_lccode:D 0 = `#1 ~
\tex_lowercase:D { \tex_let:D ^^@ } \tex_undefined:D
\@@_disable_loop:N
}
@@ -501,18 +501,19 @@
{
\l_@@_type_int =
\if_meaning:w \l_@@_token \c_space_token
- \c_zero
+ 0
\else:
\if_catcode:w \exp_not:N \l_@@_token \c_group_begin_token
- \c_one
+ 1
\else:
\if_catcode:w \exp_not:N \l_@@_token \c_group_end_token
- - \c_one
+ - 1
\else:
- \c_two
+ 2
\fi:
\fi:
\fi:
+ \exp_stop_f:
\if_case:w \l_@@_type_int
\exp_after:wN \@@_a_space:w
\or: \exp_after:wN \@@_a_bgroup:w
@@ -593,9 +594,9 @@
\group_end:
\cs_new_protected:Npn \@@_a_group:nw #1
{
- \tex_lccode:D \c_zero = \@@_extract_charcode: \scan_stop:
+ \tex_lccode:D 0 = \@@_extract_charcode: \scan_stop:
\tex_lowercase:D { \tex_toks:D \l_@@_index_int {#1} }
- \if_int_compare:w \tex_lccode:D \c_zero = \tex_escapechar:D
+ \if_int_compare:w \tex_lccode:D 0 = \tex_escapechar:D
\int_set:Nn \tex_escapechar:D { 139 - \tex_escapechar:D }
\fi:
\tex_afterassignment:D \@@_a_group_test:w
@@ -650,14 +651,14 @@
\cs_new_protected:Npn \@@_a_store:
{
\tex_advance:D \l_@@_nesting_int \l_@@_type_int
- \if_int_compare:w \tex_lccode:D \c_zero = \c_thirty_two
- \tex_multiply:D \l_@@_type_int \c_two
+ \if_int_compare:w \tex_lccode:D 0 = `\ \exp_stop_f:
+ \tex_multiply:D \l_@@_type_int 2 \exp_stop_f:
\fi:
\tex_skip:D \l_@@_index_int
= \l_@@_normal_int sp plus \l_@@_type_int sp \scan_stop:
\int_incr:N \l_@@_index_int
\int_zero:N \l_@@_normal_int
- \if_int_compare:w \l_@@_nesting_int = - \c_one
+ \if_int_compare:w \l_@@_nesting_int = -1 \exp_stop_f:
\cs_set_eq:NN \@@_a_loop:w \scan_stop:
\fi:
}
@@ -698,9 +699,9 @@
}
\cs_new_protected:Npn \@@_a_cs:ww #1; #2;
{
- \if_int_compare:w #1 > \c_zero
+ \if_int_compare:w #1 > 0 \exp_stop_f:
\tex_skip:D \l_@@_index_int
- = \__int_eval:w \l_@@_normal_int + \c_one sp \scan_stop:
+ = \__int_eval:w \l_@@_normal_int + 1 sp \scan_stop:
\tex_advance:D \l_@@_index_int #1 \exp_stop_f:
\l_@@_normal_int #2 \exp_stop_f:
\else:
@@ -756,7 +757,7 @@
% \begin{macrocode}
\cs_new:Npn \@@_b_normals:ww #1;
{
- \if_int_compare:w #1 = \c_zero
+ \if_int_compare:w #1 = 0 \exp_stop_f:
\@@_b_special:w
\fi:
\@@_b_normal:wwN #1;
@@ -802,7 +803,7 @@
\exp_not:n { \fi: \fi: \fi: \fi: \fi: \fi: \fi: \fi: }
\exp_not:N \__int_value:w `#1 \s__tl
\exp_not:N \exp_after:wN \exp_not:N \@@_b_normals:ww
- \exp_not:N \__int_value:w \exp_not:N \__int_eval:w - \c_one +
+ \exp_not:N \__int_value:w \exp_not:N \__int_eval:w - 1 +
}
% \end{macrocode}
% \end{macro}
@@ -823,7 +824,7 @@
{
\exp_after:wN \@@_b_normals:ww
\__int_value:w \__int_eval:w
- \if_int_compare:w #1 = \c_zero
+ \if_int_compare:w #1 = 0 \exp_stop_f:
#3
\else:
\tex_skip:D \__int_eval:w #4 + #1 \__int_eval_end:
@@ -869,7 +870,7 @@
\else:
\exp_after:wN \@@_b_special_space:w \__int_value:w
\fi:
- \__int_eval:w \c_one + #1 \exp_after:wN ;
+ \__int_eval:w 1 + #1 \exp_after:wN ;
\token_to_str:N
}
\group_end:
@@ -982,10 +983,10 @@
{
\use_none:n #2
\exp_not:n { \\ > \ \ }
- \if_int_compare:w "#2 = \c_zero
+ \if_int_compare:w "#2 = 0 \exp_stop_f:
\exp_after:wN \@@_show_cs:n
\else:
- \if_int_compare:w "#2 = \c_thirteen
+ \if_int_compare:w "#2 = 13 \exp_stop_f:
\exp_after:wN \exp_after:wN
\exp_after:wN \@@_show_active:n
\else:
@@ -1028,7 +1029,7 @@
\token_if_toks_register:NTF #1 \__prg_break: { }
\use_none:nnn
\__prg_break_point:
- \use:n { = \tex_the:D #1 }
+ \use:n { \exp_after:wN = \tex_the:D #1 }
}
}
% \end{macrocode}
@@ -1058,11 +1059,11 @@
{
\int_compare:nNnTF
{ \str_count:n { #1 ~ ( #4 #2 #3 ) } }
- > { \l_iow_line_count_int - \c_three }
+ > { \l_iow_line_count_int - 3 }
{
- \str_range:nnn { #1 ~ ( #4 #2 #3 ) } \c_one
+ \str_range:nnn { #1 ~ ( #4 #2 #3 ) } { 1 }
{
- \l_iow_line_count_int - \c_three
+ \l_iow_line_count_int - 3
- \str_count:N \c_@@_show_etc_str
}
\c_@@_show_etc_str
diff --git a/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-build.dtx b/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-build.dtx
index d9631e8092f..b7aba0ecfdc 100644
--- a/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-build.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/l3str/l3tl-build.dtx
@@ -23,8 +23,8 @@
%<*driver|package>
% The version of expl3 required is tested as early as possible, as
% some really old versions do not define \ProvidesExplPackage.
-\RequirePackage{expl3}[2017/02/10]
-%<package>\@ifpackagelater{expl3}{2017/02/10}
+\RequirePackage{expl3}[2017/03/07]
+%<package>\@ifpackagelater{expl3}{2017/03/07}
%<package> {}
%<package> {%
%<package> \PackageError{l3tl-build}{Support package l3kernel too old}
@@ -36,7 +36,7 @@
%<package> }%
%<package> \endinput
%<package> }
-\GetIdInfo$Id: l3tl-build.dtx 6878 2017-02-10 07:40:59Z joseph $
+\GetIdInfo$Id: l3tl-build.dtx 6984 2017-03-07 20:53:23Z joseph $
{L3 Experimental token list construction}
%</driver|package>
%<*driver>
@@ -208,7 +208,7 @@
\fi:
\tex_the:D \tex_toks:D #1 \exp_stop_f:
\exp_after:wN \@@_unpack_loop:w
- \int_use:N \__int_eval:w #1 + \c_one ;
+ \int_use:N \__int_eval:w #1 + 1 ;
}
% \end{macrocode}
% \end{macro}
@@ -278,7 +278,7 @@
\cs_new_protected:Npn \@@_one:n #1
{
\tex_toks:D \l_@@_index_int {#1}
- \tex_advance:D \l_@@_index_int \c_one
+ \int_incr:N \l_@@_index_int
\if_int_compare:w \l_@@_index_int > \c_max_register_int
\@@_unpack:
\l_@@_index_int \l_@@_start_index_int
@@ -287,7 +287,7 @@
\cs_new_protected:Npn \@@_one:o #1
{
\tex_toks:D \l_@@_index_int \exp_after:wN {#1}
- \tex_advance:D \l_@@_index_int \c_one
+ \int_incr:N \l_@@_index_int
\if_int_compare:w \l_@@_index_int > \c_max_register_int
\@@_unpack:
\l_@@_index_int \l_@@_start_index_int
diff --git a/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx b/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx
index 3d46c309a72..d528151f656 100644
--- a/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/xgalley/l3galley.dtx
@@ -1,7 +1,7 @@
% \iffalse
%
%% File: l3galley.dtx Copyright (C) 1999-2001, 2004-2009 Frank Mittelbach
-%% (C) 2010-2016 The LaTeX3 Project
+%% (C) 2010-2017 The LaTeX3 Project
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -24,8 +24,8 @@
%<*driver|package>
% The version of expl3 required is tested as early as possible, as
% some really old versions do not define \ProvidesExplPackage.
-\RequirePackage{expl3}[2017/02/10]
-%<package>\@ifpackagelater{expl3}{2017/02/10}
+\RequirePackage{expl3}[2017/03/07]
+%<package>\@ifpackagelater{expl3}{2017/03/07}
%<package> {}
%<package> {%
%<package> \PackageError{l3galley}{Support package l3kernel too old}
@@ -37,7 +37,7 @@
%<package> }%
%<package> \endinput
%<package> }
-\GetIdInfo$Id: l3galley.dtx 6878 2017-02-10 07:40:59Z joseph $
+\GetIdInfo$Id: l3galley.dtx 6984 2017-03-07 20:53:23Z joseph $
{L3 Experimental galley code}
%</driver|package>
%<*driver>
@@ -263,7 +263,7 @@
% is retained for the rest of the paragraph.
% For example,
% \begin{verbatim}
-% \galley_parshape_set_multi_par:nnnN { 1 }
+% \galley_parshape_set_multi:nnnN { 1 }
% { 2 pt , 4 pt , 6 pt } { 2 pt , 4 pt , 6 pt } \c_true_bool
% \end{verbatim}
% would create a paragraph shape in which the first line is the full
@@ -964,6 +964,13 @@
% \end{macrocode}
% \end{variable}
%
+% \begin{variable}{\c_@@_max_penalty_int}
+% \enquote{Infinite} penalty.
+% \begin{macrocode}
+\int_const:Nn \c_@@_max_penalty_int { 10000 }
+% \end{macrocode}
+% \end{variable}
+%
% \subsection{Independent galley levels}
%
% As well as the main vertical list, independent galleys are required
@@ -1227,7 +1234,7 @@
% \cs{tex_parskip:D}, which will leave an unwanted break-point here
% otherwise.
% \begin{macrocode}
- \tex_penalty:D \c_ten_thousand
+ \tex_penalty:D \c_@@_max_penalty_int
}
% \end{macrocode}
% Once a cutout has been set, properly tidying up needs some work. The
@@ -1251,11 +1258,9 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_par_update_cutout:
{
- \bool_if:nF
- {
- \seq_if_empty_p:N \g_@@_cutout_left_seq
- && \seq_if_empty_p:N \g_@@_cutout_right_seq
- }
+ \bool_lazy_and:nnF
+ { \seq_if_empty_p:N \g_@@_cutout_left_seq }
+ { \seq_if_empty_p:N \g_@@_cutout_right_seq }
{
\prg_replicate:nn \tex_prevgraf:D
{
@@ -1266,11 +1271,9 @@
}
\int_compare:nNnT \l_@@_group_level_int = \etex_currentgrouplevel:D
{
- \bool_if:nT
- {
- \seq_if_empty_p:N \g_@@_cutout_left_seq
- && \seq_if_empty_p:N \g_@@_cutout_right_seq
- }
+ \bool_lazy_and:nnT
+ { \seq_if_empty_p:N \g_@@_cutout_left_seq }
+ { \seq_if_empty_p:N \g_@@_cutout_right_seq }
{ \bool_gset_false:N \g_@@_cutout_active_bool }
}
}
@@ -1581,7 +1584,7 @@
\tl_if_empty:NTF \g_@@_interpar_penalty_user_tl
{
\bool_if:NTF \g_galley_no_break_next_bool
- { \tex_penalty:D \c_ten_thousand }
+ { \tex_penalty:D \c_@@_max_penalty_int }
{ \tex_penalty:D \l_galley_interpar_penalty_int }
}
{
@@ -1833,15 +1836,13 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_parshape_set_margins:
{
- \bool_if:nTF
- {
- \dim_compare_p:nNn \l_galley_total_left_margin_dim = \c_zero_dim
- && \dim_compare_p:nNn \l_galley_total_right_margin_dim = \c_zero_dim
- }
- { \tex_parshape:D \c_zero }
+ \bool_lazy_and:nnTF
+ { \dim_compare_p:nNn \l_galley_total_left_margin_dim = \c_zero_dim }
+ { \dim_compare_p:nNn \l_galley_total_right_margin_dim = \c_zero_dim }
+ { \tex_parshape:D 0 \exp_stop_f: }
{
\tex_parshape:D
- \c_one
+ 1 \exp_stop_f:
\l_galley_total_left_margin_dim
\l_galley_text_width_dim
}
@@ -1855,11 +1856,9 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_parshape_set_indents:
{
- \bool_if:nF
- {
- \seq_if_empty_p:N \l_@@_parshape_left_indent_seq
- && \seq_if_empty_p:N \l_@@_parshape_right_indent_seq
- }
+ \bool_lazy_and:nnF
+ { \seq_if_empty_p:N \l_@@_parshape_left_indent_seq }
+ { \seq_if_empty_p:N \l_@@_parshape_right_indent_seq }
{
\@@_parshape_set_indents:NN
\l_@@_parshape_left_indent_seq
@@ -1896,11 +1895,9 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_parshape_set_cutouts:
{
- \bool_if:nF
- {
- \seq_if_empty_p:N \g_@@_cutout_left_seq
- && \seq_if_empty_p:N \g_@@_cutout_right_seq
- }
+ \bool_lazy_and:nnF
+ { \seq_if_empty_p:N \g_@@_cutout_left_seq }
+ { \seq_if_empty_p:N \g_@@_cutout_right_seq }
{
\@@_parshape_set_cutouts:n { left }
\@@_parshape_set_cutouts:n { right }
@@ -1909,7 +1906,7 @@
\seq_count:N \l_@@_cutout_left_indent_seq
- \seq_count:N \l_@@_cutout_right_indent_seq
}
- \int_compare:nNnTF \l_@@_tmp_int > \c_zero
+ \int_compare:nNnTF \l_@@_tmp_int > 0
{ \@@_parshape_set_cutouts:N \l_@@_cutout_right_indent_seq }
{ \@@_parshape_set_cutouts:N \l_@@_cutout_left_indent_seq }
\@@_parshape_set_indents:NN
@@ -1943,9 +1940,9 @@
{
\seq_count:N \g_@@_tmpa_seq
- \seq_count:N \g_@@_tmpb_seq
- + \c_one
+ + 1
}
- \int_compare:nNnT \l_@@_tmp_int > \c_zero
+ \int_compare:nNnT \l_@@_tmp_int > 0
{
\prg_replicate:nn
{ \l_@@_tmp_int }
@@ -2102,10 +2099,10 @@
{
\bool_if:NTF #1
{ % TODO Hook for font changes required!
- \dim_compare:nNnTF { \tex_fontdimen:D \c_three \tex_font:D }
+ \dim_compare:nNnTF { \tex_fontdimen:D 3 \tex_font:D }
= \c_zero_dim
{ \tex_spaceskip:D \c_zero_dim }
- { \tex_spaceskip:D \tex_fontdimen:D \c_two \tex_font:D }
+ { \tex_spaceskip:D \tex_fontdimen:D 2 \tex_font:D }
}
{ \tex_spaceskip:D \c_zero_dim }
}
@@ -2172,12 +2169,12 @@
{
\tex_unskip:D
\bool_if:NF #1
- { \tex_vadjust:D { \tex_penalty:D \c_ten_thousand } }
+ { \tex_vadjust:D { \tex_penalty:D \c_@@_max_penalty_int } }
\dim_compare:nNnF {#2} = \c_zero_dim
{ \tex_vadjust:D { \skip_vertical:n {#2} } }
- \tex_penalty:D \c_ten_thousand
+ \tex_penalty:D \c_@@_max_penalty_int
\tex_hfil:D
- \tex_penalty:D -\c_ten_thousand
+ \tex_penalty:D - \c_@@_max_penalty_int
}
}
% \end{macrocode}
@@ -2236,17 +2233,17 @@
\cs_new_protected:Npn \galley_display_widow_penalties_set:n #1
{
\etex_displaywidowpenalties:D
- \__int_eval:w \clist_count:n {#1} + \c_one \__int_eval_end:
+ \__int_eval:w \clist_count:n {#1} + 1 \__int_eval_end:
\clist_map_function:nN {#1} \@@_set_aux:n
- \c_zero
+ 0 \exp_stop_f:
}
\cs_generate_variant:Nn \galley_display_widow_penalties_set:n { V , v }
\cs_new_protected:Npn \galley_widow_penalties_set:n #1
{
\etex_widowpenalties:D
- \__int_eval:w \clist_count:n {#1} + \c_one \__int_eval_end:
+ \__int_eval:w \clist_count:n {#1} + 1 \__int_eval_end:
\clist_map_function:nN {#1} \@@_set_aux:n
- \c_zero
+ 0 \exp_stop_f:
}
\cs_generate_variant:Nn \galley_widow_penalties_set:n { V , v }
\cs_new:Npn \@@_set_aux:n #1 { \int_eval:n {#1} ~ }
@@ -2295,9 +2292,9 @@
\cs_new_protected:Npn \galley_display_club_penalties_set:n #1
{
\etex_clubpenalties:D
- \__int_eval:w \clist_count:n {#1} + \c_one \__int_eval_end:
+ \__int_eval:w \clist_count:n {#1} + 1 \__int_eval_end:
\clist_map_function:nN {#1} \@@_set_aux:n
- \c_zero
+ 0 \exp_stop_f:
\@@_calc_interline_penalties:
}
\cs_generate_variant:Nn \galley_display_club_penalties_set:n { V , v }
@@ -2320,9 +2317,9 @@
% \begin{macrocode}
\cs_new_protected:Npn \galley_interline_penalty_set:n #1
{
- \int_compare:nNnTF { \etex_interlinepenalties:D \c_zero } = \c_zero
+ \int_compare:nNnTF { \etex_interlinepenalties:D 0 } = 0
{
- \etex_interlinepenalties:D \c_one \__int_eval:w #1 \__int_eval_end:
+ \etex_interlinepenalties:D 1 = \__int_eval:w #1 \__int_eval_end:
\@@_calc_interline_penalties:
}
{
@@ -2330,7 +2327,7 @@
{
\__int_eval:w
\etex_interlinepenalties:D ##1
- - \etex_interlinepenalties:D \etex_interlinepenalties:D \c_zero
+ - \etex_interlinepenalties:D \etex_interlinepenalties:D 0
+ #1
\__int_eval_end:
}
@@ -2341,11 +2338,11 @@
\cs_new_protected:Npn \@@_set_interline_penalty:nn #1#2
{
\etex_interlinepenalties:D
- \etex_interlinepenalties:D \c_zero
- \int_step_function:nnnN \c_one \c_one {#1}
+ \etex_interlinepenalties:D 0 \exp_stop_f:
+ \int_step_function:nnnN { 1 } { 1 } {#1}
\@@_set_interline_penalty_auxi:n
- \int_step_function:nnnN { #1 + \c_one } \c_one
- { \etex_interlinepenalties:D \c_zero - \c_one }
+ \int_step_function:nnnN { #1 + 1 } { 1 }
+ { \etex_interlinepenalties:D 0 - 1 }
\@@_set_interline_penalty_auxii:n
\__int_eval:w #2 \__int_eval_end:
}
@@ -2376,17 +2373,11 @@
\exp_args:Nff \@@_calc_interline_penalties:nn
{
\int_max:nn
- {
- \clist_count:N \l_galley_club_penalties_clist
- + \c_one
- }
+ { \clist_count:N \l_galley_club_penalties_clist + 1 }
{
\int_max:nn
- {
- \clist_count:N \l_galley_line_penalties_clist
- + \c_one
- }
- { \etex_clubpenalties:D \c_zero }
+ { \clist_count:N \l_galley_line_penalties_clist + 1 }
+ { \etex_clubpenalties:D 0 }
}
}
{ \clist_count:N \l_galley_line_penalties_clist }
@@ -2400,11 +2391,11 @@
\cs_new_protected:Npn \@@_calc_interline_penalties:nn #1#2
{
\etex_interlinepenalties:D #1 ~
- \int_step_function:nnnN \c_one \c_one {#2}
+ \int_step_function:nnnN { 1 } { 1 } {#2}
\@@_calc_interline_penalties_auxi:n
- \int_step_function:nnnN { #2 + \c_one } \c_one { #1 - \c_one }
+ \int_step_function:nnnN { #2 + 1 } { 1 } { #1 - 1 }
\@@_calc_interline_penalties_auxii:n
- \etex_interlinepenalties:D \etex_interlinepenalties:D \c_zero
+ \etex_interlinepenalties:D \etex_interlinepenalties:D 0 \exp_stop_f:
}
\cs_new:Npn \@@_calc_interline_penalties_auxi:n #1
{
@@ -2417,7 +2408,7 @@
\cs_new:Npn \@@_calc_interline_penalties_auxii:n #1
{
\__int_eval:w
- \etex_interlinepenalties:D \etex_interlinepenalties:D \c_zero
+ \etex_interlinepenalties:D \etex_interlinepenalties:D 0 \exp_stop_f:
+ 0 \clist_item:Nn \l_galley_club_penalties_clist {#1}
- \etex_clubpenalties:D #1 ~
\__int_eval_end:
@@ -2457,8 +2448,8 @@
{
\clist_set:Nx #1
{
- \int_step_function:nnnN \c_one \c_one
- { \etex_clubpenalties:D \c_zero - \c_one }
+ \int_step_function:nnnN { 1 } { 1 }
+ { \etex_clubpenalties:D 0 - 1 }
\@@_save_display_club_penalties:n
}
}
@@ -2468,8 +2459,8 @@
{
\clist_set:Nx #1
{
- \int_step_function:nnnN \c_one \c_one
- { \etex_displaywidowpenalties:D \c_zero - \c_one }
+ \int_step_function:nnnN { 1 } { 1 }
+ { \etex_displaywidowpenalties:D 0 - 1 }
\@@_save_display_widow_penalties:n
}
}
@@ -2482,8 +2473,8 @@
{
\clist_set:Nx #1
{
- \int_step_function:nnnN \c_one \c_one
- { \etex_widowpenalties:D \c_zero - \c_one }
+ \int_step_function:nnnN { 1 } { 1 }
+ { \etex_widowpenalties:D 0 - 1 }
\@@_save_widow_penalties:n
}
}
@@ -2495,7 +2486,7 @@
% last value in the primitive array.
% \begin{macrocode}
\cs_new_protected:Npn \galley_interline_penalty:
- { \__int_value:w \etex_interlinepenalties:D \etex_interlinepenalties:D \c_zero }
+ { \__int_value:w \etex_interlinepenalties:D \etex_interlinepenalties:D 0 \exp_stop_f: }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -2523,7 +2514,7 @@
{
\mode_if_vertical:T
{
- \int_compare:nNnT \@dbltopnum = { - \c_one }
+ \int_compare:nNnT \@dbltopnum = { -1 }
{
\dim_compare:nNnT \tex_pagetotal:D < \topskip
{ \tex_hbox:D { } }
@@ -2643,7 +2634,7 @@
\leavevmode
\setbox \@tempboxa = \hbox { {#1} }
\galley_parshape_set_single:nnnN
- \c_one
+ { 1 }
{ \box_wd:N \@tempboxa }
\c_zero_dim
\c_false_bool
diff --git a/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx b/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx
index d86baef3497..290c64bc8b8 100644
--- a/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx
+++ b/Master/texmf-dist/source/latex/l3experimental/xgalley/xgalley.dtx
@@ -1,7 +1,7 @@
% \iffalse
%
%% File: xgalley.dtx Copyright (C) 1999-2001, 2004-2009 Frank Mittelbach
-%% (C) 2010-2012,2014,2106 The LaTeX3 Project
+%% (C) 2010-2012,2014,2016-2017 The LaTeX3 Project
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
@@ -23,7 +23,7 @@
%
%<*driver|package>
\RequirePackage{xparse}
-\GetIdInfo$Id: xgalley.dtx 6805 2016-12-28 22:15:52Z joseph $
+\GetIdInfo$Id: xgalley.dtx 6963 2017-02-20 02:29:02Z bruno $
{L3 Experimental galley}
%</driver|package>
%<*driver>
@@ -892,14 +892,14 @@
\bool_if:NTF \l_@@_parshape_on_left_bool
{
\galley_parshape_set_single:nVVN
- \c_zero
+ { 0 }
\l_@@_tmpa_clist
\l_@@_tmpb_clist
\c_true_bool
}
{
\galley_parshape_set_single:nVVN
- \c_zero
+ { 0 }
\l_@@_tmpb_clist
\l_@@_tmpa_clist
\c_true_bool
@@ -1047,7 +1047,7 @@
\tl_clear:N \l_@@_justification_other_tl
\galley_interword_spacing_set:N \l_galley_fixed_spacing_bool
\bool_if:NTF \l_galley_par_stretch_last_bool
- { \int_set_eq:NN \l_galley_last_line_fit_int \c_one_thousand }
+ { \int_set:Nn \l_galley_last_line_fit_int { 1000 } }
{ \int_zero:N \l_galley_last_line_fit_int }
\skip_set:Nn \@rightskip { \l_galley_line_right_skip }
}
@@ -1095,7 +1095,7 @@
\AssignTemplateKeys
\galley_interword_spacing_set:N \l_galley_fixed_spacing_bool
\bool_if:NTF \l_galley_par_stretch_last_bool
- { \int_set_eq:NN \l_galley_last_line_fit_int \c_one_thousand }
+ { \int_set:Nn \l_galley_last_line_fit_int { 1000 } }
{ \int_zero:N \l_galley_last_line_fit_int }
\skip_set:Nn \@rightskip { \l_galley_line_right_skip }
}