mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Snipped some duplicate code, resolved #97
This commit is contained in:
@@ -1991,27 +1991,9 @@ static void readInterpreterSections(Toy_Interpreter* interpreter) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TOY_LITERAL_TYPE: {
|
case TOY_LITERAL_TYPE:
|
||||||
//what the literal is
|
case TOY_LITERAL_TYPE_INTERMEDIATE:
|
||||||
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: {
|
|
||||||
//what the literal represents
|
//what the literal represents
|
||||||
Toy_LiteralType literalType = (Toy_LiteralType)readByte(interpreter->bytecode, &interpreter->count);
|
Toy_LiteralType literalType = (Toy_LiteralType)readByte(interpreter->bytecode, &interpreter->count);
|
||||||
unsigned char constant = readByte(interpreter->bytecode, &interpreter->count);
|
unsigned char constant = readByte(interpreter->bytecode, &interpreter->count);
|
||||||
|
|||||||
Reference in New Issue
Block a user