texlive[72909] Master/texmf-dist: codehigh (20nov24)

commits+karl at tug.org commits+karl at tug.org
Wed Nov 20 22:15:19 CET 2024


Revision: 72909
          https://tug.org/svn/texlive?view=revision&revision=72909
Author:   karl
Date:     2024-11-20 22:15:19 +0100 (Wed, 20 Nov 2024)
Log Message:
-----------
codehigh (20nov24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/codehigh/codehigh.pdf
    trunk/Master/texmf-dist/doc/latex/codehigh/codehigh.tex
    trunk/Master/texmf-dist/tex/latex/codehigh/codehigh.sty

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

Modified: trunk/Master/texmf-dist/doc/latex/codehigh/codehigh.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/codehigh/codehigh.tex	2024-11-20 21:15:08 UTC (rev 72908)
+++ trunk/Master/texmf-dist/doc/latex/codehigh/codehigh.tex	2024-11-20 21:15:19 UTC (rev 72909)
@@ -2,7 +2,7 @@
 \documentclass[oneside]{book}
 \usepackage[a4paper,margin=2cm]{geometry}
 
-\newcommand*{\myversion}{2023A}
+\newcommand*{\myversion}{2024A}
 \newcommand*{\mydate}{Version \myversion\ (\the\year-\mylpad\month-\mylpad\day)}
 \newcommand*{\mylpad}[1]{\ifnum#1<10 0\the#1\else\the#1\fi}
 

Modified: trunk/Master/texmf-dist/tex/latex/codehigh/codehigh.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/codehigh/codehigh.sty	2024-11-20 21:15:08 UTC (rev 72908)
+++ trunk/Master/texmf-dist/tex/latex/codehigh/codehigh.sty	2024-11-20 21:15:19 UTC (rev 72909)
@@ -12,7 +12,7 @@
 
 \NeedsTeXFormat{LaTeX2e}
 \RequirePackage{expl3}
-\ProvidesExplPackage{codehigh}{2023-02-11}{2023A}
+\ProvidesExplPackage{codehigh}{2024-11-20}{2024A}
   {Highlight codes and demos with l3regex and lpeg}
 
 %\RequirePackage{xparse}
@@ -603,36 +603,27 @@
 %%> \section{Fake Verbatim Command}
 %%% -------------------------------------------------------
 
-\tl_new:N \l__codehigh_fake_code_tl
+\tl_const:Nn \c__codehigh_fake_escape_tl { \\\{\}\#\^\ \% }
 
 \NewDocumentCommand \fakeverb { +m }
   {
     \group_begin:
-    \tl_set:Nn \l__codehigh_fake_code_tl {#1}
-    \__codehigh_fake_verb:N \l__codehigh_fake_code_tl
+    \group_align_safe_begin:
+    \ttfamily \frenchspacing
+    \tl_analysis_map_inline:nn {#1}
+      {
+        \int_compare:nNnTF {##2} = { -1 }
+          {
+            \exp_args:NNo \tl_if_in:NnTF \c__codehigh_fake_escape_tl {##1}
+              { \exp_after:wN \cs_to_str:N ##1 }
+              { \exp_after:wN \token_to_str:N ##1 }
+          }
+          { \exp_after:wN \token_to_str:N ##1 }
+      }
+    \group_align_safe_end:
     \group_end:
   }
 
-\cs_new_protected:Npn \__codehigh_fake_verb:N #1
-  {
-    \regex_replace_all:nnN { \c{\\} } { \\ } #1
-    % use \cO to avoid errors of unmatched braces
-    \regex_replace_all:nnN { \c{\{} } { \cO\{ } #1
-    \regex_replace_all:nnN { \c{\}} } { \cO\} } #1
-    % use \cO to avoid doubled hash characters
-    \regex_replace_all:nnN { \c{\#} } { \cO\# } #1
-    % need to escape ^ because ^^ and ^^^^ are special
-    \regex_replace_all:nnN { \c{\^} } { \^ } #1
-    % why we can not use \c{\ } instead of \c{\h}?
-    \regex_replace_all:nnN { \c{\h} } { \  } #1
-    \regex_replace_all:nnN { \c{\%} } { \% } #1
-    % remove spaces after control words
-    \regex_replace_all:nnN { . } { \c{string}\0 } #1
-    \tl_set:Ne #1 { #1 }
-    %\tl_log:N #1
-    \ttfamily \frenchspacing \tl_to_str:N #1
-  }
-
 %%% -------------------------------------------------------
 %%> \section{Tracing CodeHigh}
 %%% -------------------------------------------------------



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