Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function foo():i32{}
- function bar = $generate_bar;
- struct point{ field x, y:Foo; }
- --------------
- (c) {
- let foo = c->create_function("foo");
- let bar = c->create_function("bar");
- let point = c->create_struct("point");
- foo->set_declaration((c){
- c->set_return_type(c->get_i32());
- });
- foo->set_declaration((c){
- });
- bar->set_definition((c) => generate_bar(c));
- point->set_definition((c) {
- let x = c->create_field("x");
- let y = c->create_field("y");
- x->set_type((c) => c.resolve_type("Foo"));
- y->set_type((c) => c.resolve_type("Foo"));
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement