1
0
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:
Turiiya 2023-05-19 15:28:01 +02:00 committed by GitHub
parent a39c26507c
commit aded6088e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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{}
} }