Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrInternalPackage = errors.New("use of internal package") ErrUnexported = errors.New("use of unexported name") ErrGeneric = errors.New("use of uninstantiated generic") ErrCGo = errors.New("use of CGo") ErrInvalid = errors.New("use of invalid type") ErrInterfaceTypeConstraint = errors.New("interface contains type constraint") ErrIncomplete = errors.New("use of incomplete (or unallocatable) type") )
Functions ¶
func ReceiverRyeTypeName ¶
ReceiverRyeTypeName returns the name of the actual type when the type is used as a receiver in a Rye method. In other words, this function returns the string should come before the "//" in Rye method names.
Types ¶
type ConverterError ¶
type ConverterError struct {
// contains filtered or unexported fields
}
func (*ConverterError) Error ¶
func (e *ConverterError) Error() string
Error returns a short error message.
func (*ConverterError) String ¶
func (e *ConverterError) String() string
String returns a full multi-line error message containing all errors.
func (*ConverterError) Unwrap ¶
func (e *ConverterError) Unwrap() []error
type ConverterSet ¶
type ConverterSet struct {
// contains filtered or unexported fields
}
func NewConverterSet ¶
func NewConverterSet(tset *typeset.TypeSet, basePkg string) *ConverterSet
NewConverterSet creates a new ConverterSet. basePkg is the package path Ryegen was initiated in (usually "main").
func (*ConverterSet) Add ¶
Add adds a converter to the ConverterSet, meaning it will end up in the generated code. debugName is used for printing error messages and generating debug info, optional. Returns the name of the resulting converter function.
func (*ConverterSet) Code ¶
func (cs *ConverterSet) Code() ([]byte, *Graph, error)
Code returns all of the generated converter Go code. The returned Graph can be used to get information about the resulting converter graph. Call Graph.Contains to find out which converters are still usable. If the returned error is a ConverterError, the returned code is still valid, but the erroneous converters and any converters associated with them are not included. Call ConverterError.String to get a detailed list of all errors.
type Direction ¶
type Direction uint8
func (Direction) String ¶
String returns the PascalCase string representation ("ToRye" or "FromRye").
func (Direction) StringCamelCase ¶
StringCamelCase returns the camelCase string representation ("toRye" or "fromRye").
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph represents a resulting converter graph. All methods will return a reasonable result if the *Graph is nil.
func (*Graph) Contains ¶
Contains returns whether the graph contains a complete and valid node with the given type and direction.
func (*Graph) DebugDOTCode ¶
DebugDOTCode generates DOT (graphviz) code for the converter dependency graph. If nodeRe is nil, all nodes are included. If nodeRe is non-nil, all nodes depending on any matching nodes are included.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package typeset handles type stringification and automatic struct aliasing.
|
Package typeset handles type stringification and automatic struct aliasing. |
|
Package walktypes simplifies recursively iterating over types from the Go types package.
|
Package walktypes simplifies recursively iterating over types from the Go types package. |