Guest User

Untitled

a guest
Nov 11th, 2012
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import haxe.macro.Expr;
  2. import haxe.macro.Context;
  3. using tink.macro.tools.ExprTools;
  4. class MyTrace
  5. {
  6.     @:macro static public function mtrace(e:haxe.macro.Expr)
  7.     {
  8.         var e2 = {expr:EConst(CString(e.toString())),pos:Context.currentPos()};
  9.         return macro trace( $e2 + ' ' + $e);
  10.     }
  11. }
  12. class Main
  13. {
  14.     public static function main()
  15.     {
  16.         var obj = {nr:10};
  17.         MyTrace.mtrace(obj.nr);
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment