Skip to content

Commit f8b70b7

Browse files
committed
parser: allow for @[has_globals] to be used for all V programs, turn the @[wasm_import_namespace] error into a notice
1 parent 0eb41e5 commit f8b70b7

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

vlib/v/parser/parser.v

+2-7
Original file line numberDiff line numberDiff line change
@@ -3716,19 +3716,14 @@ fn (mut p Parser) module_decl() ast.Module {
37163716
p.is_generated = true
37173717
}
37183718
'has_globals' {
3719-
if p.inside_vlib_file {
3720-
p.has_globals = true
3721-
} else {
3722-
p.error_with_pos('[has_globals] is allowed only in .v files of `vlib` modules',
3723-
ma.pos)
3724-
}
3719+
p.has_globals = true
37253720
}
37263721
'translated' {
37273722
p.is_translated = true
37283723
}
37293724
'wasm_import_namespace' {
37303725
if !p.pref.is_fmt && p.pref.backend != .wasm {
3731-
p.error_with_pos('[wasm_import_namespace] is allowed only in the wasm backend',
3726+
p.note_with_pos('@[wasm_import_namespace] is only supported by the wasm backend',
37323727
ma.pos)
37333728
}
37343729
}

0 commit comments

Comments
 (0)