From 64944c24f639212c5db81731f699601c2c0fa81d Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Fri, 4 Aug 2023 14:52:01 +1000 Subject: [PATCH] Snipped some duplicate code, resolved #97 --- source/toy_interpreter.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/source/toy_interpreter.c b/source/toy_interpreter.c index 4435068..a5f0fa5 100644 --- a/source/toy_interpreter.c +++ b/source/toy_interpreter.c @@ -1991,27 +1991,9 @@ static void readInterpreterSections(Toy_Interpreter* interpreter) { } break; - case TOY_LITERAL_TYPE: { - //what the literal is - Toy_LiteralType literalType = (Toy_LiteralType)readByte(interpreter->bytecode, &interpreter->count); - unsigned char constant = readByte(interpreter->bytecode, &interpreter->count); - - Toy_Literal typeLiteral = TOY_TO_TYPE_LITERAL(literalType, constant); - - //save the type - Toy_pushLiteralArray(&interpreter->literalCache, typeLiteral); - -#ifndef TOY_EXPORT - if (Toy_commandLine.verbose) { - printf("(type "); - Toy_printLiteral(typeLiteral); - printf(")\n"); - } -#endif - } - break; - - case TOY_LITERAL_TYPE_INTERMEDIATE: { + case TOY_LITERAL_TYPE: + case TOY_LITERAL_TYPE_INTERMEDIATE: + { //what the literal represents Toy_LiteralType literalType = (Toy_LiteralType)readByte(interpreter->bytecode, &interpreter->count); unsigned char constant = readByte(interpreter->bytecode, &interpreter->count);