Skip to content

Commit

Permalink
check x.vweb case
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Jul 29, 2024
1 parent 15b82e9 commit 77c75a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vlib/v/parser/comptime.v
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,11 @@ fn (mut p Parser) comptime_call() ast.ComptimeCall {
p.error(error_msg)
return err_node
}
if name == 'vweb' && 'vweb' !in p.ast_imports.map(it.mod) {
import_mods := p.ast_imports.map(it.mod)
if name == 'vweb' && 'vweb' !in import_mods && 'x.vweb' !in import_mods {
p.error_with_pos('`\$vweb` cannot be used without import vweb', start_pos.extend(p.prev_tok.pos()))
return err_node
} else if name == 'veb' && 'veb' !in p.ast_imports.map(it.mod) {
} else if name == 'veb' && 'veb' !in import_mods {
p.error_with_pos('`\$veb` cannot be used without import veb', start_pos.extend(p.prev_tok.pos()))
return err_node
}
Expand Down

0 comments on commit 77c75a3

Please sign in to comment.