class thx.macro.Macros
Available on neko
Helper methods to use inside macro context.
Class Fields
static function getFileInClassPath(file:String):String
Given a relative file path, it returns the absolute path to that file if it is encountered within any of the available class path.
It returns null if the file is not found in the class paths.
static function getModuleDirectory(type:String):String
Given a fully qualified path to a type, it returns the path to the directory containing the module that contains that type.
If the type is not found, an exception is thrown.
static function getModulePath(type:String):String
Given a fully qualified path to a type, it returns the path to the file module containing that type.
If the type is not found, an exception is thrown.
static function getPackageDirectories(pack:String, ?paths:Array<String>):Array<String>
It returns all the directories that contain (or might contain) modules for the
specified pack
. The search is made by default in Context.getClassPath
, but
can be restricted to a certain list of paths
.
static function getPackageModules(pack:String, ?paths:Array<String>):Array<String>
Given a pack
age path, it returns all the modules contained in there.
The returned values have a fully qualified identifier for the module (it
includes the package and the module name).
The search is made by default in Context.getClassPath
, but
can be restricted to a certain list of paths
.
static function replaceSymbol(expr:Expr, symbol:String, withExpr:Expr):Expr
Given an expression expr, a String symbol and an expression withExpr, it returns a new expression with the substituion of symbol with witnExpr expression.