Advertisement
tinyevil

Untitled

Jan 15th, 2019
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. template debug_print!(T:Type)
  2. function(val: ref T){
  3.     @if (compiler.is_struct(T)){
  4.         puts(@compiler.get_type_name(T));
  5.         puts("{");
  6.         @for ( field in T.fields ){
  7.             puts("var ");
  8.             puts(@field.name);
  9.             puts(": ");
  10.             puts(@compiler.get_type_name(field.type));
  11.             puts(" = ");
  12.             debug_print!(@field.type)(val.@field);
  13.             puts(";");
  14.         }
  15.         puts("}");
  16.     }else{
  17.         ...
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement