Skip to content

Commit bd3d018

Browse files
committed
Requires now 18.0 and comes as a Tatin package
1 parent 04ea4dc commit bd3d018

15 files changed

+229
-19
lines changed

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
.acre
1+
.acre/
2+
aplcore
23
Dist/
3-
Development.dws
4+
change_history/
5+
.gitignore

APLSource/EventCodes.aplc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@
6262

6363
∇ r←Version
6464
:Access Public Shared
65-
r←({⍵}⍕⎕THIS)'2.0.0.15' '2020-03-22'
65+
r←({⍵}⍕⎕THIS)'3.0.0.16' '2020-09-21'
6666
6767

6868
∇ History
6969
:Access Public Shared
70-
⍝ * 2.0.0
71-
⍝ * BREAKING CHANGE: File extension changed from .DYALOG to .APLC
70+
⍝ * 3.0.0
71+
⍝ * BREAKING CHANGES:
72+
⍝ * Requires now Dyalog 18.0 or better
73+
⍝ * Is delivered as a Tatin package
7274
⍝\\
7375
⍝ For information regarding older versions see <https://github.com/aplteam/EventCodes/releases>
7476

APLSource/Initialize.aplf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{r}←Initialize;⎕TRAP
2+
⎕TRAP←0 'S'
3+
r←⍬
4+
{}⎕SE.UCMD'cd ',AcreConfig.ProjectFolder
5+
⎕SE.aplteam.InitializeAPLTreeProject ⎕THIS
6+
⍝Done

APLSource/TestCases/Prepare.aplf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
Prepare
2+
⎕IO←1 ⋄ ⎕ML←1
23
T←⎕NEW ##.Tester2 ⎕THIS
4+
T.codeCoverage←⎕NEW ##.CodeCoverage(,⊂'#.',{⍵,'.',⍵}2↓⍕⎕THIS.##)
5+
T.codeCoverage.filename←(⊃1 ⎕NPARTS''),'TestResults/CodeCoverage'
6+
⍝Done

APLSource/TestCases/RunTests.aplf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
RunTests;dcfFilename;htmlFilename;tno
2+
Prepare
3+
dcfFilename←(⊃,/¯1↓⎕NPARTS T.codeCoverage.filename),'.dcf'
4+
:If ##.FilesAndDirs.IsFile dcfFilename
5+
:AndIf ∆YesOrNo'CodeCovarge data file already exists; override?'
6+
tno←dcfFilename ⎕FTIE 0
7+
dcfFilename ⎕FERASE tno
8+
:EndIf
9+
T.Run 1
10+
htmlFilename←##.CodeCoverage.ProcessDataAndCreateReport T.codeCoverage.filename
11+
##.APLTreeUtils2.GoToWebPage'file://',htmlFilename
12+
⍝Done

APLSource/TestCases/Test_30.aplf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
list←⌽GetInstalledAPLs ⍬
77
:Repeat
8-
version←3⊃' '##.APLTreeUtils.Split⊃list
8+
version←3⊃' '##.APLTreeUtils2.Split⊃list
99
:If 0=≢errors←∆GetErrorsFromHelpPage'http://help.dyalog.com/',version,'/Content/Language/System%20Functions/trap.htm'
1010
list←1↓list
1111
:EndIf

APLSource/TestCases/Test_ZZZ_998.aplf

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
R←Test_ZZZ_998(stopFlag batchFlag);⎕IO;⎕ML;⎕TRAP;report;buff;xml;source
22
⍝ Checks on two text vectors: "⍝TODO⍝" and "⍝CHECK⍝"; never fails, just reports.
3-
⎕IO←0 ⋄ ⎕ML←3
43
⎕TRAP←(999 'C' '. ⍝ Deliberate error')(0 'N')
54
R←T._OK
65
report←''
76

