2022-09-08 10:59:49 -06:00
|
|
|
package analyzer
|
|
|
|
|
|
|
|
// This is a global, cannonical list of primitive and built-in types.
|
|
|
|
|
2022-10-04 14:19:26 -06:00
|
|
|
var PrimitiveF32 = createPrimitive("Int", Type {})
|
|
|
|
var PrimitiveF64 = createPrimitive("Int", Type {})
|
2022-09-10 17:50:18 -06:00
|
|
|
var PrimitiveInt = createPrimitive("Int", Type {})
|
|
|
|
var PrimitiveUInt = createPrimitive("UInt", Type {})
|
|
|
|
var PrimitiveI8 = createPrimitive("I8", Type {})
|
|
|
|
var PrimitiveI16 = createPrimitive("I16", Type {})
|
|
|
|
var PrimitiveI32 = createPrimitive("I32", Type {})
|
|
|
|
var PrimitiveI64 = createPrimitive("I64", Type {})
|
|
|
|
var PrimitiveU8 = createPrimitive("U8", Type {})
|
|
|
|
var PrimitiveU16 = createPrimitive("U16", Type {})
|
|
|
|
var PrimitiveU32 = createPrimitive("U32", Type {})
|
|
|
|
var PrimitiveU64 = createPrimitive("U64", Type {})
|
2022-10-01 15:21:17 -06:00
|
|
|
var PrimitiveObj = createPrimitive("Obj", Type {})
|
2022-09-10 17:50:18 -06:00
|
|
|
var PrimitiveFace = createPrimitive("Face", Type {})
|
2022-09-29 22:04:28 -06:00
|
|
|
var PrimitiveFunc = createPrimitive("Func", Type {})
|
2022-09-08 10:59:49 -06:00
|
|
|
|
2022-09-10 17:50:18 -06:00
|
|
|
var BuiltInString = createPrimitive("String", Type {
|
2022-09-18 00:41:06 -06:00
|
|
|
actual: PrimitiveU32,
|
2022-09-10 17:50:18 -06:00
|
|
|
kind: TypeKindVariableArray,
|
|
|
|
})
|
2022-09-08 10:59:49 -06:00
|
|
|
|
2022-09-10 17:50:18 -06:00
|
|
|
// createPrimitive provides a quick way to construct a primitive for the above
|
|
|
|
// list.
|
|
|
|
func createPrimitive (name string, inherits Type) (primitive TypeSection) {
|
|
|
|
primitive.where = locator { name: name }
|
2022-09-21 19:25:48 -06:00
|
|
|
primitive.what = inherits
|
2022-09-10 17:50:18 -06:00
|
|
|
return
|
2022-09-08 10:59:49 -06:00
|
|
|
}
|