Created
December 21, 2011 12:11
-
-
Save skial/1505801 to your computer and use it in GitHub Desktop.
Haxe Macro | Access build field doc
This file contains 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
package uhu.macro.doc; | |
import haxe.macro.Context; | |
import haxe.macro.Expr; | |
import neko.io.File; | |
import neko.io.FileOutput; | |
/** | |
* ... | |
* @author Skial Bainn | |
*/ | |
class Build { | |
public static var file:FileOutput; | |
@:macro | |
public static function build():Array<Field> { | |
file = File.write('log.txt'); | |
var fields:Array<Field> = Context.getBuildFields(); | |
for (n in fields) { | |
file.writeString('' + n.name + ' | ' + n.doc + '\n'); | |
} | |
file.close(); | |
return fields; | |
} | |
} |
This file contains 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
package uhu.macro; | |
/** | |
* ... | |
* @author Skial Bainn | |
*/ | |
@:autoBuild(uhu.macro.doc.Build.build()) | |
interface Doc {} |
This file contains 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
main | null |
This file contains 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
package ; | |
import uhu.macro.Doc; | |
/** | |
* ... | |
* @author Skial Bainn | |
*/ | |
class Main implements Doc { | |
/** | |
* kkllkklklklklklklk | |
*/ | |
public static function main():Void { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment