mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vet: allow vetting files with global variables (#18195)
This commit is contained in:
parent
a39c26507c
commit
aded6088e9
@ -3788,8 +3788,9 @@ fn (mut p Parser) global_decl() ast.GlobalDecl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !p.has_globals && !p.pref.enable_globals && !p.pref.is_fmt && !p.pref.translated
|
if !p.has_globals && !p.pref.enable_globals && !p.pref.is_fmt && !p.pref.is_vet
|
||||||
&& !p.is_translated && !p.pref.is_livemain && !p.pref.building_v && !p.builtin_mod {
|
&& !p.pref.translated && !p.is_translated && !p.pref.is_livemain && !p.pref.building_v
|
||||||
|
&& !p.builtin_mod {
|
||||||
p.error('use `v -enable-globals ...` to enable globals')
|
p.error('use `v -enable-globals ...` to enable globals')
|
||||||
return ast.GlobalDecl{}
|
return ast.GlobalDecl{}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user