Documentation
¶
Overview ¶
Package transpiler walks a parsed Go AST and emits SimplicityHL source code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EitherFieldInfo ¶ added in v0.1.1
type EitherFieldInfo struct {
LeftFieldNames []string // snake_case names of left branch fields
LeftType string // combined left type (tuple if multiple)
RightFieldName string // snake_case name of right branch field
RightType string // right branch type
}
EitherFieldInfo tracks field names for Either struct types
type JetCall ¶ added in v0.1.1
type JetCall struct {
VarName string // Variable name being assigned (empty if inline)
JetName string // Simplicity jet name
Args string // Comma-separated arguments
ReturnType string // Return type from jet registry
IsWitness bool // True if argument should come from witness
}
JetCall represents a jet function call in the code.
type MatchCase ¶ added in v0.1.1
type MatchCase struct {
Pattern string // "Left", "Right", "Some", "None"
VarName string // The variable name bound in the case
VarType string // The type of the bound variable
BodyStmts []string // Statements in the case body
}
MatchCase represents a single case in a type switch or match expression
type MatchExpression ¶ added in v0.1.1
type MatchExpression struct {
Scrutinee string // The expression being matched
ScrutineeType string // The type of the scrutinee (e.g., "Either<u256, [u8; 64]>")
Cases []MatchCase // The cases
IsBoolMatch bool // true for boolean if/else (true/false patterns)
}
MatchExpression represents a complete match/type-switch
type Transpiler ¶
type Transpiler struct {
// contains filtered or unexported fields
}
Transpiler converts Go AST to SimplicityHL.
func (*Transpiler) ToSimplicityHL ¶
func (t *Transpiler) ToSimplicityHL(file *ast.File) (string, error)
ToSimplicityHL transpiles Go AST to SimplicityHL code.
type UnrolledLoop ¶ added in v0.1.1
type UnrolledLoop struct {
IndexVar string
Iterations int
BodyStmts [][]string // Body statements for each iteration
}
UnrolledLoop represents a for loop that has been unrolled
Click to show internal directories.
Click to hide internal directories.