[latex3-commits] [latex3/latex3] main: Use N-type flags in l3fp, l3regex, l3str-convert (instead of n-type) (cf9c00cb7)
github at latex-project.org
github at latex-project.org
Tue Jan 16 22:11:03 CET 2024
Repository : https://github.com/latex3/latex3
On branch : main
Link : https://github.com/latex3/latex3/commit/cf9c00cb707430196c3cf6d43f431395479f22ae
>---------------------------------------------------------------
commit cf9c00cb707430196c3cf6d43f431395479f22ae
Author: Bruno Le Floch <blflatex at gmail.com>
Date: Fri Jan 12 16:38:12 2024 +0100
Use N-type flags in l3fp, l3regex, l3str-convert (instead of n-type)
>---------------------------------------------------------------
cf9c00cb707430196c3cf6d43f431395479f22ae
l3kernel/l3fp-symbolic.dtx | 10 +-
l3kernel/l3fp-traps.dtx | 28 ++---
l3kernel/l3fp.dtx | 16 +--
l3kernel/l3regex.dtx | 30 ++---
l3kernel/l3str-convert.dtx | 218 +++++++++++++++++------------------
l3kernel/testfiles/m3fp-traps001.lvt | 96 +++++++--------
6 files changed, 199 insertions(+), 199 deletions(-)
diff --git a/l3kernel/l3fp-symbolic.dtx b/l3kernel/l3fp-symbolic.dtx
index 22b9585e5..b85dd0019 100644
--- a/l3kernel/l3fp-symbolic.dtx
+++ b/l3kernel/l3fp-symbolic.dtx
@@ -599,7 +599,7 @@
% \end{macro}
% \end{macro}
%
-% \begin{variable}{@@_symbolic}
+% \begin{variable}{\l_@@_symbolic_flag}
% \begin{macro}{\fp_set_variable:nn, \@@_set_variable:nn}
% Refuse invalid identifiers. If the variable does not exist yet,
% define it just as in \cs{fp_new_variable:n} (but without unnecessary
@@ -615,7 +615,7 @@
% raised, |#1|~was present in \cs{l_@@_symbolic_fp}. In all cases,
% the |#1|-free result ends up in |\l__fp_variable_#1_fp|.
% \begin{macrocode}
-\flag_new:n { @@_symbolic }
+\flag_new:N \l_@@_symbolic_flag
\cs_new_protected:Npn \fp_set_variable:nn #1
{
\exp_args:No \@@_set_variable:nn { \tl_to_str:n {#1} }
@@ -628,10 +628,10 @@
\@@_variable_set_parsing:Nn \cs_set_eq:NN {#1}
\fp_set:Nn \l_@@_symbolic_fp {#2}
\cs_set_nopar:cpn { l_@@_variable_#1_fp }
- { \flag_ensure_raised:n { @@_symbolic } \c_nan_fp }
- \flag_clear:n { @@_symbolic }
+ { \flag_ensure_raised:N \l_@@_symbolic_flag \c_nan_fp }
+ \flag_clear:N \l_@@_symbolic_flag
\fp_set:cn { l_@@_variable_#1_fp } { \l_@@_symbolic_fp }
- \flag_if_raised:nT { @@_symbolic }
+ \flag_if_raised:NT \l_@@_symbolic_flag
{
\msg_error:nneee { fp } { id-loop }
{ #1 }
diff --git a/l3kernel/l3fp-traps.dtx b/l3kernel/l3fp-traps.dtx
index 983fb9117..52d3bd473 100644
--- a/l3kernel/l3fp-traps.dtx
+++ b/l3kernel/l3fp-traps.dtx
@@ -74,17 +74,17 @@
%
% \begin{variable}[module = fp]
% {
-% fp_invalid_operation,
-% fp_division_by_zero,
-% fp_overflow,
-% fp_underflow
+% \l_fp_invalid_operation_flag,
+% \l_fp_division_by_zero_flag,
+% \l_fp_overflow_flag,
+% \l_fp_underflow_flag
% }
% Flags to denote exceptions.
% \begin{macrocode}
-\flag_new:n { fp_invalid_operation }
-\flag_new:n { fp_division_by_zero }
-\flag_new:n { fp_overflow }
-\flag_new:n { fp_underflow }
+\flag_new:N \l_fp_invalid_operation_flag
+\flag_new:N \l_fp_division_by_zero_flag
+\flag_new:N \l_fp_overflow_flag
+\flag_new:N \l_fp_underflow_flag
% \end{macrocode}
% \end{variable}
%
@@ -167,7 +167,7 @@
{
#1
\@@_error:nnfn { invalid } {##2} { \fp_to_tl:n { ##3; } } { }
- \flag_ensure_raised:n { fp_invalid_operation }
+ \flag_ensure_raised:N \l_fp_invalid_operation_flag
##1
}
\exp_args:Nno \use:n
@@ -176,7 +176,7 @@
#1
\@@_error:nffn { invalid-ii }
{ \fp_to_tl:n { ##2; } } { \fp_to_tl:n { ##3; } } {##1}
- \flag_ensure_raised:n { fp_invalid_operation }
+ \flag_ensure_raised:N \l_fp_invalid_operation_flag
\exp_after:wN \c_nan_fp
}
\exp_args:Nno \use:n
@@ -184,7 +184,7 @@
{
#1
\@@_error:nffn { invalid } {##1} {##2} { }
- \flag_ensure_raised:n { fp_invalid_operation }
+ \flag_ensure_raised:N \l_fp_invalid_operation_flag
\exp_after:wN \c_nan_fp
}
}
@@ -217,7 +217,7 @@
{
#1
\@@_error:nnfn { zero-div } {##2} { \fp_to_tl:n { ##3; } } { }
- \flag_ensure_raised:n { fp_division_by_zero }
+ \flag_ensure_raised:N \l_fp_division_by_zero_flag
\exp_after:wN ##1
}
\exp_args:Nno \use:n
@@ -226,7 +226,7 @@
#1
\@@_error:nffn { zero-div-ii }
{ \fp_to_tl:n { ##3; } } { \fp_to_tl:n { ##4; } } {##2}
- \flag_ensure_raised:n { fp_division_by_zero }
+ \flag_ensure_raised:N \l_fp_division_by_zero_flag
\exp_after:wN ##1
}
}
@@ -289,7 +289,7 @@
{ \fp_to_tl:n { \s_@@ \@@_chk:w ##1##2##3; } }
{ \token_if_eq_meaning:NNF 0 ##2 { - } #4 }
{#2}
- \flag_ensure_raised:n { fp_#2 }
+ \flag_ensure_raised:c { l_fp_#2_flag }
#3 ##2
}
}
diff --git a/l3kernel/l3fp.dtx b/l3kernel/l3fp.dtx
index 4f4fee8af..ec7965e0c 100644
--- a/l3kernel/l3fp.dtx
+++ b/l3kernel/l3fp.dtx
@@ -874,9 +874,9 @@
% a computation is not exact, in other words, almost always. At the
% moment, this exception is entirely ignored in \LaTeX3.
% \end{itemize}
-% To each exception we associate a \enquote{flag}: \texttt{fp_overflow},
-% \texttt{fp_underflow}, \texttt{fp_invalid_operation} and
-% \texttt{fp_division_by_zero}. The state of these flags can be tested
+% To each exception we associate a \enquote{flag}: \cs{l_fp_overflow_flag},
+% \cs{l_fp_underflow_flag}, \cs{l_fp_invalid_operation_flag} and
+% \cs{l_fp_division_by_zero_flag}. The state of these flags can be tested
% and modified with commands from \pkg{l3flag}
%
% By default, the \enquote{invalid operation} exception triggers an
@@ -907,12 +907,12 @@
% \emph{This function is experimental, and may be altered or removed.}
% \end{function}
%
-% \begin{variable}[module = fp]
+% \begin{variable}
% {
-% fp_overflow,
-% fp_underflow,
-% fp_invalid_operation,
-% fp_division_by_zero
+% \l_fp_overflow_flag,
+% \l_fp_underflow_flag,
+% \l_fp_invalid_operation_flag,
+% \l_fp_division_by_zero_flag
% }
% Flags denoting the occurrence of various floating-point exceptions.
% \end{variable}
diff --git a/l3kernel/l3regex.dtx b/l3kernel/l3regex.dtx
index 3651921b0..89bd564cf 100644
--- a/l3kernel/l3regex.dtx
+++ b/l3kernel/l3regex.dtx
@@ -3508,7 +3508,7 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{variable}{@@_cs}
+% \begin{variable}{\l_@@_cs_flag}
% \begin{macro}+\@@_compile_}:+
% \begin{macro}{\@@_compile_end_cs:}
% \begin{macro}[EXP]{\@@_compile_cs_aux:Nn, \@@_compile_cs_aux:NNnnnN}
@@ -3522,7 +3522,7 @@
% \cs{@@_item_exact_cs:n} with an argument consisting of all
% possibilities separated by \cs{scan_stop:}.
% \begin{macrocode}
-\flag_new:n { @@_cs }
+\flag_new:N \l_@@_cs_flag
\cs_new_protected:cpn { @@_compile_ \c_right_brace_str : }
{
\@@_if_in_cs:TF
@@ -3532,7 +3532,7 @@
\cs_new_protected:Npn \@@_compile_end_cs:
{
\@@_compile_end:
- \flag_clear:n { @@_cs }
+ \flag_clear:N \l_@@_cs_flag
\__kernel_tl_set:Nx \l_@@_internal_a_tl
{
\exp_after:wN \@@_compile_cs_aux:Nn \l_@@_internal_regex
@@ -3540,7 +3540,7 @@
}
\exp_args:Ne \@@_compile_one:n
{
- \flag_if_raised:nTF { @@_cs }
+ \flag_if_raised:NTF \l_@@_cs_flag
{ \@@_item_cs:n { \exp_not:o \l_@@_internal_regex } }
{
\@@_item_exact_cs:n
@@ -3559,7 +3559,7 @@
\@@_compile_cs_aux:Nn
}
{
- \@@_quark_if_nil:NF #1 { \flag_ensure_raised:n { @@_cs } }
+ \@@_quark_if_nil:NF #1 { \flag_ensure_raised:N \l_@@_cs_flag }
\@@_use_none_delimit_by_q_recursion_stop:w
}
}
@@ -3581,7 +3581,7 @@
{
\@@_quark_if_nil:NF #1
{
- \flag_ensure_raised:n { @@_cs }
+ \flag_ensure_raised:N \l_@@_cs_flag
\@@_use_i_delimit_by_q_recursion_stop:nw
}
\@@_use_none_delimit_by_q_recursion_stop:w
@@ -6720,12 +6720,12 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{@@_begin, @@_end}
+% \begin{variable}{\l_@@_begin_flag, \l_@@_end_flag}
% Those flags are raised to indicate begin-group or end-group tokens
% that had to be added when extracting submatches.
% \begin{macrocode}
-\flag_new:n { @@_begin }
-\flag_new:n { @@_end }
+\flag_new:N \l_@@_begin_flag
+\flag_new:N \l_@@_end_flag
% \end{macrocode}
% \end{variable}
%
@@ -6990,8 +6990,8 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_group_end_extract_seq:N #1
{
- \flag_clear:n { @@_begin }
- \flag_clear:n { @@_end }
+ \flag_clear:N \l_@@_begin_flag
+ \flag_clear:N \l_@@_end_flag
\cs_set_eq:NN \@@_tmp:w \scan_stop:
\__kernel_tl_gset:Nx \g_@@_internal_tl
{
@@ -7000,9 +7000,9 @@
\@@_tmp:w
}
\int_set:Nn \l_@@_added_begin_int
- { \flag_height:n { @@_begin } }
+ { \flag_height:N \l_@@_begin_flag }
\int_set:Nn \l_@@_added_end_int
- { \flag_height:n { @@_end } }
+ { \flag_height:N \l_@@_end_flag }
\tex_afterassignment:D \@@_extract_check:w
\__kernel_tl_gset:Nx \g_@@_internal_tl
{ \g_@@_internal_tl \if_false: { \fi: } }
@@ -7055,7 +7055,7 @@
\if_int_compare:w #1 < \c_zero_int
\prg_replicate:nn {-#1}
{
- \flag_raise:n { @@_begin }
+ \flag_raise:N \l_@@_begin_flag
\exp_not:n { { \if_false: } \fi: }
}
\fi:
@@ -7063,7 +7063,7 @@
\if_int_compare:w #1 > \c_zero_int
\prg_replicate:nn {#1}
{
- \flag_raise:n { @@_end }
+ \flag_raise:N \l_@@_end_flag
\exp_not:n { \if_false: { \fi: } }
}
\fi:
diff --git a/l3kernel/l3str-convert.dtx b/l3kernel/l3str-convert.dtx
index f1430aaa8..24998bcdd 100644
--- a/l3kernel/l3str-convert.dtx
+++ b/l3kernel/l3str-convert.dtx
@@ -343,13 +343,13 @@
% \end{macrocode}
% \end{variable}
%
-% \begin{variable}{@@_byte, @@_error}
+% \begin{variable}{\l_@@_byte_flag, \l_@@_error_flag}
% Conversions from one \meta{encoding}/\meta{escaping} pair to another
% are done within \texttt{e}-expanding assignments. Errors are
% signalled by raising the relevant flag.
% \begin{macrocode}
-\flag_new:n { @@_byte }
-\flag_new:n { @@_error }
+\flag_new:N \l_@@_byte_flag
+\flag_new:N \l_@@_error_flag
% \end{macrocode}
% \end{variable}
%
@@ -599,8 +599,8 @@
%
% \subsubsection{Error-reporting during conversion}
%
-% \begin{macro}{\@@_if_flag_error:nne}
-% \begin{macro}{\@@_if_flag_no_error:nne}
+% \begin{macro}{\@@_if_flag_error:Nne}
+% \begin{macro}{\@@_if_flag_no_error:Nne}
% When converting using the function \cs{str_set_convert:Nnnn}, errors
% should be reported to the user after each step in the
% conversion. Errors are signalled by raising some flag (typically
@@ -608,30 +608,30 @@
% give the user an error, otherwise remove the arguments. On the other
% hand, in the conditional functions \cs{str_set_convert:NnnnTF},
% errors should be suppressed. This is done by changing
-% \cs{@@_if_flag_error:nne} into \cs{@@_if_flag_no_error:nne}
+% \cs{@@_if_flag_error:Nne} into \cs{@@_if_flag_no_error:Nne}
% locally.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_if_flag_error:nne #1
+\cs_new_protected:Npn \@@_if_flag_error:Nne #1
{
- \flag_if_raised:nTF {#1}
+ \flag_if_raised:NTF #1
{ \msg_error:nne { str } }
{ \use_none:nn }
}
-\cs_new_protected:Npn \@@_if_flag_no_error:nne #1#2#3
- { \flag_if_raised:nT {#1} { \bool_gset_true:N \g_@@_error_bool } }
+\cs_new_protected:Npn \@@_if_flag_no_error:Nne #1#2#3
+ { \flag_if_raised:NT #1 { \bool_gset_true:N \g_@@_error_bool } }
% \end{macrocode}
% \end{macro}
% \end{macro}
%
-% \begin{macro}[rEXP]{\@@_if_flag_times:nT}
+% \begin{macro}[rEXP]{\@@_if_flag_times:NT}
% At the end of each conversion step, we raise all relevant errors as
% one error message, built on the fly. The height of each flag
% indicates how many times a given error was encountered. This
% function prints |#2| followed by the number of occurrences of an
% error if it occurred, nothing otherwise.
% \begin{macrocode}
-\cs_new:Npn \@@_if_flag_times:nT #1#2
- { \flag_if_raised:nT {#1} { #2~(x \flag_height:n {#1} ) } }
+\cs_new:Npn \@@_if_flag_times:NT #1#2
+ { \flag_if_raised:NT #1 { #2~(x \flag_height:N #1 ) } }
% \end{macrocode}
% \end{macro}
%
@@ -675,7 +675,7 @@
% unescape and decode; encode and escape; exit the group and store the
% result in the user's variable. The various conversion functions all
% act on \cs{g_@@_result_tl}. Errors are silenced for the conditional
-% functions by redefining \cs{@@_if_flag_error:nne} locally.
+% functions by redefining \cs{@@_if_flag_error:Nne} locally.
% \begin{macrocode}
\cs_new_protected:Npn \str_set_convert:Nnnn
{ \@@_convert:nNNnnn { } \tl_set_eq:NN }
@@ -686,7 +686,7 @@
{
\bool_gset_false:N \g_@@_error_bool
\@@_convert:nNNnnn
- { \cs_set_eq:NN \@@_if_flag_error:nne \@@_if_flag_no_error:nne }
+ { \cs_set_eq:NN \@@_if_flag_error:Nne \@@_if_flag_no_error:Nne }
\tl_set_eq:NN #1 {#2} {#3} {#4}
\bool_if:NTF \g_@@_error_bool \prg_return_false: \prg_return_true:
}
@@ -695,7 +695,7 @@
{
\bool_gset_false:N \g_@@_error_bool
\@@_convert:nNNnnn
- { \cs_set_eq:NN \@@_if_flag_error:nne \@@_if_flag_no_error:nne }
+ { \cs_set_eq:NN \@@_if_flag_error:Nne \@@_if_flag_no_error:Nne }
\tl_gset_eq:NN #1 {#2} {#3} {#4}
\bool_if:NTF \g_@@_error_bool \prg_return_false: \prg_return_true:
}
@@ -893,7 +893,7 @@
% \begin{macro}[rEXP]{\@@_filter_bytes_aux:N}
% In the case of 8-bit engines, every character is a byte. For
% Unicode-aware engines, test the character code; non-bytes cause us
-% to raise the flag \texttt{@@_byte}. Spaces have already been given
+% to raise the flag \cs{l_@@_byte_flag}. Spaces have already been given
% the correct category code when this function is called.
% \begin{macrocode}
\bool_lazy_any:nTF
@@ -914,7 +914,7 @@
\if_int_compare:w `#1 < 256 \exp_stop_f:
#1
\else:
- \flag_raise:n { @@_byte }
+ \flag_raise:N \l_@@_byte_flag
\fi:
\@@_filter_bytes_aux:N
}
@@ -937,10 +937,10 @@
{
\cs_new_protected:Npn \@@_convert_unescape_:
{
- \flag_clear:n { @@_byte }
+ \flag_clear:N \l_@@_byte_flag
\__kernel_tl_gset:Nx \g_@@_result_tl
{ \exp_args:No \@@_filter_bytes:n \g_@@_result_tl }
- \@@_if_flag_error:nne { @@_byte } { non-byte } { bytes }
+ \@@_if_flag_error:Nne \l_@@_byte_flag { non-byte } { bytes }
}
}
{ \cs_new_protected:Npn \@@_convert_unescape_: { } }
@@ -997,15 +997,15 @@
{
\cs_new_protected:Npn \@@_convert_encode_:
{
- \flag_clear:n { @@_error }
+ \flag_clear:N \l_@@_error_flag
\@@_convert_gmap_internal:N \@@_encode_native_char:n
- \@@_if_flag_error:nne { @@_error }
+ \@@_if_flag_error:Nne \l_@@_error_flag
{ native-overflow } { }
}
\cs_new:Npn \@@_encode_native_char:n #1
{
\if_int_compare:w #1 > \c_@@_max_byte_int
- \flag_raise:n { @@_error }
+ \flag_raise:N \l_@@_error_flag
?
\else:
\char_generate:nn {#1} {12}
@@ -1186,9 +1186,9 @@
\exp_not:N \@@_decode_eight_bit_aux:Nn
\exp_not:c { g_@@_decode_#1_intarray }
}
- \flag_clear:n { @@_error }
+ \flag_clear:N \l_@@_error_flag
\@@_convert_gmap:N \@@_tmp:w
- \@@_if_flag_error:nne { @@_error } { decode-8-bit } {#1}
+ \@@_if_flag_error:Nne \l_@@_error_flag { decode-8-bit } {#1}
}
\cs_new:Npn \@@_decode_eight_bit_aux:Nn #1#2
{
@@ -1200,7 +1200,7 @@
\cs_new:Npn \@@_decode_eight_bit_aux:n #1
{
\if_int_compare:w #1 < \c_zero_int
- \flag_raise:n { @@_error }
+ \flag_raise:N \l_@@_error_flag
\int_value:w \c_@@_replacement_char_int
\else:
#1
@@ -1230,9 +1230,9 @@
\exp_not:c { g_@@_encode_#1_intarray }
\exp_not:c { g_@@_decode_#1_intarray }
}
- \flag_clear:n { @@_error }
+ \flag_clear:N \l_@@_error_flag
\@@_convert_gmap_internal:N \@@_tmp:w
- \@@_if_flag_error:nne { @@_error } { encode-8-bit } {#1}
+ \@@_if_flag_error:Nne \l_@@_error_flag { encode-8-bit } {#1}
}
\cs_new:Npn \@@_encode_eight_bit_aux:NNn #1#2#3
{
@@ -1248,7 +1248,7 @@
{
\int_compare:nNnTF { \intarray_item:Nn #3 { 1 + #1 } } = {#2}
{ \@@_output_byte:n {#1} }
- { \flag_raise:n { @@_error } }
+ { \flag_raise:N \l_@@_error_flag }
}
% \end{macrocode}
% \end{macro}
@@ -1349,7 +1349,7 @@
\cs_new_protected:Npn \@@_convert_unescape_hex:
{
\group_begin:
- \flag_clear:n { @@_error }
+ \flag_clear:N \l_@@_error_flag
\int_set:Nn \tex_escapechar:D { 92 }
\__kernel_tl_gset:Nx \g_@@_result_tl
{
@@ -1360,7 +1360,7 @@
\prg_break_point:
\@@_output_end:
}
- \@@_if_flag_error:nne { @@_error } { unescape-hex } { }
+ \@@_if_flag_error:Nne \l_@@_error_flag { unescape-hex } { }
\group_end:
}
\cs_new:Npn \@@_unescape_hex_auxi:N #1
@@ -1369,7 +1369,7 @@
\@@_hexadecimal_use:NTF #1
{ \@@_unescape_hex_auxii:N }
{
- \flag_raise:n { @@_error }
+ \flag_raise:N \l_@@_error_flag
\@@_unescape_hex_auxi:N
}
}
@@ -1382,7 +1382,7 @@
\@@_output_byte:w " \@@_unescape_hex_auxi:N
}
{
- \flag_raise:n { @@_error }
+ \flag_raise:N \l_@@_error_flag
\@@_unescape_hex_auxii:N
}
}
@@ -1427,8 +1427,8 @@
\cs_new_protected:cpn { @@_convert_unescape_#2: }
{
\group_begin:
- \flag_clear:n { @@_byte }
- \flag_clear:n { @@_error }
+ \flag_clear:N \l_@@_byte_flag
+ \flag_clear:N \l_@@_error_flag
\int_set:Nn \tex_escapechar:D { 92 }
\__kernel_tl_gset:Nx \g_@@_result_tl
{
@@ -1436,8 +1436,8 @@
#1 ? { ? \prg_break: }
\prg_break_point:
}
- \@@_if_flag_error:nne { @@_byte } { non-byte } { #2 }
- \@@_if_flag_error:nne { @@_error } { unescape-#2 } { }
+ \@@_if_flag_error:Nne \l_@@_byte_flag { non-byte } { #2 }
+ \@@_if_flag_error:Nne \l_@@_error_flag { unescape-#2 } { }
\group_end:
}
\cs_new:Npn #3 ##1#1##2##3
@@ -1450,12 +1450,12 @@
\@@_hexadecimal_use:NTF ##3
{ }
{
- \flag_raise:n { @@_error }
+ \flag_raise:N \l_@@_error_flag
* 0 + `#1 \use_i:nn
}
}
{
- \flag_raise:n { @@_error }
+ \flag_raise:N \l_@@_error_flag
0 + `#1 \use_i:nn
}
\@@_output_end:
@@ -1513,8 +1513,8 @@
\cs_new_protected:Npn \@@_convert_unescape_string:
{
\group_begin:
- \flag_clear:n { @@_byte }
- \flag_clear:n { @@_error }
+ \flag_clear:N \l_@@_byte_flag
+ \flag_clear:N \l_@@_error_flag
\int_set:Nn \tex_escapechar:D { 92 }
\__kernel_tl_gset:Nx \g_@@_result_tl
{
@@ -1528,8 +1528,8 @@
\g_@@_result_tl #1 ?? { ? \prg_break: }
\prg_break_point:
}
- \@@_if_flag_error:nne { @@_byte } { non-byte } { string }
- \@@_if_flag_error:nne { @@_error } { unescape-string } { }
+ \@@_if_flag_error:Nne \l_@@_byte_flag { non-byte } { string }
+ \@@_if_flag_error:Nne \l_@@_error_flag { unescape-string } { }
\group_end:
}
}
@@ -1569,7 +1569,7 @@
{ ^^J } { 0 - 1 }
}
{
- \flag_raise:n { @@_error }
+ \flag_raise:N \l_@@_error_flag
0 - 1 \use_i:nn
}
}
@@ -1825,8 +1825,8 @@
% }
% When decoding a string that is purportedly in the \textsc{utf-8}
% encoding, four different errors can occur, signalled by a specific
-% flag for each (we define those flags using \cs{flag_clear_new:n}
-% rather than \cs{flag_new:n}, because they are shared with other
+% flag for each (we define those flags using \cs{flag_clear_new:N}
+% rather than \cs{flag_new:N}, because they are shared with other
% encoding definition files).
% \begin{itemize}
% \item \enquote{Missing continuation byte}: a leading byte is not
@@ -1846,19 +1846,19 @@
% first remind the user what a correct \textsc{utf-8} string should
% look like, then add error-specific information.
% \begin{macrocode}
-\flag_clear_new:n { @@_missing }
-\flag_clear_new:n { @@_extra }
-\flag_clear_new:n { @@_overlong }
-\flag_clear_new:n { @@_overflow }
+\flag_clear_new:N \l_@@_missing_flag
+\flag_clear_new:N \l_@@_extra_flag
+\flag_clear_new:N \l_@@_overlong_flag
+\flag_clear_new:N \l_@@_overflow_flag
\msg_new:nnnn { str } { utf8-decode }
{
Invalid~UTF-8~string:
\exp_last_unbraced:Nf \use_none:n
{
- \@@_if_flag_times:nT { @@_missing } { ,~missing~continuation~byte }
- \@@_if_flag_times:nT { @@_extra } { ,~extra~continuation~byte }
- \@@_if_flag_times:nT { @@_overlong } { ,~overlong~form }
- \@@_if_flag_times:nT { @@_overflow } { ,~code~point~too~large }
+ \@@_if_flag_times:NT \l_@@_missing_flag { ,~missing~continuation~byte }
+ \@@_if_flag_times:NT \l_@@_extra_flag { ,~extra~continuation~byte }
+ \@@_if_flag_times:NT \l_@@_overlong_flag { ,~overlong~form }
+ \@@_if_flag_times:NT \l_@@_overflow_flag { ,~code~point~too~large }
}
.
}
@@ -1873,25 +1873,25 @@
Code~point~ <~1114112:~11110xxx~10xxxxxx~10xxxxxx~10xxxxxx \\
}
Bytes~of~the~form~10xxxxxx~are~called~continuation~bytes.
- \flag_if_raised:nT { @@_missing }
+ \flag_if_raised:NT \l_@@_missing_flag
{
\\\\
A~leading~byte~(in~the~range~[192,255])~was~not~followed~by~
the~appropriate~number~of~continuation~bytes.
}
- \flag_if_raised:nT { @@_extra }
+ \flag_if_raised:NT \l_@@_extra_flag
{
\\\\
LaTeX~came~across~a~continuation~byte~when~it~was~not~expected.
}
- \flag_if_raised:nT { @@_overlong }
+ \flag_if_raised:NT \l_@@_overlong_flag
{
\\\\
Every~Unicode~code~point~must~be~expressed~in~the~shortest~
possible~form.~For~instance,~'0xC0'~'0x83'~is~not~a~valid~
representation~for~the~code~point~3.
}
- \flag_if_raised:nT { @@_overflow }
+ \flag_if_raised:NT \l_@@_overflow_flag
{
\\\\
Unicode~limits~code~points~to~the~range~[0,1114111].
@@ -1970,18 +1970,18 @@
% \begin{macrocode}
\cs_new_protected:cpn { @@_convert_decode_utf8: }
{
- \flag_clear:n { @@_error }
- \flag_clear:n { @@_missing }
- \flag_clear:n { @@_extra }
- \flag_clear:n { @@_overlong }
- \flag_clear:n { @@_overflow }
+ \flag_clear:N \l_@@_error_flag
+ \flag_clear:N \l_@@_missing_flag
+ \flag_clear:N \l_@@_extra_flag
+ \flag_clear:N \l_@@_overlong_flag
+ \flag_clear:N \l_@@_overflow_flag
\__kernel_tl_gset:Nx \g_@@_result_tl
{
\exp_after:wN \@@_decode_utf_viii_start:N \g_@@_result_tl
{ \prg_break: \@@_decode_utf_viii_end: }
\prg_break_point:
}
- \@@_if_flag_error:nne { @@_error } { utf8-decode } { }
+ \@@_if_flag_error:Nne \l_@@_error_flag { utf8-decode } { }
}
\cs_new:Npn \@@_decode_utf_viii_start:N #1
{
@@ -1991,8 +1991,8 @@
\if_int_compare:w `#1 < "80 \exp_stop_f:
\int_value:w `#1
\else:
- \flag_raise:n { @@_extra }
- \flag_raise:n { @@_error }
+ \flag_raise:N \l_@@_extra_flag
+ \flag_raise:N \l_@@_error_flag
\int_use:N \c_@@_replacement_char_int
\fi:
\else:
@@ -2015,8 +2015,8 @@
\int_value:w \int_eval:n { #1 * "40 + `#3 - "80 } \exp_after:wN
\else:
\s_@@
- \flag_raise:n { @@_missing }
- \flag_raise:n { @@_error }
+ \flag_raise:N \l_@@_missing_flag
+ \flag_raise:N \l_@@_error_flag
\int_use:N \c_@@_replacement_char_int
\fi:
\s_@@
@@ -2029,8 +2029,8 @@
\if_int_compare:w #1 < #4 \exp_stop_f:
\s_@@
\if_int_compare:w #1 < #3 \exp_stop_f:
- \flag_raise:n { @@_overlong }
- \flag_raise:n { @@_error }
+ \flag_raise:N \l_@@_overlong_flag
+ \flag_raise:N \l_@@_error_flag
\int_use:N \c_@@_replacement_char_int
\else:
#1
@@ -2049,15 +2049,15 @@
\cs_new:Npn \@@_decode_utf_viii_overflow:w #1 \fi: #2 \fi:
{
\fi: \fi:
- \flag_raise:n { @@_overflow }
- \flag_raise:n { @@_error }
+ \flag_raise:N \l_@@_overflow_flag
+ \flag_raise:N \l_@@_error_flag
\int_use:N \c_@@_replacement_char_int
}
\cs_new:Npn \@@_decode_utf_viii_end:
{
\s_@@
- \flag_raise:n { @@_missing }
- \flag_raise:n { @@_error }
+ \flag_raise:N \l_@@_missing_flag
+ \flag_raise:N \l_@@_error_flag
\int_use:N \c_@@_replacement_char_int \s_@@
\prg_break:
}
@@ -2119,10 +2119,10 @@
{ \@@_encode_utf_xvi_aux:N \@@_output_byte_pair_le:n }
\cs_new_protected:Npn \@@_encode_utf_xvi_aux:N #1
{
- \flag_clear:n { @@_error }
+ \flag_clear:N \l_@@_error_flag
\cs_set_eq:NN \@@_tmp:w #1
\@@_convert_gmap_internal:N \@@_encode_utf_xvi_char:n
- \@@_if_flag_error:nne { @@_error } { utf16-encode } { }
+ \@@_if_flag_error:Nne \l_@@_error_flag { utf16-encode } { }
}
\cs_new:Npn \@@_encode_utf_xvi_char:n #1
{
@@ -2131,7 +2131,7 @@
\else:
\if_int_compare:w #1 < "10000 \exp_stop_f:
\if_int_compare:w #1 < "E000 \exp_stop_f:
- \flag_raise:n { @@_error }
+ \flag_raise:N \l_@@_error_flag
\@@_tmp:w { \c_@@_replacement_char_int }
\else:
\@@_tmp:w {#1}
@@ -2162,9 +2162,9 @@
% an unexpected trail surrogate, and a string containing an odd number
% of bytes.
% \begin{macrocode}
- \flag_clear_new:n { @@_missing }
- \flag_clear_new:n { @@_extra }
- \flag_clear_new:n { @@_end }
+ \flag_clear_new:N \l_@@_missing_flag
+ \flag_clear_new:N \l_@@_extra_flag
+ \flag_clear_new:N \l_@@_end_flag
\msg_new:nnnn { str } { utf16-encode }
{ Unicode~string~cannot~be~expressed~in~UTF-16:~surrogate. }
{
@@ -2177,9 +2177,9 @@
Invalid~UTF-16~string:
\exp_last_unbraced:Nf \use_none:n
{
- \@@_if_flag_times:nT { @@_missing } { ,~missing~trail~surrogate }
- \@@_if_flag_times:nT { @@_extra } { ,~extra~trail~surrogate }
- \@@_if_flag_times:nT { @@_end } { ,~odd~number~of~bytes }
+ \@@_if_flag_times:NT \l_@@_missing_flag { ,~missing~trail~surrogate }
+ \@@_if_flag_times:NT \l_@@_extra_flag { ,~extra~trail~surrogate }
+ \@@_if_flag_times:NT \l_@@_end_flag { ,~odd~number~of~bytes }
}
.
}
@@ -2196,17 +2196,17 @@
}
Lead~surrogates~are~pairs~of~bytes~in~the~range~[0xD800,~0xDBFF],~
and~trail~surrogates~are~in~the~range~[0xDC00,~0xDFFF].
- \flag_if_raised:nT { @@_missing }
+ \flag_if_raised:NT \l_@@_missing_flag
{
\\\\
A~lead~surrogate~was~not~followed~by~a~trail~surrogate.
}
- \flag_if_raised:nT { @@_extra }
+ \flag_if_raised:NT \l_@@_extra_flag
{
\\\\
LaTeX~came~across~a~trail~surrogate~when~it~was~not~expected.
}
- \flag_if_raised:nT { @@_end }
+ \flag_if_raised:NT \l_@@_end_flag
{
\\\\
The~string~contained~an~odd~number~of~bytes.~This~is~invalid:~
@@ -2260,10 +2260,10 @@
}
\cs_new_protected:Npn \@@_decode_utf_xvi:Nw #1#2 \s_@@_stop
{
- \flag_clear:n { @@_error }
- \flag_clear:n { @@_missing }
- \flag_clear:n { @@_extra }
- \flag_clear:n { @@_end }
+ \flag_clear:N \l_@@_error_flag
+ \flag_clear:N \l_@@_missing_flag
+ \flag_clear:N \l_@@_extra_flag
+ \flag_clear:N \l_@@_end_flag
\cs_set:Npn \@@_tmp:w ##1 ##2 { ` ## #1 }
\__kernel_tl_gset:Nx \g_@@_result_tl
{
@@ -2271,7 +2271,7 @@
#2 \q_@@_nil \q_@@_nil
\prg_break_point:
}
- \@@_if_flag_error:nne { @@_error } { utf16-decode } { }
+ \@@_if_flag_error:Nne \l_@@_error_flag { utf16-decode } { }
}
% \end{macrocode}
% \end{macro}
@@ -2377,8 +2377,8 @@
{ \@@_decode_utf_xvi_error:nNN { extra } #1#2 }
\cs_new:Npn \@@_decode_utf_xvi_error:nNN #1#2#3
{
- \flag_raise:n { @@_error }
- \flag_raise:n { str_#1 }
+ \flag_raise:N \l_@@_error_flag
+ \flag_raise:c { l_@@_#1_flag }
#2 #3 \s_@@
\int_use:N \c_@@_replacement_char_int \s_@@
}
@@ -2463,29 +2463,29 @@
% happens if the encoding was in fact not \textsc{utf-32}, because
% most arbitrary strings are not valid in \textsc{utf-32}.
% \begin{macrocode}
- \flag_clear_new:n { @@_overflow }
- \flag_clear_new:n { @@_end }
+ \flag_clear_new:N \l_@@_overflow_flag
+ \flag_clear_new:N \l_@@_end_flag
\msg_new:nnnn { str } { utf32-decode }
{
Invalid~UTF-32~string:
\exp_last_unbraced:Nf \use_none:n
{
- \@@_if_flag_times:nT { @@_overflow } { ,~code~point~too~large }
- \@@_if_flag_times:nT { @@_end } { ,~truncated~string }
+ \@@_if_flag_times:NT \l_@@_overflow_flag { ,~code~point~too~large }
+ \@@_if_flag_times:NT \l_@@_end_flag { ,~truncated~string }
}
.
}
{
In~the~UTF-32~encoding,~every~Unicode~character~
(in~the~range~[U+0000,~U+10FFFF])~is~encoded~as~4~bytes.
- \flag_if_raised:nT { @@_overflow }
+ \flag_if_raised:NT \l_@@_overflow_flag
{
\\\\
LaTeX~came~across~a~code~point~larger~than~1114111,~
the~maximum~code~point~defined~by~Unicode.~
Perhaps~the~string~was~not~encoded~in~the~UTF-32~encoding?
}
- \flag_if_raised:nT { @@_end }
+ \flag_if_raised:NT \l_@@_end_flag
{
\\\\
The~length~of~the~string~is~not~a~multiple~of~4.~
@@ -2549,9 +2549,9 @@
}
\cs_new_protected:Npn \@@_decode_utf_xxxii:Nw #1#2 \s_@@_stop
{
- \flag_clear:n { @@_overflow }
- \flag_clear:n { @@_end }
- \flag_clear:n { @@_error }
+ \flag_clear:N \l_@@_overflow_flag
+ \flag_clear:N \l_@@_end_flag
+ \flag_clear:N \l_@@_error_flag
\cs_set:Npn \@@_tmp:w ##1 ##2 { ` ## #1 }
\__kernel_tl_gset:Nx \g_@@_result_tl
{
@@ -2559,7 +2559,7 @@
#2 \s_@@_stop \s_@@_stop \s_@@_stop \s_@@_stop
\prg_break_point:
}
- \@@_if_flag_error:nne { @@_error } { utf32-decode } { }
+ \@@_if_flag_error:Nne \l_@@_error_flag { utf32-decode } { }
}
\cs_new:Npn \@@_decode_utf_xxxii_loop:NNNN #1#2#3#4
{
@@ -2568,13 +2568,13 @@
\fi:
#1#2#3#4 \s_@@
\if_int_compare:w \@@_tmp:w #1#4 > \c_zero_int
- \flag_raise:n { @@_overflow }
- \flag_raise:n { @@_error }
+ \flag_raise:N \l_@@_overflow_flag
+ \flag_raise:N \l_@@_error_flag
\int_use:N \c_@@_replacement_char_int
\else:
\if_int_compare:w \@@_tmp:w #2#3 > 16 \exp_stop_f:
- \flag_raise:n { @@_overflow }
- \flag_raise:n { @@_error }
+ \flag_raise:N \l_@@_overflow_flag
+ \flag_raise:N \l_@@_error_flag
\int_use:N \c_@@_replacement_char_int
\else:
\int_eval:n
@@ -2588,8 +2588,8 @@
{
\tl_if_empty:nF {#1}
{
- \flag_raise:n { @@_end }
- \flag_raise:n { @@_error }
+ \flag_raise:N \l_@@_end_flag
+ \flag_raise:N \l_@@_error_flag
#1 \s_@@
\int_use:N \c_@@_replacement_char_int \s_@@
}
diff --git a/l3kernel/testfiles/m3fp-traps001.lvt b/l3kernel/testfiles/m3fp-traps001.lvt
index 681c59b3b..7876d65b5 100644
--- a/l3kernel/testfiles/m3fp-traps001.lvt
+++ b/l3kernel/testfiles/m3fp-traps001.lvt
@@ -19,18 +19,18 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\TEST { fp ~ flags }
{
- \flag_if_raised:nTF { fp_invalid_operation } { \ERROR } { \FALSE }
- \exp_args:Ne \use_none:n { \flag_raise:n { fp_invalid_operation } }
- \flag_if_raised:nTF { fp_invalid_operation } { \TRUE } { \ERROR }
- \flag_clear:n { fp_invalid_operation }
- \flag_if_raised:nTF { fp_invalid_operation } { \ERROR } { \FALSE }
+ \flag_if_raised:NTF \l_fp_invalid_operation_flag { \ERROR } { \FALSE }
+ \exp_args:Ne \use_none:n { \flag_raise:N \l_fp_invalid_operation_flag }
+ \flag_if_raised:NTF \l_fp_invalid_operation_flag { \TRUE } { \ERROR }
+ \flag_clear:N \l_fp_invalid_operation_flag
+ \flag_if_raised:NTF \l_fp_invalid_operation_flag { \ERROR } { \FALSE }
{
\iow_term:e { \fp_to_tl:n { 0 * inf } }
- \flag_if_raised:nTF { fp_invalid_operation } { \TRUE } { \ERROR }
+ \flag_if_raised:NTF \l_fp_invalid_operation_flag { \TRUE } { \ERROR }
}
- \flag_if_raised:nTF { fp_invalid_operation } { \ERROR } { \FALSE }
+ \flag_if_raised:NTF \l_fp_invalid_operation_flag { \ERROR } { \FALSE }
\iow_term:e { \fp_to_decimal:n { nan } }
- \flag_if_raised:nTF { fp_invalid_operation } { \TRUE } { \ERROR }
+ \flag_if_raised:NTF \l_fp_invalid_operation_flag { \TRUE } { \ERROR }
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -43,125 +43,125 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\TEST { fp_trap:nn ~ invalid ~ operation }
{
- \flag_if_raised:nTF { fp_invalid_operation } { \ERROR } { \FALSE }
+ \flag_if_raised:NTF \l_fp_invalid_operation_flag { \ERROR } { \FALSE }
\iow_term:e { \fp_to_tl:n { 0 * inf } }
- \flag_if_raised:nTF { fp_invalid_operation } { \TRUE } { \ERROR }
- \flag_clear:n { fp_invalid_operation }
+ \flag_if_raised:NTF \l_fp_invalid_operation_flag { \TRUE } { \ERROR }
+ \flag_clear:N \l_fp_invalid_operation_flag
{
\fp_trap:nn { invalid_operation } { error }
\iow_term:e { \fp_to_tl:n { 0 * inf } }
- \flag_if_raised:nTF { fp_invalid_operation } { \TRUE } { \ERROR }
+ \flag_if_raised:NTF \l_fp_invalid_operation_flag { \TRUE } { \ERROR }
}
{
\fp_trap:nn { invalid_operation } { flag }
\iow_term:e { \fp_to_tl:n { 0 * inf } }
- \flag_if_raised:nTF { fp_invalid_operation } { \TRUE } { \ERROR }
+ \flag_if_raised:NTF \l_fp_invalid_operation_flag { \TRUE } { \ERROR }
}
{
\fp_trap:nn { invalid_operation } { none }
\iow_term:e { \fp_to_tl:n { 0 * inf } }
- \flag_if_raised:nTF { fp_invalid_operation } { \ERROR } { \FALSE }
+ \flag_if_raised:NTF \l_fp_invalid_operation_flag { \ERROR } { \FALSE }
}
\iow_term:e { \fp_to_tl:n { 0 * inf } }
- \flag_if_raised:nTF { fp_invalid_operation } { \TRUE } { \ERROR }
+ \flag_if_raised:NTF \l_fp_invalid_operation_flag { \TRUE } { \ERROR }
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\TEST { fp_trap:nn ~ division ~ by ~ zero }
{
- \flag_if_raised:nTF { fp_division_by_zero } { \ERROR } { \FALSE }
+ \flag_if_raised:NTF \l_fp_division_by_zero_flag { \ERROR } { \FALSE }
\iow_term:e { \fp_to_tl:n { 1 / 0 } }
- \flag_if_raised:nTF { fp_division_by_zero } { \TRUE } { \ERROR }
- \flag_clear:n { fp_division_by_zero }
+ \flag_if_raised:NTF \l_fp_division_by_zero_flag { \TRUE } { \ERROR }
+ \flag_clear:N \l_fp_division_by_zero_flag
{
\fp_trap:nn { division_by_zero } { error }
\iow_term:e { \fp_to_tl:n { 1 / 0 } }
- \flag_if_raised:nTF { fp_division_by_zero } { \TRUE } { \ERROR }
+ \flag_if_raised:NTF \l_fp_division_by_zero_flag { \TRUE } { \ERROR }
}
{
\fp_trap:nn { division_by_zero } { flag }
\iow_term:e { \fp_to_tl:n { 1 / 0 } }
- \flag_if_raised:nTF { fp_division_by_zero } { \TRUE } { \ERROR }
+ \flag_if_raised:NTF \l_fp_division_by_zero_flag { \TRUE } { \ERROR }
}
{
\fp_trap:nn { division_by_zero } { none }
\iow_term:e { \fp_to_tl:n { 1 / 0 } }
- \flag_if_raised:nTF { fp_division_by_zero } { \ERROR } { \FALSE }
+ \flag_if_raised:NTF \l_fp_division_by_zero_flag { \ERROR } { \FALSE }
}
\iow_term:e { \fp_to_tl:n { 1 / 0 } }
- \flag_if_raised:nTF { fp_division_by_zero } { \TRUE } { \ERROR }
+ \flag_if_raised:NTF \l_fp_division_by_zero_flag { \TRUE } { \ERROR }
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\TEST { fp_trap:nn ~ overflow }
{
\iow_term:e { \fp_to_tl:n { 1e9999 * 1e9999 } }
- \flag_if_raised:nTF { fp_overflow } { \TRUE } { \ERROR }
- \flag_clear:n { fp_overflow }
+ \flag_if_raised:NTF \l_fp_overflow_flag { \TRUE } { \ERROR }
+ \flag_clear:N \l_fp_overflow_flag
{
\fp_trap:nn { overflow } { none }
\iow_term:e { \fp_to_tl:n { 1e9999 * 1e9999 } }
- \flag_if_raised:nTF { fp_overflow } { \ERROR } { \FALSE }
+ \flag_if_raised:NTF \l_fp_overflow_flag { \ERROR } { \FALSE }
}
{
\fp_trap:nn { overflow } { flag }
\iow_term:e { \fp_to_tl:n { 1e9999 * 1e9999 } }
- \flag_if_raised:nTF { fp_overflow } { \TRUE } { \ERROR }
+ \flag_if_raised:NTF \l_fp_overflow_flag { \TRUE } { \ERROR }
}
{
\fp_trap:nn { overflow } { error }
\iow_term:e { \fp_to_tl:n { 1e9999 * 1e9999 } }
- \flag_if_raised:nTF { fp_overflow } { \TRUE } { \ERROR }
+ \flag_if_raised:NTF \l_fp_overflow_flag { \TRUE } { \ERROR }
}
- \flag_clear:n { fp_overflow }
+ \flag_clear:N \l_fp_overflow_flag
\iow_term:e { \fp_to_tl:n { 1e9999 * 1e9999 } }
- \flag_if_raised:nTF { fp_overflow } { \TRUE } { \ERROR }
- \flag_clear:n { fp_overflow }
+ \flag_if_raised:NTF \l_fp_overflow_flag { \TRUE } { \ERROR }
+ \flag_clear:N \l_fp_overflow_flag
\iow_term:e { \fp_to_tl:n { exp(1e5678) } }
- \flag_if_raised:nTF { fp_overflow } { \TRUE } { \ERROR }
+ \flag_if_raised:NTF \l_fp_overflow_flag { \TRUE } { \ERROR }
\fp_trap:nn { overflow } { error }
- \flag_clear:n { fp_overflow }
+ \flag_clear:N \l_fp_overflow_flag
\iow_term:e { \fp_to_tl:n { 1e9999 * 1e9999 } }
- \flag_if_raised:nTF { fp_overflow } { \TRUE } { \ERROR }
- \flag_clear:n { fp_overflow }
+ \flag_if_raised:NTF \l_fp_overflow_flag { \TRUE } { \ERROR }
+ \flag_clear:N \l_fp_overflow_flag
\iow_term:e { \fp_to_tl:n { exp(1e5678) } }
- \flag_if_raised:nTF { fp_overflow } { \TRUE } { \ERROR }
+ \flag_if_raised:NTF \l_fp_overflow_flag { \TRUE } { \ERROR }
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\TEST { fp_trap:nn ~ underflow }
{
\iow_term:e { \fp_to_tl:n { 1e-9999 * 1e-9999 } }
- \flag_if_raised:nTF { fp_underflow } { \TRUE } { \ERROR }
- \flag_clear:n { fp_underflow }
+ \flag_if_raised:NTF \l_fp_underflow_flag { \TRUE } { \ERROR }
+ \flag_clear:N \l_fp_underflow_flag
{
\fp_trap:nn { underflow } { none }
\iow_term:e { \fp_to_tl:n { 1e-9999 * 1e-9999 } }
- \flag_if_raised:nTF { fp_underflow } { \ERROR } { \FALSE }
+ \flag_if_raised:NTF \l_fp_underflow_flag { \ERROR } { \FALSE }
}
{
\fp_trap:nn { underflow } { flag }
\iow_term:e { \fp_to_tl:n { 1e-9999 * 1e-9999 } }
- \flag_if_raised:nTF { fp_underflow } { \TRUE } { \ERROR }
+ \flag_if_raised:NTF \l_fp_underflow_flag { \TRUE } { \ERROR }
}
{
\fp_trap:nn { underflow } { error }
\iow_term:e { \fp_to_tl:n { 1e-9999 * 1e-9999 } }
- \flag_if_raised:nTF { fp_underflow } { \TRUE } { \ERROR }
+ \flag_if_raised:NTF \l_fp_underflow_flag { \TRUE } { \ERROR }
}
- \flag_clear:n { fp_underflow }
+ \flag_clear:N \l_fp_underflow_flag
\iow_term:e { \fp_to_tl:n { 1e-9999 * 1e-9999 } }
- \flag_if_raised:nTF { fp_underflow } { \TRUE } { \ERROR }
- \flag_clear:n { fp_underflow }
+ \flag_if_raised:NTF \l_fp_underflow_flag { \TRUE } { \ERROR }
+ \flag_clear:N \l_fp_underflow_flag
\iow_term:e { \fp_to_tl:n { exp(-1e5678) } }
- \flag_if_raised:nTF { fp_underflow } { \TRUE } { \ERROR }
+ \flag_if_raised:NTF \l_fp_underflow_flag { \TRUE } { \ERROR }
\fp_trap:nn { underflow } { error }
- \flag_clear:n { fp_underflow }
+ \flag_clear:N \l_fp_underflow_flag
\iow_term:e { \fp_to_tl:n { 1e-9999 * 1e-9999 } }
- \flag_if_raised:nTF { fp_underflow } { \TRUE } { \ERROR }
- \flag_clear:n { fp_underflow }
+ \flag_if_raised:NTF \l_fp_underflow_flag { \TRUE } { \ERROR }
+ \flag_clear:N \l_fp_underflow_flag
\iow_term:e { \fp_to_tl:n { exp(-1e5678) } }
- \flag_if_raised:nTF { fp_underflow } { \TRUE } { \ERROR }
+ \flag_if_raised:NTF \l_fp_underflow_flag { \TRUE } { \ERROR }
}
\END
More information about the latex3-commits
mailing list.