mirror of
https://github.com/forth-ev/VolksForth.git
synced 2024-11-29 21:49:17 +00:00
A few modifications to the core.fr test set required by the PETSCII charset.
And some tests are commented out with \vf as VolksForth can't yet easily be ANS-shimmed into providing EVALUATE and the WHILE - ELSE construct.
This commit is contained in:
parent
2eb2620641
commit
a32c1ece1d
@ -621,15 +621,15 @@ T{ -1 1ST +! 1ST @ -> 0 }T
|
||||
TESTING CHAR [CHAR] [ ] BL S"
|
||||
|
||||
T{ BL -> 20 }T
|
||||
T{ CHAR X -> 58 }T
|
||||
T{ CHAR HELLO -> 48 }T
|
||||
T{ : GC1 [CHAR] X ; -> }T
|
||||
T{ : GC2 [CHAR] HELLO ; -> }T
|
||||
T{ CHAR x -> 58 }T \ vf: s/X/x/
|
||||
T{ CHAR hello -> 48 }T \ vf: s/HELLO/hello/
|
||||
T{ : GC1 [CHAR] x ; -> }T \ vf: s/X/x/
|
||||
T{ : GC2 [CHAR] hello ; -> }T \ vf: s/HELLO/hello/
|
||||
T{ GC1 -> 58 }T
|
||||
T{ GC2 -> 48 }T
|
||||
T{ : GC3 [ GC1 ] LITERAL ; -> }T
|
||||
T{ GC3 -> 58 }T
|
||||
T{ : GC4 S" XY" ; -> }T
|
||||
T{ : GC4 S" xy" ; -> }T \ vf: s/XY/xy/
|
||||
T{ GC4 SWAP DROP -> 2 }T
|
||||
T{ GC4 DROP DUP C@ SWAP CHAR+ C@ -> 58 59 }T
|
||||
|
||||
@ -684,13 +684,13 @@ T{ 3 GI4 -> 3 4 5 6 }T
|
||||
T{ 5 GI4 -> 5 6 }T
|
||||
T{ 6 GI4 -> 6 7 }T
|
||||
|
||||
T{ : GI5 BEGIN DUP 2 >
|
||||
WHILE DUP 5 < WHILE DUP 1+ REPEAT 123 ELSE 345 THEN ; -> }T
|
||||
T{ 1 GI5 -> 1 345 }T
|
||||
T{ 2 GI5 -> 2 345 }T
|
||||
T{ 3 GI5 -> 3 4 5 123 }T
|
||||
T{ 4 GI5 -> 4 5 123 }T
|
||||
T{ 5 GI5 -> 5 123 }T
|
||||
\vf T{ : GI5 BEGIN DUP 2 >
|
||||
\vf WHILE DUP 5 < WHILE DUP 1+ REPEAT 123 ELSE 345 THEN ; -> }T
|
||||
\vf T{ 1 GI5 -> 1 345 }T
|
||||
\vf T{ 2 GI5 -> 2 345 }T
|
||||
\vf T{ 3 GI5 -> 3 4 5 123 }T
|
||||
\vf T{ 4 GI5 -> 4 5 123 }T
|
||||
\vf T{ 5 GI5 -> 5 123 }T
|
||||
|
||||
T{ : GI6 ( N -- 0,1,..N ) DUP IF DUP >R 1- RECURSE R> THEN ; -> }T
|
||||
T{ 0 GI6 -> 0 }T
|
||||
@ -774,27 +774,27 @@ T{ W1 -> HERE 2 + }T
|
||||
\ ------------------------------------------------------------------------
|
||||
TESTING EVALUATE
|
||||
|
||||
: GE1 S" 123" ; IMMEDIATE
|
||||
: GE2 S" 123 1+" ; IMMEDIATE
|
||||
: GE3 S" : GE4 345 ;" ;
|
||||
: GE5 EVALUATE ; IMMEDIATE
|
||||
\vf : GE1 S" 123" ; IMMEDIATE
|
||||
\vf : GE2 S" 123 1+" ; IMMEDIATE
|
||||
\vf : GE3 S" : GE4 345 ;" ;
|
||||
\vf : GE5 EVALUATE ; IMMEDIATE
|
||||
|
||||
T{ GE1 EVALUATE -> 123 }T ( TEST EVALUATE IN INTERP. STATE )
|
||||
T{ GE2 EVALUATE -> 124 }T
|
||||
T{ GE3 EVALUATE -> }T
|
||||
T{ GE4 -> 345 }T
|
||||
\vf T{ GE1 EVALUATE -> 123 }T ( TEST EVALUATE IN INTERP. STATE )
|
||||
\vf T{ GE2 EVALUATE -> 124 }T
|
||||
\vf T{ GE3 EVALUATE -> }T
|
||||
\vf T{ GE4 -> 345 }T
|
||||
|
||||
T{ : GE6 GE1 GE5 ; -> }T ( TEST EVALUATE IN COMPILE STATE )
|
||||
T{ GE6 -> 123 }T
|
||||
T{ : GE7 GE2 GE5 ; -> }T
|
||||
T{ GE7 -> 124 }T
|
||||
\vf T{ : GE6 GE1 GE5 ; -> }T ( TEST EVALUATE IN COMPILE STATE )
|
||||
\vf T{ GE6 -> 123 }T
|
||||
\vf T{ : GE7 GE2 GE5 ; -> }T
|
||||
\vf T{ GE7 -> 124 }T
|
||||
|
||||
\ ------------------------------------------------------------------------
|
||||
TESTING SOURCE >IN WORD
|
||||
|
||||
: GS1 S" SOURCE" 2DUP EVALUATE
|
||||
>R SWAP >R = R> R> = ;
|
||||
T{ GS1 -> <TRUE> <TRUE> }T
|
||||
\vf : GS1 S" SOURCE" 2DUP EVALUATE
|
||||
\vf >R SWAP >R = R> R> = ;
|
||||
\vf T{ GS1 -> <TRUE> <TRUE> }T
|
||||
|
||||
VARIABLE SCANS
|
||||
: RESCAN? -1 SCANS +! SCANS @ IF 0 >IN ! THEN ;
|
||||
@ -803,8 +803,8 @@ T{ 2 SCANS !
|
||||
345 RESCAN?
|
||||
-> 345 345 }T
|
||||
|
||||
: GS2 5 SCANS ! S" 123 RESCAN?" EVALUATE ;
|
||||
T{ GS2 -> 123 123 123 123 123 }T
|
||||
\vf : GS2 5 SCANS ! S" 123 RESCAN?" EVALUATE ;
|
||||
\vf T{ GS2 -> 123 123 123 123 123 }T
|
||||
|
||||
: GS3 WORD COUNT SWAP C@ ;
|
||||
T{ BL GS3 HELLO -> 5 CHAR H }T
|
||||
@ -832,7 +832,7 @@ TESTING <# # #S #> HOLD SIGN BASE >NUMBER HEX DECIMAL
|
||||
R> DROP 2DROP <FALSE> \ LENGTHS MISMATCH
|
||||
THEN ;
|
||||
|
||||
: GP1 <# 41 HOLD 42 HOLD 0 0 #> S" BA" S= ;
|
||||
: GP1 <# 41 HOLD 42 HOLD 0 0 #> S" ba" S= ; \ vf: s/BA/ba/
|
||||
T{ GP1 -> <TRUE> }T
|
||||
|
||||
: GP2 <# -1 SIGN 0 SIGN -1 SIGN 0 0 #> S" --" S= ;
|
||||
@ -878,7 +878,7 @@ T{ GP6 -> <TRUE> }T
|
||||
LOOP
|
||||
MAX-BASE A DO
|
||||
I 0 <# #S #>
|
||||
1 = SWAP C@ 41 I A - + = AND AND
|
||||
1 = SWAP C@ C1 I A - + = AND AND \ vf: s/41/C1/
|
||||
LOOP
|
||||
R> BASE ! ;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user