#placeholder directive

#placeholder marks an identifier as defined by the metaprogram. This can be used to hint the compiler that the identifier is being generated in a compile time metaprogram.

// jai first.jai -- SOA
main :: () {
   print("Var is %, is a constant? %\n", Var, is_constant(Var));
}

#placeholder Var;

#run {
   #import "Compiler";
   options := get_build_options();

   add_build_string("Var :: true;");
}

#import "Basic";
1 Like