fix stupid protodef stuff

This commit is contained in:
adman
2026-03-02 21:40:36 +01:00
parent 65bf63d67e
commit 085b83cb71
12 changed files with 20634 additions and 23496 deletions
+6 -7
View File
@@ -38,6 +38,12 @@ type ContainerStackEntry struct {
VarToSet ast.Expr
}
type ExprGeneratorFunc func(g *Generator, data any) (ast.Expr, error)
type CompareToGeneratorFunc func(g *Generator, parts []string, inExpr ast.Expr, data any) (e ast.Expr, cet CaseExprType, err error)
type FunctionGeneratorFunc func(g *Generator, varToSet ast.Expr, data any, name string) ([]ast.Stmt, error)
type Generator struct {
packetInfos []PacketInfo
@@ -60,7 +66,6 @@ type Generator struct {
Depth int
Declared []string
ContainerStack []ContainerStackEntry
VtsStack []ast.Expr
}
func (g *Generator) Decl(name string, t token.Token, e ast.Expr) {
@@ -104,12 +109,6 @@ func ParseType(t any) (tName string, tData any, err error) {
return
}
type ExprGeneratorFunc func(g *Generator, data any) (ast.Expr, error)
type CompareToGeneratorFunc func(g *Generator, parts []string, inExpr ast.Expr, data any) (ast.Expr, error)
type FunctionGeneratorFunc func(g *Generator, varToSet ast.Expr, data any, name string) ([]ast.Stmt, error)
func (g *Generator) VisitType(data any) (e ast.Expr, err error) {
tName, tData, err := ParseType(data)
if err != nil {