Advertisement
tinyevil

Untitled

Jul 13th, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. function foo():i32{}
  2. function bar = $generate_bar;
  3.  
  4. struct point{ field x, y:Foo; }
  5.  
  6. --------------
  7.  
  8. (c) {
  9. let foo = c->create_function("foo");
  10. let bar = c->create_function("bar");
  11. let point = c->create_struct("point");
  12.  
  13. foo->set_declaration((c){
  14. c->set_return_type(c->get_i32());
  15. });
  16. foo->set_declaration((c){
  17. });
  18.  
  19. bar->set_definition((c) => generate_bar(c));
  20.  
  21. point->set_definition((c) {
  22. let x = c->create_field("x");
  23. let y = c->create_field("y");
  24.  
  25. x->set_type((c) => c.resolve_type("Foo"));
  26. y->set_type((c) => c.resolve_type("Foo"));
  27. });
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement