zig-cache: support windows drive + fwd-slash paths

closes #13539
This commit is contained in:
mike 2022-11-13 13:52:55 -05:00 committed by Andrew Kelley
parent 6494cec59c
commit 9e50cb294b

View File

@ -82,7 +82,7 @@ pub fn next(self: *Tokenizer) ?Token {
// silently ignore null target
self.state = .lhs;
},
'\\' => {
'/', '\\' => {
self.state = .target_colon_reverse_solidus;
self.index += 1;
},
@ -706,7 +706,7 @@ test "windows mixed prereqs" {
);
}
test "funky targets" {
test "windows funky targets" {
try depTokenizer(
\\C:\Users\anon\foo.o:
\\C:\Users\anon\foo\ .o:
@ -728,6 +728,16 @@ test "funky targets" {
);
}
test "windows drive and forward slashes" {
try depTokenizer(
\\C:/msys64/what/zig-cache\tmp\48ac4d78dd531abd-cxa_thread_atexit.obj: \
\\ C:/msys64/opt/zig3/lib/zig/libc/mingw/crt/cxa_thread_atexit.c
,
\\target = {C:/msys64/what/zig-cache\tmp\48ac4d78dd531abd-cxa_thread_atexit.obj}
\\prereq = {C:/msys64/opt/zig3/lib/zig/libc/mingw/crt/cxa_thread_atexit.c}
);
}
test "error incomplete escape - reverse_solidus" {
try depTokenizer("\\",
\\ERROR: illegal char '\' at position 0: incomplete escape