From eb39d909fdf52b25a37a0e60e4185dc2881d3a2b Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 12 Jun 2023 13:07:43 -0400 Subject: refactor: remove unused optable methods compilewords and addop --- forthmachine_optable.c | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'forthmachine_optable.c') 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); -- cgit v1.2.3