Another one bites the dust!

This commit is contained in:
2022-08-29 16:25:53 +10:00
parent d055e9dc94
commit 08c8e7e3e6
3 changed files with 189 additions and 21 deletions

View File

@@ -72,6 +72,21 @@ Literal copyLiteral(Literal original) {
return lit;
}
case LITERAL_TYPE_INTERMEDIATE: {
LiteralArray* array = ALLOCATE(LiteralArray, 1);
initLiteralArray(array);
//copy each element
for (int i = 0; i < AS_ARRAY(original)->count; i++) {
pushLiteralArray(array, copyLiteral(AS_ARRAY(original)->literals[i]));
}
Literal ret = TO_ARRAY_LITERAL(array);
ret.type = LITERAL_TYPE_INTERMEDIATE;
return ret;
}
case LITERAL_FUNCTION_INTERMEDIATE: //caries a compiler
case LITERAL_FUNCTION_NATIVE:
//no copying possible
return original;