You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it's not entirely clear which parts of the build.File are used
by FromFile to feed into the resulting FileInfo. Make the logic clearer
by unifying only the encoding, form, and interpretation fields, making
it obvious that the tags do not play any role here, and this implying
that the number of possible inputs are more limited than those to
toFile.
Also make it clear that the subsidiary tags are not expected to be an
output of `FromFile` by inlining only those parts of `build.File` which
are actually used. This does not affect behavior because nothing
actually uses those fields.
Also require the Encoding field, as documented, which requires some test
changes, but this should have no overall effect because the file passed
into FromFile has invariably come originally from toFile (e.g. via
ParseArgs) and that will fill in the Encoding field. Thus none of the
cmd/cue tests fail as a result.
Also remove a TODO that seems unlikely to be possible to do, as the
current mode _can_ influence various FileInfo fields, and that doesn't
necessarily seem like a bad thing.
Also, change the "handle common case" code to return the actual Form
returned by the underlying logic that this is optimized from: when
checking the "emulated" version for discrepancies in a subsequent CL, it
became clear that this was the correct behavior.
For #3280.
Signed-off-by: Roger Peppe <[email protected]>
Change-Id: Icbb54b544469002ea08710fa585177dada38c974
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1213873
Unity-Result: CUE porcuepine <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Daniel Martí <[email protected]>
0 commit comments