Fixed up ; indent.

This commit is contained in:
Brad Nelson
2022-07-30 15:08:31 -07:00
parent 357bed3c1f
commit 5f90ef3a83
2 changed files with 39 additions and 32 deletions

View File

@ -79,11 +79,9 @@ variable indent
[char] " emit space exit then [char] " emit space exit then
dup >flags -TAB AND if -1 indent+! then dup >flags -TAB AND if -1 indent+! then
dup see. dup see.
dup >flags +TAB AND if dup >flags +TAB AND if 1 indent+! then
1 indent+! dup ['] ! = if icr then
else dup ['] +! = if icr then
dup >flags -TAB AND if icr then
then
dup @ ['] BRANCH @ = dup @ ['] BRANCH @ =
over @ ['] 0BRANCH @ = or over @ ['] 0BRANCH @ = or
over @ ['] DONEXT @ = or over @ ['] DONEXT @ = or
@ -95,8 +93,11 @@ variable indent
: ?see-flags >flags IMMEDIATE_MARK and if ." IMMEDIATE " then ; : ?see-flags >flags IMMEDIATE_MARK and if ." IMMEDIATE " then ;
: see-xt ( xt -- ) : see-xt ( xt -- )
dup @ ['] see-loop @ = if dup @ ['] see-loop @ = if
['] : see. dup see. 1 indent ! ['] : see. dup see.
icr dup see-loop ['] ; see. ?see-flags cr 1 indent ! icr
dup see-loop
-1 indent+! ['] ; see.
?see-flags cr
exit exit
then then
dup >flags BUILTIN_FORK and if ." Built-in fork: " see. exit then dup >flags BUILTIN_FORK and if ." Built-in fork: " see. exit then

View File

@ -45,14 +45,16 @@ e: test-see-number
: test 123 456 ; : test 123 456 ;
see test see test
out: : test out: : test
out: 123 456 ; out: 123 456
out: ;
;e ;e
e: test-see-string e: test-see-string
: test s" hello there" ; : test s" hello there" ;
see test see test
out: : test out: : test
out: s" hello there" ; out: s" hello there"
out: ;
;e ;e
e: test-see-begin-again e: test-see-begin-again
@ -62,7 +64,7 @@ e: test-see-begin-again
out: BEGIN out: BEGIN
out: . out: .
out: AGAIN out: AGAIN
out: ; out: ;
;e ;e
e: test-see-begin-until e: test-see-begin-until
@ -72,7 +74,7 @@ e: test-see-begin-until
out: BEGIN out: BEGIN
out: . out: .
out: UNTIL out: UNTIL
out: ; out: ;
;e ;e
e: test-see-begin-while-repeat e: test-see-begin-while-repeat
@ -84,7 +86,7 @@ e: test-see-begin-while-repeat
out: WHILE out: WHILE
out: . out: .
out: REPEAT out: REPEAT
out: ; out: ;
;e ;e
e: test-see-ahead-then e: test-see-ahead-then
@ -94,7 +96,7 @@ e: test-see-ahead-then
out: AHEAD out: AHEAD
out: . out: .
out: THEN out: THEN
out: ; out: ;
;e ;e
e: test-see-for-next e: test-see-for-next
@ -104,7 +106,7 @@ e: test-see-for-next
out: FOR out: FOR
out: I . out: I .
out: NEXT out: NEXT
out: ; out: ;
;e ;e
e: test-see-for-aft-next e: test-see-for-aft-next
@ -114,10 +116,9 @@ e: test-see-for-aft-next
out: FOR out: FOR
out: AFT out: AFT
out: I . out: I .
out: THEN out: THEN .
out: .
out: NEXT out: NEXT
out: ; out: ;
;e ;e
e: test-see-string-strides e: test-see-string-strides
@ -135,55 +136,55 @@ e: test-see-string-strides
out: 1 IF out: 1 IF
out: s" " type out: s" " type
out: THEN out: THEN
out: ; out: ;
see test1 see test1
out: : test1 out: : test1
out: 1 IF out: 1 IF
out: s" >" type out: s" >" type
out: THEN out: THEN
out: ; out: ;
see test2 see test2
out: : test2 out: : test2
out: 1 IF out: 1 IF
out: s" ->" type out: s" ->" type
out: THEN out: THEN
out: ; out: ;
see test3 see test3
out: : test3 out: : test3
out: 1 IF out: 1 IF
out: s" -->" type out: s" -->" type
out: THEN out: THEN
out: ; out: ;
see test4 see test4
out: : test4 out: : test4
out: 1 IF out: 1 IF
out: s" --->" type out: s" --->" type
out: THEN out: THEN
out: ; out: ;
see test5 see test5
out: : test5 out: : test5
out: 1 IF out: 1 IF
out: s" ---->" type out: s" ---->" type
out: THEN out: THEN
out: ; out: ;
see test6 see test6
out: : test6 out: : test6
out: 1 IF out: 1 IF
out: s" ----->" type out: s" ----->" type
out: THEN out: THEN
out: ; out: ;
see test7 see test7
out: : test7 out: : test7
out: 1 IF out: 1 IF
out: s" ------>" type out: s" ------>" type
out: THEN out: THEN
out: ; out: ;
see test8 see test8
out: : test8 out: : test8
out: 1 IF out: 1 IF
out: s" ------->" type out: s" ------->" type
out: THEN out: THEN
out: ; out: ;
;e ;e
e: test-noname e: test-noname
@ -199,7 +200,8 @@ e: test-see-variable
: bar foo @ . ; : bar foo @ . ;
see bar see bar
out: : bar out: : bar
out: foo @ . ; out: foo @ .
out: ;
;e ;e
e: test-see-create e: test-see-create
@ -207,7 +209,8 @@ e: test-see-create
: bar foo @ . ; : bar foo @ . ;
see bar see bar
out: : bar out: : bar
out: foo @ . ; out: foo @ .
out: ;
;e ;e
e: test-see-value e: test-see-value
@ -215,21 +218,24 @@ e: test-see-value
: bar foo . ; : bar foo . ;
see bar see bar
out: : bar out: : bar
out: foo . ; out: foo .
out: ;
;e ;e
e: test-see-to e: test-see-to
0 value foo 0 value foo
: bar 123 to foo ; : bar 123 to foo . ;
see bar see bar
out: : bar out: : bar
out: 123 TO foo out: 123 TO foo
out: ; out: .
out: ;
;e ;e
e: test-see-immediate e: test-see-immediate
: foo 123 ; immediate : foo 123 ; immediate
see foo see foo
out: : foo out: : foo
out: 123 ; IMMEDIATE out: 123
out: ; IMMEDIATE
;e ;e