Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnvStdlib ¶
func EnvStdlib() []byte
EnvStdlib takes care of creating a flux_buffer_t, passes the buffer to the Flatbuffers TypeEnvironment and then takes care of freeing the data
func FindVarType ¶ added in v0.74.0
func MergePackages ¶
Merge packages merges the files of a given input package into a given output package. This function borrows the input and output packages, but does not own them. Memory must still be freed by the caller of this function.
Types ¶
type ASTPkg ¶
type ASTPkg struct {
// contains filtered or unexported fields
}
ASTPkg is a parsed AST.
func ParseJSON ¶
ParseJSON will take an AST formatted as JSON and return a handle the Rust AST package.
func ParseString ¶
func (ASTPkg) ASTHandle ¶
func (p ASTPkg) ASTHandle()
ASTHandle makes sure that this type implements the flux.ASTHandle interface.
func (*ASTPkg) MarshalJSON ¶
type Analyzer ¶
type Analyzer struct {
// contains filtered or unexported fields
}
func NewAnalyzer ¶
func NewAnalyzer() *Analyzer
type SemanticPkg ¶
type SemanticPkg struct {
// contains filtered or unexported fields
}
SemanticPkg is a Rust pointer to a semantic package.
func Analyze ¶
func Analyze(astPkg *ASTPkg) (*SemanticPkg, error)
Analyze parses the given Flux source, performs type inference (taking into account types from prelude and stdlib) and returns an a SemanticPkg containing an opaque pointer to the semantic graph. The graph can be deserialized by calling MarshalFB.
Note that Analyze will consume the AST, so astPkg.ptr will be set to nil, even if there's an error in analysis.
func (*SemanticPkg) Free ¶
func (p *SemanticPkg) Free()
Free frees the memory allocated by Rust for the semantic graph.
func (*SemanticPkg) MarshalFB ¶
func (p *SemanticPkg) MarshalFB() ([]byte, error)
MarshalFB serializes the given semantic package into a flatbuffer.