Added array type

This commit is contained in:
Eduard Urbach 2025-02-09 20:25:37 +01:00
parent bb01070950
commit c0ffddaba8
Signed by: eduard
GPG key ID: 49226B848C78F6C8
13 changed files with 71 additions and 22 deletions

18
src/types/Array.go Normal file
View file

@ -0,0 +1,18 @@
package types
var String = &Array{Of: Int8}
// Array is the address of an object.
type Array struct {
Of Type
}
// Name returns the type name.
func (a *Array) Name() string {
return "[]" + a.Of.Name()
}
// Size returns the total size in bytes.
func (a *Array) Size() int {
return 8
}