mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parent
a786c58d0a
commit
9de0c725f6
@ -2460,6 +2460,9 @@ fn (mut c Checker) hash_stmt(mut node ast.HashStmt) {
|
||||
'flag' {
|
||||
// #flag linux -lm
|
||||
mut flag := node.main
|
||||
if flag == 'flag' { // Checks for empty flag
|
||||
c.error('no argument(s) provided for #flag', node.pos)
|
||||
}
|
||||
if flag.contains('@VROOT') {
|
||||
// c.note(checker.vroot_is_deprecated_message, node.pos)
|
||||
flag = util.resolve_vmodroot(flag.replace('@VROOT', '@VMODROOT'), c.file.path) or {
|
||||
|
3
vlib/v/parser/tests/hash_empty_flag_value.out
Normal file
3
vlib/v/parser/tests/hash_empty_flag_value.out
Normal file
@ -0,0 +1,3 @@
|
||||
vlib/v/parser/tests/hash_empty_flag_value.vv:1:1: error: no argument(s) provided for #flag
|
||||
1 | #flag
|
||||
| ~~~~~
|
1
vlib/v/parser/tests/hash_empty_flag_value.vv
Normal file
1
vlib/v/parser/tests/hash_empty_flag_value.vv
Normal file
@ -0,0 +1 @@
|
||||
#flag
|
Loading…
Reference in New Issue
Block a user