This file contains hidden or 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 ; | |
| #if macro | |
| import haxe.macro.Context.*; | |
| using haxe.macro.Tools; | |
| #end | |
| class ClassList { | |
| static var NAME = 'ClassList';//must be the fully qualified name of this class | |
| macro static function build() { |
This file contains hidden or 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 ; | |
| #if macro | |
| import haxe.macro.Compiler; | |
| import haxe.macro.Context; | |
| import haxe.macro.Expr; | |
| using haxe.macro.Tools; | |
| #end |
This file contains hidden or 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
| var run = true; | |
| Thread.create(function () { | |
| Sys.getChar(true); | |
| run = false; | |
| }); | |
| while (run) { | |
| Sys.sleep(.5); | |
| println('yay');//assume this would block until the other side reads in fact |
This file contains hidden or 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
| enum Process<O> { | |
| Emit(head:O,tail:Process<O>); | |
| Held(ft:Future<Process<O>>); | |
| Halt(e:Null<Error>); | |
| } | |
| typedef InOut<In, Out> = Process<Either<Callback<In>, Out>>; |
This file contains hidden or 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
| abstract Flags(Int) { | |
| public inline function new(i = 0) { | |
| this = i; | |
| } | |
| public inline function has( index : Int ) : Bool { | |
| return this & (1 << index) != 0; | |
| } |
This file contains hidden or 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 flash.events; | |
| extern class EventDispatcher implements IEventDispatcher { | |
| function new(?target:IEventDispatcher) : Void; | |
| function addEventListener<T:Event>(type:EventType<T>, listener: T->Void, useCapture:Bool = false, priority:Int = 0, useWeakReference:Bool = false):Void; | |
| function dispatchEvent(event:Event):Bool; | |
| function hasEventListener(type:String):Bool; | |
| function removeEventListener<T:Event>(type:EventType<T>, listener: T->Void, useCapture:Bool = false):Void; | |
| function toString():String; | |
| function willTrigger(type:String):Bool; |
This file contains hidden or 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.macro.*; | |
| import haxe.macro.Type; | |
| using haxe.macro.Tools; | |
| private typedef Accessor = { | |
| name: String, | |
| read: Bool, |
This file contains hidden or 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 ; | |
| class Helper { | |
| static public function indexOf<A>(i:Iterable<A>, filter:A->Bool):Int { | |
| var i = 0; | |
| for (x in a) { | |
| i++; | |
| if (filter(x)) return i; | |
| } |
This file contains hidden or 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 strict; | |
| import StdTypes.Int in HxInt; | |
| abstract Int(HxInt) from HxInt to HxInt { | |
| @:op(this + b) inline function add(b:Int):Int return this + (b : HxInt); | |
| @:op(this - b) inline function subtract(b:Int):Int return this - (b : HxInt); | |
| @:op(this * b) inline function multiply(b:Int):Int return this * (b : HxInt); | |
| @:op(this >>> b) inline function urshift(b:Int):Int return this >>> (b : HxInt); | |
| @:op(this >> b) inline function rshift(b:Int):Int return this >> (b : HxInt); |
This file contains hidden or 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 CompletionPoint = { | |
| file:String, | |
| offset:Int | |
| } | |
| interface HaxeCompletion { | |
| function field(at:CompletionPoint):Array<haxe.macro.ClassField>; | |
| function usage(at:CompletionPoint):Array<haxe.macro.Position>; | |
| function toplevel(at:CompletionPoint):Array<TopLevel>; | |
| } |