cgen: fix getn_cross_tmp_variable
parent
dbcb23ddc8
commit
625ed030ef
|
@ -46,8 +46,8 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
v vet vlib/v/parser
|
v vet vlib/v/parser
|
||||||
v vet vlib/v/ast
|
v vet vlib/v/ast
|
||||||
v vet vlib/v/ast
|
|
||||||
v vet vlib/v/gen/cgen.v
|
v vet vlib/v/gen/cgen.v
|
||||||
|
v vet vlib/v/checker
|
||||||
# - name: Test v binaries
|
# - name: Test v binaries
|
||||||
# run: ./v -silent build-vbinaries
|
# run: ./v -silent build-vbinaries
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,9 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn vet_file(path string, table &table.Table, prefs &pref.Preferences) {
|
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{
|
file_ast := parser.parse_file(path, table, .parse_comments, prefs, &ast.Scope{
|
||||||
parent: 0
|
parent: 0
|
||||||
})
|
})
|
||||||
|
|
|
@ -1315,7 +1315,8 @@ fn (mut g Gen) gen_cross_tmp_variable(left []ast.Expr, val ast.Expr) {
|
||||||
mut has_var := false
|
mut has_var := false
|
||||||
for lx in left {
|
for lx in left {
|
||||||
if val_.str() == lx.str() {
|
if val_.str() == lx.str() {
|
||||||
g.write('_var_$lx.position().pos')
|
g.write('_var_')
|
||||||
|
g.write(lx.position().pos.str())
|
||||||
has_var = true
|
has_var = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -1341,7 +1342,7 @@ fn (mut g Gen) gen_cross_tmp_variable(left []ast.Expr, val ast.Expr) {
|
||||||
mut has_var := false
|
mut has_var := false
|
||||||
for lx in left {
|
for lx in left {
|
||||||
if val_.str() == lx.str() {
|
if val_.str() == lx.str() {
|
||||||
g.write('_var_$lx.position().pos')
|
g.write('_var_${lx.position()}.pos')
|
||||||
has_var = true
|
has_var = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue