internal/cuetxtar: fill nested pos=[]
CUE_UPDATE=1 now fills pos=[] placeholders
in @test(err) directives that appear inside
an @test(eq, {...}) body, matching the
behaviour of top-level @test(err, pos=[]).
- Add posWriteback callback to cmpCtx so
cmpErr can enqueue fill write-backs
without direct runner access.
- Add enqueueNestedPosWrite to locate the
inner attr text within the outer attr
and rewrite pos=[...] in-place.
- Refactor formatPosSpec to take explicit
baseLine and srcFileName params, enabling
reuse from both code paths.
- Extract replacePosSpec (using
strings.Cut) to DRY up pos=[...]
find-and-replace across enqueuePosWrite,
enqueueNestedPosWrite, and
replaceSuberrPos.
- Emit _|_ for error values in
eqWriteValue to avoid a confusing
let-containing struct in fill output.
- Add BottomLit check in astCmp so _|_
requires val.Err() != nil.
- Convert 039_reference_to_root.txtar to
use @test(eq) annotations.
Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: Iaf15c0a5530cc9b0c9a9da7b18a4bdbd56e9455d
Reviewed-on: https://cue.gerrithub.io/c/cue-lang/cue/+/1235392
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>