mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: disallow statements after a return, branch check $if, $else, switch, and loops correctly
This commit is contained in:
committed by
Alexander Medvednikov
parent
58b52aa9fb
commit
1864e92ff4
@@ -870,6 +870,7 @@ pub fn fork() int {
|
||||
pid := C.fork()
|
||||
return pid
|
||||
}
|
||||
panic('os.fork not supported in windows') // TODO
|
||||
}
|
||||
|
||||
pub fn wait() int {
|
||||
@@ -877,6 +878,7 @@ pub fn wait() int {
|
||||
pid := C.wait(0)
|
||||
return pid
|
||||
}
|
||||
panic('os.wait not supported in windows') // TODO
|
||||
}
|
||||
|
||||
pub fn file_last_mod_unix(path string) int {
|
||||
|
||||
@@ -27,7 +27,6 @@ fn test_write_and_read_string_to_file() {
|
||||
|
||||
read_hello := os.read_file(filename) or {
|
||||
panic('error reading file $filename')
|
||||
return
|
||||
}
|
||||
assert hello == read_hello
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ pub fn get_module_filename(handle HANDLE) ?string {
|
||||
return error('Cannot get file name from handle.')
|
||||
}
|
||||
}
|
||||
panic('this should be unreachable') // TODO remove unreachable after loop
|
||||
}
|
||||
|
||||
// Ref - https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-formatmessagea#parameters
|
||||
|
||||
Reference in New Issue
Block a user