Created
May 28, 2014 14:52
-
-
Save misterpah/25c0d74e098631f44cc3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import haxe.macro.Context; | |
import haxe.macro.Expr; | |
class ClassNameHelper { | |
macro static public function getClassName():ExprOf<String> { | |
return { expr: EConst(CString(Context.getLocalClass().toString())), pos: Context.currentPos() } | |
} | |
} | |
class Test { | |
public static function main() { | |
trace(ClassNameHelper.getClassName()); //Test | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment