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

parser: remove start_tmp() entirely

This commit is contained in:
Alexander Medvednikov
2019-11-11 05:22:34 +03:00
parent 91896af877
commit b3143bb559
4 changed files with 22 additions and 32 deletions

View File

@@ -12,13 +12,10 @@ import (
fn (p mut Parser) match_statement(is_expr bool) string {
p.check(.key_match)
p.fspace()
p.cgen.start_tmp()
typ := p.bool_expression()
typ, expr := p.tmp_expr()
if typ.starts_with('array_') {
p.error('arrays cannot be compared')
}
expr := p.cgen.end_tmp()
// is it safe to use p.cgen.insert_before ???
tmp_var := p.get_tmp()
p.cgen.insert_before('$typ $tmp_var = $expr;')