The code for doing this:
\gdef\ProcessAsymptoteLine#1^^M{%
\def\@tempa{#1}%
{%
\escapechar=-1\relax%
\xdef\@tempb{\string\end\string{\CurrentAsymptote\string}}%
}%
\ifx\@tempa\@tempb%
\edef\next{\endgroup\noexpand\end{\CurrentAsymptote}}%
\else%
\ThisAsymptote{#1}%
\let\next\ProcessAsymptoteLine%
\fi%
\next%
}
The lines in boldface test for the line match.
It appears (naively?) to be pretty easy to extend the definition of this macro to one that it terminates after exactly one line. Why might this be useful?
It could be used within other macros since it does on depend on line breaks.
The asy environment used for inline code within a LaTeX document is defined starting on line 244 here: https://github.com/vectorgraphics/asymptote/blob/master/doc/asy-latex.dtx). Lines are read in one at a time until one matches \end{asy}.
The code for doing this: \gdef\ProcessAsymptoteLine#1^^M{% \def\@tempa{#1}% {% \escapechar=-1\relax% \xdef\@tempb{\string\end\string{\CurrentAsymptote\string}}% }% \ifx\@tempa\@tempb% \edef\next{\endgroup\noexpand\end{\CurrentAsymptote}}% \else% \ThisAsymptote{#1}% \let\next\ProcessAsymptoteLine% \fi% \next% }
The lines in boldface test for the line match.
It appears (naively?) to be pretty easy to extend the definition of this macro to one that it terminates after exactly one line. Why might this be useful?
Any thoughts?