-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathhelp.ijs
More file actions
432 lines (427 loc) · 4.85 KB
/
help.ijs
File metadata and controls
432 lines (427 loc) · 4.85 KB
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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
coclass 'jqtide'
ContextHelp=: ,'j'
ContextTarget=: 'dict'
helpcontext=: 3 : 0
ContextTarget=: 'dict'
helpcontext_do y
)
helpcontext1=: 3 : 0
ContextTarget=: 'nuvoc'
helpcontext_do y
)
helpcontext_do=: 3 : 0
ndx=. 2 { I. ' ' = 40 {. y
'class bgn end'=. 0 ". ndx {. y
txt=. (ndx+1) }. y
if. end > bgn do.
sel=. (1+end-bgn) {. bgn }. txt
else.
sel=. helppos class;bgn;txt,LF
end.
if. 0=#sel do. '' return. end.
helpsel sel
)
helpndx=: 3 : 0
y=. ,y
if. 2 = 3!:0 y do.
if. 'goto_' -: 5{.y do. y=. 'goto_?'
elseif. 'for_' -: 4{.y do. y=. 'for_?'
elseif. 'label_' -: 6{.y do. y=. 'label_?'
end.
top=. <y
if. top e. DICT do.
>DICTX {~ DICT i.top
else.
''
end.
else.
''
end.
)
helpndx_nuvoc=: 3 : 0
top=. <,y
if. top e. DICTNV do.
>DICTNVX {~ DICTNV i.top
else.
''
end.
)
helppos=: 3 : 0
'class pos txt'=. y
txt=. ucp txt
txt=. txt {.~ pos + (pos }. txt) i. LF
ndx=. - (|. txt) i. LF
pos=. pos - ndx + #txt
txt=. ndx {. txt
if. '[-' -: }. 3 {. txt do.
if. helperror utf8 txt do. '' return. end.
end.
if. class=0 do.
at=. pos{txt,LF
as=. pos{LF,txt
if. *./ (at,as) e. ' ',LF do.
'' [ helpword utf8 txt return.
end.
end.
sep=. {.~ <./ @ (i.&('() ''',{.a.))
beg=. sep&.|. pos{.txt
bit=. beg,sep pos}.txt
if. 0=#bit-.' ' do.
txt=. ''
else.
wds=. ;:utf8 bit
len=. #&>}:wds
txt=. > wds {~ 0 i.~ (#beg)>:+/\len
end.
txt
)
helpsel=: 3 : 0
assert. 2=3!:0 y
s=. dlb@dtb y
if. 0=#s do. return. end.
if. 0=#ContextHelp do. return. end.
for_h. ,ContextHelp do.
select. h
case. 'j' do.
if. #ndx=. helpndx_nuvoc s do.
ndx return.
end.
end.
end.
''
)
helpword=: 3 : 0
r=. ;: :: 0: y
if. r -: 0 do.
smoutput LF,'word formation failed: ',dlb y
else.
smoutput r
smoutput ''
end.
)
htmlhelpbaselib=: 3 : 0
if. fexist f=. jpath '~.Main/', y do.
open f
else.
browse_j_ 'https://github.com/jsoftware/base9/tree/master/',y
end.
''
)
helperror=: 3 : 0
0 return.
)
j=. <;._2 (0 : 0)
= d000
=. d001
=: d001
< d010
<. d011
<: d012
> d020
>. d021
>: d022
_ d030
_. d031
_: d032
+ d100
+. d101
+: d102
* d110
*. d111
*: d112
- d120
-. d121
-: d122
% d130
%. d131
%: d132
^ d200
^. d201
^: d202n
$ d210
$. d211
$: d212
~ d220n
~. d221
~: d222
| d230
|. d231
|: d232
. d300
.. d301
.: d301
: d310n
:. d311
:: d312
, d320
,. d321
,: d322
; d330
;. d331
;: d332
# d400
#. d401
#: d402
! d410
!. d411
!: d412
/ d420
/. d421
/: d422
\ d430
\. d431
\: d432
[ d500
[: d502
] d500
{ d520
{. d521
{: d522
{:: d523
} d530n
}. d531
}: d532
" d600n
". d601
": d602
` d610
`: d612
@ d620
@. d621
@: d622
& d630n
&. d631
&: d632
&.: d631c
? d640
?. d640
__ d030
a. dadot
a: dadot
A. dacapdot
b. dbdotn
C. dccapdot
d. dddot
D. ddcapdot
D: ddcapco
e. dedot
E. decapdot
f. dfdot
H. dhcapdot
i. didot
i: dico
I. dicapdot
j. djdot
L. dlcapdot
L: dlcapco
M. dmcapdot
o. dodot
p. dpdot
p.. dpdotdot
p: dpco
q: dqco
r. drdot
s: dsco
S: dscapco
t. dtdotm
t: dtco
T. dtcapdot
u: duco
x: dxco
assert. cassert
break. cbreak
catch. ctry
do. ctrl
else. cif
elseif. cif
end. ctrl
label_? cgoto
case. csel
continue. ccont
fcase. csel
for. cfor
for_? cfor
goto_? cgoto
if. cif
return. cret
select. csel
throw. cthrow
try. ctry
while. cwhile
whilst. cwhile
0: dconsf
1: dconsf
2: dconsf
3: dconsf
4: dconsf
5: dconsf
6: dconsf
7: dconsf
8: dconsf
9: dconsf
_1: dconsf
_2: dconsf
_3: dconsf
_4: dconsf
_5: dconsf
_6: dconsf
_7: dconsf
_8: dconsf
_9: dconsf
)
n=. j i.&> ' '
DICT=: n {.each j
DICTX=: (n+1) }.each j
j=. <;._2 (0 : 0)
= eq
=. eqdot
=: eqco
< lt
<. ltdot
<: ltco
> gt
>. gtdot
>: gtco
_ under
_. underdot
_: underco
+ plus
+. plusdot
+: plusco
* star
*. stardot
*: starco
- minus
-. minusdot
-: minusco
% percent
%. percentdot
%: percentco
^ hat
^. hatdot
^: hatco
$ dollar
$. dollardot
$: dollarco
~ tilde
~. tildedot
~: tildeco
| bar
|. bardot
|: barco
. dot
.. dotdot
.: dotco
: co
:. codot
:: coco
, comma
,. commadot
,: commaco
; semi
;. semidot
;: semico
# number
#. numberdot
#: numberco
! bang
!. bangdot
!: bangco
/ slash
/. slashdot
/.. slashdot
/: slashco
\ bslash
\. bslashdot
\: bslashco
[ squarelf
[: squarelfco
] squarert
{ curlylf
{. curlylfdot
{: curlylfco
{:: curlylfcoco
{{ DirectDefinition
} curlyrt
}. curlyrtdot
}: curlyrtco
}} DirectDefinition
" quote
". quotedot
": quoteco
` grave
`: graveco
@ at
@. atdot
@: atco
& ampm
&. ampdot
&.: ampdotco
&: ampco
? query
?. querydot
0: zeroco
1: zeroco
2: zeroco
3: zeroco
4: zeroco
5: zeroco
6: zeroco
7: zeroco
8: zeroco
9: zeroco
_1: zeroco
_2: zeroco
_3: zeroco
_4: zeroco
_5: zeroco
_6: zeroco
_7: zeroco
_8: zeroco
_9: zeroco
a. adot
a: aco
A. acapdot
b. bdot
C. ccapdot
d. ddot
D. dcapdot
D: dcapco
e. edot
E. ecapdot
f. fdot
F. fcap
F.. fcap
F.: fcap
F: fcap
F:. fcap
F:: fcap
H. hcapdot
i. idot
i: ico
I. icapdot
j. jdot
L. lcapdot
L: lcapco
m. mdot
M. mcapdot
o. odot
p. pdot
p.. pdotdot
p: pco
q: qco
r. rdot
s: sco
S: scapco
t. tdot
t: tco
T. tcapdot
u. udot
u: uco
v. udot
x: xco
Z: zcapco
)
n=. j i.&> ' '
DICTNV=: n {.each j
DICTNVX=: (n+1) }.each j