From f2948cee9bd925dd79285a1075456ec561e42454 Mon Sep 17 00:00:00 2001 From: Brad Nelson Date: Tue, 7 Jun 2022 23:56:14 -0700 Subject: [PATCH] Fixup accept extra CR. --- common/base_tests.fs | 8 ++------ common/boot.fs | 2 +- common/testing.fs | 1 - 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/common/base_tests.fs b/common/base_tests.fs index 55376a9..f7bdd24 100644 --- a/common/base_tests.fs +++ b/common/base_tests.fs @@ -103,16 +103,12 @@ e: test-accept in: 1234567890xxxxxx pad 10 accept pad swap type cr - out:\ --> 1234567890 - out:cr! - out:cr + out: --> 1234567890 out: 1234567890 in: foo pad 10 accept pad swap type cr - out:\ --> foo - out:cr! - out:cr + out: --> foo out: foo ;e diff --git a/common/boot.fs b/common/boot.fs index b126941..0dc7371 100644 --- a/common/boot.fs +++ b/common/boot.fs @@ -159,7 +159,7 @@ variable hld ( Input ) : raw.s depth 0 max for aft sp@ r@ cells - @ . then next ; variable echo -1 echo ! variable arrow -1 arrow ! 0 value wascr -: *emit ( n -- ) dup emit 13 = if cr then ; +: *emit ( n -- ) dup 13 = if drop cr else emit then ; : ?echo ( n -- ) echo @ if *emit else drop then ; : ?arrow. arrow @ if >r >r raw.s r> r> ." --> " then ; : *key ( -- n ) diff --git a/common/testing.fs b/common/testing.fs index 68d530a..da27e8f 100644 --- a/common/testing.fs +++ b/common/testing.fs @@ -45,7 +45,6 @@ variable expect-used variable result-used : result-type ( a n -- ) for aft dup c@ result-emit 1+ then next drop ; : expected ( -- a n ) expect-buffer expect-used @ ; : resulted ( -- a n ) result-buffer result-used @ ; -: out:cr! 13 expect-emit ; : out:cr 13 expect-emit nl expect-emit ; : out:\ ( "line" -- ) nl parse expect-type ; : out: ( "line" -- ) out:\ out:cr ;