view rectypeTest/struct.cbc @ 5:90e6146d24cd

fix stack1.c
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Wed, 22 Oct 2014 19:02:57 +0900
parents bacef8675607
children
line wrap: on
line source

struct aaa {
	__rectype *child;
};
__code test() {
	struct aaa b;
}

struct interface {
	__code (*next)(struct interface);
};


#include <stdio.h>
#include <stdlib.h>
__code csB() {
	exit(0);
}
__code print(struct interface p) {
	puts("hello");
	exit(0);
}

__code csA(struct interface p) {
	struct interface ds = { csB };
	goto p.next(ds);
//	goto p.next(3); // error
}

int main() {
	struct interface ds = { print };
	goto csA(ds);
	return 0;
}