Plan 9 from Bell Labs’s /usr/web/sources/contrib/steve/root/sys/src/cmd/tex/web2c/triptrap/trap.mf

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


% This is a diabolical test file for MF84. Don't get stuck.
if not known inimf: .inimf.=.0. % next lines are skipped if format loaded
  inimf; nonstopmode; tracingtitles:=day; showstopping:=year; hppp:=1000;
  << == >> ::: || `` '' -- !! ?? ## && @@ $$ [[ ]] {{ }} . (( 5.5.5 )) ++ "..";
  begingroup save =; let=,; save,; newinternal $=,; let ):=, endgroup;
  let year=month; showvariable errorstopmode,readstring,2,"2",,,(,),<<,year;
  tracingrestores:=tracingcommands:=.00000762939453125; % that's 2^(-17)
  if tracingcommands>0:tracingcommands:=if not cycle "":1.1 forever;fi;
  tracingcommands:=2.1 exitif tracingcommands>2 endfor; showtoken |=:|>;
  tracingedges:=1/.00001; tracingequations:=$+1; p~=tracingedges+.00001;
  interim tracingspecs:=tracingpens:=tracingchoices:=tracingstats:=
  warningcheck:=tracingoutput:=tracingmacros:=1; $:=ASCII""; $:=x; p~:=p~;
  delimiters (); delimiters begintext endtext; vardef foo(text t)=t enddef;
  def lig(text t,|)=ligtable0::for *=1step1until60:0kern boundarychar+*,endfor
  skipto0;ligtable t:t|0,skipto255;boundarychar:=boundarychar+51.29999enddef;
  foo begintext interim proofing:=(-.5; shipout nullpicture; special"3" endtext;
  for n=tracingpens step 1 until proofing:fi endfor showstats; let!!=skipto;
  path p~; p~=(0,0)..controls (15,4) and (-15,-12)..(4,0);  everyjob /*\;;
  vardef /*\`'@#=message @ & str#@ &jobname&char ASCII'`&str@#!enddef;
  let next=dump; vardef `'='` enddef; def '`="\*/" enddef;
elseif known"": `'pass[2.]; outer\; let next=\; delimiters ^~7! fi
next\; % the second pass will now compute silently; the first pass will halt
batchmode; ^~7,endgroup pausing:=1; exitif p exitif boolean pen pencircle endfor
scantokens begingroup message char0&"watch this"; "pair p[],';"&char-1endgroup
path p[][]p,w,qw; qw=(1,-2)..(2,-1)..(2.5,0.5)..(1,2)..(turningnumber',2.5);
numeric p[][]; p[[ [$] ]]=10000000000000000; "this string constant is incomplete
string foo[]p,p~if true:[];
boolean p[]~,boolean fi.boolean; showvariable boolean; def\\= =end enddef;
picture e[]e[], e[], p~[]~[][];
pen p~[]~,q["a",qq; p~1~=q=pencircle scaled mexp(-3016.57654);
transform p,pp0; if p=p:qq=makepen((1,0)..cycle) xscaled hex "1000";fi
qq:=makepen((0,0)..(1,0)..(0,1)..(0,0)..(1,0)..(0,1)..cycle);
vardef p[][]p~ begintext suffix a,b endtext())suffix@=show #@; p.a.b() enddef;
expandafter let\endtext\\; outer endtext,\,;;qq:=pencircle scaled 4.5 yscaled 2;
(6,12)-p7=(0,1)transformed p=(2/(x-x),3/0)transformed p;
p1\2p=p007=begintext if string p~[$]: p.1.2-p.1.199999,1 endtext transformed p;
showstopping:=0;showvariable p; p=p; let [[=begingroup; let ]]=endgroup;
(xxpart p+.002,yxpart p)=1[p1,p2]=(5,y+.00001)=(5,y)=(yypart p,xypart p);
reverse(p~..cycle) transformed p=p2. 3.p;
p[000000000001]2p~(,[2]3p~,-)=p~1~2[pausing];
vardef p~[]@# tertiary t:=if p@ @=@ @p fi; vardef p[][]p~[]=BAD; inner ;;
show p~[-2]~[3000,x]++4000>path p3; showvariable p,P;
numeric p[]~; p3~=2alpha; p[1/$]~=3beta;
begingroup save p; showvariable p; 3beta=1]]; showvariable p;
def//expr;=enddef;def!primary!false):!fi enddef;
def _aa__ secondary _a_=if(true enddef; qq:=makepen(qw..(qw scaled$)..cycle);
primarydef _**__=[[show _*__]] enddef;
secondarydef _***__=expandafter __ scantokens"**oct"_ enddef;
// //pencircle slanted length p~**makepen reverse subpath p7-p2 of
 (p7{p2}..controls _aa__ not odd.1(15) and known p or !p2and-p2..{1,1}(-p2
 {curl- +1)..tension atleast1..cycle sqrt2++sqrt2***[[]];
[[interim proofing:=charcode:=-20.5;chardp:=-2048;shipout nullpicture]];
if charexists -275.50002>known p0 0p=known p~: randomseed charcode; fi
randomseed:="goof"; a[($,18++1+-+18),(2,3)]=b[(3,2),(1,$);
show (^+1,~+2) slanted-1 yscaled-2 zscaled-(3,4), p transformed(pp xscaled 9),
 pp shifted (1,2) transformed(p transformed p), -_[0][1,2]; show
floor sind mlog sqrt mexp200cosd angle(normaldeviate,uniformdeviate-chardp);
string s[]; s1=s2=s4; s3=s5; s1=s2; if s1<=s4<>(s1<>s3):show[[char34=s2:=s3]]fi;
substring penoffset point.1of.p~of[[pencircle]]rotated1080/2/1/3of decimal
 directiontime postcontrol-1.5of(p~&cycle)-precontrol1/2of p~(p~)=s1:=s4:=s4;
path p~[]; p~1=p2{length"  "}&cycle; p~1=p2=p~0; p2..controls-p2..cycle=p~2;(p7
..tension1.2..p~[length p~2]..p~2&{0,1}p2..tension1and atleast1..cycle)..tension
 x..{curl1}-p7{curl hex "IsBad"}..tension.75and.74999..p2{0,1}&p2{_,'}..cycle:=p
 ~4; subpath(-9,9)of subpath(3.5001,7.00001)of p~4=p~6;
show p~6, directiontime(1,2) of p~6, directiontime(1,-1.00001) of p~6;
p~3=(0,0)..controls (1,1) and (0,1)..(1,0); show p2..p2{p7}&{$,$}cycle,
 (directiontime(1,1) of subpath(.314159,1) of p~3)[.314159,1];
p~5=(subpath(0,.25)of p~3&subpath(.25,1)of p~3)shifted begintext1,0;
p~3:=2/3'zscaled'{p~3}..controls(2,2/3(3))and penoffset(1/2x,y)of(0,1)(1,0);
show p~3 intersectiontimes reverse p~3, point.17227 of p~3, point1-.28339of p~3;
show point xpart(p~5 intersectiontimes p~5 shifted (.01,0))of p~5-
 point ypart(p~5 intersectiontimes p~5 shifted (.01,0))of p~5;
[[interim tracingedges:=1; e[-1+-+ -1.00001]=nullpicture; addto e1 also[[
addto e0 doublepath p~5 scaled 3 withpen q; e0=e1=e2; cull e1 dropping (0,.1);
nullpicture]];show e1 shifted(4089,-4095), e2 shifted(-4095,4092)shifted (-3,0),
e2 shifted(4089,-4095)]];addto e1 also  e2 shifted(-2,$); e1:=e1 shifted(-4,$);
addto e0 also e1rotated89.999+e1scaled$; show e0 xscaled-10 yscaled2 xscaled82
yscaled683;addto e1 doublepath (0,9) withweight-3 withweight turningnumber p~6
 withpen pencircle xscaled(oct"180"++1) rotated-angle(64,$) shifted (9,8)
 withpen makepen(($,$)..(1,0)..(1,1)..($,0)..($,$)&cycle)xscaled4095.49999;
show e1, totalweight e1; chardp:=charcode:=5; xoffset:=-1.5; shipout e1;
showstats; addto e2doublepath p~ yscaled1/60; e3:=e2 yscaled 0;
autorounding:=2; addto e3doublepath(.5,0)..(3.5,1.5)withweight2;
tracingspecs:=0; q:=makepen((1,1)..cycle) yscaled 1.5;
p~8=(($,yy)rotated p{0,1}..{0,$}(1,0){0,$}..cycle)scaled2shifted(1000.49,9);
turningcheck:=1;addto e2doublepath p~8 withpen q withweight p withpen cycle p;
[[interim autorounding:=xx=.1; addto e2 contour p~8 withpen q withweight2]];
chardx:=chardp:=charext:=-14.5;shipout-(-e0-e2)+e2shifted(0,6turningnumber p~8);
p~9=(0,0)..(1,.5)..(5,1.5)..(7,2.5)..(12,3.5)..(13,4);addto e3 doublepath p~9;
smoothing:=1; addto e3 doublepath p~9; addto e3 doublepath (-4095,0)..tension
3/4 and 999..(0,2); show e3 rotated-90, (e0+e0) rotated90$ rotated90;
if "a" if "ab">"b" elseif path reverse (3,4): >="aa":foo elseif fi "bar"
else if '-(1,yy)<': :fi else def dup text t=[[t;save enddef;def|suffix$=,$
enddef; def||tertiary p=show substring p of("a" enddef;||(2,$)&"bc");
tertiarydef x++y=[[dup showtoken x;]];def quote x expr z of y=z enddef;
 texts(quote x=(y+0)y+y)("xx",foo(x))=0]] enddef; def texts(text t,tt)expr?=
 for n:=,for n"yy":n,length if false:endfor tt,t,:if string n:forsuffixes n=
 foo1,[foo(n)],':show t,tt|(n;exitif not('<='+(?,yy)) endfor for m= :+endfor
  for m=alpha step-1.1 3$: +m endfor fi endfor enddef; show (0,0){curl2}..
 subpath(23.3,4.5)of p~9{curl3}..($,$){curl4}..cycle;numspecial p~++2+3;[[
let?=if;save if,\;def if=endinput?enddef;def texts=input enddef;texts trap ]];
dup[[def texts secondary x=primarydef y++y=x@y enddef; showtoken++;x enddef]]\;
proofing:=1;texts:="a"&"b";% strings "yy" and "ab" no longer appear in memory
texts-1.00001a1=-(a2+a3+a4+a5+a6);-(a3,a2)/.99999=-(a4+a5+[[showdependencies;
a6]],a3+a4+a5+a6)]]; 1.00001a4+1=a5+a6; alpha:=.9alpha+7; showdependencies;
a5=a6=2/3-a6; cull e1 dropping($,4a5)withweight1.5; charcode:=chardp:=27;
openwindow 3 from (0,0) to (0,0) at "whoops"; addto p; shipout p; cull p;
openwindow -.5 from ($,$) to ($,$) at (0,0); special p; numspecial "p";
openwindow 15.49999 from (0,32*1024) to (1,31*1057) at (0,0); shipout e1;
openwindow 5 from (0,length((0,0){0,0})) to (4,2) at ($,1);
openwindow 6 from (length($,0),1) to (3,10) at (-5,2);
display nullpicture; display p inwindow 3; display p inwindow 6;
display e1 inwindow 6; cull e0 dropping (0.1,4095.999999) withweight 3.5
withweight-3.5; display e0 inwindow 5.5; addto e0 also p; addto e0 contour 0;
display e0 inwindow 5.49999; addto e0 contour p~9;
display e1 inwindow 3+3; display e0e0 inwindow[[vardef e[]e=enddef;6]];
addto e0 also e1; display e0 inwindow 5; ligtable||:255|=:|>>0,skipto0;
display e1 inwindow 15; display e1 inwindow 6;
show [[interim tracingcommands:=0; lig("g")(=:|); lig("h":"i")(|=:);
lig("j")(|=:>);lig("k")(=:|>); lig("l")(|=:|>)]];
b1:=c.a[ [[let c=++;vardef b=enddef;1]] ]; ligtable"m":0=:0,skipto5;
!!; errhelp 0; errmessage "Be like Jane";
errhelp "He%%%lp%"; errmessage""; errhelp ""; errmessage "Another";
headerbyte 0; headerbyte(48.5)substring(-9,9)of"long"; for\=0:\
headerbyte 9:2a6,"q"; fontdimen 9:2a6,"q"; fontdimen 1:2048;
fontmaking:=1; extensible 5 5,"c"255.5,"d"; charlist 0:5:"a":"d";
ligtable255:255::"a"=:"b","d" kern -2048,"c":0:99.5:"e"|=:|"f",0kern';
ligtable 5:0; def clear(text x)=interim x:=$ enddef; clear(hppp); vppp=0;
[[clear(tracingmacros); clear(tracingcommands); clear(tracingoutput\;
 clear(proofing);designsize:=.99999;charcode:=ASCII char-418.5;vppp:=designsize;
 def dp expr d = charcode:=charcode+1; chardp:=d; shipout nullpicture enddef;
 dp 13; dp 12; dp 0; dp 21; dp -2; dp 17; dp 11; dp 3; charic:=-1000; dp -1;
 dp 25; dp 31; dp 19; dp 7; charwd:=256; chardy:=6; dp 23; dp 30]];
def f(suffix@@)(expr a,b)(text t)=numeric w; show a; % wipes out the old w
addto @@ contour (0,0)..(2,0)..(1,$)..(1,1)..cycle withpen qq; % strange path
addto @@ doublepath (0,0){1,1}..{2,1}(2,1) withpen qq; % carefully chosen
addto @@ doublepath(($,$){1,0}..(1,1){1,0})scaled.5 withpen nullpen;
cull @@ keeping (4,4) withweight1.5; enddef; def g(suffix$)=show $ enddef;
addto e0 contour (0,0){1,0}..{1,0}(1,0){0,$}..{0,1}cycle withpen qq;
f(e[3,w); g(e3,transformed p,penoffset-(1,1.3)of(pencircle scaled20 yscaled-.5),
 directiontime (0,1) of ((0,0)..controls(1,1)and($,1)..(3,0)),
 point 3.14159 of p~9 intersectiontimes subpath (3.14159,4) of p~9,
 (($,1.1)..(1,$)) intersectiontimes precontrol$ of (0,0);
addto e3 doublepath(-4094.99998,0)..(4094.99998,-.00001) withpen penoffset 0 of
pencircle; addto e3 also e3 shifted (0,257); ,"flushed with pride"; numeric xx;
def f(expr x,y,z)=showdependencies;tracingcapsules:=1;showdependencies;show
 1/3(3,6)*((x+y)+(y-x)), (1,1)/sqrt2 zscaled (x+1,x+2) - (x+1,x+2) rotated 45,
 (0,1) zscaled (1,y+2)-(1,y+2) rotated 90 enddef; f((xx+1)/.3,(yy-1)/.5,(xx,0));
'=(1000o3-4000(o1-o2)+4000o2+9,-.01o3+3ooo+
 [[oo=9/10(o2+o4+o5-20);o4=o5=8/9(o1+.5o2); o6=-.0001o2;showdependencies;
  numeric o[];xpart(alfa,[[pair alfa;0]])]])=-2/3[[save p;(p$,1-p$)]];
xoffset:=yoffset:=4000[[oo=.5ooo=2*-1/2(ooo+[[numeric ooo;1]]);oo]];
for @=angle(sqrt$,mlog$):charext:=uniformdeviate$;charht:=2048;granularity:=-8;
addto e3 contour (0,-100)..tension 500..(100,-99)..tension 3000..cycle;
tracingoutput:=@; shipout e3; special "bye"; interim char 99 = "c"; true=false;
[[clear(tracingcommands); charcode:=ASCII char 269-13; shipout+nullpicture;
"careful" quote for for = @ step 200 until 2*2600: &" METAFONT" endfor;]];
scrollmode; "hello again"&char31; save p; fillin:=-.043;
def f expr x=let )=]; let [=(; show _ enddef; begingroup tracingspecs:=1;
show nullpen, makepath.qq, makepath(q rotated1), makepath pencircle rotated $;
addto e0 doublepath (0,2){0,$}..{0,$}(0,1)..{1,0}(3,0)..(4,0){1,0}..cycle
 withpen makepen((0,0)..(5,2.9)..(4,3)..cycle); tracingonline:=1; f xx[1);
showdependencies; qq:=q; showstats; bye endtext
% things not tested:
% interaction (error insertion/deletion, interrupts, \pausing, files not there)
% date, time; initialization of random number generator without randomseed
% system-dependent parsing of file names, areas, extensions
% certain error messages, especially fatal ones
% things that can't happen in INIMF
% unusual cases of fixed-point arithmetic

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].