Add a mechanism to hook into the compilation process with custom transforms, see #20

A custom transform is a node module that exports hooks called by the compiler on specific occasions, then being able to modify the intermediate results. Starting with 'afterParse' to modify the AST before compilation is performed.
This commit is contained in:
dcodeIO
2018-05-26 13:13:39 +02:00
parent 7ad13f9d65
commit 113925fa7e
5 changed files with 29 additions and 3 deletions

2
std/assembly.d.ts vendored
View File

@ -267,7 +267,7 @@ declare function offsetof<T>(fieldName?: string): usize;
declare function changetype<T>(value: any): T;
/** Explicitly requests no bounds checks on the provided expression. Useful for array accesses. */
declare function unchecked<T>(value: T): T;
/** Creates a `call_indirect` instruction, calling the specified target by index with the specified arguments. */
/** Emits a `call_indirect` instruction, calling the specified function in the function table by index with the specified arguments. Does result in a runtime error if the arguments do not match the called function. */
declare function call_indirect<T>(target: Function | u32, ...args: any[]): T;
/** Tests if a 32-bit or 64-bit float is `NaN`. */
declare function isNaN<T = f32 | f64>(value: T): bool;