Getters & setters (static); Instantiate compiler tests; Cleanup

This commit is contained in:
dcodeIO
2017-12-27 02:37:53 +01:00
parent 5c4bf1af76
commit ba61a5e414
49 changed files with 2359 additions and 1952 deletions

View File

@ -1,3 +1,7 @@
import {
Target
} from "./compiler";
import {
Class,
Function
@ -205,6 +209,18 @@ export class Type {
static readonly void: Type = new Type(TypeKind.VOID, 0);
}
// export class ClassType extends Type {
// constructor(cls: Class) {
// super(TypeKind.USIZE, clz.size);
// }
// }
// export class FunctionType extends Type {
// constructor(fun: Function) {
// super(TypeKind.USIZE, fun.program.target == Target.WASM64 ? 8 : 4);
// }
// }
/** Converts an array of types to an array of native types. */
export function typesToNativeTypes(types: Type[]): NativeType[] {
const k: i32 = types.length;