[latex3-commits] [l3svn] r6920 - Move l3flag to l3kernel (see #336)

noreply at latex-project.org noreply at latex-project.org
Tue Feb 14 01:35:42 CET 2017


Author: bruno
Date: 2017-02-14 01:35:41 +0100 (Tue, 14 Feb 2017)
New Revision: 6920

Added:
   trunk/l3kernel/l3flag.dtx
   trunk/l3kernel/testfiles/m3flag001.luatex.tlg
   trunk/l3kernel/testfiles/m3flag001.lvt
   trunk/l3kernel/testfiles/m3flag001.tlg
Removed:
   trunk/l3experimental/l3str/l3flag.dtx
   trunk/l3experimental/l3str/testfiles/m3flag001.luatex.tlg
   trunk/l3experimental/l3str/testfiles/m3flag001.lvt
   trunk/l3experimental/l3str/testfiles/m3flag001.tlg
Modified:
   trunk/l3experimental/l3str/l3regex.dtx
   trunk/l3experimental/l3str/l3str-convert.dtx
   trunk/l3experimental/l3str/l3str.ins
   trunk/l3kernel/l3.ins
   trunk/l3kernel/l3format.ins
   trunk/l3kernel/source3body.tex
   trunk/l3kernel/testfiles/m3expl001.luatex.tlg
   trunk/l3kernel/testfiles/m3expl001.ptex.tlg
   trunk/l3kernel/testfiles/m3expl001.tlg
   trunk/l3kernel/testfiles/m3expl001.uptex.tlg
   trunk/l3kernel/testfiles/m3expl001.xetex.tlg
   trunk/l3kernel/testfiles/m3expl003.luatex.tlg
   trunk/l3kernel/testfiles/m3expl003.ptex.tlg
   trunk/l3kernel/testfiles/m3expl003.tlg
   trunk/l3kernel/testfiles/m3expl003.uptex.tlg
   trunk/l3kernel/testfiles/m3expl003.xetex.tlg
Log:
Move l3flag to l3kernel (see #336)

All tests pass so I probably didn't break things.  I don't close
the issue yet because I want to move l3fp-traps to using l3flag too.


Deleted: trunk/l3experimental/l3str/l3flag.dtx
===================================================================
--- trunk/l3experimental/l3str/l3flag.dtx	2017-02-13 23:51:34 UTC (rev 6919)
+++ trunk/l3experimental/l3str/l3flag.dtx	2017-02-14 00:35:41 UTC (rev 6920)
@@ -1,372 +0,0 @@
-% \iffalse meta-comment
-%
-%% File: l3flag.dtx Copyright (C) 2011-2012,2014-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
-% 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$
-  {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 at latex-project.org}
-%          {latex-team at latex-project.org}^^A
-%    }^^A
-% }
-%
-% \date{Released \ExplFileDate}
-%
-% \maketitle
-%
-% \begin{documentation}
-%
-% Flags are the only data-type that can be modified 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 very significantly 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 increases the \meta{height} by $1$. 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{flag
-% name} such as \texttt{str_missing}.  The \meta{flag name} is used as
-% part of \cs{use:c} constructions hence is expanded at point of use.
-% It must expand to character tokens only, with no spaces.
-%
-% A typical use case of flags would be to keep track of whether an
-% exceptional condition has occured during expandable processing, and
-% produce a meaningful (non-expandable) message after the end of the
-% expandable processing.  This is exemplified by \pkg{l3str-convert},
-% which for performance reasons performs conversions of individual
-% characters expandably and for readability reasons produces a single
-% error message describing incorrect inputs that were encountered.
-%
-% Flags should not be used without carefully considering the fact that
-% raising a flag takes a time and memory proportional to its height.
-% Flags should not be used unless unavoidable.
-%
-% \section{Setting up flags}
-%
-% \begin{function}{\flag_new:n}
-%   \begin{syntax}
-%     \cs{flag_new:n} \Arg{flag name}
-%   \end{syntax}
-%   Creates a new flag with a name given by \meta{flag name}, or raises
-%   an error if the name is already taken. The \meta{flag name} may not
-%   contain spaces. The declaration is global, but flags are always
-%   local variables. The \meta{flag} will initially have zero height.
-% \end{function}
-%
-% \begin{function}{\flag_zero:n}
-%   \begin{syntax}
-%     \cs{flag_zero:n} \Arg{flag name}
-%   \end{syntax}
-%   The \meta{flag}'s height is set to zero. The assignment is local.
-% \end{function}
-%
-% \begin{function}{\flag_zero_new:n}
-%   \begin{syntax}
-%     \cs{flag_zero_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_show:n}
-%   \begin{syntax}
-%     \cs{flag_show:n} \Arg{flag name}
-%   \end{syntax}
-%   Displays the \meta{flag}'s height in the terminal.
-% \end{function}
-%
-% \begin{function}{\flag_log:n}
-%   \begin{syntax}
-%     \cs{flag_log:n} \Arg{flag name}
-%   \end{syntax}
-%   Writes the \meta{flag}'s height to the log file.
-% \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_use:n}
-%   \begin{syntax}
-%     \cs{flag_use: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 height is increased by $1$ locally.
-% \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}
-%
-% The height $h$ of a flag (initially zero) is stored by setting control
-% sequences of the form \cs[no-index]{flag \meta{name} \meta{integer}}
-% to \tn{relax} for $0\leq\meta{integer}<h$.  When a flag is raised, a
-% \enquote{trap} function \cs[no-index]{flag \meta{name}} is called.
-% The existence of this function is also used to test for the existence
-% of a flag.
-%
-% \begin{macro}{\flag_new:n}
-%   For each flag, we define a \enquote{trap} function, which by default
-%   simply increases the flag by $1$ by letting the appropriate control
-%   sequence to \tn{relax}.  This can be done expandably!
-%   \begin{macrocode}
-\cs_new_protected:Npn \flag_new:n #1
-  {
-    \cs_new:cpn { flag~#1 } ##1 ;
-      { \exp_after:wN \use_none:n \cs:w flag~#1~##1 \cs_end: }
-  }
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\flag_zero:n}
-% \begin{macro}[aux]{\@@_zero:wn}
-%   Undefine control sequences, starting from the |0| flag, upwards,
-%   until reaching an undefined control sequence.  We don't use
-%   \cs{cs_undefine:c} because that would act globally.
-%    \begin{macrocode}
-\cs_new_protected:Npn \flag_zero:n { \@@_zero:wn 0 ; }
-\cs_new_protected:Npn \@@_zero:wn #1 ; #2
-  {
-    \if_cs_exist:w flag~#2~#1 \cs_end:
-      \cs_set_eq:cN { flag~#2~#1 } \tex_undefined:D
-      \exp_after:wN \@@_zero:wn
-      \__int_value:w \__int_eval:w \c_one + #1
-    \else:
-      \use_i:nnn
-    \fi:
-    ; {#2}
-  }
-%    \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\flag_zero_new:n}
-%   As for other datatypes, zero the \meta{flag} or create a new one,
-%   as appropriate.
-%    \begin{macrocode}
-\cs_new_protected:Npn \flag_zero_new:n #1
-  { \flag_if_exist:nTF {#1} { \flag_zero:n } { \flag_new:n } {#1} }
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\flag_show:n, \flag_log:n}
-%   Show the height (terminal or log file) using appropriate \pkg{l3msg}
-%   auxiliaries.
-%    \begin{macrocode}
-\cs_new_protected:Npn \flag_show:n #1
-  {
-    \exp_args:Nc \__msg_show_variable:NNNnn { flag~#1 } \cs_if_exist:NTF ? { }
-      { > ~ flag ~ #1 ~ height = \flag_use:n {#1} }
-  }
-\cs_new_protected:Npn \flag_log:n
-  { \__msg_log_next: \flag_show:n }
-%    \end{macrocode}
-% \end{macro}
-%
-% \subsection{Expandable flag commands}
-%
-% \begin{macro}[EXP, pTF]{\flag_if_exist:n}
-%   A flag exist if the corresponding trap \cs[no-index]{flag \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 { flag~#1 }
-      { \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 flag~#1~0 \cs_end:
-      \prg_return_true:
-    \else:
-      \prg_return_false:
-    \fi:
-  }
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}[EXP]{\flag_use:n}
-% \begin{macro}[EXP, aux]{\@@_height_loop:wn, \@@_height_end:wn}
-%   Extract the value of the flag by going through all of the
-%   control sequences starting from |0|.
-%    \begin{macrocode}
-\cs_new:Npn \flag_use:n { \@@_height_loop:wn 0; }
-\cs_new:Npn \@@_height_loop:wn #1 ; #2
-  {
-    \if_cs_exist:w flag~#2~#1 \cs_end:
-      \exp_after:wN \@@_height_loop:wn \__int_value:w \__int_eval:w \c_one +
-    \else:
-      \exp_after:wN \@@_height_end:wn
-    \fi:
-    #1 ; {#2}
-  }
-\cs_new:Npn \@@_height_end:wn #1 ; #2 {#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 flag~#1 \exp_after:wN \cs_end:
-    \__int_value:w \flag_use:n {#1} ;
-  }
-%    \end{macrocode}
-% \end{macro}
-%
-% \subsection{Option check-declarations}
-%
-% \begin{macro}[EXP,aux]{\@@_chk_exist:n}
-%   In package mode, there is an option to check all variables used are
-%   defined.  Since flags are not implemented in terms of other
-%   variables, we need to add checks by hand.
-%    \begin{macrocode}
-%<*package>
-\tex_ifodd:D \l at expl@check at declarations@bool
-  \cs_set_protected:Npn \flag_zero:n #1
-    {
-      \exp_args:Nc \__chk_if_exist_var:N { flag~#1 }
-      \@@_zero:wn 0 ; {#1}
-    }
-  \cs_set:Npn \@@_chk_exist:n #1
-    {
-      \flag_if_exist:nF {#1}
-        {
-          \__msg_kernel_expandable_error:nnn
-            { kernel } { bad-variable } { flag~#1~ }
-        }
-    }
-  \tl_map_inline:nn
-    {
-      \flag_if_raised_p:n
-      \flag_if_raised:nT
-      \flag_if_raised:nF
-      \flag_if_raised:nTF
-      \flag_use:n
-    }
-    {
-      \use:x
-        {
-          \exp_not:n { \cs_set:Npn #1 ##1 }
-            {
-              \exp_not:n { \@@_chk_exist:n {##1} }
-              \exp_not:o { #1 {##1} }
-            }
-        }
-    }
-\fi:
-%</package>
-%    \end{macrocode}
-% \end{macro}
-%
-%    \begin{macrocode}
-%</initex|package>
-%    \end{macrocode}
-%
-% \end{implementation}
-%
-% \PrintIndex

Modified: trunk/l3experimental/l3str/l3regex.dtx
===================================================================
--- trunk/l3experimental/l3str/l3regex.dtx	2017-02-13 23:51:34 UTC (rev 6919)
+++ trunk/l3experimental/l3str/l3regex.dtx	2017-02-14 00:35:41 UTC (rev 6920)
@@ -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}
 %

Modified: trunk/l3experimental/l3str/l3str-convert.dtx
===================================================================
--- trunk/l3experimental/l3str/l3str-convert.dtx	2017-02-13 23:51:34 UTC (rev 6919)
+++ trunk/l3experimental/l3str/l3str-convert.dtx	2017-02-14 00:35:41 UTC (rev 6920)
@@ -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}

Modified: trunk/l3experimental/l3str/l3str.ins
===================================================================
--- trunk/l3experimental/l3str/l3str.ins	2017-02-13 23:51:34 UTC (rev 6919)
+++ trunk/l3experimental/l3str/l3str.ins	2017-02-14 00:35:41 UTC (rev 6920)
@@ -51,7 +51,6 @@
 
 \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}}}

Deleted: trunk/l3experimental/l3str/testfiles/m3flag001.luatex.tlg
===================================================================
--- trunk/l3experimental/l3str/testfiles/m3flag001.luatex.tlg	2017-02-13 23:51:34 UTC (rev 6919)
+++ trunk/l3experimental/l3str/testfiles/m3flag001.luatex.tlg	2017-02-14 00:35:41 UTC (rev 6920)
@@ -1,166 +0,0 @@
-This is a generated file for the LaTeX (2e + expl3) validation system.
-Don't change this file in any respect.
-Author: Bruno Le Floch
-============================================================
-TEST 1: flag_new
-============================================================
-Defining \flag A on line ...
-\long macro:#1;->\exp_after:wN \use_none:n \cs:w flag A #1\cs_end: 
-\long macro:#1;->\exp_after:wN \use_none:n \cs:w flag A #1\cs_end: 
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!
-! LaTeX error: "kernel/command-already-defined"
-! 
-! Control sequence \flag A already defined.
-! 
-! See the LaTeX3 documentation for further information.
-! 
-! For immediate help type H <return>.
-!...............................................  
-l. ...  }
-|'''''''''''''''''''''''''''''''''''''''''''''''
-| This is a coding error.
-| 
-| LaTeX has been asked to create a new control sequence '\flag A' but this
-| name has already been used elsewhere.
-| 
-| The current meaning is:
-|   \long macro:#1;->\exp_after:wN \use_none:n \cs:w flag A #1\cs_end: 
-|...............................................
-Defining \flag A on line ...
-Defining \flag B on line ...
-============================================================
-============================================================
-TEST 2: raise, test, height
-============================================================
-F 0 undefined undefined undefined 
-T 1 \relax undefined undefined 
-T 2 \relax \relax undefined 
-F 0 undefined undefined undefined 
-============================================================
-============================================================
-TEST 3: zero
-============================================================
-F 0 undefined undefined undefined 
-T 1 \relax undefined undefined 
-F 0 undefined undefined undefined 
-T 10 \relax \relax \relax 
-F 0 undefined undefined undefined 
-============================================================
-============================================================
-TEST 4: show, log
-============================================================
-> flag C height=1.
-<recently read> }
-l. ...  }
-> flag C height=3.
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!
-! LaTeX error: "kernel/variable-not-defined"
-! 
-! Variable \flag other undefined.
-! 
-! See the LaTeX3 documentation for further information.
-! 
-! For immediate help type H <return>.
-!...............................................  
-l. ...  }
-|'''''''''''''''''''''''''''''''''''''''''''''''
-| This is a coding error.
-| 
-| LaTeX has been asked to show a variable \flag other, but this has not been
-| defined yet.
-|...............................................
-============================================================
-============================================================
-TEST 5: undefined
-============================================================
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!
-! LaTeX error: "check/non-declared-variable"
-! 
-! The variable \flag other has not been declared on line ....
-! 
-! See the LaTeX3 documentation for further information.
-! 
-! For immediate help type H <return>.
-!...............................................  
-l. ...  }
-|'''''''''''''''''''''''''''''''''''''''''''''''
-| Checking is active, and you have tried do so something like:
-|   \tl_set:Nn \flag other { ... }
-| without first having:
-|   \tl_new:N \flag other
-| 
-| LaTeX will create the variable and continue.
-|...............................................
-! Undefined control sequence.
-<argument> \LaTeX3 error: 
-                Erroneous variable flag other used!
-l. ...  }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-! Undefined control sequence.
-<argument> \LaTeX3 error: 
-                Erroneous variable flag other used!
-l. ...  }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-|\flag other 0;|
-! Undefined control sequence.
-<argument> \LaTeX3 error: 
-                Erroneous variable flag other used!
-l. ...  }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-|0|
-! Undefined control sequence.
-<argument> \LaTeX3 error: 
-                Erroneous variable flag other used!
-l. ...  }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-|F|
-! Undefined control sequence.
-<argument> \LaTeX3 error: 
-                Erroneous variable flag other used!
-l. ...  }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-||
-! Undefined control sequence.
-<argument> \LaTeX3 error: 
-                Erroneous variable flag other used!
-l. ...  }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-|F|
-! Undefined control sequence.
-<argument> \LaTeX3 error: 
-                Erroneous variable flag other used!
-l. ...  }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-|F|
-============================================================

Deleted: trunk/l3experimental/l3str/testfiles/m3flag001.lvt
===================================================================
--- trunk/l3experimental/l3str/testfiles/m3flag001.lvt	2017-02-13 23:51:34 UTC (rev 6919)
+++ trunk/l3experimental/l3str/testfiles/m3flag001.lvt	2017-02-14 00:35:41 UTC (rev 6920)
@@ -1,90 +0,0 @@
-%
-% Copyright (C) 2011,2017 LaTeX3 Project
-%
-
-\documentclass{minimal}
-\input{regression-test}
-
-\RequirePackage[log-functions, check-declarations]{expl3}
-\RequirePackage{l3flag}
-
-\begin{document}
-
-\START
-\AUTHOR{Bruno Le Floch}
-\ExplSyntaxOn
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\OMIT
-\def\foo{foo}
-\TIMO
-
-\TEST { flag_new }
-  {
-    {
-      \flag_if_exist:nT {A} { \ERROR }
-      \flag_new:n {A}
-      \TYPE { \cs_meaning:c { flag~A } }
-    }
-    \flag_if_exist:nF {A} { \ERROR }
-    \TYPE { \cs_meaning:c { flag~A } }
-    \flag_new:n {A}
-    \flag_new:n {B}
-  }
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\OMIT
-\flag_new:n { C }
-\cs_new:Npn \test:
-  {
-    \flag_if_raised:nTF { C } { T } { F } ~
-    \flag_use:n { C } ~
-    \cs_meaning:c { flag~C~0 } ~
-    \cs_meaning:c { flag~C~1 } ~
-    \cs_meaning:c { flag~C~2 } ~ \NEWLINE
-  }
-\TIMO
-
-\TEST { raise,~test,~height }
-  {
-    { \TYPE { \prg_replicate:nn {3} { \test: \flag_raise:n {C} } } }
-    \TYPE { \test: }
-  }
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\TEST { zero }
-  {
-    \TYPE { \test: \flag_raise:n {C} \test: }
-    {
-      \prg_replicate:nn {10} { \flag_raise:n {C} }
-      \flag_zero:n {C}
-      \TYPE { \test: \prg_replicate:nn {10} { \flag_raise:n {C} } \test: }
-    }
-    \TYPE { \test: }
-  }
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\TEST { show,~log }
-  {
-    \flag_raise:n {C}
-    \flag_show:n {C}
-    \flag_raise:n {C}
-    \flag_raise:n {C}
-    \flag_log:n {C}
-    \flag_log:n { other }
-  }
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\TEST { undefined }
-  {
-    \flag_zero:n { other }
-    \flag_raise:n { other }
-    \TYPE { | \flag_raise:n { other } | }
-    \TYPE { | \flag_use:n { other } | }
-    \TYPE { | \flag_if_raised:nTF { other } {T} {F} | }
-    \TYPE { | \flag_if_raised:nT { other } {T} | }
-    \TYPE { | \flag_if_raised:nF { other } {F} | }
-    \TYPE { | \bool_if:nTF { \flag_if_raised_p:n { other } } {T} {F} | }
-  }
-
-\END

Deleted: trunk/l3experimental/l3str/testfiles/m3flag001.tlg
===================================================================
--- trunk/l3experimental/l3str/testfiles/m3flag001.tlg	2017-02-13 23:51:34 UTC (rev 6919)
+++ trunk/l3experimental/l3str/testfiles/m3flag001.tlg	2017-02-14 00:35:41 UTC (rev 6920)
@@ -1,166 +0,0 @@
-This is a generated file for the LaTeX (2e + expl3) validation system.
-Don't change this file in any respect.
-Author: Bruno Le Floch
-============================================================
-TEST 1: flag_new
-============================================================
-Defining \flag A on line ...
-\long macro:#1;->\exp_after:wN \use_none:n \cs:w flag A #1\cs_end: 
-\long macro:#1;->\exp_after:wN \use_none:n \cs:w flag A #1\cs_end: 
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!
-! LaTeX error: "kernel/command-already-defined"
-! 
-! Control sequence \flag A already defined.
-! 
-! See the LaTeX3 documentation for further information.
-! 
-! For immediate help type H <return>.
-!...............................................  
-l. ...  }
-|'''''''''''''''''''''''''''''''''''''''''''''''
-| This is a coding error.
-| 
-| LaTeX has been asked to create a new control sequence '\flag A' but this
-| name has already been used elsewhere.
-| 
-| The current meaning is:
-|   \long macro:#1;->\exp_after:wN \use_none:n \cs:w flag A #1\cs_end: 
-|...............................................
-Defining \flag A on line ...
-Defining \flag B on line ...
-============================================================
-============================================================
-TEST 2: raise, test, height
-============================================================
-F 0 undefined undefined undefined 
-T 1 \relax undefined undefined 
-T 2 \relax \relax undefined 
-F 0 undefined undefined undefined 
-============================================================
-============================================================
-TEST 3: zero
-============================================================
-F 0 undefined undefined undefined 
-T 1 \relax undefined undefined 
-F 0 undefined undefined undefined 
-T 10 \relax \relax \relax 
-F 0 undefined undefined undefined 
-============================================================
-============================================================
-TEST 4: show, log
-============================================================
-> flag C height=1.
-<recently read> }
-l. ...  }
-> flag C height=3.
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!
-! LaTeX error: "kernel/variable-not-defined"
-! 
-! Variable \flag other undefined.
-! 
-! See the LaTeX3 documentation for further information.
-! 
-! For immediate help type H <return>.
-!...............................................  
-l. ...  }
-|'''''''''''''''''''''''''''''''''''''''''''''''
-| This is a coding error.
-| 
-| LaTeX has been asked to show a variable \flag other, but this has not been
-| defined yet.
-|...............................................
-============================================================
-============================================================
-TEST 5: undefined
-============================================================
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!
-! LaTeX error: "check/non-declared-variable"
-! 
-! The variable \flag other has not been declared on line ....
-! 
-! See the LaTeX3 documentation for further information.
-! 
-! For immediate help type H <return>.
-!...............................................  
-l. ...  }
-|'''''''''''''''''''''''''''''''''''''''''''''''
-| Checking is active, and you have tried do so something like:
-|   \tl_set:Nn \flag other { ... }
-| without first having:
-|   \tl_new:N \flag other
-| 
-| LaTeX will create the variable and continue.
-|...............................................
-! Undefined control sequence.
-<argument> \LaTeX3 error: 
-                           Erroneous variable flag other used!
-l. ...  }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-! Undefined control sequence.
-<argument> \LaTeX3 error: 
-                           Erroneous variable flag other used!
-l. ...  }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-|\flag other 0;|
-! Undefined control sequence.
-<argument> \LaTeX3 error: 
-                           Erroneous variable flag other used!
-l. ...  }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-|0|
-! Undefined control sequence.
-<argument> \LaTeX3 error: 
-                           Erroneous variable flag other used!
-l. ...  }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-|F|
-! Undefined control sequence.
-<argument> \LaTeX3 error: 
-                           Erroneous variable flag other used!
-l. ...  }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-||
-! Undefined control sequence.
-<argument> \LaTeX3 error: 
-                           Erroneous variable flag other used!
-l. ...  }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-|F|
-! Undefined control sequence.
-<argument> \LaTeX3 error: 
-                           Erroneous variable flag other used!
-l. ...  }
-The control sequence at the end of the top line
-of your error message was never \def'ed. If you have
-misspelled it (e.g., `\hobx'), type `I' and the correct
-spelling (e.g., `I\hbox'). Otherwise just continue,
-and I'll forget about whatever was undefined.
-|F|
-============================================================

Modified: trunk/l3kernel/l3.ins
===================================================================
--- trunk/l3kernel/l3.ins	2017-02-13 23:51:34 UTC (rev 6919)
+++ trunk/l3kernel/l3.ins	2017-02-14 00:35:41 UTC (rev 6920)
@@ -67,6 +67,7 @@
         \from{l3str.dtx}        {package}
         \from{l3seq.dtx}        {package}
         \from{l3int.dtx}        {package}
+        \from{l3flag.dtx}       {package}
         \from{l3quark.dtx}      {package}
         \from{l3prg.dtx}        {package}
         \from{l3clist.dtx}      {package}

Copied: trunk/l3kernel/l3flag.dtx (from rev 6919, trunk/l3experimental/l3str/l3flag.dtx)
===================================================================
--- trunk/l3kernel/l3flag.dtx	                        (rev 0)
+++ trunk/l3kernel/l3flag.dtx	2017-02-14 00:35:41 UTC (rev 6920)
@@ -0,0 +1,351 @@
+% \iffalse meta-comment
+%
+%% File: l3flag.dtx Copyright (C) 2011-2012,2014-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
+% 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 "l3kernel 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>
+\documentclass[full]{l3doc}
+%</driver>
+%<*driver|package>
+\GetIdInfo$Id$
+  {L3 Flags}
+%</driver|package>
+%<*driver>
+\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 at latex-project.org}
+%          {latex-team at latex-project.org}^^A
+%    }^^A
+% }
+%
+% \date{Released \ExplFileDate}
+%
+% \maketitle
+%
+% \begin{documentation}
+%
+% Flags are the only data-type that can be modified 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 very significantly 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 increases the \meta{height} by $1$. 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{flag
+% name} such as \texttt{str_missing}.  The \meta{flag name} is used as
+% part of \cs{use:c} constructions hence is expanded at point of use.
+% It must expand to character tokens only, with no spaces.
+%
+% A typical use case of flags would be to keep track of whether an
+% exceptional condition has occured during expandable processing, and
+% produce a meaningful (non-expandable) message after the end of the
+% expandable processing.  This is exemplified by \pkg{l3str-convert},
+% which for performance reasons performs conversions of individual
+% characters expandably and for readability reasons produces a single
+% error message describing incorrect inputs that were encountered.
+%
+% Flags should not be used without carefully considering the fact that
+% raising a flag takes a time and memory proportional to its height.
+% Flags should not be used unless unavoidable.
+%
+% \section{Setting up flags}
+%
+% \begin{function}{\flag_new:n}
+%   \begin{syntax}
+%     \cs{flag_new:n} \Arg{flag name}
+%   \end{syntax}
+%   Creates a new flag with a name given by \meta{flag name}, or raises
+%   an error if the name is already taken. The \meta{flag name} may not
+%   contain spaces. The declaration is global, but flags are always
+%   local variables. The \meta{flag} will initially have zero height.
+% \end{function}
+%
+% \begin{function}{\flag_zero:n}
+%   \begin{syntax}
+%     \cs{flag_zero:n} \Arg{flag name}
+%   \end{syntax}
+%   The \meta{flag}'s height is set to zero. The assignment is local.
+% \end{function}
+%
+% \begin{function}{\flag_zero_new:n}
+%   \begin{syntax}
+%     \cs{flag_zero_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_show:n}
+%   \begin{syntax}
+%     \cs{flag_show:n} \Arg{flag name}
+%   \end{syntax}
+%   Displays the \meta{flag}'s height in the terminal.
+% \end{function}
+%
+% \begin{function}{\flag_log:n}
+%   \begin{syntax}
+%     \cs{flag_log:n} \Arg{flag name}
+%   \end{syntax}
+%   Writes the \meta{flag}'s height to the log file.
+% \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_use:n}
+%   \begin{syntax}
+%     \cs{flag_use: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 height is increased by $1$ locally.
+% \end{function}
+%
+% \end{documentation}
+%
+% \begin{implementation}
+%
+% \section{\pkg{l3flag} implementation}
+%
+%    \begin{macrocode}
+%<*initex|package>
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+%<@@=flag>
+%    \end{macrocode}
+%
+% \TestFiles{m3flag001}
+%
+% \subsection{Non-expandable flag commands}
+%
+% The height $h$ of a flag (initially zero) is stored by setting control
+% sequences of the form \cs[no-index]{flag \meta{name} \meta{integer}}
+% to \tn{relax} for $0\leq\meta{integer}<h$.  When a flag is raised, a
+% \enquote{trap} function \cs[no-index]{flag \meta{name}} is called.
+% The existence of this function is also used to test for the existence
+% of a flag.
+%
+% \begin{macro}{\flag_new:n}
+%   For each flag, we define a \enquote{trap} function, which by default
+%   simply increases the flag by $1$ by letting the appropriate control
+%   sequence to \tn{relax}.  This can be done expandably!
+%   \begin{macrocode}
+\cs_new_protected:Npn \flag_new:n #1
+  {
+    \cs_new:cpn { flag~#1 } ##1 ;
+      { \exp_after:wN \use_none:n \cs:w flag~#1~##1 \cs_end: }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\flag_zero:n}
+% \begin{macro}[aux]{\@@_zero:wn}
+%   Undefine control sequences, starting from the |0| flag, upwards,
+%   until reaching an undefined control sequence.  We don't use
+%   \cs{cs_undefine:c} because that would act globally.
+%    \begin{macrocode}
+\cs_new_protected:Npn \flag_zero:n { \@@_zero:wn 0 ; }
+\cs_new_protected:Npn \@@_zero:wn #1 ; #2
+  {
+    \if_cs_exist:w flag~#2~#1 \cs_end:
+      \cs_set_eq:cN { flag~#2~#1 } \tex_undefined:D
+      \exp_after:wN \@@_zero:wn
+      \__int_value:w \__int_eval:w \c_one + #1
+    \else:
+      \use_i:nnn
+    \fi:
+    ; {#2}
+  }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\flag_zero_new:n}
+%   As for other datatypes, zero the \meta{flag} or create a new one,
+%   as appropriate.
+%    \begin{macrocode}
+\cs_new_protected:Npn \flag_zero_new:n #1
+  { \flag_if_exist:nTF {#1} { \flag_zero:n } { \flag_new:n } {#1} }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\flag_show:n, \flag_log:n}
+%   Show the height (terminal or log file) using appropriate \pkg{l3msg}
+%   auxiliaries.
+%    \begin{macrocode}
+\cs_new_protected:Npn \flag_show:n #1
+  {
+    \exp_args:Nc \__msg_show_variable:NNNnn { flag~#1 } \cs_if_exist:NTF ? { }
+      { > ~ flag ~ #1 ~ height = \flag_use:n {#1} }
+  }
+\cs_new_protected:Npn \flag_log:n
+  { \__msg_log_next: \flag_show:n }
+%    \end{macrocode}
+% \end{macro}
+%
+% \subsection{Expandable flag commands}
+%
+% \begin{macro}[EXP, pTF]{\flag_if_exist:n}
+%   A flag exist if the corresponding trap \cs[no-index]{flag \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 { flag~#1 }
+      { \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 flag~#1~0 \cs_end:
+      \prg_return_true:
+    \else:
+      \prg_return_false:
+    \fi:
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[EXP]{\flag_use:n}
+% \begin{macro}[EXP, aux]{\@@_height_loop:wn, \@@_height_end:wn}
+%   Extract the value of the flag by going through all of the
+%   control sequences starting from |0|.
+%    \begin{macrocode}
+\cs_new:Npn \flag_use:n { \@@_height_loop:wn 0; }
+\cs_new:Npn \@@_height_loop:wn #1 ; #2
+  {
+    \if_cs_exist:w flag~#2~#1 \cs_end:
+      \exp_after:wN \@@_height_loop:wn \__int_value:w \__int_eval:w \c_one +
+    \else:
+      \exp_after:wN \@@_height_end:wn
+    \fi:
+    #1 ; {#2}
+  }
+\cs_new:Npn \@@_height_end:wn #1 ; #2 {#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 flag~#1 \exp_after:wN \cs_end:
+    \__int_value:w \flag_use:n {#1} ;
+  }
+%    \end{macrocode}
+% \end{macro}
+%
+% \subsection{Option check-declarations}
+%
+% \begin{macro}[EXP,aux]{\@@_chk_exist:n}
+%   In package mode, there is an option to check all variables used are
+%   defined.  Since flags are not implemented in terms of other
+%   variables, we need to add checks by hand.  Not all functions need to
+%   be patched because some are defined in terms of others.
+%    \begin{macrocode}
+%<*package>
+\tex_ifodd:D \l at expl@check at declarations@bool
+  \cs_set_protected:Npn \flag_zero:n #1
+    {
+      \exp_args:Nc \__chk_if_exist_var:N { flag~#1 }
+      \@@_zero:wn 0 ; {#1}
+    }
+  \cs_set:Npn \@@_chk_exist:n #1
+    {
+      \flag_if_exist:nF {#1}
+        {
+          \__msg_kernel_expandable_error:nnn
+            { kernel } { bad-variable } { flag~#1~ }
+        }
+    }
+  \cs_set:Npn \flag_use:n #1
+    {
+      \@@_chk_exist:n {#1}
+      \@@_height_loop:wn 0; {#1}
+    }
+  \prg_set_conditional:Npnn \flag_if_raised:n #1 { p , T , F , TF }
+    {
+      \@@_chk_exist:n {#1}
+      \if_cs_exist:w flag~#1~0 \cs_end:
+        \prg_return_true:
+      \else:
+        \prg_return_false:
+      \fi:
+    }
+\fi:
+%</package>
+%    \end{macrocode}
+% \end{macro}
+%
+%    \begin{macrocode}
+%</initex|package>
+%    \end{macrocode}
+%
+% \end{implementation}
+%
+% \PrintIndex

Modified: trunk/l3kernel/l3format.ins
===================================================================
--- trunk/l3kernel/l3format.ins	2017-02-13 23:51:34 UTC (rev 6919)
+++ trunk/l3kernel/l3format.ins	2017-02-14 00:35:41 UTC (rev 6920)
@@ -67,6 +67,7 @@
         \from{l3alloc.dtx}      {initex}
         % ==============================
         \from{l3int.dtx}        {initex}
+        \from{l3flag.dtx}       {initex}
         \from{l3quark.dtx}      {initex}
         \from{l3prg.dtx}        {initex}
         \from{l3clist.dtx}      {initex}

Modified: trunk/l3kernel/source3body.tex
===================================================================
--- trunk/l3kernel/source3body.tex	2017-02-13 23:51:34 UTC (rev 6919)
+++ trunk/l3kernel/source3body.tex	2017-02-14 00:35:41 UTC (rev 6920)
@@ -416,6 +416,7 @@
 \DocInput{l3basics.dtx}
 \DocInput{l3expan.dtx}
 \DocInput{l3prg.dtx}
+\DocInput{l3flag.dtx}
 \DocInput{l3quark.dtx}
 \DocInput{l3token.dtx}
 \DocInput{l3int.dtx}

Modified: trunk/l3kernel/testfiles/m3expl001.luatex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.luatex.tlg	2017-02-13 23:51:34 UTC (rev 6919)
+++ trunk/l3kernel/testfiles/m3expl001.luatex.tlg	2017-02-14 00:35:41 UTC (rev 6920)
@@ -1665,6 +1665,24 @@
 Defining \g_tmpb_int on line ...
 \g_tmpb_int=\count116
 Defining \c_minus_one on line ...
+Defining \flag_new:n on line ...
+Defining \flag_zero:n on line ...
+Defining \__flag_zero:wn on line ...
+Defining \flag_zero_new:n on line ...
+Defining \flag_show:n on line ...
+Defining \flag_log:n on line ...
+Defining \flag_if_exist_p:n on line ...
+Defining \flag_if_exist:nT on line ...
+Defining \flag_if_exist:nF on line ...
+Defining \flag_if_exist:nTF on line ...
+Defining \flag_if_raised_p:n on line ...
+Defining \flag_if_raised:nT on line ...
+Defining \flag_if_raised:nF on line ...
+Defining \flag_if_raised:nTF on line ...
+Defining \flag_use:n on line ...
+Defining \__flag_height_loop:wn on line ...
+Defining \__flag_height_end:wn on line ...
+Defining \flag_raise:n on line ...
 Defining \quark_new:N on line ...
 Defining \q_nil on line ...
 Defining \q_mark on line ...

Modified: trunk/l3kernel/testfiles/m3expl001.ptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.ptex.tlg	2017-02-13 23:51:34 UTC (rev 6919)
+++ trunk/l3kernel/testfiles/m3expl001.ptex.tlg	2017-02-14 00:35:41 UTC (rev 6920)
@@ -1397,6 +1397,24 @@
 Defining \g_tmpb_int on line ...
 \g_tmpb_int=\count117
 Defining \c_minus_one on line ...
+Defining \flag_new:n on line ...
+Defining \flag_zero:n on line ...
+Defining \__flag_zero:wn on line ...
+Defining \flag_zero_new:n on line ...
+Defining \flag_show:n on line ...
+Defining \flag_log:n on line ...
+Defining \flag_if_exist_p:n on line ...
+Defining \flag_if_exist:nT on line ...
+Defining \flag_if_exist:nF on line ...
+Defining \flag_if_exist:nTF on line ...
+Defining \flag_if_raised_p:n on line ...
+Defining \flag_if_raised:nT on line ...
+Defining \flag_if_raised:nF on line ...
+Defining \flag_if_raised:nTF on line ...
+Defining \flag_use:n on line ...
+Defining \__flag_height_loop:wn on line ...
+Defining \__flag_height_end:wn on line ...
+Defining \flag_raise:n on line ...
 Defining \quark_new:N on line ...
 Defining \q_nil on line ...
 Defining \q_mark on line ...

Modified: trunk/l3kernel/testfiles/m3expl001.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.tlg	2017-02-13 23:51:34 UTC (rev 6919)
+++ trunk/l3kernel/testfiles/m3expl001.tlg	2017-02-14 00:35:41 UTC (rev 6920)
@@ -1397,6 +1397,24 @@
 Defining \g_tmpb_int on line ...
 \g_tmpb_int=\count116
 Defining \c_minus_one on line ...
+Defining \flag_new:n on line ...
+Defining \flag_zero:n on line ...
+Defining \__flag_zero:wn on line ...
+Defining \flag_zero_new:n on line ...
+Defining \flag_show:n on line ...
+Defining \flag_log:n on line ...
+Defining \flag_if_exist_p:n on line ...
+Defining \flag_if_exist:nT on line ...
+Defining \flag_if_exist:nF on line ...
+Defining \flag_if_exist:nTF on line ...
+Defining \flag_if_raised_p:n on line ...
+Defining \flag_if_raised:nT on line ...
+Defining \flag_if_raised:nF on line ...
+Defining \flag_if_raised:nTF on line ...
+Defining \flag_use:n on line ...
+Defining \__flag_height_loop:wn on line ...
+Defining \__flag_height_end:wn on line ...
+Defining \flag_raise:n on line ...
 Defining \quark_new:N on line ...
 Defining \q_nil on line ...
 Defining \q_mark on line ...

Modified: trunk/l3kernel/testfiles/m3expl001.uptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.uptex.tlg	2017-02-13 23:51:34 UTC (rev 6919)
+++ trunk/l3kernel/testfiles/m3expl001.uptex.tlg	2017-02-14 00:35:41 UTC (rev 6920)
@@ -1397,6 +1397,24 @@
 Defining \g_tmpb_int on line ...
 \g_tmpb_int=\count117
 Defining \c_minus_one on line ...
+Defining \flag_new:n on line ...
+Defining \flag_zero:n on line ...
+Defining \__flag_zero:wn on line ...
+Defining \flag_zero_new:n on line ...
+Defining \flag_show:n on line ...
+Defining \flag_log:n on line ...
+Defining \flag_if_exist_p:n on line ...
+Defining \flag_if_exist:nT on line ...
+Defining \flag_if_exist:nF on line ...
+Defining \flag_if_exist:nTF on line ...
+Defining \flag_if_raised_p:n on line ...
+Defining \flag_if_raised:nT on line ...
+Defining \flag_if_raised:nF on line ...
+Defining \flag_if_raised:nTF on line ...
+Defining \flag_use:n on line ...
+Defining \__flag_height_loop:wn on line ...
+Defining \__flag_height_end:wn on line ...
+Defining \flag_raise:n on line ...
 Defining \quark_new:N on line ...
 Defining \q_nil on line ...
 Defining \q_mark on line ...

Modified: trunk/l3kernel/testfiles/m3expl001.xetex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl001.xetex.tlg	2017-02-13 23:51:34 UTC (rev 6919)
+++ trunk/l3kernel/testfiles/m3expl001.xetex.tlg	2017-02-14 00:35:41 UTC (rev 6920)
@@ -1663,6 +1663,24 @@
 Defining \g_tmpb_int on line ...
 \g_tmpb_int=\count116
 Defining \c_minus_one on line ...
+Defining \flag_new:n on line ...
+Defining \flag_zero:n on line ...
+Defining \__flag_zero:wn on line ...
+Defining \flag_zero_new:n on line ...
+Defining \flag_show:n on line ...
+Defining \flag_log:n on line ...
+Defining \flag_if_exist_p:n on line ...
+Defining \flag_if_exist:nT on line ...
+Defining \flag_if_exist:nF on line ...
+Defining \flag_if_exist:nTF on line ...
+Defining \flag_if_raised_p:n on line ...
+Defining \flag_if_raised:nT on line ...
+Defining \flag_if_raised:nF on line ...
+Defining \flag_if_raised:nTF on line ...
+Defining \flag_use:n on line ...
+Defining \__flag_height_loop:wn on line ...
+Defining \__flag_height_end:wn on line ...
+Defining \flag_raise:n on line ...
 Defining \quark_new:N on line ...
 Defining \q_nil on line ...
 Defining \q_mark on line ...

Modified: trunk/l3kernel/testfiles/m3expl003.luatex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.luatex.tlg	2017-02-13 23:51:34 UTC (rev 6919)
+++ trunk/l3kernel/testfiles/m3expl003.luatex.tlg	2017-02-14 00:35:41 UTC (rev 6920)
@@ -1665,6 +1665,24 @@
 Defining \g_tmpb_int on line ...
 \g_tmpb_int=\count116
 Defining \c_minus_one on line ...
+Defining \flag_new:n on line ...
+Defining \flag_zero:n on line ...
+Defining \__flag_zero:wn on line ...
+Defining \flag_zero_new:n on line ...
+Defining \flag_show:n on line ...
+Defining \flag_log:n on line ...
+Defining \flag_if_exist_p:n on line ...
+Defining \flag_if_exist:nT on line ...
+Defining \flag_if_exist:nF on line ...
+Defining \flag_if_exist:nTF on line ...
+Defining \flag_if_raised_p:n on line ...
+Defining \flag_if_raised:nT on line ...
+Defining \flag_if_raised:nF on line ...
+Defining \flag_if_raised:nTF on line ...
+Defining \flag_use:n on line ...
+Defining \__flag_height_loop:wn on line ...
+Defining \__flag_height_end:wn on line ...
+Defining \flag_raise:n on line ...
 Defining \quark_new:N on line ...
 Defining \q_nil on line ...
 Defining \q_mark on line ...

Modified: trunk/l3kernel/testfiles/m3expl003.ptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.ptex.tlg	2017-02-13 23:51:34 UTC (rev 6919)
+++ trunk/l3kernel/testfiles/m3expl003.ptex.tlg	2017-02-14 00:35:41 UTC (rev 6920)
@@ -1397,6 +1397,24 @@
 Defining \g_tmpb_int on line ...
 \g_tmpb_int=\count117
 Defining \c_minus_one on line ...
+Defining \flag_new:n on line ...
+Defining \flag_zero:n on line ...
+Defining \__flag_zero:wn on line ...
+Defining \flag_zero_new:n on line ...
+Defining \flag_show:n on line ...
+Defining \flag_log:n on line ...
+Defining \flag_if_exist_p:n on line ...
+Defining \flag_if_exist:nT on line ...
+Defining \flag_if_exist:nF on line ...
+Defining \flag_if_exist:nTF on line ...
+Defining \flag_if_raised_p:n on line ...
+Defining \flag_if_raised:nT on line ...
+Defining \flag_if_raised:nF on line ...
+Defining \flag_if_raised:nTF on line ...
+Defining \flag_use:n on line ...
+Defining \__flag_height_loop:wn on line ...
+Defining \__flag_height_end:wn on line ...
+Defining \flag_raise:n on line ...
 Defining \quark_new:N on line ...
 Defining \q_nil on line ...
 Defining \q_mark on line ...

Modified: trunk/l3kernel/testfiles/m3expl003.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.tlg	2017-02-13 23:51:34 UTC (rev 6919)
+++ trunk/l3kernel/testfiles/m3expl003.tlg	2017-02-14 00:35:41 UTC (rev 6920)
@@ -1397,6 +1397,24 @@
 Defining \g_tmpb_int on line ...
 \g_tmpb_int=\count116
 Defining \c_minus_one on line ...
+Defining \flag_new:n on line ...
+Defining \flag_zero:n on line ...
+Defining \__flag_zero:wn on line ...
+Defining \flag_zero_new:n on line ...
+Defining \flag_show:n on line ...
+Defining \flag_log:n on line ...
+Defining \flag_if_exist_p:n on line ...
+Defining \flag_if_exist:nT on line ...
+Defining \flag_if_exist:nF on line ...
+Defining \flag_if_exist:nTF on line ...
+Defining \flag_if_raised_p:n on line ...
+Defining \flag_if_raised:nT on line ...
+Defining \flag_if_raised:nF on line ...
+Defining \flag_if_raised:nTF on line ...
+Defining \flag_use:n on line ...
+Defining \__flag_height_loop:wn on line ...
+Defining \__flag_height_end:wn on line ...
+Defining \flag_raise:n on line ...
 Defining \quark_new:N on line ...
 Defining \q_nil on line ...
 Defining \q_mark on line ...

Modified: trunk/l3kernel/testfiles/m3expl003.uptex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.uptex.tlg	2017-02-13 23:51:34 UTC (rev 6919)
+++ trunk/l3kernel/testfiles/m3expl003.uptex.tlg	2017-02-14 00:35:41 UTC (rev 6920)
@@ -1397,6 +1397,24 @@
 Defining \g_tmpb_int on line ...
 \g_tmpb_int=\count117
 Defining \c_minus_one on line ...
+Defining \flag_new:n on line ...
+Defining \flag_zero:n on line ...
+Defining \__flag_zero:wn on line ...
+Defining \flag_zero_new:n on line ...
+Defining \flag_show:n on line ...
+Defining \flag_log:n on line ...
+Defining \flag_if_exist_p:n on line ...
+Defining \flag_if_exist:nT on line ...
+Defining \flag_if_exist:nF on line ...
+Defining \flag_if_exist:nTF on line ...
+Defining \flag_if_raised_p:n on line ...
+Defining \flag_if_raised:nT on line ...
+Defining \flag_if_raised:nF on line ...
+Defining \flag_if_raised:nTF on line ...
+Defining \flag_use:n on line ...
+Defining \__flag_height_loop:wn on line ...
+Defining \__flag_height_end:wn on line ...
+Defining \flag_raise:n on line ...
 Defining \quark_new:N on line ...
 Defining \q_nil on line ...
 Defining \q_mark on line ...

Modified: trunk/l3kernel/testfiles/m3expl003.xetex.tlg
===================================================================
--- trunk/l3kernel/testfiles/m3expl003.xetex.tlg	2017-02-13 23:51:34 UTC (rev 6919)
+++ trunk/l3kernel/testfiles/m3expl003.xetex.tlg	2017-02-14 00:35:41 UTC (rev 6920)
@@ -1663,6 +1663,24 @@
 Defining \g_tmpb_int on line ...
 \g_tmpb_int=\count116
 Defining \c_minus_one on line ...
+Defining \flag_new:n on line ...
+Defining \flag_zero:n on line ...
+Defining \__flag_zero:wn on line ...
+Defining \flag_zero_new:n on line ...
+Defining \flag_show:n on line ...
+Defining \flag_log:n on line ...
+Defining \flag_if_exist_p:n on line ...
+Defining \flag_if_exist:nT on line ...
+Defining \flag_if_exist:nF on line ...
+Defining \flag_if_exist:nTF on line ...
+Defining \flag_if_raised_p:n on line ...
+Defining \flag_if_raised:nT on line ...
+Defining \flag_if_raised:nF on line ...
+Defining \flag_if_raised:nTF on line ...
+Defining \flag_use:n on line ...
+Defining \__flag_height_loop:wn on line ...
+Defining \__flag_height_end:wn on line ...
+Defining \flag_raise:n on line ...
 Defining \quark_new:N on line ...
 Defining \q_nil on line ...
 Defining \q_mark on line ...

Copied: trunk/l3kernel/testfiles/m3flag001.luatex.tlg (from rev 6918, trunk/l3experimental/l3str/testfiles/m3flag001.luatex.tlg)
===================================================================
--- trunk/l3kernel/testfiles/m3flag001.luatex.tlg	                        (rev 0)
+++ trunk/l3kernel/testfiles/m3flag001.luatex.tlg	2017-02-14 00:35:41 UTC (rev 6920)
@@ -0,0 +1,166 @@
+This is a generated file for the LaTeX (2e + expl3) validation system.
+Don't change this file in any respect.
+Author: Bruno Le Floch
+============================================================
+TEST 1: flag_new
+============================================================
+Defining \flag A on line ...
+\long macro:#1;->\exp_after:wN \use_none:n \cs:w flag A #1\cs_end: 
+\long macro:#1;->\exp_after:wN \use_none:n \cs:w flag A #1\cs_end: 
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!
+! LaTeX error: "kernel/command-already-defined"
+! 
+! Control sequence \flag A already defined.
+! 
+! See the LaTeX3 documentation for further information.
+! 
+! For immediate help type H <return>.
+!...............................................  
+l. ...  }
+|'''''''''''''''''''''''''''''''''''''''''''''''
+| This is a coding error.
+| 
+| LaTeX has been asked to create a new control sequence '\flag A' but this
+| name has already been used elsewhere.
+| 
+| The current meaning is:
+|   \long macro:#1;->\exp_after:wN \use_none:n \cs:w flag A #1\cs_end: 
+|...............................................
+Defining \flag A on line ...
+Defining \flag B on line ...
+============================================================
+============================================================
+TEST 2: raise, test, height
+============================================================
+F 0 undefined undefined undefined 
+T 1 \relax undefined undefined 
+T 2 \relax \relax undefined 
+F 0 undefined undefined undefined 
+============================================================
+============================================================
+TEST 3: zero
+============================================================
+F 0 undefined undefined undefined 
+T 1 \relax undefined undefined 
+F 0 undefined undefined undefined 
+T 10 \relax \relax \relax 
+F 0 undefined undefined undefined 
+============================================================
+============================================================
+TEST 4: show, log
+============================================================
+> flag C height=1.
+<recently read> }
+l. ...  }
+> flag C height=3.
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!
+! LaTeX error: "kernel/variable-not-defined"
+! 
+! Variable \flag other undefined.
+! 
+! See the LaTeX3 documentation for further information.
+! 
+! For immediate help type H <return>.
+!...............................................  
+l. ...  }
+|'''''''''''''''''''''''''''''''''''''''''''''''
+| This is a coding error.
+| 
+| LaTeX has been asked to show a variable \flag other, but this has not been
+| defined yet.
+|...............................................
+============================================================
+============================================================
+TEST 5: undefined
+============================================================
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!
+! LaTeX error: "check/non-declared-variable"
+! 
+! The variable \flag other has not been declared on line ....
+! 
+! See the LaTeX3 documentation for further information.
+! 
+! For immediate help type H <return>.
+!...............................................  
+l. ...  }
+|'''''''''''''''''''''''''''''''''''''''''''''''
+| Checking is active, and you have tried do so something like:
+|   \tl_set:Nn \flag other { ... }
+| without first having:
+|   \tl_new:N \flag other
+| 
+| LaTeX will create the variable and continue.
+|...............................................
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                Erroneous variable flag other used!
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                Erroneous variable flag other used!
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+|\flag other 0;|
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                Erroneous variable flag other used!
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+|0|
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                Erroneous variable flag other used!
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+|F|
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                Erroneous variable flag other used!
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+||
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                Erroneous variable flag other used!
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+|F|
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                Erroneous variable flag other used!
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+|F|
+============================================================

Copied: trunk/l3kernel/testfiles/m3flag001.lvt (from rev 6918, trunk/l3experimental/l3str/testfiles/m3flag001.lvt)
===================================================================
--- trunk/l3kernel/testfiles/m3flag001.lvt	                        (rev 0)
+++ trunk/l3kernel/testfiles/m3flag001.lvt	2017-02-14 00:35:41 UTC (rev 6920)
@@ -0,0 +1,89 @@
+%
+% Copyright (C) 2011,2017 LaTeX3 Project
+%
+
+\documentclass{minimal}
+\input{regression-test}
+
+\RequirePackage[log-functions, check-declarations]{expl3}
+
+\begin{document}
+
+\START
+\AUTHOR{Bruno Le Floch}
+\ExplSyntaxOn
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\OMIT
+\def\foo{foo}
+\TIMO
+
+\TEST { flag_new }
+  {
+    {
+      \flag_if_exist:nT {A} { \ERROR }
+      \flag_new:n {A}
+      \TYPE { \cs_meaning:c { flag~A } }
+    }
+    \flag_if_exist:nF {A} { \ERROR }
+    \TYPE { \cs_meaning:c { flag~A } }
+    \flag_new:n {A}
+    \flag_new:n {B}
+  }
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\OMIT
+\flag_new:n { C }
+\cs_new:Npn \test:
+  {
+    \flag_if_raised:nTF { C } { T } { F } ~
+    \flag_use:n { C } ~
+    \cs_meaning:c { flag~C~0 } ~
+    \cs_meaning:c { flag~C~1 } ~
+    \cs_meaning:c { flag~C~2 } ~ \NEWLINE
+  }
+\TIMO
+
+\TEST { raise,~test,~height }
+  {
+    { \TYPE { \prg_replicate:nn {3} { \test: \flag_raise:n {C} } } }
+    \TYPE { \test: }
+  }
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\TEST { zero }
+  {
+    \TYPE { \test: \flag_raise:n {C} \test: }
+    {
+      \prg_replicate:nn {10} { \flag_raise:n {C} }
+      \flag_zero:n {C}
+      \TYPE { \test: \prg_replicate:nn {10} { \flag_raise:n {C} } \test: }
+    }
+    \TYPE { \test: }
+  }
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\TEST { show,~log }
+  {
+    \flag_raise:n {C}
+    \flag_show:n {C}
+    \flag_raise:n {C}
+    \flag_raise:n {C}
+    \flag_log:n {C}
+    \flag_log:n { other }
+  }
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\TEST { undefined }
+  {
+    \flag_zero:n { other }
+    \flag_raise:n { other }
+    \TYPE { | \flag_raise:n { other } | }
+    \TYPE { | \flag_use:n { other } | }
+    \TYPE { | \flag_if_raised:nTF { other } {T} {F} | }
+    \TYPE { | \flag_if_raised:nT { other } {T} | }
+    \TYPE { | \flag_if_raised:nF { other } {F} | }
+    \TYPE { | \bool_if:nTF { \flag_if_raised_p:n { other } } {T} {F} | }
+  }
+
+\END

Copied: trunk/l3kernel/testfiles/m3flag001.tlg (from rev 6918, trunk/l3experimental/l3str/testfiles/m3flag001.tlg)
===================================================================
--- trunk/l3kernel/testfiles/m3flag001.tlg	                        (rev 0)
+++ trunk/l3kernel/testfiles/m3flag001.tlg	2017-02-14 00:35:41 UTC (rev 6920)
@@ -0,0 +1,166 @@
+This is a generated file for the LaTeX (2e + expl3) validation system.
+Don't change this file in any respect.
+Author: Bruno Le Floch
+============================================================
+TEST 1: flag_new
+============================================================
+Defining \flag A on line ...
+\long macro:#1;->\exp_after:wN \use_none:n \cs:w flag A #1\cs_end: 
+\long macro:#1;->\exp_after:wN \use_none:n \cs:w flag A #1\cs_end: 
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!
+! LaTeX error: "kernel/command-already-defined"
+! 
+! Control sequence \flag A already defined.
+! 
+! See the LaTeX3 documentation for further information.
+! 
+! For immediate help type H <return>.
+!...............................................  
+l. ...  }
+|'''''''''''''''''''''''''''''''''''''''''''''''
+| This is a coding error.
+| 
+| LaTeX has been asked to create a new control sequence '\flag A' but this
+| name has already been used elsewhere.
+| 
+| The current meaning is:
+|   \long macro:#1;->\exp_after:wN \use_none:n \cs:w flag A #1\cs_end: 
+|...............................................
+Defining \flag A on line ...
+Defining \flag B on line ...
+============================================================
+============================================================
+TEST 2: raise, test, height
+============================================================
+F 0 undefined undefined undefined 
+T 1 \relax undefined undefined 
+T 2 \relax \relax undefined 
+F 0 undefined undefined undefined 
+============================================================
+============================================================
+TEST 3: zero
+============================================================
+F 0 undefined undefined undefined 
+T 1 \relax undefined undefined 
+F 0 undefined undefined undefined 
+T 10 \relax \relax \relax 
+F 0 undefined undefined undefined 
+============================================================
+============================================================
+TEST 4: show, log
+============================================================
+> flag C height=1.
+<recently read> }
+l. ...  }
+> flag C height=3.
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!
+! LaTeX error: "kernel/variable-not-defined"
+! 
+! Variable \flag other undefined.
+! 
+! See the LaTeX3 documentation for further information.
+! 
+! For immediate help type H <return>.
+!...............................................  
+l. ...  }
+|'''''''''''''''''''''''''''''''''''''''''''''''
+| This is a coding error.
+| 
+| LaTeX has been asked to show a variable \flag other, but this has not been
+| defined yet.
+|...............................................
+============================================================
+============================================================
+TEST 5: undefined
+============================================================
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!
+! LaTeX error: "check/non-declared-variable"
+! 
+! The variable \flag other has not been declared on line ....
+! 
+! See the LaTeX3 documentation for further information.
+! 
+! For immediate help type H <return>.
+!...............................................  
+l. ...  }
+|'''''''''''''''''''''''''''''''''''''''''''''''
+| Checking is active, and you have tried do so something like:
+|   \tl_set:Nn \flag other { ... }
+| without first having:
+|   \tl_new:N \flag other
+| 
+| LaTeX will create the variable and continue.
+|...............................................
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           Erroneous variable flag other used!
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           Erroneous variable flag other used!
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+|\flag other 0;|
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           Erroneous variable flag other used!
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+|0|
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           Erroneous variable flag other used!
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+|F|
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           Erroneous variable flag other used!
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+||
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           Erroneous variable flag other used!
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+|F|
+! Undefined control sequence.
+<argument> \LaTeX3 error: 
+                           Erroneous variable flag other used!
+l. ...  }
+The control sequence at the end of the top line
+of your error message was never \def'ed. If you have
+misspelled it (e.g., `\hobx'), type `I' and the correct
+spelling (e.g., `I\hbox'). Otherwise just continue,
+and I'll forget about whatever was undefined.
+|F|
+============================================================



More information about the latex3-commits mailing list