cmd/cue: reuse astutil.ToFile for --path expressions
The logic is the same, so this saves us a little bit of duplication.
Noticed in passing while investigating a different issue.
While here, add TODOs about these ToFile APIs modifying the input AST.
This could very well be problematic if either func is called
from a public API, as this could affect end users.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I72c55d3311176bbfd8254a33d6c7ced78589f50e
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1233924
Reviewed-by: Matthew Sackman <matthew@cue.works>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>