23 lines
572 B
C
23 lines
572 B
C
|
|
#include "../../include/ground.h"
|
||
|
|
|
||
|
|
GroundBytecodeValue _GroundCopyBytecodeValue(GroundBytecodeValue* value) {
|
||
|
|
GroundBytecodeValue newValue = *value;
|
||
|
|
switch (value->type.type) {
|
||
|
|
case GroundType_Int:
|
||
|
|
case GroundType_Double:
|
||
|
|
case GroundType_Bool:
|
||
|
|
case GroundType_Char:
|
||
|
|
break;
|
||
|
|
|
||
|
|
case GroundType_String: {
|
||
|
|
newValue.as.String = Ground.Copy.String(&value->as.String);
|
||
|
|
break;
|
||
|
|
}
|
||
|
|
|
||
|
|
// TODO: Implement copying for everything else
|
||
|
|
default: break;
|
||
|
|
}
|
||
|
|
|
||
|
|
return newValue;
|
||
|
|
}
|