package bindx; import haxe.macro.Expr; import haxe.macro.Context; import bindx.macro.BindExtMacros; using haxe.macro.Tools; using bindx.macro.MacroUtils; @:access(bindx.macro.BindxExtMacro) class BindExt { @:noUsing macro static public function expr(expr:ExprOf, listener:ExprOf->Null->Void>):ExprOfVoid> { return BindxExtMacro.bindExpr(expr, listener); } @:noUsing macro static public function exprTo(expr:ExprOf, target:ExprOf):ExprOfVoid> { var type = expr.getComplexType(); return BindxExtMacro.bindExpr(expr, macro function (_, to:Null<$type>) $target = to); } @:noUsing macro static public function chain(expr:ExprOf, listener:Expr):ExprOfVoid> { return BindxExtMacro.bindChain(expr, listener); } @:noUsing macro static public function chainTo(expr:ExprOf, target:ExprOf):ExprOfVoid> { var type = expr.getComplexType(); return BindxExtMacro.bindChain(expr, macro function (_, to:Null<$type>) $target = to); } }