Improved type system
This commit is contained in:
parent
8eabcf258d
commit
69a5fdc703
20 changed files with 111 additions and 67 deletions
27
src/types/Parse.go
Normal file
27
src/types/Parse.go
Normal file
|
@ -0,0 +1,27 @@
|
|||
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 Pointer
|
||||
default:
|
||||
panic("Unknown type " + name)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue