Diff for /gforth/locals-test.fs between versions 1.2 and 1.4

version 1.2, 1994/06/17 12:35:08 version 1.4, 1994/07/27 13:37:03
Line 1 Line 1
 include glocals.fs  include glocals.fs
   include debugging.fs
   
 : localsinfo \ !! only debugging  : localsinfo \ !! only debugging
  ." stack: " .s ." locals-size: " locals-size ? ." locals-list"   ." stack: " .s ." locals-size: " locals-size ? ." locals-list"
Line 28  depth . cr Line 29  depth . cr
 ." testing part 2" cr  ." testing part 2" cr
   
 : xxxx  : xxxx
     [ ." starting xxxx" .s cr ]     [ ." starting xxxx" .s cr ]
 { f } f  { f } f
 if  if
   { a b }   { a b }
   b a   b a
 [ ." before else" .s cr ]  [ ." before else" .s cr ]
 else  else
 [ ." after else" .s cr ]  [ ." after else" .s cr ]
   { c d }   { c d }
   c d   c d
 then  then
 [ ." locals-size after then:" locals-size @ . cr ]  [ ." locals-size after then:" locals-size @ . cr ]
 f drop  ~~ f ~~ drop
     [ ." ending xxxx" .s cr ]  [ ." ending xxxx" .s cr ]
 ;  ;
   
 2 3 1 xxxx . . cr  2 3 1 xxxx . . cr
Line 64  begin Line 65  begin
 [ ." after { a }" .s cr ]  [ ." after { a }" .s cr ]
 1 while  1 while
 [ ." after while" .s cr ]  [ ." after while" .s cr ]
   { b }   { b }
   a b   a b
 [ ." after a" .s cr ]  [ ." after a" .s cr ]
 repeat  repeat
 [ ." after repeat" .s cr  [ ." after repeat" .s cr
Line 244  until Line 245  until
     [ ." after xexit" localsinfo ]      [ ." after xexit" localsinfo ]
     else      else
     { b }      { b }
     [ ." before xthen" localsinfo      [ ." before xthen" localsinfo ]
     then      then
     [ ." after xthen" localsinfo ]      [ ." after xthen" localsinfo ]
 ;  ;
   
   ." strcmp1 coming up" cr
   : strcmp1 { addr1 u1 addr2 u2 -- n }
    u1 u2 min 0 ?do
      addr1 c@ addr2 c@ - ?dup if
        unloop exit
      then
      addr1 char+ TO addr1
      addr2 char+ TO addr2
    loop
    u1 u2 - ;
   
   : teststrcmp1
   ." lp@:" lp@ . cr
   s" xxx" s" yyy" strcmp1 . cr
   ." lp@:" lp@ . cr
   s" xxx" s" xxx" strcmp1 . cr
   ." lp@:" lp@ . cr
   s" xxx" s" xxxx" strcmp1 . cr
   ." lp@:" lp@ . cr
   s" xxx3" s" xxx2" strcmp1 . cr
   ." lp@:" lp@ . cr
   s" " s" " strcmp1 . cr
   ." lp@:" lp@ . cr
   ." lp@:" lp@ . cr
   ." stack:" .s cr
   ;
   teststrcmp1
   
   
 bye  bye

Removed from v.1.2  
changed lines
  Added in v.1.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>