1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
|
# Comiler simplified once
# Full compiler minus error checking and index tracking
# Syntax simplified to avoid _ Β· βΏ ' πππ½πΎπ and double quote in comment
# Already didn't have . [] :;? β π£π€π
# Blocks are functions; no empty list literals; no useless parentheses
naβΒ―1ββ’alphβ("aA"+ββ26)βΎΛ"Γ Γ"+β(β23)βΎ24+β7
lfβ@+β¨10,13β©
β¨charSet,cglβ©β(βΎ β β Β¨)β¨
"+-ΓΓ·ββββ|Β¬β§β¨<>β =β€β₯β‘β’β£β’β₯βΎβββββ«»β½β/ββββββββ·β!" # Function
mod1β"ΛΛΛΒ¨ββΌΒ΄Λ`" # 1-modifier
"βββΈββΎββΆββββ" # 2-modifier
"β,"βΎlf # Separator
":;?" # Header punctuation
"βββ©" # Gets
"(){}β¨β©[]" # Bracket
"βΏ" # Ligature
"Β·" # nOthing
"ππππ½πΎπ€π©π¨π£ππ" # Input
".Β―Οβ" # Numeric
(β"0")+β10 # Digit
"_"βΎΛβ₯alph # Alphabetic
"β’ "βΎ@+9 # Whitespace
β¨cc,qs,qd,ncβ©β"#'""@" # Preprocessed characters
β©
β¨bF,b1,b2,bS,bH,bG,bB,bL,bO,bX,bN,bD,bA,bW,bPβ©ββΒ¨Λβ(0Β»+`)cgl
Mβ1βΈβ(0βΈβ€β§>)-ββ # β for an init,length pair π© as above
sepββbS
predβ2+βbH
bIβbX+ββ-5βbRβ8+βbX
# Convert characters to numbers, mostly the same as tokens
cgfβ(cgrββcharSet)βcharSet
CharCodeβcgrβΛ1-Λ1βcgfββ’
swapundoβCharCodeββmod1βΈ/"ΛβΌ"
vdβ1+viββbN # Start of identifier numbering (plus dot)
charRoleβ4βΎΛβΎβ₯Β¨Λβ(β βcglΛ)β¨1,2,3,Β―1,Β―1,Β―3,β¨Β―1,0β©,Β―2,0,Β¬/β¨5,6β©β© # For first vd chars
Tββ`Γ β ITββββ βΈT β I1Tβ(1+βββ )βΈT
PNβ1(βΎ/βΎΛ)(β¨/β£) # Partitioned-none: partitions where π¨<π© is never 1
# Source to β¨tokens, roles, number of identifiers, literalsβ©
# Identifiers then literal tokens are numbered starting at vi
Tokenizeβ{β¨System,varsβ©βπ¨
# Resolve comments and strings
cβπ©=ccβsβ/β¨0,0β©βΈΒ«βΈβ§smβπ©=qsβdβ/dmβπ©=qd
gββqββΎβ¨ sβΒ―1βdβ/cβ© βqβ©gβq # Open indices
eβ gββΎβ¨2+sβ 1βdβ-βΒ»βββ(0βΎ+`c)βΈ//(π©βlf)βΎ1β© # Matching close indices
Seββ (>/β’)βΎββ {(βΛπ¨)πβ(β β(Β―1βΈβ))π©βΎπ©βπ¨}β¨0β©Λ # Find reachable openings
Stβ(β π©)β(/βΌ(Se qβe)βΈβ) # All indices β reached mask
aβSt qβbβSt eβfβ1β `abβaβ¨b # Open/close masks; filter
# Extract character and string literals
uβfβ§π©=ncβciβ/uβ¨Β»aβ§sm
chrβ(ββπ©-(nc-@)Γββu)ci # Characters (indices ci)
f>β©qeβdmβ§Β«aβ§β©dm # Quote Escape
strβπ©βΛ1-Λ(siβa>Β»qe)(β£+`βΈΓβ(βΎβ1)<)β `dmβ§ab # Strings (indices /si)
# Extract words: identifiers and numbers
tβCharCode f/π©
ndβ(t=βbN)>Β«t M bDβrrβt=bR # Namespace dot; π£
wβΒ»βΈ<lβrrβ¨nd<t M bN(β£β-Λ)ββbW # Word chars l, start w
usβt=Β―1++Β΄bAβsyβt=βbW # Underscore, system dot
wkβ(Β¬w/rr)ΓnaββΓ·Λ(βbA)-Λw/t # Kind of word from first char
t-β©naΓlβ§tβ₯na+βbA # Case-insensitive
wβ β©Β»βΈβ¨sy # Start system word at dot
wiβ0<wtβ(2Γwkβ₯0)(ΓβΒ¬+β’)w/sy # Type: 0 number, 1 system, 2 identifier
iβl>nβlβ§(+`w)β0βΎΒ¬wi # Identifier/Number masks
numβReadNumsβ(((0βΎus)<β¨βΒ«0βΎn)/0βΈβΎ) tΓl # Numbers
irβ(us/ΛΒ«βΈ<i)(β’+β§β(2βΈ=))wi/wk # Identifier role
ifβ(Β»β`)βΈ<igβ(i>us)Γ+`w>n # Identifier groups and first character
frβ(1=wi/wt)<if/rr # Identifier is π£-based
wβ©ifβ¨nβ§wβwsβ1=0βΈ<βΈ/wt/Λβ©Β¬w/rr # Don't produce an identifier for π£
igββ©1-Λ0βΎ+`βΈΓΒ¬fr
idβvarsβΈβΎβΎβ(wsβΎ2)βigβtβcharSet # β¨Identifiers, system valuesβ©
# Deduplicate literals and identifiers; other cleanup
kiβ(wtββΈβ/w>rr)βΎ(ciβΎ/si)β+`Β»f # Indices in t
kβidβΎβ¨num,chr,strβ©βk(β’>Β―1Β»β`)βΈ/Β¨Λβ©jββΒ¨k # IDs j into uniques k
kβ©SystemβΎ(1βΈβ)k # System value lookup
wfβΒ¬lβ¨t M bW # Index management for...
tβ©(wβ¨wf)/(varsβ βΈββΎj++`vdΒ»kkββ Β¨k)βΎ(kiβΈβ)t # Add IDs; remove words/whitespace
t-β©t(MΓ-ββ)bS # Separators are equivalent
pββ `1Β¨sbβΒ―1β1β/1(βΎβ βΎΛ)t=sep # Separator group boundaries (excludes leading and trailing)
ebββ¨3,5,7β©+βbB # End brackets that allow separators
skβsb/Λp>β¨βΒ«(MβbHβ¨ebβΛpβΈ+)(sb-p)βt # Keep the first of each group that's not just inside a bracket
t/Λβ©1Β¨βΎ(skβΈβ)tβ sep # Remove the rest
imβ(t=bR)β¨t M vdβ+Β΄2βkk # Identifier (or π£) mask
rβirβΎ(imβΈ/)(vdβt)βcharRoleβΎ0 # Role
t+β©(βbX)((β’Mββ5)Γ5+3βΈ+βΈβ€)t # Case-insensitive special names
t-β©vi(<+10Γ=)t # Shift . to bX and variables back one
β¨t,r,kβ©
}
# π© is a list of tokens that contains the numeric literals, each
# preceded by 0. Return the numbers.
ReadNumsβ{
β¨e,d,n,p,iβ©β=βπ©Β¨((βbA)+-Β΄"ea")βΎ+ββΒ΄bN # Masks for e.Β―Οβ
cβeβ¨zβ0=π©βmβΒ¬nβ¨c
fβ(17β₯Β¬(β’-T)+`)βΈβ§gβ(Β«β€(d<π©β βbD)>βI1TΒ¬)βΈβ§m # No leading 0s; max 17 digits
lβ(Β―1βΎβ¨Ο,1β©βΎβ10)βΛ(Β¬d)/fΓπ©-1+βbN # Digit lookup, with β as 1 to avoid βΓ0
vβ(>βΒ«0β€l)/0(0βΈβ€ΓΓβ10βΈ+)`l # Numeric valuesβmantissas and exponents
vΓβ©β¨1,Β―1β©βΛ(rβ>βΒ»m)/Β»n # Negate if Β―
vmβc/z # Mask of mantissas in l
dpβvm/f(--Β»βΈ-(<Γβ’)ββ(I1TΒ«d)βΈ-)β(/>βΒ«)g # Decimal position
tβ10β|eeβdp-Λvm/Β«vΓΒ¬vm # Power of 10
tΓ·ΛβΎ((0>ee)βΈ/)tΓβΎ((0<ee)βΈ/)vm/vΓ(r/i)β1ββ # Correct β then Γ10βee
}
Parse β {β¨r,vn,defβ©βπ¨βnvββ vn
# Bracket and ligature validation and handling
# Open brackets have role Β―1 and closed ones have role 0
gββ+`pβ(Β―1-2Γr)Γπ© M bB # Paren (actually any bracket type) depth and grade
dlβΒ«βΈβ¨dcβr=4 # Dot left
r-β©(π©=βbG)>Β«dc<0β€r+p # Role Β―4 for exports: βbG is β
srβΒ»βΎ(((βββdl)βΈβg)βΈβ)slβΒ«βΈβ¨r=Β―2βnsβΒ¬slβ¨sr # Strand right and left; not stranded
cpβπ©=1+βbB # Closed paren
nrβ(ITΒ¬cp)β(π©=2+βbI)+2Γπ©=βbO # Nothingness role: 1 for π¨, 2 for Β·
nxβ0
gβΛβ©βgβsdlβslβ¨dl # Avoid reordering strands and dots in rev
rpββ βΈΒ»βΎ(gβΈβ)ββ r # Position of previous, for roles
# Permutation to reverse each expression: *more* complicated than it looks
revββ+`Β―1β(Β―1βΎg)(β£ββΈββΛββΒ¬βΛ)β+`βΈ+1βΎgβsdlβ¨r=Β―1
gfββfdβ+`brβrevβpΓπ©Mβ¨2+βbB,2β© # Order by brace depth fd to de-nest blocks
revβΛβ©gfβfdβΛβ©gfβbrβΛβ©gf
π©βΛβ©revβdcβΛβ©rev
# Compute parsing ordering grβ‘gβrev
BEβ=β¨+β2βΈ= # Bracket equals: match β¨[ or β©] given β¨ or β© only
gβ©β+`pβ©br-Λrevβpβbpβ0(<ββ(/βg)>)gβp # Order by non-brace bracket depth
gβΛβ©βgβΒ«βΈβ¨dcβgrβgβrev # Now by dots
sllβ1+2Γ·Λ0(<-β/>)grβsr-slβlβ/gβπ©BEΛ5+βbB # Strand length; list starts
bβbr>0βcβ/br<0βbpβΎΒ¨β©β¨/b,cβ© # Block Begin (mask) and Close (index), in matching order
gβΛβ©gsββgrβslβgrβ©gβrevβgiββg # Send strand prefixes *βΏ to the end
# Headers
hhβπ©=βbHβcsβπ©=1+βbH # Case header : and separator ;
fiβ+`cbβbβ¨csβHβcbΒ¬βPNβ’ # Body index fi; which bodies Have a property
cqβ(Hπ©=pred)β¨chβH hh # ch: body has : header ; cq: or ? predicate
cfβ1βΎΒ¬coβcb/csβcmβ0βΎβ¨βΒ«co # cf: body is first; cm: body is one of multiple
ccβ(ββΒ«co)βcβΎ/cs # Case close
hiβ/hfβhhβΛβITβΎ((β½g)βΈβ)cbβ¨hh # Header component indices
unβ0=usβswapundo(β ββ£-β)hiβπ©
utβun/Β»usβhi/Λβ©0=us # Undo type: 0 normal, 1 βΌ, 2 ΛβΌ
hrβ(ββnsΓββr)revβΛhi # Header component roles
hlβ2=hnβ(1βΈΒ»+Β«)hcβΒ―1=hr # hl: is label, hc: is :
hoβ(Β»β¨(Β«(hr=3)β§β’))hl<2β€hr # Header operands
hmβΒ¬hoβ¨haβho<(0=hr)β§1=hn # Mask for main name; header arguments
hkβ3|1-Λ(+`bIβΎnv)βhiβπ©ΓΒ¬revβsr # Kind: 0 special, 1 name, 2 compound
hmaβhm>hlaβhlβ§(0=hr)β§1β hkβhr+β©hlaβhl>β©hla # Lone non-name subject is π© with π omitted
hvβ(hla+haΓ1+Β«hc)+(hoΓ4+Β«3=hr)+hmaΓ3Γ1-Λ2βhr # Special name for position
hkΓβ©Β¬hcβ¨hlβ§0=hr # Treat subject labels like special names
hm>β©hcβhr/Λβ©hmβhxβ(1Β»hc)/ha # Header-derived role hr and immediacy Β¬hx
ut-β©-βΒ»utΓho # Shift βΌ from right operand to main name
ut/Λβ©hmβhxβ¨β©1=hr
cwhβhc/Β»hlβhaΓ1+heβ0β hk # Body π¨ for just headers
ut2β2=ut
cwβ(cwhβ2Γut2)βΎ(chβΈ/)1+-βΒ«(Β»cq)<1(β’<Β«)cf # Body π¨: 0 no, 1 allowed, 2 required
hl/Λβ©hmβhuβ(Β¬he)βΎ(hiβΈβ)hf # hu: mask of header special names
hjβgiβΛhe/hiβhdβ2=he/hk # hj: header assignments; hd: which ones destructure
# Block properties
ssββ¨0,3,5,6β©β(β’+(0<hk)ΓhvβΈ-)βΎ(hiβΈβ)π©-βbI # Special name
ss+β©(revβr=3)β§π©=3+βbI # Treat _π£_ as 3, like π
HSβ(Β―1+`cf)βbΒ¬βPN=βssβspβ/hu<π© M bI # Has-special (π€π©π¨/π£π/π); indices of specials
fxβHS 1βfrβ(fxβ¨0βΈ<)βΈ+ftβ2(β£β2Γβ’)βHS 3 # Body immediacy Β¬fx, type ft, role fr
ftββ©1-Λfrβ©hrβΎ(chβΈ/)frβfxβ©hxβΈββΎ(chβΈ/)fx
fscβ(ftββ¨0,2,3β©)+3Γfx # Special name count
hv-β©(Β»+`hc)β3ΓΒ¬ch/fx # Header variable slot
# Propagate roles through parentheses
# ir is the role of the expression ending at each position (truncated to the right)
rβ©sl-ΛnsΓ(1βcf/fr)βΎ((cβrev)βΈβ)r # Add block roles; make strand elements Β―1
ptβcpβ§ns # Pass-through parentheses: not in strands
ppβptβ§Β»esβrpβ1βΎΛr<0 # Parens enclosing one object (maybe with assignment) don't change roles
irβ((rpβ0βΎΛ(1+es)Γ3=β’)ββ’-es<2β€β’)r+ppΓ(ITΒ¬pp)βr # Propagate modifier roles
irββ©(ITΒ¬ptβ§ir=0)((β-β’)β(+`Β¬pp)(β’β1β+)β)ir # ...and function roles
r+β©ptΓΒ»ir # Roles at pt were 0; set them now
nrΓβ©Β¬nxβ¨β©(0β ir)β§1=nr # Assume π can't be Nothing
irβ©(irΓ0=nr)-nr # Include nothingness
r-β©(r=Β―4)β§1Β»r=Β―1 # Lone β to role Β―5
r(ΓβΒ¬-β’)β©dl # Namespace and dot to Β―1
# Reorder for parsing
xvβπ©-vi # Save for lexical resolution
π©βΛβ©gβhgβgβhfβrβΛβ©grβnsβΛβ©grβirβΛβ©gr
lβ©(l0βlββgs)βΎ/grβsr>sl # Indices of list literals
lmβ(0Β¨sll)βΎΛ(5+βbB)-Λl0βπ© # List merge, adding 2 for []
# Parsing part 1
aβ(Β―5βΈ<β§β€βΒ―3)rβpsβa<r<0 # a: assignment, ps: part separator
trβ1β€erβirβΛITΒ»ps # er: expression role; tr: train or modifier expression
noβ0β-irβneβ0β-erβnxβΛβ©gr # Nothing value; expression
nxββ©neΓa
nxββ©neΓπ©=pred
oaββ½/hg<opβ(er<2)β§rβ₯2βroβopβ¨Β«opβ§m2βr=3 # op: active modifiers; ro: mod or right operand
nxββ©opΓ2(Β«βm2ΓΒ»)noβ2Γm2β₯roβ¨rββ2
sβπ©=sepβfoβπ©ββ¨2+βbB,1+βbHβ© # Separators, function open { or ;
lsβsβ§fo<βIT loβπ©BEΛ4+βbB # List Separators: after β¨lo, not {fo
mmβπ©=2+βbGβmaβtr<mmβ§Β«irβ₯1βmmβ§β©1Β»ps # Modified assignment; monadic modified
osββββ βΈ(β£-T)βΎβ½Β¬roβ¨ma # Operator skip: distance rightward to derived function start
atβ1+ββosβΈ+aiβ/a # Assignment target
afβΒ―4β aiβrβarβatβr # af for actual (non-export) assignment; assignment role
akβaf+(0β€ar)+(aiβma)+(βbG)-Λaiβπ© # Class of assignment: 1β 2β? 3β? 4β©? 5+β©?
atβΎβ©hjβacβΒ«βΈ-(akβΎ6Β¨hj)βΎ(atβΈβ)0Β¨π© # Header assignment is 6 temporarily
aaβ0<gacβgβacβ©Β»+`(1βΈΒ»βΈβ¨0=+`)βΈΓgiβac # Broadcast ac to the entire target
apiβ/(π©=βbO)β§apβaaβ§2=no # Assignment placeholder
nxββ©noΓap<nsβ€Β»loβ¨ls
ac-β©3Γ6=acβahβ6=gac # Assignment is header; 6β3
nxββ©aaΓ1=no # Prevent assignment to π¨ if it's Β·
nfβH ac<xv=vi-ΛβbG # Namespace bodies
fwβH giβnx # Bodies where π¨ must be defined
fwββ©nfΒ¬βΈΓ(1-Λ0βΎccβrev)βnr
fwβ₯βI1Tβ©cf # If a body fails on π¨, later ones won't see π¨
cwββ©2ΓfwβcwΓβ©fx
nnβgβfiβ2=cwβno(β£-=)β©nnβne(β£-=)β©nn # 2=cw indicates π¨ is never Nothing
hqβ/ahβ§π©β₯nv+vi # Header constant
af>β©almβaiβaaβalβalm/ai # aliases al
ai/Λβ©afβat/Λβ©afβΎ1Β¨hj
# Lexical resolution (independent of parsing part 2 below)
diβ/dmβΒ»dc # Dots aren't scoped
idβ/(huβ¨dmβ¨giβΒ«aaβ§a)<(0βΈβ€β§<βnv)xv # Identifier indices in xv
saβ0<spβacβdβ(icβidβac)Mβ¨2,2β© # Which accesses are definitions
idfβidβfiβidvβidβxv # Function index and name ID
dpβdβ§(0=idf)β§idv<β def # Definitions of vars in def
dpfβ(dp/idv)βdef
dβ©(0β€dpf)βΎ(dpβΈ/)dβzdaβ0Β¨daβ/defβ€0 # Turn def Β―1 β into β©
dnβ(dgβzdaβΎ(dfβd/idf)βΎβ fsc)βdaβΎdvβd/idv # Identifier name ID, per-block
# Order every referenced identifier, and an undeclaration for each declaration
ixfβ((1=ic)+idfβΒ―1βΎcb/gf)βΎdfβ(β π©)βΎ1-Λccβgf# First order by block index, open for real and closed for virtual
igβ(βββ(idvβΎdv))βΈββixf # Then order by name
igβ©<β(β d)βΈ/(βdsβ+`igβdβΎΒ―1Β¨dv)βig # Last order by declaration depth
dβΛβ©igβidβΛβ©igβicβΛβ©ig
duβ+´¬»βΈβ¨0<dsβuvβ(duβig)βidv # Number undefined (always sorted to front)
ixβ(ic<3)β§iaβ0<ic # Which are exports, assignments
iddβ(β’-(uvβdedβ-0βdef)βΎ(duβIT d)βΈβ)idβfd # Identifier frame depth
dxβdgβzdaβΎ(digββd/ig)βixaβd(/β₯1βPN)ix # Exported identifier mask
idiβ(uvβΈββΎ(Β―1+`duβd)βdigββΈβdaβ βΈββ’)(ββfsc+β)dedβΎdf # Slot within frame
uuβ(ia<1Β«d)β§d(β£+`βΈβ(1βΎixa)<PN)0<idd # Unused marker
spiβ((spfβspβfi)β3Γfx)+3+spβxv # Special name index
uuβΎβ©ββΎβ½spi+6Γspf # and unused marker
idorββΎβ¨3,2,3β©/β¨1+gβΛhj-1, di, idβΎspβ© # Identifier bytecode ordering
idoβ32+uu(β’+2Γ>)iaβΎsa # Opcode
idocββ¨32Β¨hj,0Β¨hj,he/hv
64Β¨di,diβxv, ido,iddβΎ0Β¨sp,idiβΎspiβ© # Identifier bytecode: instruction, depth, slot
# Parsing part 2
taβtrβ§2(>β¨|)ps(β’-T)+`Β¬ro # Train argument (first-level)
faβ/(hgβ¨taβ¨roβ¨Β«βΈβ¨ps<aa)<(r=1)β¨Β»op # Active functions: cases fe are excluded
dyβ2β nyβfaβ2Β«noβ2ΓΒ¬(trβ§rβ₯0)β¨ro<r=0 # Dyadic
obβprβ/Β―1(β’-Β»)uββ·β§prβπ©βΛpiβ/hg<π©<sep # Objects to be loaded
cnβpiβΎltβ/π©β₯clβvi+nvβobβΎβ©(cl-Λβ u)+ltβπ© # Constants
bkβcβgi # Block loads
llβsllβΎΛ(Β¬lo/1Β«ps)+-βΒ»1β(loβΎ1)/+`lsβΎ0 # List Length
drβ(hdΒ¬βΈ/hj)βΎ/s>(2=ne)β¨lsβ¨Β»r=Β―5βrtβ/fo # Drop (block separator) and return
qpβ/π©=pred # Predicate
flβ(dyΓββos)βΈ+fa+dy # Function application site
drβΎβ©((1+dy)Γfnβ2=fmβfaβne)/fl # Turn function applications on Β· to drops
fnβ©Β¬fnβfa/Λβ©fnβfl/Λβ©fn # And remove them
# Object code generation: numbers oc ordered by source location (after rev) oi
aoβ48+(0β(1+βbG)-Λaiβπ©+ma+mm)βΎ-hd # Assignment opcode
orββidorβΎgβΛβΎβ¨cn,cn,bk,bk,hq,api,2/l,at,dr,qp,al+1,al+1,oa+1βoaβos,fl,rtβ©
ocβorββΎidocβΎβ¨0Β¨cn,ob,1Β¨bk,1+ββ bk,43Β¨hq,44Β¨api,β₯β(11+lm+lβaa)βll,ao,6Β¨dr,42Β¨qp,66Β¨al,vi-Λ(al-1)βπ©
24+oaβr,16+(fn/dy+2Γfmβ1=ny)+4Γ0<faβer,Β―1βrcβ7+nfβ©
# Indices for multi-body blocks
cmβ¨β©(fxβ§1β cw)β¨0<utβ©utβΎ(chβΈ/)ch # Dyad- and inverse-only generate as multiple
cjβ/cvβ1+1=ciwβcwβΛciβ/cm # Number of copies
ckβ4β(2Γciβut)+1<ciw # Position
cgβΒ―1+`cifβciβcf # Which block
cktβ(2-Β¬(cfβ§cm)/fx)β(cif/ββββcg)βΈββββΈβcv+ck
ciβ©ckt/βΈβ(Β―1(ββΎΛcj(βββ£+β)ck+cgββ)0βΎ+`ckt)βcjβci
# Output
fzββ¨cf/ft,cf/Β¬fx,ciβΎ((cf/cm)βΈ/)/cfβ© # Per-function data
czββ¨/1βΎorβ₯oc-ββ rt,fsc+β Β¨dn,dn,dxβ© # Per-body data
β¨ocβΎΒ―1βrc,u,fz,czβ© # Overall output
}
Compileβ{
defaultsββ¨β0,(!β"System values not supported"Β¨),β0,β0β©
β¨prims,Sys,vars,redefβ© β βΎβ(β βdefaultsΛ) ββ(4<β )π¨
β¨tok,role,valβ©ββ¨sys,varsβ© Tokenize π©
β¨oc,prim,blk,bdyβ©ββ¨role,βval,redefΒ»0Β¨varsβ© Parse tok
β¨oc, βΎβ¨primβprimsβ©βΎ1βval, <Λβ>blk, <Λβ>bdyβ©
}
|