mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fix the build
This commit is contained in:
parent
0ad0a61db2
commit
8947717e3e
@ -106,7 +106,7 @@ fn (g mut CGen) save() {
|
||||
}
|
||||
|
||||
|
||||
// returns expression's type, and entire expression's string representation
|
||||
// returns expression's type, and entire expression's string representation)
|
||||
fn (p mut Parser) tmp_expr() (string, string) {
|
||||
// former start_tmp()
|
||||
if p.cgen.is_tmp {
|
||||
@ -117,7 +117,7 @@ fn (p mut Parser) tmp_expr() (string, string) {
|
||||
p.cgen.is_tmp = true
|
||||
//
|
||||
typ := p.bool_expression()
|
||||
// former end_tmp()
|
||||
|
||||
res := p.cgen.tmp_line
|
||||
if p.cgen.prev_tmps.len > 0 {
|
||||
p.cgen.tmp_line = p.cgen.prev_tmps.last()
|
||||
|
@ -184,7 +184,7 @@ fn (p mut Parser) for_st() {
|
||||
}
|
||||
p.fspace()
|
||||
p.check(.lcbr)
|
||||
//p.genln('')
|
||||
p.genln('') // TODO why is this needed?
|
||||
p.statements()
|
||||
p.close_scope()
|
||||
p.for_expr_cnt--
|
||||
|
@ -989,6 +989,10 @@ fn (p mut Parser) statements() string {
|
||||
|
||||
fn (p mut Parser) statements_no_rcbr() string {
|
||||
p.open_scope()
|
||||
|
||||
if !p.inside_if_expr {
|
||||
//p.genln('')
|
||||
}
|
||||
mut i := 0
|
||||
mut last_st_typ := ''
|
||||
for p.tok != .rcbr && p.tok != .eof {
|
||||
@ -996,6 +1000,7 @@ fn (p mut Parser) statements_no_rcbr() string {
|
||||
last_st_typ = p.statement(true)
|
||||
// println('last st typ=$last_st_typ')
|
||||
if !p.inside_if_expr {
|
||||
//p.genln('')// // end st tok= ${p.strtok()}')
|
||||
p.fgenln('')
|
||||
}
|
||||
i++
|
||||
@ -2513,7 +2518,7 @@ fn (p mut Parser) if_st(is_expr bool, elif_depth int) string {
|
||||
p.returns = false
|
||||
if p.tok == .key_else {
|
||||
if !p.inside_if_expr {
|
||||
//p.fgenln('')
|
||||
p.fgenln('')
|
||||
}
|
||||
p.check(.key_else)
|
||||
p.fspace()
|
||||
|
Loading…
Reference in New Issue
Block a user