Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import haxe.macro.Expr;
- import haxe.macro.Context;
- using tink.macro.tools.ExprTools;
- class MyTrace
- {
- @:macro static public function mtrace(e:haxe.macro.Expr)
- {
- var e2 = {expr:EConst(CString(e.toString())),pos:Context.currentPos()};
- return macro trace( $e2 + ' ' + $e);
- }
- }
- class Main
- {
- public static function main()
- {
- var obj = {nr:10};
- MyTrace.mtrace(obj.nr);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment