Added array type
This commit is contained in:
parent
bb01070950
commit
c0ffddaba8
13 changed files with 71 additions and 22 deletions
18
src/types/Array.go
Normal file
18
src/types/Array.go
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue