~lbnz/xr0

b27072de4f4a36ec2ae906dce56787fc585941bb — Claude Betz 2 months ago a733c5a feat/converge-syntax
checkpoint
M src/0v/ast/expr/expr.c => src/0v/ast/expr/expr.c +2 -9
@@ 686,13 686,6 @@ ast_expr_clump_create(struct ast_expr *arg)
	return expr;
}

struct ast_expr *
ast_expr_as_allocation(struct ast_expr *expr)
{
	assert(expr->kind = EXPR_ALLOCATION);
	return expr;
}

static struct ast_expr *
ast_expr_alloc_copy(struct ast_expr *expr)
{


@@ 718,10 711,10 @@ ast_expr_alloc_str_build(struct ast_expr *expr, struct strbuilder *b)

	switch (expr->u.alloc.kind) {
	case ALLOC:
		strbuilder_printf(b, ".%s %s;", "alloc", arg);
		strbuilder_printf(b, ".%s %s;", "malloc", arg);
		break;
	case DEALLOC:
		strbuilder_printf(b, ".%s %s;", "dealloc", arg);
		strbuilder_printf(b, ".%s %s;", "free", arg);
		break;
	case CLUMP:
		strbuilder_printf(b, ".%s %s;", "clump", arg);

M src/0v/ast/expr/verify.c => src/0v/ast/expr/verify.c +0 -2
@@ 177,8 177,6 @@ static struct error *
rangeprocess_alloc(struct ast_expr *expr, struct ast_expr *lw, struct ast_expr *up,
		struct state *state)
{
	struct error *err;

	struct ast_expr *lval = ast_expr_assignment_lval(expr),
			*rval = ast_expr_assignment_rval(expr);
	assert(ast_expr_kind(rval) == EXPR_ALLOCATION);

M src/0v/ast/function/function.c => src/0v/ast/function/function.c +1 -1
@@ 336,7 336,7 @@ inititalise_param(struct ast_variable *param, struct state *state)
	assert(obj);
	if (object_hasvalue(obj)) {
		/* must on the clump or heap */
		struct value *val = object_as_value(obj);	
		//struct value *val = object_as_value(obj);	
		//struct location *loc = value_as_location(val);
		//assert(
		//	location_type(loc) == LOCATION_DEREFERENCABLE ||

M src/0v/ast/stmt/verify.c => src/0v/ast/stmt/verify.c +0 -5
@@ 372,8 372,6 @@ sel_absexec(struct ast_stmt *stmt, struct state *state, bool should_setup)
struct decision
sel_decide(struct ast_expr *control, struct state *state)
{
	/*printf("(sel_decide) state: %s\n", state_str(state));*/
	/*printf("(sel_decide) control: %s\n", ast_expr_str(control));*/
	struct result *res = ast_expr_pf_reduce(control, state);
	if (result_iserror(res)) {
		return (struct decision) { .err = result_as_error(res) };


@@ 381,11 379,8 @@ sel_decide(struct ast_expr *control, struct state *state)
	assert(result_hasvalue(res)); /* TODO: user error */

	struct value *v = result_as_value(res);
	/*printf("(sel_decide) value: %s\n", value_str(v));*/
	if (value_issync(v)) {
		struct ast_expr *sync = value_as_sync(v);
		/*printf("state: %s\n", state_str(state));*/
		/*printf("sync: %s\n", ast_expr_str(sync));*/
		struct props *p = state_getprops(state);
		if (props_get(p, sync)) {
			return (struct decision) { .decision = true, .err = NULL };