Conversation
Search order done with custom functions. First copies addresses forth->C and those are used in creating and finding. Another C function to implement search wordlist. To enable wordlist support Macro PF_SUPPORT_WORDLIST must be defined. To set wordlist count fth/search.fth and constant WORDLISTS is to place to look. This commit currently breaks all words which use latest and context. For example WORDS display current compilation word list. Also FORGET might be also broken.
Renamed variables and commented more.
Static dictionary UNTESTED FORGET breaks MARKER breaks
forget and words working
First version which should work. More testing however required. Marker and forget aren't thoroughly tested
|
Works on static dictionary, test cases OK. Build system done only for Unix. Please review. |
|
I'm sorry this has not been reviewed for so long. |
philburk
left a comment
There was a problem hiding this comment.
I did not do an in-depth review of the code because I am not sure if you are still interested. Let me know if you are.
| } | ||
| } | ||
|
|
||
| /* This should be written in forth */ |
There was a problem hiding this comment.
Can it be written in Forth? Is something in pForth preventing that?
| { | ||
| const char *s; | ||
|
|
There was a problem hiding this comment.
These white space errors have all been fixed.
So the code would need to be rebased and all tabs converted to 4 spaces.
| \ Author: Hannu Vuolasaho | ||
| \ Copyright 2015 3DO, Phil Burk, Larry Polansky, Devid Rosenboom | ||
| \ | ||
| \ The pForth software code is dedicated to the public domain, |
| wl.order.first ! | ||
| ; | ||
|
|
||
| : wordlist ( -- wid , Create a new empty word list ) |
There was a problem hiding this comment.
In pForth, definitions are generally in UPPER CASE.
| forth-wordlist set-current | ||
| : hello ." Hello forth" cr ; | ||
|
|
||
| [then] No newline at end of file |
| /* Insert your functions here. */ | ||
|
|
||
| #ifdef PF_SUPPORT_WORDLIST | ||
| CustomFunctionTable[NUM_CUSTOM_FUNCTIONS + 0] = ffInitWordLists; |
There was a problem hiding this comment.
The custom functions are for others to extend pForth. These words would be part of pForth and should have IDs like the other kernel words.
Preliminary word list support. should work, but there must be some issues.