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

compiler: use cerror instead of panic.

This commit is contained in:
Delyan Angelov
2019-08-29 03:30:17 +03:00
committed by Alexander Medvednikov
parent 32683ad6fd
commit 83954acfd4
10 changed files with 74 additions and 43 deletions

View File

@@ -28,11 +28,12 @@ mut:
fn new_scanner(file_path string) *Scanner {
if !os.file_exists(file_path) {
panic('"$file_path" doesn\'t exist')
cerror('"$file_path" doesn\'t exist')
}
mut raw_text := os.read_file(file_path) or {
panic('scanner: failed to open "$file_path"')
cerror('scanner: failed to open "$file_path"')
return 0
}
// BOM check