1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

scanner: fix vmod_file on windows

This commit is contained in:
yuyi 2020-05-27 09:32:39 +08:00 committed by GitHub
parent 6f7628cb67
commit 23c0bb600c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -783,8 +783,12 @@ pub fn (mut s Scanner) scan() token.Token {
s.error('@VMOD_FILE can be used only in projects, that have v.mod file') s.error('@VMOD_FILE can be used only in projects, that have v.mod file')
} }
vmod_content := os.read_file(vmod_file_location.vmod_file) or {''} vmod_content := os.read_file(vmod_file_location.vmod_file) or {''}
$if windows {
s.vmod_file_content = vmod_content.replace('\r\n', '\n')
} $else {
s.vmod_file_content = vmod_content s.vmod_file_content = vmod_content
} }
}
return s.new_token(.string, s.vmod_file_content, 10) return s.new_token(.string, s.vmod_file_content, 10)
} }
if !token.is_key(name) { if !token.is_key(name) {