h(b0:o(1<(<(xy;(й=(`q<(x;(;(;(13:P0-(;(0;(H>("'021    h=(<()>(8;(8;(;(<(% >('<(&(0>(;(<(<(<(h<(ȯ<()>(P<(]C(\C(]C(|C(Ud( !"k(#$% ol(&'()*+,-./0n(1HBm(20Bm(3Bm(4Am(xd((e(e(șd(3e(j(j(0Hd(d(Cd(d(d()d(j(Ae(htu nV' 0*+byh(red? no label branchge(((: label never used)W((ag? branch never taken(((e( branch always takeno(( x line never executed( (xLegend:=pnc v W9EndWhile1:( While1 0 Fn1Fn91:vaLu vauCRs1CRs  2(cccc<''r( 8 rr,' ',(ne((1n),1)n),' ',f(8@Xf('p[q]li5'fmt1F),F add line nosvalu@@plerner,' ?'[0,1labbi] all labels should be usedalidH8P7(rr,' '[nunu] always taken (line used, next NOT used)ames (WX885 bi1,1n>1n branch in4L(8(96'E'@HH( following are (some "controlled") branches99,@fre 'x'@8T(r((r),1)r' x'[nu] lines not executedcoun@Htyennu1nun=0 not used & next not used0vaLuHH(nnen only deal with non empty linesHLuaveCr8>(fF0 4f already left justified (8(83 brne/f[;2]='' 82,W9((k[o labne/f[;1]=':' amesp(().Ol10:nef[;0]'' NOT re(@ne'monitoring off'=ɫn(MF ons,>''Fn)[;2]@9( n0s(((Fn,><'CR)'nt we8@intFn1ա>(f=' ')1''CRs n the (onsio0CCh( X(livel10(" 0(While1:(0N>N>N>U+ +  p0 objects deleted0P : , OQP(hO(h8RT,UP(h, iP(8(;CRlf-(( (h , '(Pow3 2 syntax errorMyFn[5] :if 2=2 ^ P     bo1,1n>1neo 'CR( @ ((h  P (=(h" , ,(h, 3+ ,F(hc@ &P BU( 8 ((h ", ""(h, OQ/P8(MyFnBU( fx 0 4lfig(0X ((h , , "<(<(0(origS(0&Dp(MyFnCR( ),(* some branches followed by labels in < HP 9 (h (h >OQ/P (h, pP0  (h ",+ (<0@ .  'OQP (h ,  e.@P @    'OQP,  +(h, .P(ح ((h(h .(0  (h , "P00  + OQP B(08 ( " "(h,OQ/P3  '8P ; (h , ,(h ,,  e  ' Ph S (h  OQ\P(h 0 OQ\P(h H OQ\P(h ` OQ\P;,  h0t  (h , + 00 ( P,(h , d0(   (h, P(P 1(h# (h, , (h$,(h8q P0   ', ,  0 &@ (is A   ' (P 9  "OQ/P OQ/P(h ,  PP 2 + "   "e, F F,  P( ( , , (0  ,3 , 0h S(h$8(h(h" ,   (h, 3 , OQ\P  h0 (h" , ",   0@Te t/ OQP (h, 3(h,  @8 % (h!, ", ,    88: (  ) ",  (@ , (h! >OQP) ", ' @@ , (h! >OQP) ", P@@ , 'OQP)(h" , , ", @  <(*<(`<(:.<(8 ( < VT N>N> 8(mm n(h"( > '((%(h V 1 < DVT N>N>)(h >, ", (h  Ah0 (h#x(h  <08:<((p =(0$> contains diamonds<08 % "< <, DF ,0 8h<(8P 8(h  (h >OQ/P(h%H<, D*_PP (: 2(h(h& , ", F, (h =(P  nd 8 0 *** ":end" on line 0(  , "(0  /  ,3 0 ȕ=( ( (h% , (@!!$>improperly formatted function: < @X1 G 5(h 5 , "   (h, 3 F 'X0  , '  "0 h :end Pnb w@ 5(h,, (h , "(h ",OQ/PF 5P8 (&(h&0 ' ' (h, 8p(  5(h, (  21NS (  0(h&" (8ne t!(h (h& ,  8urn( t exe ( @fix ;pSh(86h(]h(h(Sh(h(0Uh(h(Th(h(H^h(h(`Xh(h(C( Sh(h(Rh(h( D(Yh(h( D(Xh(h( D( Wh(h( D(pZh(h( D(PRh(h(D(HTh(h(D(Qh(h(Qh(h(C(x[h(h(8Qh(h(XWh(h((Xh(h(Wh(h(pYh(h(stYh(h(ee[h(h(Uh(x&h(Ph(h(Uh(P&h(enWh( 38Yh(h%h(Ph(h(A(6h(%h([h(h( Zh(&h(!7h($h("X7h(%h(#PZh(X$h(#8\h($h($1p]h(#h(%0\h(h(&0͈Zh(h('0.h((#h('0.h(h((_XPh(Ph()_͸Th((h(*_`Vh(h(*_͸\h(h(*_̀Vh(h(+Vh(Xh(+Vh(0h(+nsVh(h(,10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0 )-211E^c    llHrrrnullstmt(1,lnsn)n'NS' always followed by . AnHHon n1f(+/^\' '=f)forigcr Fnons,(fn' ')fnesn't mH@. C ffn,nullstmt add null stmt for last thou@Prut modifiedmodified~b~(' '., 1 0 t)''t 2 3 lfre prePP remove final null statement if line before has no branchP  lf(-b,0)lf This workspace will do code coverage of functions. Under Dyalog APL are found a namespace, 'CodeCov', and a few functions to test the code coverage functions themselves. Namespace 'CodeCov' contains 2 functions, and to verify that code meets specific standards. Function runs function several times and reports on anomalies found in its code with . It first initializes monitoring on before running it by using function then reports on at the end with function . will report on code that prevent from doing its job properly. By using a left argument of 1 will be reformatted to allow to work properly otherwise it will signal an error. A backup copy of will be kept in 'MyFnBU'. Another function, will test itself to make sure it doesn't miss anything. et al should work with any APL with or without control structures. Under other APLs only the code coverage functions are present.sent.  I; ^h(h( ph(h((1uh(h(b/bh(4h(elxh(4h( rh(4h( bh(04h( rh(P3h( ^h(3h( h( ;0)EndWhile1:   While1(  fn(1+fn' ')fn ((EndIf5:(><fnewnew(1)Else5   next:   EndIf4:@ln)(0=nc b)/b,'orig' take a backup copy? @   bt,Fn,'BU' 0 l(modified^fix=1)EndIf4 0  @  lf(0,-bb' '^.=lf)lf remove extra columns:@@  tons,(-bb'.'Fn)Fn the original source @    EndIf3: mdified ~( EndIf31:[1+1n H32blf[line;4],(0,-lns)(nnullstmt),0 4lf[line;] H8)flflf,((t),lns)' ' add padding 8@  (nlinet/t(>cs>CS[;2])/CS[;0])EndIf31 8X  add null statements where needed (all stmts starting a new line) X  H  lf[t/t;4+lns]nnullstmt insert null statement,(-bH8n  lf(~t)lf expand 8H  n+/t\(1+b)/b create expand mask'^.=lf)HP et we still need to split before labels preceded by branches PP  lf[line;0]' ' those are no more comment lines P@  lf[line;](0,-lns)f(nnullstmt),elllf[line;]@8f4 nlinet/t(ell>0)el^lab1bl 8`  do not insert but modify lines where a full comment exist (or is empty) `H  insert null statement after labels where required HHb)b(0fix)EndIf3 fix troubles here H  X  lf(el\''),(lab\':'),((/br)\''),(dab\'*'),lf columns of flags XP  lablab1end>dab mark statements following ":end" as labelsP  X  (1'>improperly formatted function: <',Fn)signal(modified^0=fix)11 X0  modifiedmodifiedn/bl 0    EndIf2:P  1'>* some branches or control stmts followed by in <',Fn Ph  branching out before rest of statements are executed prevents their coverage h    EndIf1:@n  1'>* some branches followed by labels in <',Fn@0  (/bllab^1t/b//br)EndIf1 00f5 t(1t)-1t(b/t),tb~el 0`  account for empty lines (because of some APLs' behavior with empty lines) `  X  being branched to (same out of the branch as into the label for ex),(XX  branching before a label prevents from determining if the label is XdI5   @  branched to line exclude those to be splitted@P fdab/dia^\csbr any statement to split? P@  diab^lf='' diamonds @H  fellell\dia((+/^\' '=f)fdiaf,'')[;0]' ' HH  even those with labels. We should account for that. HP  for some APLs, lines without code are NOT reported executedNoPH  labell/csCS[;5])cs ctrl stmts branched to1: PH  end/b^(>CS[;4])cs lines to branch toHHCRbrb^(lf='')ncs pure branches H8  l20:ellf[;0]' ' empty lines 8@  none of the above (no :end statements) @    next @  otherwise we report by returning a resultCRs)@0  lf'*** ":end" on line ',t/t0@  we found :end statements. This is not good. @@  (f1t/b^(>t[0])>>1tstr>CS[;1])/csCS[;0] off'=88s,' appropriatly, i.e. :for :endfor 8X  check that no :end statement appears - they should all be matched X8  "branches", "is an :end", etc.tified 8X  Ctrl stmts are listed in variable 'CS' along with properties like XX  No label and control str is allowed in the same stmt in APLWin onlXX$@ and labels are always immediatly followed by a space in Dyalog XP  control statements always have a space before the colon?P@bnbr body of fn@@ nb\nb>rCCtext f find comments and text@@(1Fn,'> contains diamonds<')signal(0=fix)11@P this statement to be inserted in some strategic placesPPSHADOW'ML' ML2 ons'.',0NSI Original NameSpace P` This fn will save a copy of the CR of the (modified) fn and its line flags`X The definition of all control statements is kept in 'ControlStmts'X` Some control statements are considered as branches, ie :Until, :End[For]`P On some systems like APL+Win full lines should have a nullP If 1 they will be fixed and the fix returned - this is useful when you want to see what changes are madeP If 0 and a fn needs to be fixed an error will be signalled.Pnew fix CCinit fn;bl;ons;str;modified;end;lf;line;lns;Fn;ell;t;cbr;dab;br;dia;nb;lab;io;b;n;f;r;cs;nullstmt;el;orig P 'fn' is a list of names of functions to do code coverage on.>PH( statement inserted BEFORE the on the same line.H(hH( Version1.43 (0While11:(1dia)Endwhile11 0(Cinit(ljust0forih It returns pairs of function name and its flags for each function in the list.+s'h((ons,new0 2io0CR)((((nc'fix')l10 sedn(((lf signal(fix>1)11((((dia1++/^\':'felllf(((( report trouble cases:( p(ndia1 $ ( t2nn+1CCQ( (lftlf l ( diandia ( elltell (While11'r 8( and followed by label on next line8@x( in variable 'fnCR'. Those flags will bes>@H( no code on this line (comment or empty line)fns arHH( fix0 no fix by default - bombs if fn not normalizedH8(( branch on this line (at the end) X8` If 1 they will be fixed by removing s (and a backup taken in 'fnBU'). 1`X The checks made here are for and control statements followed by Q(X (Endwhile11:nl 8(l10:fn1(b1bf=' ')/f,' ',fnin2 58@( : label on this line or "branched to" line>@(|Q(@( diamond on this line potentially misleading@H(While1:(0CS[;3] 3] X(n0k( ( cs>cs>dab (lse1:( (bbl^1/br @P( nb\nb>rCCtext f find comments and text1@(nt,'fx 0 4lf'lse1(8(l30:X(8 fflf[n;]ell[n;]CCundia lf[n;] NSI8 lf[line;]bCC< H(fflf whatever remains... rHCP(@bnbr body of fn@P( DanB 1999 initialize fns to produce Code Coverage report PH if we do not wish a result we then signal the caseS;aHp The functions WILL be checked for conformance with specifications as per the left arg: p0(block(+/^\' '=block)block00(blockD CCundia line;io;n;len(08x(t\s='''' APLWin accounts for "8H(I;llah(pbh(ns_h(h(ll_h( 5h(CRh(H( (x( e'note (( find where text is((io0 XI;ti`h(_h(e h(h(r `ah(6h(e h(H5h(spnsX8 & %'&(0 nt88 ( 1(h` & ,6 (h8 @(CCtest;x;tr;io U(tCCtext s 8(lc[(lc'A')+26]26(lc'a')lcav)s 8(io1( ((h , ,(8 (( lower 's' into 'ls' (lec ^pEcr1wr)  P (% P( n+/D1,D%l T(io0 p(use: (toX7n(@(eraseN1 (thelect0H(VersionP xt(Testsplitline5 H(Testsplitline3 (Testsplitline2 ؐ(Testsplitline4 ((Testmod1linewrem( Y(Testsplitline6 x(Testsplitline1 (Testmodcomment (x/(Testinsertmultline(f(L20((Testinsertbetweenlabels( а(Testifelse@  (Testif (Testend(A(Testbranchtonext( saament [ 0Q(Testinsertline (Testifcomment tab(  (h8V "on(  (n( (ExpectedResults h(ids%(n( null statementJ(HR(CStable`u(NS i(ansO(nc((brs (Testaddlastline ?(Testsplitline7 (CSobJhh`` XhXX`H`HPP 1!H 13x?`4'x?C\Jh8\]XnXb PXnox}htcx}~huООh@x Wx-:in !8 P Wx-:for @FHi(CCreset(nxt( :endselect((:casese( '(Testcontinue (del&{F{( :continueue(@(block>len١>(1ա>D 1n(n-1)<''e@0( rc(-rc) 0 1 +rcs>s[0]ch 0HR(CCtest (tr col U( line'x',line (CCtext(xqk(  EndIf5tmoeElse5nt wnextll t eEndIf4b b EndIf3s  EndIf31  EndIf2/  While11ln]origlls nlnbtatem12]cbr taeells whal lnss st lnline22]netlft(CS;bllf  fix (31[new (:trapap(( P( D is where to split(@(I;inpfh(eh(t 0fh(chee@Pf(block(:whilele(@paeehh(Ph((h(h(h(h(زh(h(h(h(xh(h(Xh(8h(h(h(h(ȱh(h(h(xh(Xh(@h((h(h(h( ذh(h(h(h(xh(`h(Hh(0h(h(h( h(Яh(h(h(h(ph(Xh(@h((h(h(h(h(&Ȯh(h(h()h(hh($Ph(8h( h(h(h('حh(h(h( h(xh(`h(!Hh(00h(4h(h(h(Ьh(%h(h(;h(Eph(HXh(@h((h(Ih(1h(Kh(ȫh(Jh(Bh(h(Nhh(Ph( 8h( h(h(Ch(تh(h(h("h(xh(`h(Hh(0h(h(Xh(Yh([Щh(Fh(h(h(?ph(Xh(@h(h(5h(بh(h(h(-ph(iXh(8@h(q(h(h(h(^h(Uh(ȧh(9h(hh(Ph(8h(_ h(jh(h( h(ػh(gh(Gh(h(:xh(6`h(fHh(P0h(mh(h(h(кh(@h(h(xh(ph(\Xh(@h(`h(Hh(d0h(ch(h(h(MХh(h(<h(}h(ph(RXh(3@h(7(h(h(h(>h(Ȥh(h(h(h(ehh(]Ph(8h(w h(~h(`h(bأh(h(ah(h(xh(`h(Hh(0h(h(h(h(Тh(h(h(h(Sph(Xh( @h((h(h(h(h(ȡh(h(h(h(h(hh(VPh(28h( h(kh(h(+ئh(h(Dh(h(txh(Wxh(X8h({8h(Hh(hh(Xh(8h(h( h(ph(Xh(@h((h(Zh((h( h(`h(Hh(0h(h(h(h(Аh(h(h(h(ph(Xh(@h((h(h(h(vh(ȏh(hh(h(Иh('h(th(*th(th(Th(xth(`th(Hth(0th(rth(th((h(sh(sh(Hh(sh(sh(sh(Apsh(Xsh(@sh((sh(،h(0h(#h(h(oh(xh( `h(Qhph(h(qh(sh(rh( `h( lrh(]rh(P_h(ns hh(h1)Else5 [144] t,Fn,'CRlf' [145] b(1lf)MONITOR Fn [146] EndIf5 [147] Else5: [148] newnew(Fn),(lf) [149] EndIf5: [150] fn(1+fn' ')fn [151] While1 [152] EndWhile1: @(apl(:selectct(8(rcs CClower s;io;n;i;rc;ls;c;mask;lc 8?l99BHlcKQcTZls]crcfH (CClower!У(MyFnp(NS.(MakeCS(CCundia(:andifif((:returnrn( (Testifelseif (:Elsese((:endifif((:endforor((:leaveve(( :endwhilele((:elseifif((:repeatat( Wx-:if `,@@( split a line of statements at the diamonds@ euxLegendutoWhile1  [EndIf1r aElse15]he ifw/o lf'cbaQ]F)Ffordd l rnnu ',(1)nnu ',f cs [40] FB1Fn [1 4labEndW xeeld: [4neeremecutbrndialway neanch  [7br: lase dab ?anhons  ( len''line ((r((-rc)1)rcsses:(((s[i.+5](n,5)':Else'(@@(nii/imask^(':else'ls)>':elseif'lsine;]@@( to differenciate them we change else to Elsee@@( special case: else and elseif are similar;g@P(l99:llh( l105(ii+1  ( s[r](r)c' @(r((mask^cls)/n).+clc[av>cs[i]] lumnsa@8(i0f5: ( s,av[0],s HЧ( use lowercase version to search, replace in 's' lfH ( mask,0,>s[1] @( DanB return lowercase of 's' where cs existra@0 ;e (h(x`h(neh(h( `h(3h( Гh(2h( `rh(x2h( ah(h(we(ah((2h(d h(h(efh(1h( phh(1h( bPh(p1h( h( 1h( h(x0h( h(0h( ؒh((0h( h(0h( 1h(h( hh(h( (h(h( h(/h( h(h/h( h(0/h( h( 00 &,1 0(h(nls,lc[0,avs] (((l10:(i=cs)l99f)1(8((+/ex delv),' objects deleted'k;lcn80(l20:deldelv[;i]^.='CR'dIf10((x~0>1١>0ҡ>x((08(x,1'),(1nH$(xxExpectedResults[;2]>,0 1tr1 CCinit'T'nl 3HT(CCinit0`Eh(rh(qh(Xh(qh(hqh(h( ph((h(Pph(oh(qh(h( qh(Pqh(@h(8qh(h(h(oh(qh(oh( oh(oh(oh(ph(oh(8ph(8oh(nh(hoh(Poh(nh(nh(h(nh(@h(Hnh(nh(`nh(0nh(nh(qh(mh(xnh(mh(mh(mh(hh(Xmh(nh(pmh(@mh((mh(h(lh(mh(lh(lh(lh(Hh(hlh(mh(lh(Plh(8lh(h(kh(lh(lh(kh(kh(h(xkh( lh(kh(`kh(Hkh(uh(kh(kh(kh(jh(jh(h(jh(0kh(jh(pjh(Xjh(h(jh(jh((jh(ih(ih(ph(ih(@jh(ih(ih(hih(ph( ih(ih(8ih(ih(hh(h(hh(Pih(hh(hh(xhh(h(0hh(hh(Hhh(hh(hh(th(gh(`hh(gh(gh(gh(ph(Xgh(gh(pgh(@gh((gh(x0 00 L( danb 2001] (ControlStmts 0PATHpX  o0(??See 'describe'be'0 `(describeobJ   ; h(`h( Xh(h( @h(h( h(h( Жh(h( h(`h( ph(Xh( Hh(h( h(h( h(Hh( h(  o(note n(EndWhile1A@  (:gototo(?   (nullstmts[ (Endwhile117  (test(CC ` (modifiedKn( .&$"`[WN)LG#:210/-*3"!(:orifif((L ('(HR(len0rl((:untilil((:endtrapap(addwRbIndhandlerec9899MFNEXPW89W78W85W82W79W80W88W86W81W84W83W87W92W90W91W93W94W95vAlW96W97W98vaLueW99l4l3chkcompmemcmmErDswitswspqpatedpatn3eNdiNwSlXfrIDtnLeArgobwrcl`bf9(as(rcRasciiaplamxlatetIerEfoNSinWsbUfArG o(readBuf opfilehdl v(replace l7l5rDbuftoreadxFrX87X88X89X90X91X92X93X94X95obJX96dFnX97X98cOdeX99l2jtnofnazendsamamrepshownolimcpttieargobjmsgstrCl05l01sourcedlml160l130l120matl60line1line0comcrfnl50l40l30l20l10CupUvpossslmasknispWbl1l0lbrtSTxfrtoclose create writeall copyright describe foriformeparse version xfr xfrfrom blksize XfrObjs openreadXscreatefopeninfilenameof(bout x(txtrepld equivalence xlddPh(Hh(h( h(h(h(h(h(Лh(h(ah(h(h(h(ȝh(h(0h(ph(0h(h(8h(h(Ƞh(h(Xbh(h(h(h(Оh(@bh(hh(Ph(h(8h( h((bh(h(h(h(bh(؟h(h(h(h(h(xh(ah(`h(ah((.,**_(       Y      $  []();/\+-*^<=>,!?~_ܭ}{abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789. ':  |`#@"%&徼е뱿    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      h(   hh(h(hh(Hh((h(h(h(h(ȸh(h(h(xh(Xh(8h(h(h(صh(h(h(h(fix parmss!0obJrl150l145l140l110Yl100l90Fl80l70?l47l455l15NaMCodTtrans8rangeqobjslistfiledebugd5 !',n& D"/BC.EAh@9:;<=>?82=*F/y$|+40HG-u7)