@@ -325,15 +325,15 @@ I mark(I*m,I k,I t){DO(k, m[i]=i?t:-t) R k;}
325
325
// this rule doesn't apply to function argument lists, eg: f:{ [a] 1} is ok. however f: {\n\n [a;b;d] 1+1} not ok
326
326
// so the check probably has to do with whether some useful symbol occurred on the line already
327
327
//other errors: syntax error
328
- K wd (S s , int n ){lineA = s ; fdc = 0 ;R wd_ (s ,n ,* denameD (& KTREE ,d_ ,1 ),0 );}
329
- K wd_ (S s , int n , K dict , K func ) //parse: s input string, n length ;
328
+ K wd (S s , int n ){lineA = s ; fdc = 0 ;R wd_ (s ,n ,denameD (& KTREE ,d_ ,1 ),0 );}
329
+ K wd_ (S s , int n , K * dict , K func ) //parse: s input string, n length ;
330
330
//assumes: s does not contain a }])([{ mismatch, s is a "complete" expression
331
331
{
332
332
if (!s ) R 0 ;
333
333
if (strstr (s ,":\\t" )) { show (kerr ("\\t syntax" )); R 0 ; }
334
334
//I z=0; if((z=syntaxChk(s))) {O("%lld\n",z); R SYE;}
335
335
if (syntaxChk (s )) R SYE ;
336
- if ('\\' == s [0 ] && fbs ){fbs = 0 ; R backslash (s ,n ,& dict );}
336
+ if ('\\' == s [0 ] && fbs ){fbs = 0 ; R backslash (s ,n ,dict );}
337
337
338
338
PDA p = 0 ;
339
339
K km = newK (-1 ,1 + n ); U (km ) I * m = kI (km );//marks
@@ -461,7 +461,7 @@ K* inKtree(K*d, S t, I create) {
461
461
}
462
462
463
463
//TODO: capture - oom all
464
- I capture (S s ,I n ,I k ,I * m ,V * w ,I * d ,K * locals ,K dict ,K func )
464
+ I capture (S s ,I n ,I k ,I * m ,V * w ,I * d ,K * locals ,K * dict ,K func )
465
465
//IN string, string length, pos in string, markings;
466
466
//OUT words, current #words; IN locals-storage, names-storage, charfunc/NULL
467
467
{
@@ -581,23 +581,23 @@ I capture(S s,I n,I k,I*m,V*w,I*d,K*locals,K dict,K func)
581
581
if (state ) //Bracketed parameters exist and are well-formed
582
582
{
583
583
S a = strchr (s + k + 1 ,'[' ); S b = strchr (a ,']' );
584
- j = wd_ (a + 1 ,b - a - 1 ,* zdict ,z ); //Grab only params. This must create entries in *zdict
584
+ j = wd_ (a + 1 ,b - a - 1 ,zdict ,z ); //Grab only params. This must create entries in *zdict
585
585
M (z ,j ) //not g
586
586
cd (j );
587
587
}
588
588
else //Deal with any implicit Z,Y,X parameters
589
589
{
590
590
K t = Kd ();
591
591
M (z ,t )
592
- j = wd_ (s + k + 1 ,r - 2 ,t ,0 ); //Grab all local names
592
+ j = wd_ (s + k + 1 ,r - 2 ,& t ,0 ); //Grab all local names
593
593
M (z ,t ,j );
594
594
I n = 0 ;
595
595
DO (3 , if (DE (t ,IFP [2 - i ])){n = 3 - i ;break ;})
596
596
DO (n ,denameD (zdict ,IFP [i ],1 )) //TODO: oom
597
597
cd (t ); cd (j );
598
598
}
599
599
600
- j = wd_ (s + k + 1 ,r - 2 ,* ydict ,z );
600
+ j = wd_ (s + k + 1 ,r - 2 ,ydict ,z );
601
601
M (z ,j )
602
602
cd (j );
603
603
@@ -655,20 +655,20 @@ I capture(S s,I n,I k,I*m,V*w,I*d,K*locals,K dict,K func)
655
655
else z = ((K (* )())vn_ [charpos (n_s ,u [1 ])])();
656
656
else if (func )
657
657
{
658
- if (& dict == (K * )kV (func )+ PARAMS )
658
+ if (dict == (K * )kV (func )+ PARAMS )
659
659
{
660
660
V q = newEntry (u );
661
661
U (q )
662
- M (q ,kap (& dict ,& q ))
662
+ M (q ,kap (dict ,& q ))
663
663
z = EV (q );
664
664
cd (q );
665
665
}
666
- else if ((q = DE (dict ,u ))) z = EVP (q ); //If func has its local, use it
666
+ else if ((q = DE (* dict ,u ))) z = EVP (q ); //If func has its local, use it
667
667
//else if(':'==s[k+r] && ':'==s[k+r+1] && -MARK_VERB==m[k+r+1])
668
668
// {m[k+r]=MARK_NAME; r++; z=denameS(kV(func)[CONTeXT],u);} //m[]= probably superfluous
669
669
else if (- MARK_VERB == m [k + r ] && ':' == s [k + r + 1 ] && - MARK_VERB == m [k + r + 1 ])
670
670
{if (':' == s [k + r ])r ++ ; z = denameS (kV (func )[CONTeXT ],u ,1 );}
671
- else if (dict == * (( K * )kV (func )+ LOCALS ) && ':' == s [k + r ] && - MARK_VERB == m [k + r ]) z = denameD (& dict ,u ,1 );
671
+ else if (dict == ( K * )kV (func )+ LOCALS && ':' == s [k + r ] && - MARK_VERB == m [k + r ]) z = denameD (dict ,u ,1 );
672
672
//K3.2: a+:1 format applies to context-globals not locals
673
673
else z = denameS (kV (func )[CONTeXT ],u ,0 );//Otherwise check the context (refactor with above?)
674
674
}
@@ -678,13 +678,13 @@ I capture(S s,I n,I k,I*m,V*w,I*d,K*locals,K dict,K func)
678
678
I i ;for (i = k ;i < strlen (s );i ++ ){
679
679
if (!fbr && s [i ]== ';' )break ;
680
680
else if (s [i ]== ':' || (fbr && (s [i ]== 'x' || s [i ]== 'y' || s [i ]== 'z' ))){fdc = 1 ;break ;}}
681
- z = inKtree (& dict ,u ,0 );
681
+ z = inKtree (dict ,u ,0 );
682
682
if ((!fdc )&& !z ){L err = (L )VLE ;
683
683
#ifndef DEBUG
684
684
oerr (); O ("%s\n%c\n" ,u ,'^' );
685
685
#endif
686
686
R err ;}
687
- z = denameD (& dict ,u ,fll && fdc ); }
687
+ z = denameD (dict ,u ,fll && fdc ); }
688
688
)
689
689
CS (MARK_VERB , // "+" "4:" "_bin" ; grab "+:", "4::"
690
690
if (s [k ]== '\\' ){z = (V )0x7c ; break ;} //trace or scan
0 commit comments