cvsuser     03/06/25 20:24:18

  Modified:    languages/BASIC/compiler COMP_expressions.pm
                        COMP_parsefuncs.pm testsuite.pl
               languages/BASIC/compiler/samples eliza2.bas
  Log:
  Fixed bugs, removed debugging messages, etc..
  String arrays now passed correctly to functions, subs.
  
  Revision  Changes    Path
  1.14      +1 -1      parrot/languages/BASIC/compiler/COMP_expressions.pm
  
  Index: COMP_expressions.pm
  ===================================================================
  RCS file: /cvs/public/parrot/languages/BASIC/compiler/COMP_expressions.pm,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -w -r1.13 -r1.14
  --- COMP_expressions.pm       23 Jun 2003 03:40:07 -0000      1.13
  +++ COMP_expressions.pm       26 Jun 2003 03:24:15 -0000      1.14
  @@ -84,7 +84,7 @@
        return 0
   }
   sub isarray {
  -     #print "Looking up $_[0]$seg...";
  +     #print STDERR "Looking up $_[0]$seg...\n";
        $_ =(grep /^\Q$_[0]$seg\E$/i, keys %arrays );
        #print "$_\n";
        return $_;
  
  
  
  1.17      +1 -2      parrot/languages/BASIC/compiler/COMP_parsefuncs.pm
  
  Index: COMP_parsefuncs.pm
  ===================================================================
  RCS file: /cvs/public/parrot/languages/BASIC/compiler/COMP_parsefuncs.pm,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -w -r1.16 -r1.17
  --- COMP_parsefuncs.pm        24 Jun 2003 01:54:14 -0000      1.16
  +++ COMP_parsefuncs.pm        26 Jun 2003 03:24:15 -0000      1.17
  @@ -1238,8 +1238,7 @@
                } else {
                        s/\(\)//g;
                        $_=changename($_);
  -                     $_=~s/\$/_string/g;
  -                     #print "Marking ${_}${seg}\n";
  +                     #print STDERR "Marking ${_}${seg}\n";
                        $arrays{"${_}${seg}"}=1;
                        push @{$code{$seg}->{code}},<<PUSHARR;
        .param PerlHash array_$englishname
  
  
  
  1.10      +16 -19    parrot/languages/BASIC/compiler/testsuite.pl
  
  Index: testsuite.pl
  ===================================================================
  RCS file: /cvs/public/parrot/languages/BASIC/compiler/testsuite.pl,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -w -r1.9 -r1.10
  --- testsuite.pl      12 Jun 2003 02:52:59 -0000      1.9
  +++ testsuite.pl      26 Jun 2003 03:24:15 -0000      1.10
  @@ -32,6 +32,22 @@
   }
   
   __DATA__
  +' Passing string arrays, expect 99 and "Hello"
  +function foo(i, thing$())
  +     print i
  +     print thing$(10)
  +     foo=1
  +end function
  +dim fool$()
  +fool$(10)="Hello"
  +a=foo(99, fool$())
  +
  +' String Arrays, expect "One"
  +dim g$()
  +g$(5)="One"
  +g$(6)="Two"
  +print g$(5)
  +
   ' Evil BASIC bug, expect 55
   dim B(1), z(1)
   Z(54,6)=54
  @@ -177,15 +193,6 @@
   a=mine(5)
   print t(3)
   
  -' Expect 234
  -function inkey$(a, b)
  -     a=3.14
  -     inkey$="234"
  -end function
  -s$=inkey$(r, 45)
  -print s$
  -print r
  -
   1740 print "Branched"
        end
   ' Logical Operators 
  @@ -498,16 +505,6 @@
   print sqr(t),
   if t=3 then print "True!"
   next t
  -
  -' Expect 234
  -function inkey$
  -     inkey$="234"
  -end function
  -Y = VAL(inkey$)
  -print y
  -end
  -1740 print "Branched"
  -     end
   
   
   ' Expect OK
  
  
  
  1.2       +2 -11     parrot/languages/BASIC/compiler/samples/eliza2.bas
  
  Index: eliza2.bas
  ===================================================================
  RCS file: /cvs/public/parrot/languages/BASIC/compiler/samples/eliza2.bas,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -r1.1 -r1.2
  --- eliza2.bas        9 Mar 2003 23:08:52 -0000       1.1
  +++ eliza2.bas        26 Jun 2003 03:24:18 -0000      1.2
  @@ -5,13 +5,6 @@
   16 REM Parrot BASIC port by Clinton Pierce
   18 REM Freely Redistributable (I think)
   19 dim rep$(1), conj$(1), ans$(1), response(1), rescnt(1), resmax(1)
  -20 GOTO 100
  -49 REM Busy indicator
  -50 IF TWIRL$="" THEN LET TWIRL$=CHR$(92)+CHR$(124)+CHR$(47)+CHR$(45)
  -55 LET TA$=LEFT$(TWIRL$,1)
  -60 PRINT TA$+CHR$(8);
  -65 LET TWIRL$=RIGHT$(TWIRL$,LEN(TWIRL$)-1)+TA$
  -70 RETURN
   100 RESTORE 10600
   105 PRINT "Please wait, initializing...(This will take a minute)"
   110 GOSUB 1500
  @@ -42,7 +35,9 @@
   1265   LET K$=" "+K$+" "
   1270   FOR J=1 TO WORDS
   1280     LET W=INSTR(K$, CONJ$(J,2))
  +         print "Looking for ";CONJ$(J,2)
   1290     IF W<1 THEN GOTO 1350
  +      print "Found one"
   1300     LET FA$=LEFT$(K$,W)
   1310     LET FA$=FA$+CONJ$(J,1)
   1320     LET FA$=FA$+RIGHT$(K$,LEN(K$)-(W+LEN(CONJ$(J,2))))
  @@ -63,14 +58,12 @@
   1520 REM Read in keywords
   1521   LET REPLIES=1
   1530   READ REP$(REPLIES)
  -1531   GOSUB 50
   1535   IF REP$(REPLIES) = "-" THEN GOTO 1560
   1540   LET REPLIES=REPLIES+1
   1550   GOTO 1530
   1560   REM
   1565   LET WORDS=1
   1570   READ CONJ$(WORDS,2)
  -1571   GOSUB 50
   1575   IF CONJ$(WORDS,2) = "-" THEN GOTO 1610
   1580   READ CONJ$(WORDS,1)
   1590   LET WORDS=WORDS+1
  @@ -78,7 +71,6 @@
   1610   REM
   1615   LET ANS=1
   1620   READ ANS$(ANS)
  -1621   GOSUB 50
   1630   IF ANS$(ANS) = "-" THEN GOTO 1680
   1640   LET ANS=ANS+1
   1650   GOTO 1620
  @@ -86,7 +78,6 @@
   1682   READ A
   1683   IF A=-1 THEN GOTO 1750
   1684   READ B
  -1685   GOSUB 50
   1686   LET RESPONSE(ANSI)=A
   1688   LET RESCNT(ANSI)=A
   1689   LET RESMAX(ANSI)=A+B-1
  
  
  

Reply via email to