Skip to content

Commit

Permalink
Make unterminated m : 0 definition a control error
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryHRich committed Feb 10, 2025
1 parent dfe3e8f commit 9b8df55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jsrc/cx.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,8 @@ static A jtcolon0(J jt, I deftype){A l,z;C*p,*q,*s;A *sb;I m,n;
RZ(z=exta(isboxed?INT:LIT,1,1,isboxed?24:300)); sb=AAV1(z); s=CAV1(z);
while(1){
RE(l=jgets("\001")); // abort if error on input
if(!l)break; // exit loop if EOF. The incomplete definition will be processed
// obsolete if(!l)break; // exit loop if EOF. The incomplete definition will be processed
ASSERT(l!=0,EVCTRL) // EOF: unterminated definition in script is an error
if(deftype!=0)RZ(l=ddtokens(l,0b1010)); // if non-noun def, handle DDs, for explicit def, return string, allow jgets(). Leave noun contents untouched
// check for end: ) by itself, possibly with spaces
m=AN(l); p=q=CAV(l);
Expand Down
3 changes: 3 additions & 0 deletions test/gctrl.ijs
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,9 @@ f0 =. {{ (u. f. b. 0) }} NB. u. does not invoke PPPP
9!:41(1)
}}

'control error' -: 0!:100 etx 'tvbl =. 3 : 0',LF,'5'
_1 = 4!:0 <'tvbl'

4!:55 ;:'calcA f0 f1 f2 f3 fp g0 g1 g1__ g2 g3 g4 g5 gvb l numloc1 numloc2 r test tmonad testhetrf vb__ vb_z_'


Expand Down

0 comments on commit 9b8df55

Please sign in to comment.