@@ -240,7 +240,11 @@ CREATE []KEYWORDS []KEYWORDS KEY_SIZE ALLOT
240
240
241
241
: ]KEYWORD ( n -- addr) $WIDTH * []KEYWORDS + ;
242
242
: KEY, ( addr u --) #KEYWORDS @ ]KEYWORD PLACE #KEYWORDS 1+! ;
243
- : KEY" [CHAR] " PARSE KEY, ;
243
+
244
+ \ KEY" removes punctuation from the stored string because the
245
+ \ analyzer removes it as well.
246
+ \ But you can use it in the source code for human readability
247
+ : KEY" [CHAR] " PARSE PUNCTUATION$ STRIP KEY, ;
244
248
245
249
\ debugging ..............
246
250
\ : PRINT$ COUNT TYPE ;
@@ -281,15 +285,6 @@ VARIABLE POSITION
281
285
282
286
: KEYWORD$ ( -- $addr) KWORD# @ ]KEYWORD ;
283
287
284
- \ : A$ S" This rain in spain, is mainly on the TI-99" ;
285
- \ S" POOPY DIAPER" FIND-KEYWORD
286
- \ CR CR .S
287
-
288
- \ : .KEYWORD KEYWORD$ COUNT TYPE ;
289
-
290
- : ANALYZE ( addr len --)
291
- PUNCTUATION$ STRIP TOUPPER FIND-KEYWORD ;
292
-
293
288
294
289
\ ==============================================
295
290
\ --- REPLIES SUPPORT CODE ---
@@ -336,7 +331,7 @@ MACRO []XT " CELLS R@ + 2 CELLS +" \ address of Array of Xts
336
331
\ of the keyword phrase.
337
332
\ return everything after the keyword phrase
338
333
: /TAIL ( addr len -- adr len)
339
- POSITION @ KEYWORD$ LEN + /STRING 0 MAX ;
334
+ POSITION @ KEYWORD$ LEN + 1+ /STRING 0 MAX ;
340
335
341
336
342
337
\ conjugate any phrases in the ]PHRASE table
@@ -368,6 +363,13 @@ MACRO []XT " CELLS R@ + 2 CELLS +" \ address of Array of Xts
368
363
369
364
: <TOPIC?> <TOPIC> '?' ;
370
365
366
+ : ANALYZE ( addr len --)
367
+ PUNCTUATION$ STRIP TOUPPER FIND-KEYWORD ;
368
+
369
+
370
+ \ ALL THE REPLY CODE IS KEPT IN THE ELIZA VOCABULARY
371
+ \ THIS PREVENTS A NAME COLLISION WITH THE 'IF' KEYWORD
372
+
371
373
ONLY FORTH ALSO ELIZA DEFINITIONS
372
374
\
373
375
\ Replies for unknown KEYWORD
@@ -383,12 +385,6 @@ ONLY FORTH ALSO ELIZA DEFINITIONS
383
385
:: CR ." Do you feel strongly about discussing such things?" ;
384
386
} REPLY: TAPDANCE
385
387
386
- \ **************************************************
387
- \ Eliza replies are separate file for easier editing
388
- \ They compile into LOW RAM and take almost all 8K
389
- S" DSK2.ELIZADATA4" INCLUDED
390
-
391
- \ **************************************************
392
388
393
389
\ A few more reply type words
394
390
DECIMAL
@@ -407,7 +403,7 @@ DECIMAL
407
403
\ Keyword Forth word that is called
408
404
KEY" BYE" : BYE END_SESSION ;
409
405
KEY" GOODBYE" : GOODBYE END_SESSION ;
410
-
406
+
411
407
\ bad words list
412
408
KEY" SHIT"
413
409
{ :: CR ." Hey now." CR ." We don't use that kind of language here." ;
@@ -424,6 +420,12 @@ DECIMAL
424
420
KEY" BASTARD" : BASTARD SHIT ;
425
421
KEY" HELL" : HELL SHIT ;
426
422
423
+ \ **************************************************
424
+ \ Eliza replies are separate file for easier editing
425
+ \ They compile into LOW RAM and take almost all 8K
426
+ S" DSK2.ELIZADATA4" INCLUDED
427
+
428
+ \ **************************************************
427
429
\ programmer's trap door into Forth :-)
428
430
KEY" CONSOLE" : CONSOLE
429
431
CR
@@ -478,5 +480,4 @@ DECIMAL
478
480
LOCK
479
481
480
482
INCLUDE DSK1.SAVESYS
481
-
482
483
' START SAVESYS DSK2.ELIZA
0 commit comments