~lbnz/xr0

8185bc3362c5b04f40a82848ea0755396f194a55 — Xr0 Team 6 months ago 1ee0d67
allow dual proto def
3 files changed, 6 insertions(+), 15 deletions(-)

A libx/ctype.h
M src/0v/main.c
M tests/3-program/000-matrix.x
A libx/ctype.h => libx/ctype.h +0 -0
M src/0v/main.c => src/0v/main.c +3 -0
@@ 207,6 207,9 @@ pass1(struct ast *root, struct externals *ext)
			ast_externdecl_install(decl, ext);
			continue;
		}
		if (!externals_getfunc(ext, ast_function_name(f))) {
			ast_externdecl_install(decl, ext);
		}
		
		/* XXX: ensure that verified functions always have an abstract */
		assert(ast_function_abstract(f));

M tests/3-program/000-matrix.x => tests/3-program/000-matrix.x +3 -15
@@ 17,11 17,7 @@ matrix_create(int rows, int cols) ~ [
	for (i = 0; i < result->rows; i++) {
		.alloc result->data[i];	
	}
];

struct matrix *
matrix_create(int rows, int cols)
{
]{
	int i;
	struct matrix *m;



@@ 49,11 45,7 @@ matrix_destroy(struct matrix *m) ~ [
	}
	.dealloc m->data;
	.dealloc m;
];

void
matrix_destroy(struct matrix *m)
{
]{
	int i;

	for (i = 0; i < m->rows; i++) ~ [ .dealloc m->data[i]; ] {


@@ 79,11 71,7 @@ matrix_add(struct matrix *m1, struct matrix *m2) ~ [
	for (i = 0; i < result->rows; i++) {
		.alloc result->data[i];	
	}
];

struct matrix *
matrix_add(struct matrix *m1, struct matrix *m2)
{
]{
	int i; int j;
	struct matrix *res;