texlive[65482] Master/texmf-dist: piton (7jan23)

commits+karl at tug.org commits+karl at tug.org
Sat Jan 7 22:22:46 CET 2023


Revision: 65482
          http://tug.org/svn/texlive?view=revision&revision=65482
Author:   karl
Date:     2023-01-07 22:22:46 +0100 (Sat, 07 Jan 2023)
Log Message:
-----------
piton (7jan23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/lualatex/piton/piton-french.pdf
    trunk/Master/texmf-dist/doc/lualatex/piton/piton-french.tex
    trunk/Master/texmf-dist/doc/lualatex/piton/piton.pdf
    trunk/Master/texmf-dist/source/lualatex/piton/piton.dtx
    trunk/Master/texmf-dist/source/lualatex/piton/piton.ins
    trunk/Master/texmf-dist/tex/lualatex/piton/piton.sty

Modified: trunk/Master/texmf-dist/doc/lualatex/piton/piton-french.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/lualatex/piton/piton-french.tex
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/piton/piton-french.tex	2023-01-07 21:22:30 UTC (rev 65481)
+++ trunk/Master/texmf-dist/doc/lualatex/piton/piton-french.tex	2023-01-07 21:22:46 UTC (rev 65482)
@@ -130,9 +130,9 @@
 
 L'extension \pkg{piton} se charge simplement avec la commande |\usepackage| : |\usepackage{piton}|.
 
-On a néanmoins deux remarques à formuler :
+On a cependant deux remarques à formuler :
 \begin{itemize}
-\item l'extension \pkg{piton} utilise l'extension \pkg{xcolor} (néanmoins \pkg{piton} charge pas \pkg{xcolor} : si
+\item l'extension \pkg{piton} utilise l'extension \pkg{xcolor} (mais \pkg{piton} ne charge pas \pkg{xcolor} : si
 \pkg{xcolor} n'est pas chargée avant le |\begin{document}|, une erreur fatale sera levée) ;
 
 \item l'extension \pkg{piton} n'est utilisable qu'avec LuaLaTeX : si un autre moteur de compilation (comme |latex|,
@@ -418,7 +418,7 @@
 Name.Decorator & les décorateurs (instructions débutant par \verb|@|) \\
 Name.Namespace & le nom des modules (= bibliothèques extérieures) \\
 Name.Class & le nom des classes au moment de leur définition, c'est-à-dire après le mot-clé \verb|class| \\
-Exception & le nom des exceptions prédéfinies (eg: SyntaxError) \\
+Exception & le nom des exceptions prédéfinies (ex.: SyntaxError) \\
 Comment & les commentaires commençant par \texttt{\#} \\
 Comment.LaTeX & les commentaires commençant par \texttt{\#>} qui sont composés en LaTeX par \pkg{piton} (et
                 appelés simplement «commentaires LaTeX» dans ce document) \\
@@ -483,6 +483,8 @@
 \item Il est possible d'avoir, dans les commentaires Python, les éléments entre \texttt{\$} composés en mode
 mathématique de LaTeX.
 \item Il est possible d'insérer du code LaTeX à n'importe quel endroit d'un listing Python.
+\item Dans le cas où la classe Beamer est utilisée, l'extension \pkg{piton} détecte automatiquement certaines
+commandes de Beamer.
 \end{itemize}
 
 
@@ -514,7 +516,7 @@
 Par exemple, avec |\SetPitonStyle{Comment.LaTeX = \normalfont\color{blue}}|, les commentaires LaTeX seront composés
 en bleu.
 
-Si on souhaite qu'un croisillon (|#|) soit affiché en début de commantaire dans le \textsc{pdf}, on peut régler
+Si on souhaite qu'un croisillon (|#|) soit affiché en début de commentaire dans le \textsc{pdf}, on peut régler
 |Comment.LaTeX| de la manière suivante :
 
 \begin{Verbatim}
@@ -595,6 +597,46 @@
 appelé dans ce document «commentaire LateX», il suffit de le faire débuter par |#>|).
 
 
+
+\subsubsection{Comportement dans la classe Beamer}
+
+\colorbox{yellow!50}{\textbf{Nouveau 1.1}}
+
+\smallskip
+Quand \pkg{piton} est utilisé dans la classe \cls{beamer}, les commandes suivantes de \cls{beamer} sont détectées
+directement dans les environnements |{Piton}| (sans avoir à utiliser aucun mécanisme d'échappement) : |\action|,
+|\alert|, |\invisible|, |\only|, |\uncover| et |\visible|.\footnote{L'extension \pkg{piton} détecte la classe
+  \cls{beamer} mais il est aussi possible, si le besoin s'en faisait sentir, d'activer ce comportement avec la clé
+  |beamer| au chargement de \pkg{piton} : |\usepackage[beamer]{piton}|}
+
+\medskip
+Néanmoins, \textbf{il ne doit pas y avoir de retours à la ligne} dans les arguments de ces commandes.
+
+\medskip
+Remarquons que, comme l'environnement |{Piton}| prend son argument selon un mode verbatim, il convient, ce qui
+n'est pas surprenant, de l'utiliser dans des |{frame}| protégés par la clé |fragile|.
+
+\medskip
+Voici un exemple complet de fichier :
+
+\begin{Verbatim}
+\documentclass{beamer}
+\usepackage{xcolor}
+\usepackage{piton}
+
+\begin{document}
+
+\begin{frame}[fragile]
+\begin{Piton}
+def carré(x):
+~emphase#\only<2>{    return x*x}@
+\end{Piton}
+\end{frame}
+
+\end{document}
+\end{Verbatim}
+
+
 \bigskip
 \subsection{Coupure des pages et des lignes}
 
@@ -605,7 +647,7 @@
 Par défaut les listings produits par l'environnement |{Piton}| et par la commande |\PitonInputFile| sont
 insécables.
 
-Néanmoins, la commande |\PitonOptions| propose la clé |splittable| pour autoriser et autoriser de telles coupures.
+Néanmoins, la commande |\PitonOptions| propose la clé |splittable| pour autoriser de telles coupures.
 
 \begin{itemize}
 \item Si la clé |splittable| est utilisée sans valeur, les listings sont sécables n'importe où.
@@ -630,8 +672,7 @@
 sont pas sécables.
 
 \medskip
-\colorbox{yellow!50}{\textbf{Nouveau 0.99}}\enskip Il existe néanmoins des clés (disponibles dans |\PitonOptions|)
-pour autoriser ces coupures.
+Il existe néanmoins des clés (disponibles dans |\PitonOptions|) pour autoriser ces coupures.
 
 \begin{itemize}
 \item La clé |break-lines| active la coupure des lignes. Les seuls points de coupure possibles sont les espaces (y compris
@@ -719,11 +760,10 @@
 valeur initiale de~$n$ est~4 mais on peut la changer avec la clé |tab-size| de |\PitonOptions|.
 
 \smallskip
-\colorbox{yellow!50}{\bfseries Nouveau 1.0}\enskip Il existe aussi une clé |tabs-auto-gobble| qui détermine
-le nombre minimal de caractères U+0009 débutant chaque ligne (non vide) de l'environnement |{Piton}| et applique
-|gobble| avec cette valeur (avant le remplacement des caractères U+0009 par des espaces, bien entendu). Cette clé
-est donc similaire à la clé |auto-gobble| mais agit sur des caractères U+0009 au lieu de caractères U+0020
-(espaces).
+Il existe aussi une clé |tabs-auto-gobble| qui détermine le nombre minimal de caractères U+0009 débutant chaque
+ligne (non vide) de l'environnement |{Piton}| et applique |gobble| avec cette valeur (avant le remplacement des
+caractères U+0009 par des espaces, bien entendu). Cette clé est donc similaire à la clé |auto-gobble| mais agit sur
+des caractères U+0009 au lieu de caractères U+0020 (espaces).
 
 \section{Exemples}
 

Modified: trunk/Master/texmf-dist/doc/lualatex/piton/piton.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/lualatex/piton/piton.dtx
===================================================================
--- trunk/Master/texmf-dist/source/lualatex/piton/piton.dtx	2023-01-07 21:22:30 UTC (rev 65481)
+++ trunk/Master/texmf-dist/source/lualatex/piton/piton.dtx	2023-01-07 21:22:46 UTC (rev 65482)
@@ -1,6 +1,6 @@
 % \iffalse -*- coding: utf-8 ; -*- \fi \iffalse meta-comment
 %
-% Copyright (C) 2022 by F. Pantigny
+% Copyright (C) 2023 by F. Pantigny
 % -----------------------------------
 %
 % This file may be distributed and/or modified under the
@@ -15,8 +15,8 @@
 %
 % \fi
 % \iffalse
-\def\myfileversion{1.0}
-\def\myfiledate{2022/12/29}
+\def\myfileversion{1.1}
+\def\myfiledate{2023/01/07}
 %
 %
 %<*batchfile> 
@@ -26,7 +26,7 @@
 \usedir{tex/latex/cascade}
 \preamble
 
-Copyright (C) 2022 by F. Pantigny
+Copyright (C) 2023 by F. Pantigny
 -----------------------------------
 
 This file may be distributed and/or modified under the
@@ -258,7 +258,7 @@
 %
 % The command |\PitonOptions| takes in as argument a comma-separated list of
 % \textsl{key=value} pairs. The scope of the settings done by that command is
-% the current TeX group.\footnote{We remind that an LaTeX environment is, in
+% the current TeX group.\footnote{We remind that a LaTeX environment is, in
 % particular, a TeX group.}
 %
 % \begin{itemize}
@@ -635,6 +635,47 @@
 % this document). 
 % 
 %
+% \subsubsection{Behaviour in the class Beamer}
+%
+% \colorbox{yellow!50}{\textbf{New 1.1}}
+%
+% \smallskip
+% When \pkg{piton} is used in the class \cls{beamer}, the following commands of
+% \cls{beamer} are automatically detected in the environments |{Piton}|
+% (without any escaping mechanism) : |\action|,
+% |\alert|, |\invisible|, |\only|, |\uncover| and |\visible|.\footnote{The extension \pkg{piton} detects the class
+%   \cls{beamer} but, if needed, it's also possible to activate that mechanism
+%   with the key |beamer| provided by \pkg{piton} at load-time: |\textbackslash usepackage[beamer]{piton}|}
+%
+% \medskip
+% However, there must be \textbf{no end-of-line} in the arguments of those commands.
+% 
+% \medskip
+% Remark that, since the environment |{Piton}| takes in its body with a verbatim
+% mode, it's necessary to use the environments |{Piton}| within environments
+% |{frame}| protected by the key |fragile|.
+%
+% \medskip
+% Here is a complete example of file:
+%
+% \begin{Verbatim}
+% \documentclass{beamer}
+% \usepackage{xcolor}
+% \usepackage{piton}
+%
+% \begin{document}
+%
+% \begin{frame}[fragile]
+% \begin{Piton}
+% def square(x):
+% ~emphase#\only<2>{    return x*x}@
+% \end{Piton}
+% \end{frame}
+%
+% \end{document}
+% \end{Verbatim}
+%
+%
 % \subsection{Page breaks and line breaks}
 %
 % \label{breakable}
@@ -671,8 +712,8 @@
 % |\PitonInputFile| are not breakable.
 %
 % \smallskip
-% \colorbox{yellow!50}{\textbf{New 0.99}}\enskip There exist several keys
-% (available in |\PitonOptions|) to allow and control such line breaks.
+% There exist several keys (available in |\PitonOptions|) to allow and control
+% such line breaks.
 %
 % \begin{itemize}
 % \item The key |break-lines| actives the lines breaks. Only the spaces (even in
@@ -766,12 +807,12 @@
 % change it with the key |tab-size| of |\PitonOptions|.
 %
 % \smallskip
-% \colorbox{yellow!50}{\textbf{New 1.0}}\enskip There exists also a key
-% |tabs-auto-gobble| which computes the minimal value $n$ of the number
-% of consecutive characters U+0009 beginning each (non empty) line of the
-% environment |{Piton}| and applies |gobble| with that value of~$n$ (before
-% replacement of the tabulations by spaces, of course). Hence, that key is
-% similar to the key |auto-gobble| but acts on U+0009 instead of U+0020 (spaces).
+% There exists also a key |tabs-auto-gobble| which computes the minimal value
+% $n$ of the number of consecutive characters U+0009 beginning each (non empty)
+% line of the environment |{Piton}| and applies |gobble| with that value of~$n$
+% (before replacement of the tabulations by spaces, of course). Hence, that key
+% is similar to the key |auto-gobble| but acts on U+0009 instead of U+0020
+% (spaces).
 %
 % \section{Examples}
 %
@@ -1369,6 +1410,12 @@
 %    \begin{macrocode}
 \bool_new:N \c_@@_math_comments_bool
 %    \end{macrocode}
+%
+% \medskip
+% The following boolean corresponds to the key |beamer|. 
+%    \begin{macrocode}
+\bool_new:N \c_@@_beamer_bool
+%    \end{macrocode}
 % 
 % \bigskip
 % We define a set of keys for the options at load-time.
@@ -1382,7 +1429,9 @@
     comment-latex .code:n = { \lua_now:n { comment_latex = "#1" } } ,   
     comment-latex .value_required:n = true ,
     math-comments .bool_set:N = \c_@@_math_comments_bool ,
-    math-comments .default:n  = true , 
+    math-comments .default:n  = true ,
+    beamer        .bool_set:N = \c_@@_beamer_bool ,
+    beamer        .default:n = true , 
     unknown .code:n = \msg_error:nn { piton } { unknown~key~for~package }
   }
 %    \end{macrocode}
@@ -1392,7 +1441,7 @@
   {
     Unknown~key.\\
     You~have~used~the~key~'\l_keys_key_str'~but~the~only~keys~available~here~
-    are~'comment-latex',~'escape-inside',~'footnote',~'footnotehyper'~and~
+    are~'beamer',~'comment-latex',~'escape-inside',~'footnote',~'footnotehyper'~and~ 
     'math-comments'.~Other~keys~are~available~in~\token_to_str:N \PitonOptions.\\
     That~key~will~be~ignored.
   }
@@ -1419,6 +1468,11 @@
 \endgroup
 %    \end{macrocode}
 % 
+% \bigskip
+%    \begin{macrocode}
+\@ifclassloaded { beamer } { \bool_set_true:N \c_@@_beamer_bool } { }
+\bool_if:NT \c_@@_beamer_bool { \lua_now:n { piton_beamer = true } }
+%    \end{macrocode}
 % 
 % \bigskip
 %    \begin{macrocode}
@@ -2085,6 +2139,7 @@
 % or disallow page breaks.
 %    \begin{macrocode}
       \lua_now:n { piton.CountLinesFile(token.scan_argument()) } { #2 }  
+%    \end{document}     
 % If the final user has used both |left-margin=auto| and |line-numbers| or
 % |all-line-numbers|, we have to compute the width of the maximal number of
 % lines at the end of the composition of the listing to fix the correct value to
@@ -2326,6 +2381,8 @@
     Exception        .value_required:n = true ,
     Comment.LaTeX    .tl_set:c = pitonStyle Comment.LaTeX ,
     Comment.LaTeX    .value_required:n = true ,
+    Beamer           .tl_set:c = pitonStyle Beamer ,
+    Beamer           .value_required:n = true ,
     unknown          .code:n = 
       \msg_error:nn { piton } { Unknown~key~for~SetPitonStyle }
   }
@@ -2391,6 +2448,7 @@
     InitialValues    = \@@_piton:n ,
     Dict.Value       = \@@_piton:n ,
     Interpol.Inside  = \color{black}\@@_piton:n ,
+    Beamer           = \@@_piton:n , 
     Post.Function    = \@@_piton:n ,
   }
 %    \end{macrocode}
@@ -2482,8 +2540,8 @@
 % The function |L| takes in as argument a pattern and returns a \textsc{lpeg}
 % \emph{which does a capture} of the pattern. That capture will be sent to LaTeX
 % with standard LaTeX catcodes for all the characters: the elements captured
-% will be formatted as normal LaTeX codes. It's suitable for the ``comment
-% LateX'' in the environments |{Piton}| and the elements beetween
+% will be formatted as normal LaTeX codes. It's suitable for the ``LaTeX
+% comments'' in the environments |{Piton}| and the elements beetween 
 % ``|escape-inside|''. That function won't be much used.
 %    \begin{macrocode}
 local function L(pattern)
@@ -2510,7 +2568,7 @@
 % LaTeX formatting instructions corresponding to the syntactic nature of that
 % Python chunk). The first argument is a pattern (that is to say a \textsc{lpeg}
 % without capture) and the second element is a Lua string corresponding to the
-% name of a \pkg{piton} style. If the seconde argument is not present, the
+% name of a \pkg{piton} style. If the second argument is not present, the
 % function |K| behaves as the function |Q| does.
 %    \begin{macrocode}
 local function K(pattern, style)
@@ -2582,7 +2640,7 @@
 %    \end{macrocode}
 % 
 % \medskip
-% On the other hand, the \textsc{lpeg} |Identifier| (with a capital) also return
+% On the other hand, the \textsc{lpeg} |Identifier| (with a capital) also returns
 % a \emph{capture}.
 %    \begin{macrocode}
 local Identifier = K ( identifier )
@@ -2674,7 +2732,7 @@
 % 
 % \bigskip
 % Some strings of length 2 are explicit because we want the corresponding
-% ligatures available in some fonts as \emph{Fira Code} to be active.
+% ligatures available in some fonts such as \emph{Fira Code} to be active.
 %    \begin{macrocode}
 local Operator = 
   K ( P "!=" + P "<>" + P "==" + P "<<" + P ">>" + P "<=" + P ">=" + P ":=" 
@@ -2834,7 +2892,7 @@
 % First, we define \textsc{lpeg} for the interpolations in the f-strings. Here
 % is an example of a f-string with an interpolation and a format
 % instruction\footnote{There is no special \pkg{piton} style for the formatting
-% instruction (after the comma): the style which will be applied will be the
+% instruction (after the colon): the style which will be applied will be the
 % style of the encompassing string, that is to say |String.Short| or
 % |String.Long|.} in that interpolation:
 %
@@ -3178,7 +3236,7 @@
 % \emph{parsing expression grammars} (\textsc{peg}).
 % 
 % \smallskip 
-% If the word |def| is not followed by a identifier and parenthesis, it will be
+% If the word |def| is not followed by an identifier and parenthesis, it will be
 % catched as keyword by the \textsc{lpeg} |Keyword| (useful if, for example, the
 % final user wants to speak of the keyword \piton{def}).
 %
@@ -3185,7 +3243,7 @@
 % \bigskip
 % \paragraph{The dictionaries of Python}
 %
-% We have \textsc{lpeg} dealings with dictionaries of Python because, in
+% We have \textsc{lpeg} dealing with dictionaries of Python because, in
 % typesettings of explicit Python dictionnaries, one may prefer to have all the
 % values formatted in black (in order to see more clearly the keys which are
 % usually Python strings). That's why we have a \pkg{piton} style |Dict.Value|.
@@ -3216,7 +3274,39 @@
   * K ( P "}" )
 %    \end{macrocode}
 %
+% \bigskip
+% \paragraph{Commands of Beamer}
 %
+%
+%    \begin{macrocode}
+local Beamer = P ( "blablabla" ) 
+
+if piton_beamer then
+  Beamer =
+      L ( 
+          ( P "\\uncover" + P "\\only" + P "\\alert" + P "\\visible" 
+            + P "\\invisible" + P "\\action" 
+          ) 
+          * P "<" 
+          * (1 - P ">") ^ 0 
+          * P ">{" 
+        )
+      * K ( Expression , 'Beamer' ) 
+      * L ( P "}" )
+    +  
+      L ( 
+          ( P "\\alt" )
+          * P "<" 
+          * (1 - P ">") ^ 0 
+          * P ">{" 
+        )
+      * K ( Expression , 'Beamer' ) 
+      * L ( P "}{" )
+      * K ( Expression , 'Beamer' ) 
+      * L ( P "}" )
+end
+%    \end{macrocode}
+% 
 % \bigskip
 % \paragraph{The main LPEG}
 %
@@ -3240,6 +3330,7 @@
          + Space
          + Escape 
          + CommentLaTeX
+         + Beamer 
          + LongString 
          + Comment
          + ExceptionInConsole
@@ -3505,11 +3596,15 @@
 %
 % \vspace{1cm}
 % \section{History}
+% \subsection*{Changes between versions 0.99 and 1.0}
 %
+% The extension \pkg{piton} detects the class \cls{beamer} and activates the
+% commands |\action|, |\alert|, |\invisible|, |\only|, |\uncover| and |\visible|
+% in the environments |{Piton}| when the class \cls{beamer} is used.
+%
 % \subsection*{Changes between versions 0.99 and 1.0}
 %
 % New key |tabs-auto-gobble|.
-%
 % 
 % \subsection*{Changes between versions 0.95 and 0.99}
 %

Modified: trunk/Master/texmf-dist/source/lualatex/piton/piton.ins
===================================================================
--- trunk/Master/texmf-dist/source/lualatex/piton/piton.ins	2023-01-07 21:22:30 UTC (rev 65481)
+++ trunk/Master/texmf-dist/source/lualatex/piton/piton.ins	2023-01-07 21:22:46 UTC (rev 65482)
@@ -1,5 +1,5 @@
 %%
-%% Copyright (C) 2022 by F. Pantigny
+%% Copyright (C) 2023 by F. Pantigny
 %%
 %%
 %% This file may be distributed and/or modified under the
@@ -17,7 +17,7 @@
 \usedir{tex/latex/cascade}
 \preamble
 
-Copyright (C) 2022 by F. Pantigny
+Copyright (C) 2023 by F. Pantigny
 
 This file may be distributed and/or modified under the
 conditions of the LaTeX Project Public License, either

Modified: trunk/Master/texmf-dist/tex/lualatex/piton/piton.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/piton/piton.sty	2023-01-07 21:22:30 UTC (rev 65481)
+++ trunk/Master/texmf-dist/tex/lualatex/piton/piton.sty	2023-01-07 21:22:46 UTC (rev 65482)
@@ -6,7 +6,7 @@
 %%
 %% piton.dtx  (with options: `package')
 %% 
-%% Copyright (C) 2022 by F. Pantigny
+%% Copyright (C) 2023 by F. Pantigny
 %% 
 %% This file may be distributed and/or modified under the
 %% conditions of the LaTeX Project Public License, either
@@ -18,8 +18,8 @@
 %% and version 1.3 or later is part of all distributions of
 %% LaTeX version 2005/12/01 or later.
 %% 
-\def\myfileversion{1.0}
-\def\myfiledate{2022/12/29}
+\def\myfileversion{1.1}
+\def\myfiledate{2023/01/07}
 
 
 
@@ -37,6 +37,7 @@
 \bool_new:N \c__piton_footnotehyper_bool
 \bool_new:N \c__piton_footnote_bool
 \bool_new:N \c__piton_math_comments_bool
+\bool_new:N \c__piton_beamer_bool
 \keys_define:nn { piton / package }
   {
     footnote .bool_set:N = \c__piton_footnote_bool ,
@@ -47,6 +48,8 @@
     comment-latex .value_required:n = true ,
     math-comments .bool_set:N = \c__piton_math_comments_bool ,
     math-comments .default:n  = true ,
+    beamer        .bool_set:N = \c__piton_beamer_bool ,
+    beamer        .default:n = true ,
     unknown .code:n = \msg_error:nn { piton } { unknown~key~for~package }
   }
 \msg_new:nnn { piton } { unknown~key~for~package }
@@ -53,7 +56,7 @@
   {
     Unknown~key.\\
     You~have~used~the~key~'\l_keys_key_str'~but~the~only~keys~available~here~
-    are~'comment-latex',~'escape-inside',~'footnote',~'footnotehyper'~and~
+    are~'beamer',~'comment-latex',~'escape-inside',~'footnote',~'footnotehyper'~and~
     'math-comments'.~Other~keys~are~available~in~\token_to_str:N \PitonOptions.\\
     That~key~will~be~ignored.
   }
@@ -69,6 +72,8 @@
   { \tl_head:V \c__piton_escape_inside_tl }
   { \tl_tail:V \c__piton_escape_inside_tl }
 \endgroup
+\@ifclassloaded { beamer } { \bool_set_true:N \c__piton_beamer_bool } { }
+\bool_if:NT \c__piton_beamer_bool { \lua_now:n { piton_beamer = true } }
 \hook_gput_code:nnn { begindocument } { . }
   {
     \@ifpackageloaded { xcolor }
@@ -605,6 +610,8 @@
     Exception        .value_required:n = true ,
     Comment.LaTeX    .tl_set:c = pitonStyle Comment.LaTeX ,
     Comment.LaTeX    .value_required:n = true ,
+    Beamer           .tl_set:c = pitonStyle Beamer ,
+    Beamer           .value_required:n = true ,
     unknown          .code:n =
       \msg_error:nn { piton } { Unknown~key~for~SetPitonStyle }
   }
@@ -656,6 +663,7 @@
     InitialValues    = \__piton_piton:n ,
     Dict.Value       = \__piton_piton:n ,
     Interpol.Inside  = \color{black}\__piton_piton:n ,
+    Beamer           = \__piton_piton:n ,
     Post.Function    = \__piton_piton:n ,
   }
 \bool_if:NT \c__piton_math_comments_bool
@@ -1036,6 +1044,32 @@
   K ( P "{" )
   * ItemOfSet * ( K ( P "," ) * ItemOfSet )  ^ 0
   * K ( P "}" )
+local Beamer = P ( "blablabla" )
+
+if piton_beamer then
+  Beamer =
+      L (
+          ( P "\\uncover" + P "\\only" + P "\\alert" + P "\\visible"
+            + P "\\invisible" + P "\\action"
+          )
+          * P "<"
+          * (1 - P ">") ^ 0
+          * P ">{"
+        )
+      * K ( Expression , 'Beamer' )
+      * L ( P "}" )
+    +
+      L (
+          ( P "\\alt" )
+          * P "<"
+          * (1 - P ">") ^ 0
+          * P ">{"
+        )
+      * K ( Expression , 'Beamer' )
+      * L ( P "}{" )
+      * K ( Expression , 'Beamer' )
+      * L ( P "}" )
+end
 local SyntaxPythonAux =
       Lc ( '\\__piton_begin_line:' ) *
       ( ( space - P "\r" ) ^0 * P "\r" ) ^ -1 *
@@ -1046,6 +1080,7 @@
          + Space
          + Escape
          + CommentLaTeX
+         + Beamer
          + LongString
          + Comment
          + ExceptionInConsole



More information about the tex-live-commits mailing list.