internal/core: __reclose: detect and restore non-recursive closing
Extend __reclose to detect non-recursive closing from embedded
close()-d values opened with ..., and restore the appropriate
closing level. Add tests for non-recursive detection, mixed
recursive/non-recursive, and __reclose wrapping close().
Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: I5a9bf4e851bba934cf2ab93cc8d2c1842f92fbc1
Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1236309
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>