Implemented struct pointer types
This commit is contained in:
@ -1,27 +0,0 @@
|
||||
package types
|
||||
|
||||
// Parse creates a new type from a list of tokens.
|
||||
func Parse(name string) Type {
|
||||
switch name {
|
||||
case "Int":
|
||||
return Int
|
||||
case "Int64":
|
||||
return Int64
|
||||
case "Int32":
|
||||
return Int32
|
||||
case "Int16":
|
||||
return Int16
|
||||
case "Int8":
|
||||
return Int8
|
||||
case "Float":
|
||||
return Float
|
||||
case "Float64":
|
||||
return Float64
|
||||
case "Float32":
|
||||
return Float32
|
||||
case "Pointer":
|
||||
return PointerAny
|
||||
default:
|
||||
panic("Unknown type " + name)
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
package types
|
||||
|
||||
import "git.akyoto.dev/cli/q/src/token"
|
||||
|
||||
// ParseList generates a list of types from comma separated tokens.
|
||||
func ParseList(tokens token.List, source []byte) []Type {
|
||||
var list []Type
|
||||
|
||||
tokens.Split(func(parameter token.List) error {
|
||||
typ := Parse(parameter.Text(source))
|
||||
list = append(list, typ)
|
||||
return nil
|
||||
})
|
||||
|
||||
return list
|
||||
}
|
Reference in New Issue
Block a user