diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce573b12b3..12f0314f05 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,13 +47,15 @@ jobs: steps: - uses: actions/checkout@v1 - name: Install dependencies - run: sudo apt-get update; sudo apt-get install --quiet -y tcc libglfw3 libglfw3-dev libfreetype6-dev libssl-dev sqlite3 libsqlite3-dev + run: sudo apt-get update; sudo apt-get install --quiet -y libglfw3 libglfw3-dev libfreetype6-dev libssl-dev sqlite3 libsqlite3-dev - name: Build v run: make && ./v -o v v.v - name: Test v->c with tcc env: VFLAGS: -cc tcc run: | + echo "New TCC" + sudo ln -s /var/tmp/tcc/bin/tcc /usr/local/bin/tcc tcc -version ./v -o v2 v.v # Make sure vtcc can build itself ./v test v diff --git a/vlib/compiler/comptime.v b/vlib/compiler/comptime.v index b12a6b185b..5510ea8ac3 100644 --- a/vlib/compiler/comptime.v +++ b/vlib/compiler/comptime.v @@ -120,10 +120,9 @@ fn (p mut Parser) comp_time() { p.check(.dollar) p.check(.name) p.check(.assign) - p.cgen.start_tmp() - p.bool_expression() - val := p.cgen.end_tmp() - println(val) + _, val := p.tmp_expr() + //p.bool_expression() + //val := p.cgen.end_tmp() p.check(.rcbr) // } } diff --git a/vlib/compiler/parser.v b/vlib/compiler/parser.v index 9261f27520..b4584bd685 100644 --- a/vlib/compiler/parser.v +++ b/vlib/compiler/parser.v @@ -2153,10 +2153,8 @@ fn (p mut Parser) string_expr() { complex_inter = true } // Get bool expr inside a temp var - p.cgen.start_tmp() - typ := p.bool_expression() - mut val := p.cgen.end_tmp() - val = val.trim_space() + typ, val_ := p.tmp_expr() + val := val_.trim_space() args += ', $val' if typ == 'string' { // args += '.str' @@ -2264,8 +2262,7 @@ fn (p mut Parser) map_init() string { keys_gen += 'tos3("$key"), ' p.check(.str) p.check(.colon) - p.cgen.start_tmp() - t := p.bool_expression() + t, val_expr := p.tmp_expr() if i == 0 { val_type = t } @@ -2275,7 +2272,6 @@ fn (p mut Parser) map_init() string { p.error('bad map element type `$val_type` instead of `$t`') } } - val_expr := p.cgen.end_tmp() vals_gen += '$val_expr, ' if p.tok == .rcbr { p.check(.rcbr)