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
package ; | |
abstract JsonMap<T>({ }) from {} { | |
public function new() this = {}; | |
public function exists(key:String) return Reflect.hasField(this, key); | |
@:arrayAccess public function get(key:String) return Reflect.field(this, key); | |
@:arrayAccess public function set(key:String, value:T):T { | |
Reflect.setField(this, key, value); | |
return value; | |
} |
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
export OLDPATH=$PATH | |
export HAXE_NIGHTLY=$HOME/bin/haxe_nightly | |
hxn(){ | |
if [ -z "$USE_HAXE_NIGHTLY" ] || $USE_HAXE_NIGHTLY; then | |
echo "Changing to Haxe stable version" | |
export HAXE_STD_PATH=$OLD_HAXE_STD | |
export PATH=$OLDPATH | |
export USE_HAXE_NIGHTLY=false | |
else | |
echo "Changing to Haxe nightly at: $HAXE_NIGHTLY" |
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 FTW | |
{ | |
public static function build() | |
{ | |
return haxe.macro.Context.getBuildFields().map(transformField); | |
} | |
static function transformField(field:Field) |
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.Context; | |
import haxe.macro.Expr; | |
using haxe.macro.ExprTools; | |
class Main | |
{ | |
inline static var QUOTED_FIELD_PREFIX = "@$__hx__"; | |
static function main() |
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; | |
using haxe.macro.Tools; | |
abstract Fast(Xml) from Xml to Xml { | |
@:noCompletion public inline function new(xml:Xml) this = xml; | |
public var name(get,never):String; | |
inline function get_name() return this.nodeName; | |
public var elements(get,never):FastIterator; |
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() { | |
var a = getValue(); | |
} | |
static function getValue():Tuple<Bool,Int> { | |
return new Tuple(true, 10); | |
} | |
} |
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 haxe.ds.StringMap; | |
import haxe.macro.Context; | |
import haxe.macro.Expr; | |
import haxe.macro.Printer; | |
import haxe.macro.Type.ClassType; | |
import neko.Lib; | |
using haxe.macro.ExprTools; |
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() { | |
var x = 7; | |
var y = 10; | |
tools.Assert.assert(x == 7 && y == 11); | |
} | |
} |
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
{ | |
/* | |
// Place your snippets for Haxe here. Each snippet is defined under a snippet name and has a prefix, body and | |
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// \t, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
// same ids are connected. | |
// Example: | |
"Print to console": { | |
"prefix": "log", | |
"body": [ |
OlderNewer