From: Phil Burk Date: Sun, 13 Sep 2020 21:06:55 +0000 (-0700) Subject: Merge pull request #75 from SeekingMeaning/0BSD X-Git-Url: http://git.subgeniuskitty.com/pforth/.git/commitdiff_plain/HEAD?hp=1f99f95d6a7eecc05cae8fb357f9b7bf564c2725 Merge pull request #75 from SeekingMeaning/0BSD relicense to 0BSD --- diff --git a/build/unix/Makefile b/build/unix/Makefile index e80b56d..626d0ce 100644 --- a/build/unix/Makefile +++ b/build/unix/Makefile @@ -73,10 +73,10 @@ LINK = $(CC) $(LDFLAGS) PFOBJS = $(PFSOURCE:.c=.o) PFEMBOBJS = $(PFSOURCE:.c=.eo) -.c.o: $(PFINCLUDES) +%.o: %.c $(PFINCLUDES) $(COMPILE) -c -o $@ $< -.c.eo: $(PFINCLUDES) pfdicdat.h +%.eo: %.c $(PFINCLUDES) pfdicdat.h $(COMPILE) $(EMBCCOPTS) -c -o $@ $< .PHONY: all clean test diff --git a/fth/ansilocs.fth b/fth/ansilocs.fth index 4e3dae9..735680f 100644 --- a/fth/ansilocs.fth +++ b/fth/ansilocs.fth @@ -142,19 +142,11 @@ if.forgotten lv.term THEN ; - : VALUE CREATE ( n ) , - immediate DOES> - state @ - IF - [compile] aliteral - compile @ - ELSE - @ - THEN + @ ; : TO ( val -- ) @@ -164,7 +156,7 @@ if.forgotten lv.term lv.compile.store ELSE find - 1 = 0= abort" TO or -> before non-local or non-value" + 0= abort" not found" >body \ point to data state @ IF \ compiling ( -- pfa ) @@ -186,7 +178,7 @@ if.forgotten lv.term [compile] literal compile (local+!) ELSE find - 1 = 0= abort" +-> before non-local or non-value" + 0= abort" not found" >body \ point to data state @ IF \ compiling ( -- pfa ) diff --git a/fth/history.fth b/fth/history.fth index 42c2696..eed5e46 100644 --- a/fth/history.fth +++ b/fth/history.fth @@ -494,6 +494,7 @@ variable KH-INSIDE ( true if we are scrolling inside the history buffer ) THEN ; +privatize : AUTO.INIT auto.init diff --git a/fth/private.fth b/fth/private.fth index d7d465d..6c0c55e 100644 --- a/fth/private.fth +++ b/fth/private.fth @@ -24,16 +24,20 @@ variable private-stop $ 20 constant FLAG_SMUDGE : PRIVATE{ + private-start @ 0= not abort" ERROR: Missing PRIVATIZE" + private-stop @ 0= not abort" ERROR: Missing PRIVATIZE" latest private-start ! 0 private-stop ! ; + : }PRIVATE - private-stop @ 0= not abort" Extra }PRIVATE" + private-stop @ 0= not abort" ERROR: Extra }PRIVATE" latest private-stop ! ; + : PRIVATIZE ( -- , smudge all words between PRIVATE{ and }PRIVATE ) - private-start @ 0= abort" Missing PRIVATE{" - private-stop @ 0= abort" Missing }PRIVATE" + private-start @ 0= abort" ERROR: Missing PRIVATE{" + private-stop @ 0= abort" ERROR: Missing }PRIVATE" private-stop @ BEGIN dup private-start @ u> \ 19970701 diff --git a/fth/t_locals.fth b/fth/t_locals.fth index 5cec9e0..0384ee2 100644 --- a/fth/t_locals.fth +++ b/fth/t_locals.fth @@ -14,6 +14,7 @@ test{ T{ 333 value my-value my-value }T{ 333 }T T{ 1000 -> my-value my-value }T{ 1000 }T T{ 35 +-> my-value my-value }T{ 1035 }T +T{ 987 to my-value my-value }T{ 987 }T : test.value ( -- ok ) 100 -> my-value my-value 100 = @@ -22,6 +23,11 @@ T{ 35 +-> my-value my-value }T{ 1035 }T ; T{ test.value }T{ TRUE }T +\ test compile time behavior of a VALUE +567 value VAL3 immediate +: VD3 val3 literal ; +T{ vd3 }T{ 567 }T + \ test locals in a word : test.locs { aa bb | cc -- ok } cc 0=