This is a WIP of a cheat-sheet that I will finish Eventually™
Mapping of the shader types to Heaps types:
Float = Float
Int = Int
Bool = Bool| using WithMacro; | |
| typedef Player = { | |
| final name:String; | |
| final level:Int; | |
| } | |
| class Main { | |
| static function main() { | |
| var player = {name: "Dan", level: 15}; |
This file was generated automatically based on this two sources:
This is a JSON object by following structure:
[string ext] : {
signs: [sign]
| #!/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 | |
| { | |
| /** |
| import haxe.macro.Context; | |
| import haxe.macro.Expr; | |
| using haxe.macro.ExprTools; | |
| class Main | |
| { | |
| inline static var QUOTED_FIELD_PREFIX = "@$__hx__"; | |
| static function main() |
| @:genericBuild(ConstMacro.build()) | |
| class Const<T> {} |
| class Main | |
| { | |
| static function main() | |
| { | |
| var a = ["a", "b", "c"]; | |
| for (p in new IndexIter(a)) | |
| { | |
| trace(p.idx); | |
| trace(p.val); |
| /** | |
| * 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> | |
| { | |
| /** |
| package fst.exception; | |
| import haxe.CallStack; | |
| /** | |
| * Exceptions base | |
| * | |
| */ | |
| class Exception { |
| import haxe.macro.Expr; | |
| class FTW | |
| { | |
| public static function build() | |
| { | |
| return haxe.macro.Context.getBuildFields().map(transformField); | |
| } | |
| static function transformField(field:Field) |