fval->m_next = (ast_expression*)ast_value_new(array->m_context, "<void>", TYPE_VOID);
index = ast_value_new(array->m_context, "index", TYPE_FLOAT);
- value = ast_value_copy((ast_value*)array->m_next);
+ value = ast_value_from_type((ast_value*)array->m_next);
if (!index || !value) {
parseerror(parser, "failed to create locals for array accessor");
entity = ast_value_new(array->m_context, "entity", TYPE_ENTITY);
index = ast_value_new(array->m_context, "index", TYPE_FLOAT);
- value = ast_value_copy((ast_value*)array->m_next);
+ value = ast_value_from_type((ast_value*)array->m_next);
if (!entity || !index || !value) {
parseerror(parser, "failed to create locals for array accessor");
goto cleanup;
/* generate the basic type value */
if (cached_typedef) {
- var = ast_value_copy(cached_typedef);
+ var = ast_value_from_type(cached_typedef);
ast_value_set_name(var, "<type(from_def)>");
} else
var = ast_value_new(ctx, "<type>", parser_token(parser)->constval.t);
/* store the base if requested */
if (storebase) {
- *storebase = ast_value_copy(var);
+ *storebase = ast_value_from_type(var);
if (isfield) {
tmp = ast_value_new(ctx, "<type:f>", TYPE_FIELD);
tmp->m_next = (ast_expression*)*storebase;
parseerror(parser, "expected another variable");
break;
}
- var = ast_value_copy(basetype);
+ var = ast_value_from_type(basetype);
cleanvar = true;
ast_value_set_name(var, parser_tokval(parser));
if (!parser_next(parser)) {