static macro public function inject() {
var glFields = TypeTools.getClass(TypeTools.follow(Context.getType('hyper.super.Awesome'))).statics.get();
for (field in glFields) {
if (field.isPublic)
switch (field.kind) {
case FMethod(k):
switch (field.expr().expr) {
case TFunction(_.expr.expr => TBlock(block)):
block.unshift(TypedExpr ???);
default:
}
default:
}
}
}
static public function print() {
trace('yeah');
}
static macro public function inject() {
for (field in glFields) {
if (field.isPublic)
switch (field.kind) {
case FMethod(k):
switch (field.expr().expr) {
case TFunction(_.expr.expr => TBlock(block)):
var e = macro Macros.print();
block.unshift(Context.typeExpr(e));
default:
}
break;
trace(field.name);
default:
}
}
}
"block.unshift(Context.typeExpr(e))" the actual class don't change and Macros.print() is never called.
Class fields can't be changed?
Sure you can, but you need a build macro. I think you best start here: http://haxe.org/manual/macro-type-building.html
--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.
--
Unexpected :
Build halted with errors.