| 1 |
$Id: unbalanced-braces.test 70173 2024-02-26 15:53:56Z karl $ |
| 2 |
|
| 3 |
This is (clearly) not an actual test file that can be run. |
| 4 |
It exists to record some of the nefarious input files that caused the |
| 5 |
problems that unbalanced-braces.ch tries to resolve. |
| 6 |
|
| 7 |
% https://tug.org/pipermail/tex-k/2022-July/003851.html |
| 8 |
% Tyge Tiessen |
| 9 |
\catcode`\{=1 \catcode`\}=2 \catcode`\#=6 |
| 10 |
\outer\def\someouter{} |
| 11 |
\def\weird{\expandafter\weirda\expandafter{\iffalse}\fi} |
| 12 |
\def\weirda#1{\ifx} |
| 13 |
\immediate\write16{\weird}\someouter |
| 14 |
|
| 15 |
% https://tex.stackexchange.com/questions/609423 |
| 16 |
% user202729 |
| 17 |
\catcode`\{=1 \catcode`\}=2 \catcode`\#=6 |
| 18 |
\def\weird{\expandafter\weirda\expandafter{\iffalse}\fi} |
| 19 |
\def\weirda#1{\expandafter\weirdb\noexpand} |
| 20 |
\def\weirdb#1{\iffalse{\fi}#1\edef\mycontainendwrite{\noexpand#1}} |
| 21 |
\immediate\write16{\weird} |
| 22 |
\expandafter\let\expandafter\myendwrite\mycontainendwrite |
| 23 |
\end |
| 24 |
|
| 25 |
% https://codegolf.stackexchange.com/questions/4399/shortest-code-that-raises-a-sigsegv/4409#4409 |
| 26 |
% -> https://groups.google.com/g/comp.text.tex/c/SEHJUKtksU8 |
| 27 |
% Bruno Le Floch |
| 28 |
\catcode`\{=1 \catcode`\}=2 \catcode`\#=6 \catcode`\~=13 |
| 29 |
\def~#1{\meaning}\write0{\expandafter~\string}\end |
| 30 |
|
| 31 |
% https://topanswers.xyz/tex?q=5286#a5394 |
| 32 |
% user202729 |
| 33 |
\catcode`\{=1 \catcode`\}=2 \catcode`\#=6 |
| 34 |
\outer\def\a{} |
| 35 |
\def\weird{\expandafter\weirda\string} |
| 36 |
\def\weirda#1{\ifx} |
| 37 |
\immediate\write-1{\weird}\a |
| 38 |
\end |
| 39 |
|
| 40 |
% (From drf) |
| 41 |
% Below is the only test file I didn't get directly from others; the thing |
| 42 |
% I like about it is that it shows the case where the \extra token of the |
| 43 |
% \output routine has been "backed_up" so it's no longer part of the |
| 44 |
% output_text when we get to <Resume the page builder after an output |
| 45 |
% routine has come to an end>. (The parsing of "\box255" reads the |
| 46 |
% following token, and sees it's not a digit, so pushes it back.) And if |
| 47 |
% you remove the "\extra", you get the case where the actual right brace |
| 48 |
% in the output routine is backed_up, which is legal and expected, so |
| 49 |
% shouldn't be messed up by my changes. |
| 50 |
% |
| 51 |
\catcode`\{=1 \catcode`\}=2 |
| 52 |
\def\makepage{ |
| 53 |
\hrule width 2in height 1in |
| 54 |
\vskip 1in plus 10in |
| 55 |
\hrule width 2in height 1in |
| 56 |
\penalty-10000 |
| 57 |
} |
| 58 |
\output{\global\advance\count0 by 1 \shipout\box255\extra} |
| 59 |
\let\lb={ |
| 60 |
\let\rb=} |
| 61 |
\message{RELAX} |
| 62 |
\let\extra=\relax |
| 63 |
\makepage |
| 64 |
\message{DONE_RELAX} |
| 65 |
\message{EXTRA_RIGHT_BRACE} |
| 66 |
\let\extra=} |
| 67 |
\makepage |
| 68 |
\message{DONE_EXTRA_RIGHTBRACE} |
| 69 |
\message{EXTRA_LEFT_BRACE} |
| 70 |
\let\extra={ |
| 71 |
\makepage |
| 72 |
\message{DONE_EXTRA_LEFT_BRACE} |
| 73 |
\end |