this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/core/compile: prepare for let change

Lets will be treated as fields soon, so labelExpr
needs to be able to get a LetClause.

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I4a975b75e57b2cb8c67dd41f209a2d837a223dd6
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/543359
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUEcueckoo <cueckoo@cuelang.org>

+4 -3
+4 -3
internal/core/compile/compile.go
··· 141 141 type frame struct { 142 142 label labeler // path name leading to this frame. 143 143 scope ast.Node // *ast.File or *ast.Struct 144 - field *ast.Field 144 + field ast.Decl 145 145 // scope map[ast.Node]bool 146 146 upCount int32 // 1 for field, 0 for embedding. 147 147 ··· 250 250 // Excluded from cross-file resolution are: 251 251 // - import specs 252 252 // - aliases 253 + // - let declarations 253 254 // - anything in an anonymous file 254 255 // 255 256 for _, f := range a { ··· 792 793 } 793 794 } 794 795 795 - func (c *compiler) labeledExpr(f *ast.Field, lab labeler, expr ast.Expr) adt.Expr { 796 + func (c *compiler) labeledExpr(f ast.Decl, lab labeler, expr ast.Expr) adt.Expr { 796 797 k := len(c.stack) - 1 797 798 return c.labeledExprAt(k, f, lab, expr) 798 799 } 799 800 800 - func (c *compiler) labeledExprAt(k int, f *ast.Field, lab labeler, expr ast.Expr) adt.Expr { 801 + func (c *compiler) labeledExprAt(k int, f ast.Decl, lab labeler, expr ast.Expr) adt.Expr { 801 802 if c.stack[k].field != nil { 802 803 panic("expected nil field") 803 804 }