(this super.Value)
| 304 | } |
| 305 | |
| 306 | func (a *SetExpr) Eval(this super.Value) super.Value { |
| 307 | a.builder.Reset() |
| 308 | a.collection.reset() |
| 309 | for _, e := range a.elems { |
| 310 | if e.Value != nil { |
| 311 | a.collection.append(e.Value.Eval(this)) |
| 312 | continue |
| 313 | } |
| 314 | val := e.Spread.Eval(this) |
| 315 | inner := super.InnerType(val.Type()) |
| 316 | if inner == nil { |
| 317 | // Treat non-list spread values values like missing. |
| 318 | continue |
| 319 | } |
| 320 | a.collection.appendSpread(inner, val.Bytes()) |
| 321 | } |
| 322 | if len(a.collection.types) == 0 { |
| 323 | return super.NewValue(a.sctx.LookupTypeSet(super.TypeNull), []byte{}) |
| 324 | } |
| 325 | it := a.collection.iter(a.sctx) |
| 326 | for !it.done() { |
| 327 | it.appendNext(&a.builder) |
| 328 | } |
| 329 | return super.NewValue(a.sctx.LookupTypeSet(it.typ), super.NormalizeSet(a.builder.Bytes())) |
| 330 | } |
| 331 | |
| 332 | type Entry struct { |
| 333 | Key Evaluator |
nothing calls this directly
no test coverage detected