View Macros.hx
import haxe.macro.Context;
import haxe.macro.Expr;
class Macros {
macro public static function autoInt():Array<Field> {
var fields = Context.getBuildFields();
var t = switch(Context.getLocalClass().get().kind) {
case KAbstractImpl(c):
View Main.cs
#pragma warning disable 109, 114, 219, 429, 168, 162
public class EntryPoint__Main {
public static void Main() {
public class Main : global::haxe.lang.HxObject {
View OneOf.hx
import haxe.ds.Either;
abstract OneOf<A, B>(Either<A, B>) from Either<A, B> to Either<A, B> {
@:from inline static function fromA<A, B>(a:A) : OneOf<A, B> return Left(a);
@:from inline static function fromB<A, B>(b:B) : OneOf<A, B> return Right(b);
@:to inline function toA():Null<A> return switch(this) {case Left(a): a; default: null;}
@:to inline function toB():Null<B> return switch(this) {case Right(b): b; default: null;}
View Main.hx
class Assert {
public static inline function assert(truth: Bool) {
#if debug
if (!truth) {
trace('assert failed');
View MacroEnum.hx
package ;
#if macro
import haxe.macro.Context;
import haxe.macro.Printer;
import haxe.macro.Expr;
class MacroEnum {
macro public static function buildToString():Array<Field> {
View FlxPhysicsDemo.hx
//change line 39 to this
super(Math.floor(stageWidth / ratio), Math.floor(stageHeight / ratio), Piramid, ratio, 30, 30);