Documentation ¶
Index ¶
- Constants
- func EqualPath(p, q Path) bool
- func FuncFullPath(pkgPath, name string) string
- func NearestSyntax(span *Span) syntax.Syntax
- func Uint64ToBytes(u uint64) []byte
- type Augment
- type Chamber
- type Enter
- type Error
- type Func
- func (f *Func) Args() []string
- func (f *Func) BodyString() string
- func (f *Func) DocLong() string
- func (f *Func) DocShort() string
- func (f *Func) FullPath() string
- func (f *Func) FuncID() ID
- func (f *Func) IsGlobal() bool
- func (f *Func) SheathID() *ID
- func (f *Func) SheathLabel() *string
- func (f *Func) SheathString() *string
- func (f *Func) SortedFieldNames() []string
- func (f *Func) StepByLabel(label string) []*Step
- func (f *Func) String() string
- type Gather
- type Hypervisor
- type ID
- type Invoke
- type Leave
- type Link
- type Logic
- type Number
- type Operator
- type Outline
- type Package
- type Path
- type PkgFunc
- type Repo
- func (repo Repo) BodyString() string
- func (repo Repo) DocFunc(pkgPath, funcName string) (string, bool)
- func (repo Repo) DocPackage(pkgPath string) (string, bool)
- func (repo Repo) Has(pkg string) bool
- func (repo Repo) Lookup(pkg string, fu string) *Func
- func (repo Repo) PkgNames() []string
- func (repo Repo) SortedPackagePaths() []string
- func (repo Repo) Stats() *RepoStats
- func (repo Repo) String() string
- func (repo Repo) StringTable(header string) [][]string
- type RepoStats
- type Select
- type Sheath
- type Span
- func (span *Span) Attach(h Hypervisor) *Span
- func (span *Span) CommentLine() string
- func (span *Span) Errorf(cause error, format string, arg ...interface{}) error
- func (span *Span) ErrorfSkip(skip int, cause error, format string, arg ...interface{}) error
- func (span *Span) Fatalf(cause error, format string, arg ...interface{})
- func (span *Span) LabelPath() Path
- func (span *Span) Panicf(cause error, format string, arg ...interface{})
- func (span *Span) Print(arg ...interface{})
- func (span *Span) Printf(format string, arg ...interface{})
- func (span *Span) Refine(sheath Sheath) *Span
- func (span *Span) SourceLine() string
- func (span *Span) SpanID() ID
- func (span *Span) Splay() tree.Tree
- func (span *Span) String() string
- func (span *Span) Trajectory() string
- type Step
- type Trajectory
- type TrajectoryPoint
Constants ¶
const KoIndent = "\t" // used to be 3 spaces
const MainFlowLabel = "█"
MainFlowLabel is the label of the function field, carrying the “main” input flow. It is a symbol that cannot come from the syntactic path.
Variables ¶
This section is empty.
Functions ¶
func FuncFullPath ¶
func NearestSyntax ¶
func Uint64ToBytes ¶
Types ¶
type Augment ¶
type Augment struct{}
Augment attaches to a lambda, in field <MainFlowLabel>, all other fields.
type Error ¶
type Error struct { Span *Span `ko:"name=span"` File string `ko:"name=file"` // file in compiler code, generating error Line int `ko:"name=line"` // line in compiler code, generating error Msg string `ko:"name=msg"` Cause error `ko:"name=cause"` }
func NewSpanErrorf ¶
type Func ¶
type Func struct { Doc string `ko:"name=doc"` ID ID `ko:"name=id"` Name string `ko:"name=name"` Pkg string `ko:"name=pkg"` // Slice of all steps in complete topological order, aligning with the gather relationship. // Equivalently, this is a reverse-time ordering of the steps. Step []*Step `ko:"name=step"` // Spread maps a step to its downstream users. Spread map[*Step][]*Step `ko:"name=spread"` // Enter points to a step included in Step. Enter *Step `ko:"name=enter"` // Field points to steps included in Step. Field map[string]*Step `ko:"name=field"` // Name of monadic argument (if not empty) Monadic string `ko:"name=monadic"` // Leave points to a step included in Step. Leave *Step `ko:"name=leave"` syntax.Syntax `ko:"name=syntax"` }
Func describes a circuit.
func NearestFunc ¶
func (*Func) BodyString ¶
func (*Func) IsGlobal ¶
IsGlobal returns true if Name starts with a capital letter non-underscore character.
func (*Func) SheathLabel ¶
func (*Func) SheathString ¶
func (*Func) SortedFieldNames ¶
func (*Func) StepByLabel ¶
type Gather ¶
type Gather struct { Field string `ko:"name=field"` // output of steps feed into this parameter Step *Step `ko:"name=step"` }
Gather describes a link between two steps.
type Hypervisor ¶
type Hypervisor interface{}
type ID ¶
type ID struct {
Data uint64 `ko:"name=data"`
}
func BlendStrings ¶
func IDFromProtoData ¶
func InterfaceID ¶
func InterfaceID(v interface{}) ID
type Logic ¶
type Logic interface {
String() string
}
Logics are designators of transformation logic. Logics are the types:
Enter{}, Leave{}, Number{}, Select{}, Augment{}, Invoke{}
Unresolved logics:
Operator{}, PkgFunc{}
type Number ¶
type Number struct {
// Value is one of: bool, LexString, LexInteger or LexFloat.
Value interface{} `ko:"name=value"`
}
type Operator ¶
type Operator struct {
Path []string `ko:"name=path"`
}
Operator is a logic described by a syntactic reference.
type Package ¶
Package is a collection of functions identified by name.
func (Package) BodyString ¶
func (Package) DocFunc ¶
DocFunc returns the documentation for the function with given name in the given package. The returned boolean is true when the function is found or false otherwise.
func (Package) DocPackage ¶
DocPackage returns the documentation of the given package.
func (Package) SortedFuncNames ¶
SortedFuncNames returns a sort list of function names in the given package.
type PkgFunc ¶
PkgFunc is a placeholder logic describing a function, to be deferred, by package and name. Upon resolution, it is replaced by a Defer{*Func}.
type Repo ¶
Repo captures the chain transform: package path -> function name -> function.
func CombineRepo ¶
CombineRepo creates a new Repo containing all packages from the given Repo's combined. If a package is contained in both Repo's, the package from the second repo wins.
func (Repo) BodyString ¶
func (Repo) DocFunc ¶
DocFunc returns the documentation for the function with given name in the package with given name in the given repo. The returned boolean is true when the function is found or false otherwise.
func (Repo) DocPackage ¶
DocPackage returns the documentation for the package with given name in the given repo. The returned boolean is true when the package is found or false otherwise.
func (Repo) Has ¶
Has returns true if the given package is contained in the given Repo or false otherwise.
func (Repo) Lookup ¶
Lookup a function with given package name and given function name. Returns nil if not found.
func (Repo) SortedPackagePaths ¶
SortedPackagePaths returns a sorted list of the names of all package contained in the given Repo.
func (Repo) StringTable ¶
type Select ¶
type Select struct {
Path []string `ko:"name=path"`
}
Field <MainFlowLabel> carries a value to select from.
type Sheath ¶
type Sheath interface { SheathID() *ID // unique identifier SheathLabel() *string // empty or a short identifier string (not necessarily uniquely-identifying) SheathString() *string // human-readable line ot text }
Sheaths are *Func, *Step, MacroSheath, Outline, Chamber, *AssignCache, *GoWeavingCtx
type Span ¶
type Span struct { Hypervisor Hypervisor `ko:"name=hypervisor"` ID ID `ko:"name=id"` Parent *Span `ko:"name=parent"` Sheath Sheath `ko:"name=sheath"` }
func RefineChamber ¶
func RefineFunc ¶
func RefineOutline ¶
func RefineStep ¶
func (*Span) Attach ¶
func (span *Span) Attach(h Hypervisor) *Span
func (*Span) CommentLine ¶
func (*Span) ErrorfSkip ¶
func (*Span) SourceLine ¶
func (*Span) Trajectory ¶
type Step ¶
type Step struct { ID ID `ko:"name=id"` Label string `ko:"name=label"` Gather []*Gather `ko:"name=gather"` Logic Logic `ko:"name=logic"` syntax.Syntax `ko:"name=syntax"` Func *Func `ko:"name=func"` // backlink to func }
Step describes a step in a circuit.
func NearestStep ¶
func (*Step) SheathLabel ¶
func (*Step) SheathString ¶
type Trajectory ¶
type Trajectory []TrajectoryPoint
func (Trajectory) String ¶
func (traj Trajectory) String() string
type TrajectoryPoint ¶
type TrajectoryPoint struct {
Span *Span `ko:"name=span"`
}
func (TrajectoryPoint) String ¶
func (p TrajectoryPoint) String() string