Skip to content

Commit

Permalink
correct error message
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Jul 29, 2024
1 parent b22799d commit c594eed
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions vlib/v/parser/comptime.v
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ fn (mut p Parser) comptime_call() ast.ComptimeCall {
}
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()))
p.error_with_pos('`\$vweb` cannot be used without importing vweb', start_pos.extend(p.prev_tok.pos()))
return err_node
} else if name == 'veb' {
if 'veb' !in import_mods {
p.error_with_pos('`\$veb` cannot be used without import veb', start_pos.extend(p.prev_tok.pos()))
p.error_with_pos('`\$veb` cannot be used without importing veb', start_pos.extend(p.prev_tok.pos()))
return err_node
}
is_veb = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
vlib/v/parser/tests/comptime_veb_without_import_veb_err.vv:2:2: error: `$veb` cannot be used without import veb
vlib/v/parser/tests/comptime_veb_without_import_veb_err.vv:2:2: error: `$veb` cannot be used without importing veb
1 | fn main() {
2 | $veb.html('index.html')
| ~~~~
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
vlib/v/parser/tests/comptime_vweb_without_import_vweb_err.vv:2:2: error: `$vweb` cannot be used without import vweb
vlib/v/parser/tests/comptime_vweb_without_import_vweb_err.vv:2:2: error: `$vweb` cannot be used without importing vweb
1 | fn main() {
2 | $vweb.html('index.html')
| ~~~~~
Expand Down

0 comments on commit c594eed

Please sign in to comment.