diff options
author | dan <[email protected]> | 2023-06-12 13:07:43 -0400 |
---|---|---|
committer | dan <[email protected]> | 2023-06-12 13:07:43 -0400 |
commit | eb39d909fdf52b25a37a0e60e4185dc2881d3a2b (patch) | |
tree | bff8b6a198d5eae255f59f24b49831ad4d03824d | |
parent | 3882eb6331079920cd9914f6adc64c439c767bc6 (diff) | |
download | forth-eb39d909fdf52b25a37a0e60e4185dc2881d3a2b.tar.gz forth-eb39d909fdf52b25a37a0e60e4185dc2881d3a2b.tar.bz2 forth-eb39d909fdf52b25a37a0e60e4185dc2881d3a2b.zip |
refactor: remove unused optable methods compilewords and addop
-rw-r--r-- | forthmachine_optable.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/forthmachine_optable.c b/forthmachine_optable.c index 2a51610..22353a1 100644 --- a/forthmachine_optable.c +++ b/forthmachine_optable.c @@ -62,32 +62,6 @@ const static wordop inittable[] = { {"i", optype_builtin, {lcsindex}}, }; - -static compileditem* optable_compilewords(optable* ot, int len, char** script) { - compileditem* oplist = malloc(sizeof(compileditem) * len); - for (int i = 0; i < len; i++) { - wordop* wordop = optable_getop(ot, script[i]); - if (wordop) { - oplist[i].type = compileditem_stackop; - oplist[i].wordop = wordop; - } else { - oplist[i].type = compileditem_literal; - oplist[i].literal = atoi(script[i]); - } - } - return oplist; -} - -void optable_addop(optable* ot, char* name, int len, char** words) { - ot->optable[ot->len].word = malloc(sizeof(name)); - strcpy(ot->optable[ot->len].word, name); - ot->optable[ot->len].optype = optype_compiled; - ot->optable[ot->len].oplistlen = len; - compileditem* oplist = optable_compilewords(ot, len, words); - ot->optable[ot->len].oplist = oplist; - ot->len++; -} - optable* optable_new(errorhandler errorhandler) { optable* ot = malloc(sizeof(optable)); ot->optable = malloc(sizeof(wordop) * OPTABLE_MAX_SIZE); |