1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

compiler/vlib: change _ := to _ = and disable _ :=

This commit is contained in:
joe-conigliaro
2019-09-25 22:10:45 +10:00
committed by Alexander Medvednikov
parent 746655c1d5
commit 8974aa4513
12 changed files with 33 additions and 33 deletions

View File

@ -90,7 +90,7 @@ fn (p mut Parser) mark_var_changed(v Var) {
}
fn (p mut Parser) known_var(name string) bool {
_ := p.find_var(name) or {
_ = p.find_var(name) or {
return false
}
return true

View File

@ -1378,9 +1378,9 @@ fn (p mut Parser) var_decl() {
}
for i, name in names {
if name == '_' {
// if names.len == 1 {
// p.error('no new variables on left side of :=')
// }
if names.len == 1 {
p.error('no new variables on left side of :=')
}
continue
}
typ := types[i]

View File

@ -333,12 +333,12 @@ fn (t &Table) find_fn(name string) ?Fn {
}
fn (t &Table) known_fn(name string) bool {
_ := t.find_fn(name) or { return false }
_ = t.find_fn(name) or { return false }
return true
}
fn (t &Table) known_const(name string) bool {
_ := t.find_const(name) or { return false }
_ = t.find_const(name) or { return false }
return true
}
@ -404,7 +404,7 @@ fn (table mut Table) add_field(type_name, field_name, field_type string, is_mut
}
fn (t &Type) has_field(name string) bool {
_ := t.find_field(name) or { return false }
_ = t.find_field(name) or { return false }
return true
}
@ -422,7 +422,7 @@ fn (t &Type) find_field(name string) ?Var {
}
fn (table &Table) type_has_field(typ &Type, name string) bool {
_ := table.find_field(typ, name) or { return false }
_ = table.find_field(typ, name) or { return false }
return true
}
@ -465,12 +465,12 @@ fn (p mut Parser) add_method(type_name string, f Fn) {
}
fn (t &Type) has_method(name string) bool {
_ := t.find_method(name) or { return false }
_ = t.find_method(name) or { return false }
return true
}
fn (table &Table) type_has_method(typ &Type, name string) bool {
_ := table.find_method(typ, name) or { return false }
_ = table.find_method(typ, name) or { return false }
return true
}