Documentation ¶
Index ¶
- Constants
- func SourceMapWrap(builder esbuilder.SourceBuilder, dom codedom.StatementOrExpression, ...) esbuilder.SourceBuilder
- func SourceMapWrapExpr(builder esbuilder.ExpressionBuilder, expression codedom.Expression, ...) esbuilder.ExpressionBuilder
- type Pather
- func (p Pather) GetMemberName(member typegraph.TGMember) string
- func (p Pather) GetModulePath(module typegraph.TGModule) string
- func (p Pather) GetRelativeModulePath(module typegraph.TGModule) string
- func (p Pather) GetSetterName(member typegraph.TGMember) string
- func (p Pather) GetStaticMemberPath(member typegraph.TGMember, referenceType typegraph.TypeReference) string
- func (p Pather) GetStaticTypePath(typedecl typegraph.TGTypeDecl, referenceType typegraph.TypeReference) string
- func (p Pather) GetTypePath(typedecl typegraph.TGTypeDecl) string
- func (p Pather) InnerInstanceName(innerType typegraph.TypeReference) string
- func (p Pather) TypeReferenceCall(typeRef typegraph.TypeReference) string
- type StateFunctionTraits
- type StateFunctionType
- type Templater
Constants ¶
const ( StateFunctionNormalSync StateFunctionType = "sync" StateFunctionNormalAsync = "async" StateFunctionSyncOrAsyncGenerator = "sync-or-async-generator" )
Variables ¶
This section is empty.
Functions ¶
func SourceMapWrap ¶
func SourceMapWrap(builder esbuilder.SourceBuilder, dom codedom.StatementOrExpression, srg *srg.SRG) esbuilder.SourceBuilder
SourceMapWrap wraps a builder statement or expression with its source mapping location.
func SourceMapWrapExpr ¶
func SourceMapWrapExpr(builder esbuilder.ExpressionBuilder, expression codedom.Expression, srg *srg.SRG) esbuilder.ExpressionBuilder
SourceMapWrapExpr wraps a builder expression with its source mapping location.
Types ¶
type Pather ¶
type Pather struct {
// contains filtered or unexported fields
}
Pather defines a helper type for generating paths.
func NewPather ¶
func NewPather(scopegraph *scopegraph.ScopeGraph) Pather
NewPather creates a new path generator for the given graph.
func (Pather) GetMemberName ¶
GetMemberName returns the name of the given member.
func (Pather) GetModulePath ¶
GetModulePath returns the global path for the given module.
func (Pather) GetRelativeModulePath ¶
GetRelativeModulePath returns the relative path for the given module.
func (Pather) GetSetterName ¶
GetSetterName returns the name of the setter for the given member.
func (Pather) GetStaticMemberPath ¶
func (p Pather) GetStaticMemberPath(member typegraph.TGMember, referenceType typegraph.TypeReference) string
GetStaticMemberPath returns the global path for the given statically defined type member.
func (Pather) GetStaticTypePath ¶
func (p Pather) GetStaticTypePath(typedecl typegraph.TGTypeDecl, referenceType typegraph.TypeReference) string
GetStaticTypePath returns the global path for the given defined type.
func (Pather) GetTypePath ¶
func (p Pather) GetTypePath(typedecl typegraph.TGTypeDecl) string
GetTypePath returns the global path for the given type.
func (Pather) InnerInstanceName ¶
func (p Pather) InnerInstanceName(innerType typegraph.TypeReference) string
InnerInstanceName returns the name of an inner instance of the given type, when accessed under a type instance which structurally composes it.
func (Pather) TypeReferenceCall ¶
func (p Pather) TypeReferenceCall(typeRef typegraph.TypeReference) string
TypeReferenceCall returns source for retrieving an object reference to the type defined by the given type reference.
type StateFunctionTraits ¶
type StateFunctionTraits struct {
// contains filtered or unexported fields
}
StateFunctionTraits is a simple struct for tracking the various traits of a function being generated.
func FunctionTraits ¶
func FunctionTraits(isAsync bool, isGenerator bool, managesResources bool) StateFunctionTraits
FunctionTraits creates and returns a StateFunctionTraits struct for the given traits of a function.
func (StateFunctionTraits) IsAsynchronous ¶
func (sft StateFunctionTraits) IsAsynchronous() bool
IsAsynchronous returns true if the function is asynchronous, therefore returning a Promise.
func (StateFunctionTraits) IsGenerator ¶
func (sft StateFunctionTraits) IsGenerator() bool
IsGenerator returns true if a function is a generator, therefore returning a Stream<T>. (note that it can also be async, and therefore return a Promise<Stream<T>>)
func (StateFunctionTraits) ManagesResources ¶
func (sft StateFunctionTraits) ManagesResources() bool
ManagesResources returns true if the function manages any resources under a `with` block.
func (StateFunctionTraits) Type ¶
func (sft StateFunctionTraits) Type() StateFunctionType
Type returns an enumeration representing the aggregated traits for the function.
type StateFunctionType ¶
type StateFunctionType string
StateFunctionType defines an enumeration of types for a function.
type Templater ¶
type Templater struct {
// contains filtered or unexported fields
}
Templater is a helper type for running go templates.
func NewTemplater ¶
func NewTemplater() *Templater