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; | |
import haxe.macro.Type; | |
class AbstractBuilder { | |
macro static public function build():Array<Field> { | |
var fields = Context.getBuildFields(); | |
var cCur = Context.getLocalClass().get(); | |
var fieldMap = [for (f in fields) f.name => true]; | |
function loop(c:ClassType) { |
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
typedef Constructible = { | |
public function new():Void; | |
} | |
@:generic | |
class Gen<T:(Constructible, Main)> { | |
public function new() { } | |
public function make() { | |
return new 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
package fst.exception; | |
import haxe.CallStack; | |
/** | |
* Exceptions base | |
* | |
*/ | |
class Exception { |
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
/** | |
* Simple wrapper for anonymous structures that are meant to be used as a | |
* keyed collection of objects of the same type (i.e. json object). | |
* | |
* Wraps Reflect calls with nice syntax and static typing without any | |
* runtime overhead. | |
*/ | |
abstract DynamicMap<V>(Dynamic<V>) from Dynamic<V> | |
{ | |
/** |
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 = ["a", "b", "c"]; | |
for (p in new IndexIter(a)) | |
{ | |
trace(p.idx); | |
trace(p.val); |
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
@:genericBuild(ConstMacro.build()) | |
class Const<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
<!-- NativeClient hxcpp toolchain --> | |
<xml> | |
<include name="gcc-toolchain.xml"/> | |
<path name="${NACL_SDK_ROOT}/toolchain/linux_x86_newlib/bin"/> | |
<set name="M" value="32" unless="HXCPP_M64" /> |
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
#!/usr/bin/env haxex -lib mcli @ | |
/** | |
Taken from mcli example https://github.com/waneck/mcli | |
Say hello. | |
Example inspired by ruby's "executable" lib example | |
**/ | |
class HaxeScript extends mcli.CommandLine | |
{ | |
/** |
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) |
OlderNewer