tests: fix compilation of parser_test.v

pull/4290/head
Delyan Angelov 2020-04-08 05:57:36 +03:00
parent ef19aa1de6
commit c00ec77737
2 changed files with 5 additions and 2 deletions

View File

@ -41,7 +41,7 @@ const (
'vlib/regex/regex_test.v',
'vlib/sqlite/sqlite_test.v', // Linux only
'vlib/strconv/ftoa/f32_f64_to_string_test.v',
'vlib/v/parser/parser_test.v',
//'vlib/v/parser/parser_test.v', // exits early, but it should compile
'vlib/v/tests/array_to_string_test.v',
'vlib/v/tests/asm_test.v', // Linux only
'vlib/v/tests/backtrace_test.v', // TCC only

View File

@ -79,7 +79,8 @@ x := 10
'
table := &table.Table{}
vpref := &pref.Preferences{}
prog := parse_file(s, table, .skip_comments, vpref)
gscope := &ast.Scope{ parent: 0 }
prog := parse_file(s, table, .skip_comments, vpref, gscope)
mut checker := checker.new_checker(table, vpref)
checker.check(prog)
res := gen.cgen([prog], table, vpref)
@ -111,6 +112,7 @@ fn test_one() {
program := ast.File{
stmts: e
scope: scope
global_scope: scope
}
mut checker := checker.new_checker(table, vpref)
checker.check(program)
@ -209,6 +211,7 @@ fn test_parse_expr() {
program := ast.File{
stmts: e
scope: scope
global_scope: scope
}
checker.check(program)
res := gen.cgen([program], table, vpref).after('#endif')