Skip to content

Commit f65dd0f

Browse files
committed
internal/core/compile: remove unnecessary code
Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: Ia02fc0d344ed0d7f7dde4357aa4a9c0efb21df41 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/527893 Unity-Result: CUEcueckoo <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Paul Jolly <[email protected]>
1 parent b89ad85 commit f65dd0f

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

internal/core/compile/compile.go

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -650,10 +650,10 @@ func (c *compiler) decl(d ast.Decl) adt.Decl {
650650
return c.comprehension(x)
651651

652652
case *ast.EmbedDecl: // Deprecated
653-
return c.embed(x.Expr)
653+
return c.expr(x.Expr)
654654

655655
case ast.Expr:
656-
return c.embed(x)
656+
return c.expr(x)
657657
}
658658
return nil
659659
}
@@ -769,18 +769,6 @@ func (c *compiler) comprehension(x *ast.Comprehension) adt.Elem {
769769
return first
770770
}
771771

772-
func (c *compiler) embed(expr ast.Expr) adt.Expr {
773-
switch n := expr.(type) {
774-
case *ast.StructLit:
775-
c.pushScope(nil, 1, n)
776-
v := &adt.StructLit{Src: n}
777-
c.addDecls(v, n.Elts)
778-
c.popScope()
779-
return v
780-
}
781-
return c.expr(expr)
782-
}
783-
784772
func (c *compiler) labeledExpr(f *ast.Field, lab labeler, expr ast.Expr) adt.Expr {
785773
k := len(c.stack) - 1
786774
return c.labeledExprAt(k, f, lab, expr)

0 commit comments

Comments
 (0)