Simplified file structure

This commit is contained in:
2024-08-07 19:39:10 +02:00
parent 1b13539b22
commit 66569446b1
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"
)