Closed lvjr closed 6 months ago
We may make \fakeverb run faster by not using l3regex:
\fakeverb
l3regex
Another implement would be to use \tl_analysis_map_inline:n, which is pretty fast: \tl_const:Nn \c__cus_verbatimize_macros_tl { \#\%\\\ \{\}\^ } \NewDocumentCommand \FakeVerb { m } { \group_begin: \ttfamily \frenchspacing \tl_analysis_map_inline:nn {#1} { \int_compare:nNnTF {##2} = { -\c_one_int } { \exp_args:NNo \tl_if_in:NnTF \c__cus_verbatimize_macros_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_end: } Originally posted by @Sophanatprime in lvjr/tabularray#370 (reply in thread)
Another implement would be to use \tl_analysis_map_inline:n, which is pretty fast:
\tl_analysis_map_inline:n
\tl_const:Nn \c__cus_verbatimize_macros_tl { \#\%\\\ \{\}\^ } \NewDocumentCommand \FakeVerb { m } { \group_begin: \ttfamily \frenchspacing \tl_analysis_map_inline:nn {#1} { \int_compare:nNnTF {##2} = { -\c_one_int } { \exp_args:NNo \tl_if_in:NnTF \c__cus_verbatimize_macros_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_end: }
Originally posted by @Sophanatprime in lvjr/tabularray#370 (reply in thread)
@Sophanatprime Are you interested in making a pull request for this improvement?
We may make
\fakeverb
run faster by not usingl3regex
: