mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
make the unchanged mutable variable error a warning in non-prod builds
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user