Interpreter up to 71/73 tests passing, the only ones that don't yet are the future ones. Struct size is still wrong though

This commit is contained in:
Nathan Braswell
2016-07-03 01:55:32 -07:00
parent 2e80682f01
commit 87c2b1d2c1
7 changed files with 63 additions and 17 deletions

View File

@@ -7,6 +7,8 @@ import util:*
import tree:*
import symbol:*
import ast_nodes:*
// for error with syntax tree
import ast_transformation:*
import poset:*
fun code_triple(): code_triple return code_triple(string(), string(), string());
@@ -464,6 +466,9 @@ obj c_generator (Object) {
var function_return_type = get_ast_type(enclosing_func)->return_type
var to_ret = code_triple()
if (!function_return_type->is_void() && !function_return_type->equality(get_ast_type(return_value), false))
error(ast_to_syntax[node], "return value type does not match function return type")
to_ret += "return"
var refamp = string()
if (function_return_type->is_ref)