Refactor.

This commit is contained in:
Brad Nelson
2022-01-30 14:08:20 -08:00
parent a3c1446528
commit d78d380b1c
6 changed files with 20 additions and 37 deletions

View File

@ -159,17 +159,15 @@ $(GEN):
COMMON_PREPLATFORM = common/boot.fs common/conditionals.fs common/vocabulary.fs \ COMMON_PREPLATFORM = common/boot.fs common/conditionals.fs common/vocabulary.fs \
common/floats.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_POSTPLATFORM = common/utils.fs common/locals.fs \
common/filetools.fs common/highlevel.fs \ common/filetools.fs common/highlevel.fs \
common/streams.fs common/blocks.fs common/streams.fs common/blocks.fs
POSIX_BOOT = $(COMMON_PREPLATFORM) \ POSIX_BOOT = $(COMMON_PREPLATFORM) \
$(COMMON_DESKTOP) \
posix/posix.fs posix/posix_highlevel.fs posix/termios.fs \ posix/posix.fs posix/posix_highlevel.fs posix/termios.fs \
common/tasks.fs $(COMMON_POSTPLATFORM) \ common/tasks.fs $(COMMON_POSTPLATFORM) $(COMMON_DESKTOP) \
common/desktop.fs posix/posix_desktop.fs \
posix/sockets.fs posix/telnetd.fs posix/httpd.fs posix/web_interface.fs \ posix/sockets.fs posix/telnetd.fs posix/httpd.fs posix/web_interface.fs \
posix/autoboot.fs \ posix/autoboot.fs \
common/fini.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) >$@ $< boot $(VERSION) $(REVISION) $(POSIX_BOOT) >$@
WINDOWS_BOOT = $(COMMON_PREPLATFORM) \ WINDOWS_BOOT = $(COMMON_PREPLATFORM) \
$(COMMON_DESKTOP) \
windows/windows.fs windows/windows_highlevel.fs \ 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 \ posix/autoboot.fs \
common/fini.fs common/fini.fs
$(GEN)/windows_boot.h: common/source_to_string.js $(WINDOWS_BOOT) | $(GEN) $(GEN)/windows_boot.h: common/source_to_string.js $(WINDOWS_BOOT) | $(GEN)

View File

@ -29,4 +29,6 @@ forth definitions ansi
: normal esc ." [0m" ; : normal esc ." [0m" ;
: at-xy ( x y -- ) esc ." [" 1+ n. ." ;" 1+ n. ." H" ; : at-xy ( x y -- ) esc ." [" 1+ n. ." ;" 1+ n. ." H" ;
: page esc ." [2J" esc ." [H" ; : page esc ." [2J" esc ." [H" ;
: set-title ( a n -- ) esc ." ]0;" type bel ;
s" uEforth" set-title
forth forth

View File

@ -350,6 +350,7 @@ e: check-snapshots
;e ;e
e: check-ansi e: check-ansi
out: set-title
out: page out: page
out: at-xy out: at-xy
out: normal out: normal
@ -379,11 +380,11 @@ DEFINED? windows [IF]
e: test-forth-namespace e: test-forth-namespace
internals voclist internals voclist
out: ansi
out: editor out: editor
out: streams out: streams
out: tasks out: tasks
out: windows out: windows
out: ansi
out: internals out: internals
out: FORTH out: FORTH
;e ;e
@ -392,6 +393,7 @@ e: test-forth-namespace
' forth list-from ' forth list-from
out: FORTH out: FORTH
check-args check-args
check-ansi
check-blocks check-blocks
out: streams out: streams
check-highlevel check-highlevel
@ -414,7 +416,6 @@ e: test-forth-namespace
out: default-key out: default-key
out: default-type out: default-type
out: windows out: windows
check-ansi
check-highlevel-floats check-highlevel-floats
out: internals out: internals
check-vocabulary check-vocabulary
@ -433,12 +434,12 @@ e: test-forth-namespace
out: httpd out: httpd
out: telnetd out: telnetd
out: sockets out: sockets
out: ansi
out: editor out: editor
out: streams out: streams
out: tasks out: tasks
out: termios out: termios
out: posix out: posix
out: ansi
out: internals out: internals
out: FORTH out: FORTH
;e ;e
@ -450,8 +451,8 @@ e: test-forth-namespace
out: httpd out: httpd
out: telnetd out: telnetd
out: sockets out: sockets
out: xlib
check-args check-args
check-ansi
check-blocks check-blocks
out: streams out: streams
check-highlevel check-highlevel
@ -474,7 +475,6 @@ e: test-forth-namespace
out: default-key out: default-key
out: default-type out: default-type
out: posix out: posix
check-ansi
check-highlevel-floats check-highlevel-floats
out: internals out: internals
check-vocabulary check-vocabulary

View File

@ -48,8 +48,17 @@ variable confirm-old-type
: confirm{ ['] type >body @ confirm-old-type ! ['] result-type is type ; : confirm{ ['] type >body @ confirm-old-type ! ['] result-type is type ;
: }confirm confirm-old-type @ is type ; : }confirm confirm-old-type @ is type ;
: expect-reset 0 expect-used ! 0 result-used ! ; : 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 : 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 ) ( Better error asserts )
: =assert ( actual expected -- ) : =assert ( actual expected -- )

View File

@ -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

View File

@ -128,11 +128,6 @@ only windows definitions
-1 echo ! -1 echo !
ansi
: set-title ( a n -- ) esc ." ]0;" type bel ;
windows
s" uEforth" set-title
( Window File Specific ) ( Window File Specific )
1 constant FILE_SHARE_READ 1 constant FILE_SHARE_READ
2 constant FILE_SHARE_WRITE 2 constant FILE_SHARE_WRITE