{
const ast_expression *fromex;
ast_expression *selfex;
- ast_value *cp = ast_value_new(self->expression.node.context, self->name, self->expression.vtype);
+ ast_value *cp = ast_value_new(self->expression.context, self->name, self->expression.vtype);
if (self->expression.next) {
- cp->expression.next = ast_type_copy(self->expression.node.context, self->expression.next);
+ cp->expression.next = ast_type_copy(self->expression.context, self->expression.next);
}
fromex = &self->expression;
selfex = &cp->expression;
ast_instantiate(ast_value, ctx, ast_value_delete);
ast_expression_init((ast_expression*)self,
(ast_expression_codegen*)&ast_value_codegen);
- self->expression.node.keep_node = true; /* keep */
+ self->expression.keep_node = true; /* keep */
self->name = name ? util_strdup(name) : nullptr;
self->expression.vtype = t;
}
ast_expression_init((ast_expression*)self, (ast_expression_codegen*)&ast_member_codegen);
- self->expression.node.keep_node = true; /* keep */
+ self->expression.keep_node = true; /* keep */
if (owner->vtype == TYPE_VECTOR) {
self->expression.vtype = TYPE_FLOAT;
void ast_block_collect(ast_block *self, ast_expression *expr)
{
self->collect.push_back(expr);
- expr->node.keep_node = true;
+ expr->keep_node = true;
}
void ast_block_delete(ast_block *self)
* type `expression`, so the ast_ident's codegen would search for
* variables through the environment (or functions, constants...).
*/
-struct ast_expression {
+struct ast_expression : ast_node {
ast_expression() {}
- ast_node node;
ast_expression_codegen *codegen;
int vtype;
ast_expression *next;
ast_expression *out;
++opts_optimizationcount[OPTIM_VECTOR_COMPONENTS];
out = (ast_expression*)ast_member_new(ctx(), (ast_expression*)sel, set[0]-'x', nullptr);
- out->node.keep_node = false;
+ out->keep_node = false;
((ast_member*)out)->rvalue = true;
if (x != -1.0f)
return (ast_expression*)ast_binary_new(ctx(), INSTR_MUL_F, constgen_float(x, false), out);
* Blub: what sorts of unreffing and resizing of
* sy->out should I be doing here?
*/
- sy->out[fid] = syexp(foldval->node.context, foldval);
+ sy->out[fid] = syexp(foldval->context, foldval);
sy->out.erase(sy->out.end() - paramcount, sy->out.end());
vec_free(exprs);
}
/* overwrite fid, the function, with a call */
- sy->out[fid] = syexp(call->expression.node.context, (ast_expression*)call);
+ sy->out[fid] = syexp(call->expression.context, (ast_expression*)call);
if (fun->vtype != TYPE_FUNCTION) {
parseerror(parser, "not a function (%s)", type_name[fun->vtype]);