The following is a description of the coverage phase.
type ObjectMap = Immutable.Map<Name, ObjectLitType>
type Name = string;
interface ObjectLitType {
type: 'object-lit',
properties: Immutable.Map<String, Immutable.List<Type>>
call?: Immutable.List<FunctionLitType>
}
type Type
= BuiltinType
| FunctionRefType
| ObjectLitType
| FunctionLitType
interface BuiltinType {
type: BasicTypes
action: Action
}
interface ObjectLitType {
type: 'object-lit',
properties: Immutable.Map<String, Immutable.List<Type>>
call?: Immutable.List<FunctionLitType>
}
interface FunctionLitType {
type: 'function-lit'
parameters: Immutable.List<Parameter>,
returnType: Type
}
interface Parameter {
type: Type
}
interface FunctionRefType {
type: 'function',
name: string,
action: Action
}
enum Action {
Set,
Get,
Apply
}
type BasicTypes
= "number"
| "string"
| "boolean"
| "void"
| "any"
| "undefined"
The ObjectMap contains references for all objects.
New functions are given a new name using a gensym and attached to the ObjectMap with a reference in the location using an ObjectLit and setting/appending to the call? property.