(this super.Value)
| 264 | } |
| 265 | |
| 266 | func (a *ArrayExpr) Eval(this super.Value) super.Value { |
| 267 | a.builder.Reset() |
| 268 | a.collection.reset() |
| 269 | for _, e := range a.elems { |
| 270 | if e.Value != nil { |
| 271 | a.collection.append(e.Value.Eval(this)) |
| 272 | continue |
| 273 | } |
| 274 | val := e.Spread.Eval(this) |
| 275 | inner := super.InnerType(val.Type()) |
| 276 | if inner == nil { |
| 277 | // Treat non-list spread values values like missing. |
| 278 | continue |
| 279 | } |
| 280 | a.collection.appendSpread(inner, val.Bytes()) |
| 281 | } |
| 282 | if len(a.collection.types) == 0 { |
| 283 | return super.NewValue(a.sctx.LookupTypeArray(super.TypeNull), []byte{}) |
| 284 | } |
| 285 | it := a.collection.iter(a.sctx) |
| 286 | for !it.done() { |
| 287 | it.appendNext(&a.builder) |
| 288 | } |
| 289 | return super.NewValue(a.sctx.LookupTypeArray(it.typ), a.builder.Bytes()) |
| 290 | } |
| 291 | |
| 292 | type SetExpr struct { |
| 293 | builder scode.Builder |
nothing calls this directly
no test coverage detected