[Dev-luatex] [PATCH] Allow literal # in argument text by escaping
luigi scarso
luigi.scarso at gmail.com
Mon May 27 10:15:25 CEST 2019
On Sun, May 26, 2019 at 3:36 PM Marcel Fabian Krüger <tex at 2krueger.de>
wrote:
> Hi,
>
> inspired by [a recent TeX.sx question][1] this allows delimited macros
> with `#` in the parameter text by doubling the `#`.
> It isn't needed that often but it is useful if you try to analyze the
> parameter text of a TeX macro using TeX code. Also it is completely
> backward-compatible (`##` always triggers an error without this) and
> it is very easy to implement.
>
> For example:
>
> \def\test#1###2{(#1)[#2]}
> \test hello#{world}
>
> would result in (hello)[world]
>
> Best regards,
> Marcel Krüger
>
>
hm, context mkiv already has the "named parameters"
eg
\def\doflushparallel#instance#status#line#label#content% called at lua end
{\begingroup
\def\currentparallelinstance{#instance}%
\def\currentparallelnumber {#status}%
\def\currentparallelline {#line}%
\def\currentparallellabel {#label}%
\def\currentparallelcontent {#content}% can be kep at the lua end .. no
need to use a virtual file
\ifcase#status\relax
\expandafter\buff_parallel_flush_nop
\or
\expandafter\buff_parallel_flush_yes
\fi
\endgroup}
(see buff-par.mkvi )
Perhaps one can play with a named parameter as kind of separator.
--
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/dev-luatex/attachments/20190527/9185b4d4/attachment-0001.html>
More information about the dev-luatex
mailing list