diff --git a/ueforth/Makefile b/ueforth/Makefile index 8da6117..8af0aef 100644 --- a/ueforth/Makefile +++ b/ueforth/Makefile @@ -159,17 +159,15 @@ $(GEN): COMMON_PREPLATFORM = common/boot.fs common/conditionals.fs common/vocabulary.fs \ common/floats.fs -COMMON_DESKTOP = common/hide_calls.fs common/ansi.fs +COMMON_DESKTOP = common/hide_calls.fs common/ansi.fs common/desktop.fs COMMON_POSTPLATFORM = common/utils.fs common/locals.fs \ common/filetools.fs common/highlevel.fs \ common/streams.fs common/blocks.fs POSIX_BOOT = $(COMMON_PREPLATFORM) \ - $(COMMON_DESKTOP) \ posix/posix.fs posix/posix_highlevel.fs posix/termios.fs \ - common/tasks.fs $(COMMON_POSTPLATFORM) \ - common/desktop.fs posix/posix_desktop.fs \ + common/tasks.fs $(COMMON_POSTPLATFORM) $(COMMON_DESKTOP) \ posix/sockets.fs posix/telnetd.fs posix/httpd.fs posix/web_interface.fs \ posix/autoboot.fs \ common/fini.fs @@ -177,9 +175,8 @@ $(GEN)/posix_boot.h: common/source_to_string.js $(POSIX_BOOT) | $(GEN) $< boot $(VERSION) $(REVISION) $(POSIX_BOOT) >$@ WINDOWS_BOOT = $(COMMON_PREPLATFORM) \ - $(COMMON_DESKTOP) \ windows/windows.fs windows/windows_highlevel.fs \ - common/tasks.fs $(COMMON_POSTPLATFORM) common/desktop.fs \ + common/tasks.fs $(COMMON_POSTPLATFORM) $(COMMON_DESKTOP) \ posix/autoboot.fs \ common/fini.fs $(GEN)/windows_boot.h: common/source_to_string.js $(WINDOWS_BOOT) | $(GEN) diff --git a/ueforth/common/ansi.fs b/ueforth/common/ansi.fs index b74ed5a..bdca015 100644 --- a/ueforth/common/ansi.fs +++ b/ueforth/common/ansi.fs @@ -29,4 +29,6 @@ forth definitions ansi : normal esc ." [0m" ; : at-xy ( x y -- ) esc ." [" 1+ n. ." ;" 1+ n. ." H" ; : page esc ." [2J" esc ." [H" ; +: set-title ( a n -- ) esc ." ]0;" type bel ; +s" uEforth" set-title forth diff --git a/ueforth/common/forth_namespace_tests.fs b/ueforth/common/forth_namespace_tests.fs index 597cefd..9151549 100644 --- a/ueforth/common/forth_namespace_tests.fs +++ b/ueforth/common/forth_namespace_tests.fs @@ -350,6 +350,7 @@ e: check-snapshots ;e e: check-ansi + out: set-title out: page out: at-xy out: normal @@ -379,11 +380,11 @@ DEFINED? windows [IF] e: test-forth-namespace internals voclist + out: ansi out: editor out: streams out: tasks out: windows - out: ansi out: internals out: FORTH ;e @@ -392,6 +393,7 @@ e: test-forth-namespace ' forth list-from out: FORTH check-args + check-ansi check-blocks out: streams check-highlevel @@ -414,7 +416,6 @@ e: test-forth-namespace out: default-key out: default-type out: windows - check-ansi check-highlevel-floats out: internals check-vocabulary @@ -433,12 +434,12 @@ e: test-forth-namespace out: httpd out: telnetd out: sockets + out: ansi out: editor out: streams out: tasks out: termios out: posix - out: ansi out: internals out: FORTH ;e @@ -450,8 +451,8 @@ e: test-forth-namespace out: httpd out: telnetd out: sockets - out: xlib check-args + check-ansi check-blocks out: streams check-highlevel @@ -474,7 +475,6 @@ e: test-forth-namespace out: default-key out: default-type out: posix - check-ansi check-highlevel-floats out: internals check-vocabulary diff --git a/ueforth/common/testing.fs b/ueforth/common/testing.fs index fcf4e6c..570092c 100644 --- a/ueforth/common/testing.fs +++ b/ueforth/common/testing.fs @@ -48,8 +48,17 @@ variable confirm-old-type : confirm{ ['] type >body @ confirm-old-type ! ['] result-type is type ; : }confirm confirm-old-type @ is type ; : expect-reset 0 expect-used ! 0 result-used ! ; +: diverged ( a n a n -- a n ) + begin + dup 0= if 2drop exit then + >r dup c@ >r rot dup c@ >r -rot r> r> <> r> swap if 2drop exit then + >r >r dup 0= if rdrop rdrop exit then r> r> + >r >r >r 1+ r> 1- r> 1+ r> 1- + again +; : expect-finish expected resulted str= if exit then }confirm - cr ." Expected:" cr expected type cr ." Resulted:" cr resulted type cr 1 throw ; + cr ." Expected:" cr expected resulted diverged type cr + ." Resulted:" cr resulted expected diverged type cr 1 throw ; ( Better error asserts ) : =assert ( actual expected -- ) diff --git a/ueforth/posix/posix_desktop.fs b/ueforth/posix/posix_desktop.fs deleted file mode 100644 index 8fffe09..0000000 --- a/ueforth/posix/posix_desktop.fs +++ /dev/null @@ -1,20 +0,0 @@ -\ Copyright 2021 Bradley D. Nelson -\ -\ Licensed under the Apache License, Version 2.0 (the "License"); -\ you may not use this file except in compliance with the License. -\ You may obtain a copy of the License at -\ -\ http://www.apache.org/licenses/LICENSE-2.0 -\ -\ Unless required by applicable law or agreed to in writing, software -\ distributed under the License is distributed on an "AS IS" BASIS, -\ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -\ See the License for the specific language governing permissions and -\ limitations under the License. - -forth definitions internals - -( Load Libraries ) -: xlib s" posix/xlib_test.fs" included ; - -forth diff --git a/ueforth/windows/windows.fs b/ueforth/windows/windows.fs index 0f31376..47539d1 100644 --- a/ueforth/windows/windows.fs +++ b/ueforth/windows/windows.fs @@ -128,11 +128,6 @@ only windows definitions -1 echo ! -ansi -: set-title ( a n -- ) esc ." ]0;" type bel ; -windows -s" uEforth" set-title - ( Window File Specific ) 1 constant FILE_SHARE_READ 2 constant FILE_SHARE_WRITE