mirror of
https://github.com/vlang/v.git
synced 2025-09-15 07:22:27 +03:00
make the unchanged mutable variable error a warning in non-prod builds
This commit is contained in:
parent
4c3df963fa
commit
126289c19b
2 changed files with 9 additions and 1 deletions
|
@ -23,6 +23,14 @@ fn (p mut Parser) error(s string) {
|
|||
p.error_with_token_index(s, p.token_idx - 1)
|
||||
}
|
||||
|
||||
fn (p mut Parser) warn_or_error(s string) {
|
||||
if p.pref.is_prod {
|
||||
p.error(s)
|
||||
} else {
|
||||
p.warn(s)
|
||||
}
|
||||
}
|
||||
|
||||
fn (p mut Parser) warn(s string) {
|
||||
p.warn_with_token_index(s, p.token_idx - 1)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue