chainTo, exprTo

This commit is contained in:
Dima Granetchi
2014-11-26 16:38:11 +02:00
parent 3a1a4209ce
commit bf41716637
+10
View File
@@ -35,10 +35,20 @@ class BindExt {
return internalBindExpr(expr, listener);
}
@:noUsing macro static public function exprTo(expr:Expr, target:Expr):Expr {
var type = Context.typeof(expr).toComplexType();
return internalBindExpr(expr, macro function (_, to:Null<$type>) $target = to);
}
@:noUsing macro static public function chain(expr:Expr, listener:Expr):Expr {
return internalBindChain(expr, listener);
}
@:noUsing macro static public function chainTo(expr:Expr, target:Expr):Expr {
var type = Context.typeof(expr).toComplexType();
return internalBindChain(expr, macro function (_, to:Null<$type>) $target = to);
}
#if macro
public static function internalBindChain(expr:Expr, listener:Expr):Expr {