parser: fix a more complicated "in" usage

pull/2023/head
Danil-Lapirow 2019-09-18 16:13:22 +03:00 committed by Alexander Medvednikov
parent b9cc6535f6
commit b0092235fc
1 changed files with 3 additions and 3 deletions

View File

@ -2081,7 +2081,7 @@ fn (p mut Parser) expression() string {
p.fgen(' ') p.fgen(' ')
p.check(.key_in) p.check(.key_in)
p.fgen(' ') p.fgen(' ')
p.gen(', ') p.gen('), ')
arr_typ := p.expression() arr_typ := p.expression()
is_map := arr_typ.starts_with('map_') is_map := arr_typ.starts_with('map_')
if !arr_typ.starts_with('array_') && !is_map { if !arr_typ.starts_with('array_') && !is_map {
@ -2093,10 +2093,10 @@ fn (p mut Parser) expression() string {
} }
// `typ` is element's type // `typ` is element's type
if is_map { if is_map {
p.cgen.set_placeholder(ph, '_IN_MAP( ') p.cgen.set_placeholder(ph, '_IN_MAP( (')
} }
else { else {
p.cgen.set_placeholder(ph, '_IN($typ, ') p.cgen.set_placeholder(ph, '_IN($typ, (')
} }
p.gen(')') p.gen(')')
return 'bool' return 'bool'