mirror of
https://github.com/vlang/v.git
synced 2025-09-14 06:52:36 +03:00
parser: fix in
expression
This commit is contained in:
parent
38aba37fe9
commit
584786d87c
2 changed files with 182 additions and 6 deletions
|
@ -18,23 +18,25 @@ fn (p mut Parser) in_optimization(typ string, ph int) {
|
|||
} else {
|
||||
p.gen(' || $expr == ')
|
||||
}
|
||||
}
|
||||
}
|
||||
if i == 0 {
|
||||
if is_str {
|
||||
p.cgen.set_placeholder(ph, ' string_eq(')
|
||||
p.cgen.set_placeholder(ph, ' (string_eq(')
|
||||
p.gen(', ')
|
||||
} else {
|
||||
p.cgen.set_placeholder(ph, ' (')
|
||||
p.gen(' ==')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
p.check_types(p.bool_expression(), typ)
|
||||
if is_str {
|
||||
p.gen(')')
|
||||
}
|
||||
}
|
||||
if p.tok != .rsbr {
|
||||
p.check(.comma)
|
||||
}
|
||||
i++
|
||||
}
|
||||
}
|
||||
p.gen(')')
|
||||
p.check(.rsbr)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue