update dependencies (#6267)
Signed-off-by: hongming <coder.scala@gmail.com>
This commit is contained in:
36
vendor/github.com/open-policy-agent/opa/internal/planner/planner.go
generated
vendored
36
vendor/github.com/open-policy-agent/opa/internal/planner/planner.go
generated
vendored
@@ -893,6 +893,40 @@ func (p *Planner) planExprEvery(e *ast.Expr, iter planiter) error {
|
||||
})
|
||||
|
||||
err := p.planTerm(every.Domain, func() error {
|
||||
// Assert that the domain is a collection type:
|
||||
// block outer
|
||||
// block a
|
||||
// isArray
|
||||
// br 1: break outer, and continue
|
||||
// block b
|
||||
// isObject
|
||||
// br 1: break outer, and continue
|
||||
// block c
|
||||
// isSet
|
||||
// br 1: break outer, and continue
|
||||
// br 1: invalid domain, break every
|
||||
|
||||
aBlock := &ir.Block{}
|
||||
p.appendStmtToBlock(&ir.IsArrayStmt{Source: p.ltarget}, aBlock)
|
||||
p.appendStmtToBlock(&ir.BreakStmt{Index: 1}, aBlock)
|
||||
|
||||
bBlock := &ir.Block{}
|
||||
p.appendStmtToBlock(&ir.IsObjectStmt{Source: p.ltarget}, bBlock)
|
||||
p.appendStmtToBlock(&ir.BreakStmt{Index: 1}, bBlock)
|
||||
|
||||
cBlock := &ir.Block{}
|
||||
p.appendStmtToBlock(&ir.IsSetStmt{Source: p.ltarget}, cBlock)
|
||||
p.appendStmtToBlock(&ir.BreakStmt{Index: 1}, cBlock)
|
||||
|
||||
outerBlock := &ir.BlockStmt{Blocks: []*ir.Block{
|
||||
{
|
||||
Stmts: []ir.Stmt{
|
||||
&ir.BlockStmt{Blocks: []*ir.Block{aBlock, bBlock, cBlock}},
|
||||
&ir.BreakStmt{Index: 1}},
|
||||
},
|
||||
}}
|
||||
p.appendStmt(outerBlock)
|
||||
|
||||
return p.planScan(every.Key, func(ir.Local) error {
|
||||
p.appendStmt(&ir.ResetLocalStmt{
|
||||
Target: cond1,
|
||||
@@ -1489,7 +1523,7 @@ func (p *Planner) planValue(t ast.Value, loc *ast.Location, iter planiter) error
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Planner) planNull(null ast.Null, iter planiter) error {
|
||||
func (p *Planner) planNull(_ ast.Null, iter planiter) error {
|
||||
|
||||
target := p.newLocal()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user