cgen: fix getn_cross_tmp_variable

pull/5612/head
Alexander Medvednikov 2020-07-01 19:19:49 +02:00
parent dbcb23ddc8
commit 625ed030ef
3 changed files with 7 additions and 3 deletions

View File

@ -46,8 +46,8 @@ jobs:
run: |
v vet vlib/v/parser
v vet vlib/v/ast
v vet vlib/v/ast
v vet vlib/v/gen/cgen.v
v vet vlib/v/checker
# - name: Test v binaries
# run: ./v -silent build-vbinaries

View File

@ -31,6 +31,9 @@ fn main() {
}
fn vet_file(path string, table &table.Table, prefs &pref.Preferences) {
if path.contains('/tests') {
return
}
file_ast := parser.parse_file(path, table, .parse_comments, prefs, &ast.Scope{
parent: 0
})

View File

@ -1315,7 +1315,8 @@ fn (mut g Gen) gen_cross_tmp_variable(left []ast.Expr, val ast.Expr) {
mut has_var := false
for lx in left {
if val_.str() == lx.str() {
g.write('_var_$lx.position().pos')
g.write('_var_')
g.write(lx.position().pos.str())
has_var = true
break
}
@ -1341,7 +1342,7 @@ fn (mut g Gen) gen_cross_tmp_variable(left []ast.Expr, val ast.Expr) {
mut has_var := false
for lx in left {
if val_.str() == lx.str() {
g.write('_var_$lx.position().pos')
g.write('_var_${lx.position()}.pos')
has_var = true
break
}