Skip to content

Commit a1c1cd7

Browse files
committed
internal/filetypes: split ParseFile
Exposing ParseFileAndType. For the embedding proposal, file and type are specfied separately and do not need to be parsed as on the command line. Issue #2031 Signed-off-by: Marcel van Lohuizen <[email protected]> Change-Id: Ib02f845d503edf1d78834a1ff2a0c224cc936748 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1196716 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Daniel Martí <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent f42327c commit a1c1cd7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/filetypes/filetypes.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,12 @@ func ParseFile(s string, mode Mode) (*build.File, error) {
260260
}
261261
return nil, errors.Newf(token.NoPos, "empty file name")
262262
}
263+
264+
return ParseFileAndType(file, scope, mode)
265+
}
266+
267+
// ParseFileAndType parses a file and type combo.
268+
func ParseFileAndType(file, scope string, mode Mode) (*build.File, error) {
263269
// Quickly discard files which we aren't interested in.
264270
// These cases are very common when loading `./...` in a large repository.
265271
typesInit()

0 commit comments

Comments
 (0)