Macro2.hx 341 B

123456789101112131415161718192021
  1. import haxe.macro.Context;
  2. class Macro2 {
  3. static function init() {
  4. function defineModule(name:String) {
  5. Context.defineModule(name, [{
  6. pos: (macro 0).pos,
  7. pack: [],
  8. name: name,
  9. kind: TDClass(),
  10. fields: []
  11. }]);
  12. }
  13. defineModule("Valid");
  14. defineModule("");
  15. defineModule("0");
  16. defineModule("Type+");
  17. }
  18. }