[latex3-commits] [l3svn] r6948 - Remove named integers from l3experimental/l3str bundle
noreply at latex-project.org
noreply at latex-project.org
Sat Feb 18 15:50:25 CET 2017
Author: bruno
Date: 2017-02-18 15:50:25 +0100 (Sat, 18 Feb 2017)
New Revision: 6948
Modified:
trunk/l3experimental/l3str/l3regex.dtx
trunk/l3experimental/l3str/l3str-convert.dtx
trunk/l3experimental/l3str/l3str-format.dtx
trunk/l3experimental/l3str/l3tl-analysis.dtx
trunk/l3experimental/l3str/l3tl-build.dtx
trunk/l3experimental/l3str/testfiles/m3str-convert002.lvt
trunk/l3experimental/l3str/testfiles/m3str-convert004.lvt
Log:
Remove named integers from l3experimental/l3str bundle
Modified: trunk/l3experimental/l3str/l3regex.dtx
===================================================================
--- trunk/l3experimental/l3str/l3regex.dtx 2017-02-17 21:27:18 UTC (rev 6947)
+++ trunk/l3experimental/l3str/l3regex.dtx 2017-02-18 14:50:25 UTC (rev 6948)
@@ -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
@@ -1102,7 +1100,7 @@
}
\cs_new_protected:Npn \@@_item_exact_cs:c #1
{
- \int_compare:nNnTF \l_@@_current_catcode_int = \c_zero
+ \int_compare:nNnTF \l_@@_current_catcode_int = 0
{
\str_if_eq_x:nnTF
{
@@ -1129,7 +1127,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 +1168,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 +1214,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 +1303,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 +1405,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 +1425,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 +1549,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:
}
@@ -1627,13 +1634,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 +1762,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 +1787,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 +1843,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 +1862,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 +1880,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 +1895,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 +1915,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 +1955,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 +1991,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,9 +2006,9 @@
{ #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:
@@ -2343,7 +2367,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 +2491,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 +2555,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 +2702,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 +2845,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 +2875,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,7 +2941,11 @@
\@@_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}
@@ -2998,7 +3034,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,7 +3081,7 @@
{
\@@_class:NnnnN \c_true_bool
{
- \if_int_compare:w "##2 = \c_zero
+ \if_int_compare:w "##2 = 0 \exp_stop_f:
\@@_item_exact_cs:c { \exp_after:wN \cs_to_str:N ##1 }
\else:
\@@_item_exact:nn { \__int_value:w "##2 } { ##3 }
@@ -3068,7 +3104,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 }
}
@@ -3386,7 +3422,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:
@@ -3514,7 +3550,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 { }
@@ -3611,7 +3647,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
@@ -3639,7 +3675,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
@@ -3672,7 +3708,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
@@ -3780,9 +3816,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}
@@ -3800,7 +3836,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:
@@ -3824,10 +3860,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
@@ -3836,8 +3872,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:
}
@@ -3866,11 +3902,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:
@@ -3930,16 +3966,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 }
@@ -4244,7 +4280,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}
@@ -4254,13 +4290,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 }
@@ -4296,7 +4332,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
@@ -4345,7 +4381,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
@@ -4371,7 +4407,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}
@@ -4438,7 +4474,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}
@@ -4715,7 +4751,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}
@@ -4789,7 +4825,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
@@ -4829,7 +4865,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 }
@@ -4855,7 +4891,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:
@@ -4881,9 +4917,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:
@@ -4969,7 +5005,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:
@@ -5003,7 +5039,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:
}
@@ -5033,7 +5069,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
@@ -5070,7 +5106,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
@@ -5134,10 +5170,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:
}
@@ -5490,14 +5526,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_use:n { @@_begin } + \flag_use:n { @@_end } }
- = \c_zero
+ = 0
{
\__msg_kernel_error:nnxxx { regex } { result-unbalanced }
{ splitting~or~extracting~submatches }
@@ -5529,12 +5565,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:
@@ -5561,12 +5597,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
@@ -5660,17 +5696,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
@@ -5688,24 +5724,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:
@@ -6029,7 +6065,7 @@
{
\int_step_inline:nnnn
\l_@@_min_state_int
- \c_one
+ { 1 }
{ \l_@@_max_state_int - 1 }
{
\trace:nnx { regex } { #1 }
Modified: trunk/l3experimental/l3str/l3str-convert.dtx
===================================================================
--- trunk/l3experimental/l3str/l3str-convert.dtx 2017-02-17 21:27:18 UTC (rev 6947)
+++ trunk/l3experimental/l3str/l3str-convert.dtx 2017-02-18 14:50:25 UTC (rev 6948)
@@ -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
@@ -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
+ \if_int_compare:w #1 > \c_@@_max_byte_int
+ \flag_raise:n { str_error }
+ \else:
\@@_output_byte:n {#1}
- \else:
- \flag_raise:n { str_error }
\fi:
}
% \end{macrocode}
@@ -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
Modified: trunk/l3experimental/l3str/l3str-format.dtx
===================================================================
--- trunk/l3experimental/l3str/l3str-format.dtx 2017-02-17 21:27:18 UTC (rev 6947)
+++ trunk/l3experimental/l3str/l3str-format.dtx 2017-02-18 14:50:25 UTC (rev 6948)
@@ -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 }
}
{
Modified: trunk/l3experimental/l3str/l3tl-analysis.dtx
===================================================================
--- trunk/l3experimental/l3str/l3tl-analysis.dtx 2017-02-17 21:27:18 UTC (rev 6947)
+++ trunk/l3experimental/l3str/l3tl-analysis.dtx 2017-02-18 14:50:25 UTC (rev 6948)
@@ -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:
@@ -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
Modified: trunk/l3experimental/l3str/l3tl-build.dtx
===================================================================
--- trunk/l3experimental/l3str/l3tl-build.dtx 2017-02-17 21:27:18 UTC (rev 6947)
+++ trunk/l3experimental/l3str/l3tl-build.dtx 2017-02-18 14:50:25 UTC (rev 6948)
@@ -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
Modified: trunk/l3experimental/l3str/testfiles/m3str-convert002.lvt
===================================================================
--- trunk/l3experimental/l3str/testfiles/m3str-convert002.lvt 2017-02-17 21:27:18 UTC (rev 6947)
+++ trunk/l3experimental/l3str/testfiles/m3str-convert002.lvt 2017-02-18 14:50:25 UTC (rev 6948)
@@ -116,7 +116,4 @@
{ \TRUE } { \ERROR }
}
-\int_compare:nNnF \etex_currentgrouplevel:D = \c_zero { \etex_showgroups:D }
-\int_compare:nNnF \etex_currentiflevel:D = \c_one { \etex_showifs:D }
-
\END
Modified: trunk/l3experimental/l3str/testfiles/m3str-convert004.lvt
===================================================================
--- trunk/l3experimental/l3str/testfiles/m3str-convert004.lvt 2017-02-17 21:27:18 UTC (rev 6947)
+++ trunk/l3experimental/l3str/testfiles/m3str-convert004.lvt 2017-02-18 14:50:25 UTC (rev 6948)
@@ -40,7 +40,4 @@
\group_end:
}
-\int_compare:nNnF \etex_currentgrouplevel:D = \c_zero { \etex_showgroups:D }
-\int_compare:nNnF \etex_currentiflevel:D = \c_one { \etex_showifs:D }
-
\END
More information about the latex3-commits
mailing list