Main3.hx 504 B

123456789101112131415161718192021222324
  1. import haxe.macro.Context;
  2. class Main3 {
  3. static function init() {
  4. Context.onAfterInitMacros(() -> {
  5. function defineType(name, kind) {
  6. Context.defineType({
  7. pack: [],
  8. name: name,
  9. pos: (macro 0).pos,
  10. kind: kind,
  11. fields: []
  12. });
  13. }
  14. defineType("lowercase", TDClass());
  15. defineType("0_class", TDClass());
  16. defineType("0_enum", TDEnum);
  17. defineType("0_struct", TDStructure);
  18. defineType("0_abstract", TDAbstract(TPath({pack: [], name: "Int"})));
  19. });
  20. }
  21. }