Skip to content

Commit

Permalink
Remove unused defns
Browse files Browse the repository at this point in the history
  • Loading branch information
upamanyus committed Jun 18, 2024
1 parent 5aba9fa commit f5b11e1
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions goose.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,6 @@ type Ctx struct {
dep *depTracker
}

// Says how the result of the currently generated expression will be used
type ExprValUsage int

const (
// The result of this expression will only be used locally,
// or entirely discarded
ExprValLocal ExprValUsage = iota
// The result of this expression will be returned from the current function
// (i.e., the "early return" control effect is available here)
ExprValReturned
// The result of this expression will control the current loop
// (i.e., the "break/continue" control effect is available here)
ExprValLoop
)

// Config holds global configuration for Coq conversion
type Config struct {
AddSourceFileComments bool
Expand Down Expand Up @@ -462,7 +447,7 @@ func (ctx Ctx) makeExpr(args []ast.Expr) glang.CallExpr {
// newExpr parses a call to new() into an appropriate allocation
func (ctx Ctx) newExpr(s ast.Node, ty ast.Expr) glang.Expr {
return glang.RefExpr{
X: glang.NewCallExpr(glang.GallinaIdent("zero_val"), ctx.coqType(ty)),
X: glang.NewCallExpr(glang.GallinaIdent("zero_val"), ctx.coqType(ty)),
Ty: ctx.coqType(ty),
}
}
Expand Down Expand Up @@ -900,7 +885,7 @@ func (ctx Ctx) unaryExpr(e *ast.UnaryExpr) glang.Expr {
// e is &s{...} (a struct literal)
sl := ctx.structLiteral(info, structLit)
return glang.RefExpr{
X: sl,
X: sl,
Ty: ctx.coqTypeOfType(e.X, ctx.typeOf(e.X)),
}
}
Expand Down Expand Up @@ -1215,7 +1200,7 @@ func (ctx Ctx) defineStmt(s *ast.AssignStmt, cont glang.Expr) glang.Expr {
e = glang.LetExpr{
Names: []string{ident.Name},
ValExpr: glang.RefExpr{
X: glang.NewCallExpr(glang.GallinaIdent("zero_val"), t),
X: glang.NewCallExpr(glang.GallinaIdent("zero_val"), t),
Ty: t,
},
Cont: e,
Expand Down

0 comments on commit f5b11e1

Please sign in to comment.