8-
xml←⎕XML'flat'##.APLTreeUtils.ReadUtf8File'publish.config'
9-
source←2⊃xml[xml[;1]⍳⊂'container';]
7+
xml←⎕XML⊃⎕NGET'publish.config'
8+
source←3⊃xml[xml[;2]⍳⊂'container';]
109
buff←T.FindSpecialString'⍝CHECK⍝'
11-
buff←(buff[;0]≢¨⎕XSI[0])⌿buff ⍝ remove caller
12-
:If ~0∊⍴buff
10+
buff←(buff[;1]≢¨⎕XSI[1])⌿buff ⍝ remove caller
11+
:If 0≠≢buff
1312
report,←↓(⊂' ⍝CHECK⍝ found:'),(⊂' '),¨buff
1413
:EndIf
1514
buff←T.FindSpecialString'⍝TODO⍝'
16-
buff←(buff[;0]≢¨⎕XSI[0])⌿buff ⍝ remove caller
17-
:If ~0∊⍴buff
15+
buff←(buff[;1]≢¨⎕XSI[1])⌿buff ⍝ remove caller
16+
:If 0≠≢buff
1817
report,←↓(⊂' ⍝TODO⍝ found:'),(⊂' '),¨buff
1918
:EndIf
20-
:If 1=⍴,report
19+
:If 1=report
2120
report,←⊂' Nothing found!'
2221
:Else
2322
⎕←'Checking for ⍝TODO⍝ and ⍝CHECK⍝ '{⍵↑,'--- ',⍺,' ',⍵⍴'-'}80⌊⎕PW-1

APLSource/TestCases/Test_ZZZ_999.aplf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
f1∨←~∧/⎕D∊⍨d~'-'
1818

1919
⍝ publish.config must be in line with what "Version" returns of course:
20-
xml←⎕XML'flat'##.APLTreeUtils.ReadUtf8File'publish.config'
20+
xml←⎕XML⊃⎕NGET'publish.config'
2121
f2←v≢(2+⎕IO)⊃xml[xml[;1+⎕IO]⍳⊂'version';]
2222
f2∨←d≢(2+⎕IO)⊃xml[xml[;1+⎕IO]⍳⊂'date';]
2323

APLSource/TestCases/∆YesOrNo.aplf

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
yesOrNo←{default}∆YesOrNo question;isOkay;answer;add;dtb;answer2
2+
⍝ Ask a simple question and allows just "Yes" or "No" as answers.
3+
⍝ You may specify a default via the optional left argument which when specified
4+
⍝ rules what happens when the user just presses <enter>.
5+
⍝ `default` must be either 1 (yes) or 0 (no).
6+
⍝ Note that this function does not work as expected when traced!
7+
isOkay←0
8+
default←{0<⎕NC ⍵:⍎⍵ ⋄ ''}'default'
9+
isOkay←0
10+
:If ~0∊⍴default
11+
'Left argument must be a scalar'⎕SIGNAL 11/⍨1≠⍴,default
12+
:AndIf ~default∊0 1
13+
'The left argument. if specified, must be a Boolean or empty'⎕SIGNAL 11
14+
:EndIf
15+
:If 0=≢default
16+
add←' (y/n) '
17+
:Else
18+
:If default
19+
add←' (Y/n) '
20+
:Else
21+
add←' (y/N) '
22+
:EndIf
23+
:EndIf
24+
:If 1<≡question
25+
((⍴question)⊃question)←((⍴question)⊃question),add
26+
question←⍪question
27+
:Else
28+
question←question,add
29+
:EndIf
30+
:Repeat
31+
⍞←question
32+
answer←⍞
33+
:If answer≡question ⍝ Did... (since version 18.0 trailing blanks are not removed anynmore)
34+
:OrIf (≢answer)=¯1+≢question ⍝ ..the ...
35+
:OrIf 0=≢answer ⍝ ...user just...
36+
dtb←{⍵↓⍨-+/∧\' '=⌽⍵}
37+
answer2←dtb answer
38+
:OrIf answer2≡((-≢answer2)↑(⎕UCS 10){~⍺∊⍵:⍵ ⋄ ' ',dtb ⍺{⌽⍵↑⍨1+⍵⍳⍺}⌽⍵}question) ⍝ ...press <enter>?
39+
:If 0≠≢default
40+
yesOrNo←default
41+
isOkay←1
42+
:EndIf
43+
:Else
44+
answer←¯1↑{⍵↓⍨-+/∧\' '=⌽⍵}answer
45+
:If answer∊'YyNn'
46+
isOkay←1
47+
yesOrNo←answer∊'Yy'
48+
:EndIf
49+
:EndIf
50+
:Until isOkay
51+
⍝Done

Make/Make.bat

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)