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
class Main { | |
static function main() { | |
MyMacro.testReify(); | |
} | |
} |
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
@:font("C:/Windows/fonts/Arial.ttf", "a-zA-Z {}\\-\"1234") | |
class MyFont extends flash.text.Font { } | |
class Main { | |
static function main() { | |
var font = new MyFont(); | |
var fmt = new flash.text.TextFormat(); | |
fmt.size = 50; | |
fmt.font = font.fontName; |
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
class Main { | |
static function main() { | |
trace(process(12)); // 24 | |
trace(process("Hello world")); // HELLO WORLD | |
} | |
@:generic static function process<T>(t:T):T { | |
return throw "unknown type: " + t; | |
} | |
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
import haxe.macro.Expr; | |
class Main { | |
static function main() { | |
var a = generateCharCodeArray("foobar"); | |
trace(a); // [102,111,111,98,97,114] | |
} | |
#if haxe_211 | |
@:macro static public function generateCharCodeArray(source:String) { |
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 haxe.xml; | |
using StringTools; | |
enum State | |
{ | |
IGNORE_SPACES; | |
BEGIN; | |
BEGIN_NODE; | |
TAG_NAME; |
NewerOlder