Commit b37aa080 authored by Anton Ertl's avatar Anton Ertl
Browse files

Merge /home/anton/tmp/gforth

parents 251b92ef 5b159440
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ Create block-input A, A, A, A, A,
    \g Text-interpret block @i{u}.  Block 0 cannot be @code{load}ed.
    dup 0= -35 and throw
    block-input 0 new-tib dup loadline ! blk !  -3 loadfilename# !
    ['] interpret catch pop-file throw ;
    ['] interpret bt-rp0-catch pop-file throw ;

: thru ( i*x n1 n2 -- j*x ) \ block-ext
    \G @code{load} the blocks @i{n1} through @i{n2} in sequence.
+18 −2
Original line number Diff line number Diff line
@@ -102,11 +102,27 @@ $10 stack: cov-stack

\ launch a debug shell, quit with emtpy line

[ifundef] bt-rp0-catch
: bt-rp0-catch ( ... xt -- ... ball )
    backtrace-rp0 @ >r	
    catch
    r> backtrace-rp0 ! ;

: bt-rp0-wrapper ( ... xt -- ... )
    bt-rp0-catch throw ;
[then]

: ???-loop ( ... -- ... )
    BEGIN
        ." dbg> " refill  WHILE
            source nip WHILE
                interpret ."  ok" cr
        REPEAT  THEN ;

: ??? ( -- )
    \G Open a debuging shell
    create-input cr
    BEGIN  ." dbg> " refill  WHILE  source nip WHILE
		interpret ."  ok" cr  REPEAT  THEN
    ['] ???-loop bt-rp0-catch throw
    0 pop-file drop ;
' ??? alias dbg-shell

+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ Variable maxnum
    #tib @ 1 >= IF  source 1- + c@ #cr = #tib +!  THEN ;
: refill-loop ( -- flag )
    base @ >r base off
    BEGIN  refill ?cr  WHILE  ['] interpret catch drop  >in @ 0=  UNTIL
    BEGIN  refill ?cr  WHILE  ['] interpret bt-rp0-catch drop  >in @ 0=  UNTIL
	true  ELSE  maxnum off false  THEN  r> base ! ;

: response:  ( -- )
+1 −1
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ Variable maxnum
  #tib @ 1 >= IF  source 1- + c@ #cr = #tib +!  THEN ;
: refill-loop ( -- flag )
  base @ >r base off
  BEGIN  refill ?cr  WHILE  ['] interpret catch drop  >in @ 0=  UNTIL
  BEGIN  refill ?cr  WHILE  ['] interpret bt-rp0-catch drop  >in @ 0=  UNTIL
  true  ELSE  maxnum off false  THEN  r> base ! ;
: get-input ( -- flag ior )
  s" /nosuchfile" url $!  s" HTTP/1.0" protocol $!
+3 −1
Original line number Diff line number Diff line
@@ -84,8 +84,10 @@ Variable argc ( -- addr ) \ gforth
: args-required ( i*x addr u -- i*x ) \ gforth
    2dup ['] args-required1 os-execute-parsing ;

: interpret2 ['] interpret bt-rp0-wrapper ;

: args-evaluate ( i*x addr u -- j*x ) \ gforth
    ['] interpret os-execute-parsing ;
    ['] interpret2 os-execute-parsing ;

\ main words

Loading