diff --git a/analyzer/primitives.go b/analyzer/primitives.go index 4b7b109..1c6b318 100644 --- a/analyzer/primitives.go +++ b/analyzer/primitives.go @@ -41,11 +41,13 @@ var PrimitiveU64 = createPrimitive("U64", Type {}) // PrimitiveObj is a blank object primitive. var PrimitiveObj = createPrimitive("Obj", Type {}) +// TODO: make these two be interface sections + // PrimitiveFace is a blank interface primitive. It accepts any value. -var PrimitiveFace = createPrimitive("Face", Type {}) +// var PrimitiveFace = createPrimitive("Face", Type {}) // PrimitiveFunc is a blank function interface primitive. It is useless. -var PrimitiveFunc = createPrimitive("Func", Type {}) +// var PrimitiveFunc = createPrimitive("Func", Type {}) // BuiltInString is a built in string type. It is a dynamic array of UTF-32 // codepoints. diff --git a/analyzer/type-section.go b/analyzer/type-section.go index 3a408cc..ed49216 100644 --- a/analyzer/type-section.go +++ b/analyzer/type-section.go @@ -11,10 +11,6 @@ type TypeSection struct { what Type complete bool argument Argument - // TODO: do not add members from parent type. instead have a member - // function to discern whether this type contains a particular member, - // and have it recurse all the way up the family tree. it will be the - // translator's job to worry about what members are placed where. members []ObjectMember } diff --git a/analyzer/type.go b/analyzer/type.go index 8c26125..cb63d18 100644 --- a/analyzer/type.go +++ b/analyzer/type.go @@ -25,7 +25,7 @@ type Type struct { locatable // one of these must be nil. - actual *TypeSection + actual Section points *Type mutable bool @@ -91,8 +91,6 @@ func (what Type) underlyingPrimitive () (underlying *TypeSection) { case &PrimitiveF32, &PrimitiveF64, - &PrimitiveFunc, - &PrimitiveFace, &PrimitiveObj, &PrimitiveU64, &PrimitiveU32, @@ -105,7 +103,7 @@ func (what Type) underlyingPrimitive () (underlying *TypeSection) { &PrimitiveUInt, &PrimitiveInt: - underlying = actual + underlying = actual.(*TypeSection) return case nil: @@ -235,9 +233,6 @@ func (analyzer analysisOperation) analyzeType ( } } - // TODO - // TODO: figure out what todo ??? - return }