Rework resolver (#489)

* Rework IR and resolver to use nested lookup tables
* Integrate types into IR
* Make components prefer IR, slimmed down AST
* Implement `export *`
* Add `@lazy` annotation and remove `--noTreeShaking`
* Add `@start` annotation and remove magic `main`
* Related refactoring, cleanup and docs
This commit is contained in:
Daniel Wirtz
2019-02-21 00:11:22 +01:00
committed by GitHub
parent e623786b42
commit 0c64f21250
234 changed files with 16949 additions and 37871 deletions

View File

@ -38,8 +38,6 @@ declare type f64 = number;
/** Compiler target. 0 = JS, 1 = WASM32, 2 = WASM64. */
declare const ASC_TARGET: i32;
/** Provided noTreeshaking option. */
declare const ASC_NO_TREESHAKING: bool;
/** Provided noAssert option. */
declare const ASC_NO_ASSERT: bool;
/** Provided memoryBase option. */
@ -354,7 +352,7 @@ declare namespace f64 {
export function store(offset: usize, value: f64, constantOffset?: usize): void;
}
/** Macro type evaluating to the underlying native WebAssembly type. */
declare type NATIVE<T> = T;
declare type native<T> = T;
/** Pseudo-class representing the backing class of integer types. */
declare class _Integer {
@ -966,7 +964,7 @@ declare function unmanaged(constructor: Function): void;
/** Annotates a class as being sealed / non-derivable. */
declare function sealed(constructor: Function): void;
/** Annotates a method or function as always inlined. */
/** Annotates a method, function or constant global as always inlined. */
declare function inline(
target: any,
propertyKey: string,
@ -979,3 +977,17 @@ declare function external(namespace: string, name: string): (
propertyKey: string,
descriptor: TypedPropertyDescriptor<any>
) => TypedPropertyDescriptor<any> | void;
/** Annotates a global for lazy compilation. */
declare function lazy(
target: any,
propertyKey: string,
descriptor: TypedPropertyDescriptor<any>
): TypedPropertyDescriptor<any> | void;
/** Annotates a function as the explicit start function. */
declare function start(
target: any,
propertyKey: string,
descriptor: TypedPropertyDescriptor<any>
): TypedPropertyDescriptor<any> | void;