Simplified file structure

This commit is contained in:
Eduard Urbach 2024-08-07 19:39:10 +02:00
parent cacee7260a
commit a466281307
Signed by: eduard
GPG key ID: 49226B848C78F6C8
219 changed files with 453 additions and 457 deletions

6
src/types/New.go Normal file
View file

@ -0,0 +1,6 @@
package types
// New creates a new type from a list of tokens.
func New(name string) Type {
return Type(name)
}

16
src/types/NewList.go Normal file
View file

@ -0,0 +1,16 @@
package types
import "git.akyoto.dev/cli/q/src/token"
// NewList generates a list of types from comma separated tokens.
func NewList(tokens token.List, source []byte) []Type {
var list []Type
tokens.Split(func(parameter token.List) error {
typ := New(parameter.Text(source))
list = append(list, typ)
return nil
})
return list
}

10
src/types/Type.go Normal file
View file

@ -0,0 +1,10 @@
package types
type Type string
const (
Invalid = ""
Any = "Any"
Int = "Int"
Pointer = "Pointer"
)