weaver

package
v0.24.8 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConflict = mdl.ErrConflict

when the definition would contradict existing information: the returned error wraps this tag. errors.Is can be used to detect it.

View Source
var ErrDuplicate = mdl.ErrDuplicate

when the definition would repeat existing information: the returned error wraps this tag. errors.Is can be used to detect it.

View Source
var ErrMissing = mdl.ErrMissing

when the definition can't find some required information: the returned error wraps this tag. errors.Is can be used to detect it.

Functions

This section is empty.

Types

type PanicWeaves

type PanicWeaves struct{}

func (*PanicWeaves) AddAspectTraits

func (p *PanicWeaves) AddAspectTraits(aspect string, traits []string) error

AddAspectTraits implements Weaves.

func (*PanicWeaves) AddFact

func (p *PanicWeaves) AddFact(key string, partsAndValue ...string) error

AddFact implements Weaves.

func (*PanicWeaves) AddGrammar

func (p *PanicWeaves) AddGrammar(name string, prog *grammar.Directive) error

AddGrammar implements Weaves.

func (*PanicWeaves) AddKind

func (p *PanicWeaves) AddKind(kind string, ancestor string) error

AddKind implements Weaves.

func (*PanicWeaves) AddKindFields

func (p *PanicWeaves) AddKindFields(kind string, fields []mdl.FieldInfo) error

AddKindFields implements Weaves.

func (*PanicWeaves) AddKindTrait

func (p *PanicWeaves) AddKindTrait(kind string, trait string) error

AddKindTrait implements Weaves.

func (*PanicWeaves) AddNounKind

func (p *PanicWeaves) AddNounKind(noun string, kind string) error

AddNounKind implements Weaves.

func (*PanicWeaves) AddNounName

func (p *PanicWeaves) AddNounName(noun string, name string, rank int) error

AddNounName implements Weaves.

func (*PanicWeaves) AddNounPair

func (p *PanicWeaves) AddNounPair(rel string, noun string, otherNoun string) error

AddNounPair implements Weaves.

func (*PanicWeaves) AddNounPath

func (p *PanicWeaves) AddNounPath(noun string, path []string, val literal.LiteralValue) error

AddNounPath implements Weaves.

func (*PanicWeaves) AddNounTrait

func (p *PanicWeaves) AddNounTrait(noun string, trait string) error

AddNounTrait implements Weaves.

func (*PanicWeaves) AddNounValue

func (p *PanicWeaves) AddNounValue(noun string, prop string, val rt.Assignment) error

AddNounValue implements Weaves.

func (*PanicWeaves) AddPattern

func (p *PanicWeaves) AddPattern(mdl.Pattern) error

AddPattern implements Weaves.

func (*PanicWeaves) AddPlural

func (p *PanicWeaves) AddPlural(many string, one string) error

AddPlural implements Weaves.

func (*PanicWeaves) AddRelation

func (p *PanicWeaves) AddRelation(name string, oneKind string, otherKind string, amany bool, bmany bool) error

AddRelation implements Weaves.

func (*PanicWeaves) ExtendPattern

func (p *PanicWeaves) ExtendPattern(mdl.Pattern) error

ExtendPattern implements Weaves.

func (*PanicWeaves) GenerateUniqueName

func (p *PanicWeaves) GenerateUniqueName(category string) string

GenerateUniqueName implements Weaves.

type Phase

type Phase int

Partitions the weave to order dependencies between types. ( ex. Nouns depend on kinds, and never the other way around. )

const (
	AnyPhase        Phase = iota
	LanguagePhase         // definitions of words
	AncestryPhase         // kinds and their derivation
	PropertyPhase         // the fields of kinds
	NounPhase             // generate explicit nouns
	VerbPhase             // apply existing verbs and rules
	ConnectionPhase       // pairings and map connections
	FallbackPhase         // generate kinds for nouns that didn't derive during connections
	ValuePhase            // apply any collected values
	NextPhase             // any sub domains
	NumPhases
)

func (Phase) String

func (i Phase) String() string

type Weaves

type Weaves interface {
	// set the possible traits of an aspect
	AddAspectTraits(aspect string, traits []string) error
	AddFact(key string, partsAndValue ...string) error
	AddGrammar(name string, prog *grammar.Directive) error
	AddKind(kind, ancestor string) error
	AddKindFields(kind string, fields []mdl.FieldInfo) error
	// apply a default trait to a kind
	AddKindTrait(kind, trait string) error
	AddNounKind(noun, kind string) error
	AddNounName(noun, name string, rank int) error
	AddNounPair(rel, noun, otherNoun string) error
	AddNounPath(noun string, path []string, val literal.LiteralValue) error
	AddNounTrait(noun, trait string) error
	AddNounValue(noun, prop string, val rt.Assignment) error
	AddPattern(mdl.Pattern) error
	AddPlural(many, one string) error
	AddRelation(name, oneKind, otherKind string, amany bool, bmany bool) error
	ExtendPattern(mdl.Pattern) error
	// generates a unique name with a passed category
	GenerateUniqueName(category string) string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