fix option_test.v
parent
8947717e3e
commit
f2b1a8cb16
|
@ -126,9 +126,9 @@ fn (p mut Parser) gen_handle_option_or_else(_typ, name string, fn_call_ph int) s
|
|||
last_ph := p.cgen.add_placeholder()
|
||||
last_typ := p.statements()
|
||||
if is_assign && last_typ == typ {
|
||||
expr_line := p.cgen.lines[p.cgen.lines.len-3]
|
||||
expr_line := p.cgen.lines[p.cgen.lines.len-2]
|
||||
last_expr := expr_line[last_ph..]
|
||||
p.cgen.lines[p.cgen.lines.len-3] = ''
|
||||
p.cgen.lines[p.cgen.lines.len-2] = ''
|
||||
p.genln('if (!$tmp .ok) {')
|
||||
p.genln('$name = $last_expr;')
|
||||
p.genln('}')
|
||||
|
|
Loading…
Reference in New Issue