generate

package
v0.24.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2024 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Camelize

func Camelize(s string) string

underscore_name to underscoreName

func Includes

func Includes(strs []string, str string) (ret bool)

does the passed string list include the passed string?

func Pascal

func Pascal(s string) string

underscore_name to UnderscoreName

Types

type DB

type DB interface {
	Write(q string, args ...interface{}) error
}

database/sql like interface

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

the generator walks a list of groups, producing one group at a time: each of which can be written to its own location.

func MakeGenerator

func MakeGenerator(groups []Group) (ret Generator, err error)

func (*Generator) Name

func (q *Generator) Name() string

func (*Generator) Next

func (q *Generator) Next() (okay bool)

advance before writing

func (*Generator) WriteReferences

func (q *Generator) WriteReferences(w DB) error

record the derived type data for the passed group using sqlite friendly data to the passed database

func (*Generator) WriteSource

func (q *Generator) WriteSource(w io.Writer) error

write a go file containing typeinfo for the current group

func (*Generator) WriteTable

func (q *Generator) WriteTable(w DB) error

record the primary type data for the passed group using sqlite friendly data to the passed database

type Group

type Group struct {
	Name string
	// contains filtered or unexported fields
}

func ReadSpec

func ReadSpec(msg compact.Message) (ret Group, err error)

read a "Spec:with group:" message

type Hashed

type Hashed struct {
	Value  uint64
	String string
}

func Hash

func Hash(slat, slot string) Hashed

Hash helper for generating signatures lookups the slat includes all of the colon separated labels used to indicate a given type. the slot specifes the typename the slat fits into.

type MessageMap

type MessageMap map[string]any

func (MessageMap) GetBool

func (mm MessageMap) GetBool(name string) (ret bool, err error)

returns false if there was a value, but it wasnt a bool

func (MessageMap) GetString

func (mm MessageMap) GetString(name, otherwise string) (ret string, err error)

returns false if there was a value, but it wasnt a string

type Names

type Names []string

func (*Names) AddName

func (gs *Names) AddName(g string)

type Registry

type Registry []Signature

Accumulates tapestry type specs to build lists of slots and slats and their signatures. Doesnt currently support multiple groups

func (Registry) Sort

func (reg Registry) Sort()

type Signature

type Signature struct {
	Type     string // ex. DiffOf
	Slot     string // ex. number_eval
	Sig      string // ex. "number_eval=Dec:by: "
	Hash     uint64 // ex. 10788210406716082593
	Optional bool
}

func (*Signature) Body

func (a *Signature) Body() (ret string)

func (*Signature) IsLessThan

func (a *Signature) IsLessThan(b Signature) (okay bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL