Skip to content

Commit

Permalink
vet: allow vetting files with global variables (#18195)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed May 19, 2023
1 parent a39c265 commit aded608
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vlib/v/parser/parser.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
&& !p.is_translated && !p.pref.is_livemain && !p.pref.building_v && !p.builtin_mod {
if !p.has_globals && !p.pref.enable_globals && !p.pref.is_fmt && !p.pref.is_vet
&& !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')
return ast.GlobalDecl{}
}
Expand Down

0 comments on commit aded608

Please sign in to comment.