From: Phil Burk Date: Sun, 13 Sep 2020 20:36:19 +0000 (-0700) Subject: Merge pull request #80 from letoh/use-pattern-rules X-Git-Url: http://git.subgeniuskitty.com/pforth/.git/commitdiff_plain/798a86ce907ac460e8646a2f57697d8b997c35d2?hp=457cb99f57292bc855e53abcdcb7b12d6681e847 Merge pull request #80 from letoh/use-pattern-rules use pattern rules instead of suffix rules in the Makefile --- diff --git a/fth/ansilocs.fth b/fth/ansilocs.fth index 3423bfc..923eef2 100644 --- a/fth/ansilocs.fth +++ b/fth/ansilocs.fth @@ -139,19 +139,11 @@ if.forgotten lv.term THEN ; - : VALUE CREATE ( n ) , - immediate DOES> - state @ - IF - [compile] aliteral - compile @ - ELSE - @ - THEN + @ ; : TO ( val -- ) @@ -161,7 +153,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 ) @@ -183,7 +175,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/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=