| 1 | \ @(#) private.fth 98/01/26 1.2\r |
| 2 | \ PRIVATIZE\r |
| 3 | \\r |
| 4 | \ Privatize words that are only needed within the file\r |
| 5 | \ and do not need to be exported.\r |
| 6 | \\r |
| 7 | \ Usage:\r |
| 8 | \ PRIVATE{\r |
| 9 | \ : FOO ; \ Everything between PRIVATE{ and }PRIVATE will become private.\r |
| 10 | \ : MOO ;\r |
| 11 | \ }PRIVATE\r |
| 12 | \ : GOO foo moo ; \ can use foo and moo\r |
| 13 | \ PRIVATIZE \ smudge foo and moo\r |
| 14 | \ ' foo \ will fail\r |
| 15 | \\r |
| 16 | \ Copyright 1996 Phil Burk\r |
| 17 | \\r |
| 18 | \ 19970701 PLB Use unsigned compares for machines with "negative" addresses.\r |
| 19 | \r |
| 20 | anew task-private.fth\r |
| 21 | \r |
| 22 | variable private-start\r |
| 23 | variable private-stop\r |
| 24 | $ 20 constant FLAG_SMUDGE\r |
| 25 | \r |
| 26 | : PRIVATE{\r |
| 27 | latest private-start !\r |
| 28 | 0 private-stop !\r |
| 29 | ;\r |
| 30 | : }PRIVATE\r |
| 31 | private-stop @ 0= not abort" Extra }PRIVATE"\r |
| 32 | latest private-stop !\r |
| 33 | ;\r |
| 34 | : PRIVATIZE ( -- , smudge all words between PRIVATE{ and }PRIVATE )\r |
| 35 | private-start @ 0= abort" Missing PRIVATE{"\r |
| 36 | private-stop @ 0= abort" Missing }PRIVATE"\r |
| 37 | private-stop @\r |
| 38 | BEGIN\r |
| 39 | dup private-start @ u> \ 19970701\r |
| 40 | WHILE\r |
| 41 | \ ." Smudge " dup id. cr\r |
| 42 | dup c@ flag_smudge or over c!\r |
| 43 | prevname\r |
| 44 | REPEAT\r |
| 45 | drop\r |
| 46 | 0 private-start !\r |
| 47 | 0 private-stop !\r |
| 48 | ;\r |