mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v.scanner: improve error diagnostic when scanner's file_path is not a file
This commit is contained in:
parent
b9771ea120
commit
9ffbda3833
@ -102,8 +102,8 @@ pub enum CommentsMode {
|
|||||||
|
|
||||||
// new scanner from file.
|
// new scanner from file.
|
||||||
pub fn new_scanner_file(file_path string, comments_mode CommentsMode, pref &pref.Preferences) &Scanner {
|
pub fn new_scanner_file(file_path string, comments_mode CommentsMode, pref &pref.Preferences) &Scanner {
|
||||||
if !os.exists(file_path) {
|
if !os.is_file(file_path) {
|
||||||
verror("$file_path doesn't exist")
|
verror('$file_path is not a file')
|
||||||
}
|
}
|
||||||
raw_text := util.read_file(file_path) or {
|
raw_text := util.read_file(file_path) or {
|
||||||
verror(err.msg)
|
verror(err.msg)
|
||||||
|
Loading…
Reference in New Issue
Block a user