62 tests passing - the two Kalypso misses that Cephalapod doesn't is string because of taking the address of a literal (which I want to fix in a broader way that will also make Kalypso pass the other tests that Cephelapod is failing because of reference of literal) and ADT, which is the last (or perhaps second to last) thing to implement.

This commit is contained in:
Nathan Braswell
2016-03-10 16:07:12 -05:00
parent 40d630f348
commit ac8493d7f3

View File

@@ -639,9 +639,12 @@ obj c_generator (Object) {
if (func_return_type->is_object() && func_return_type->indirection == 0 && has_method(func_return_type->type_def, "destruct", vector<*type>())) if (func_return_type->is_object() && func_return_type->indirection == 0 && has_method(func_return_type->type_def, "destruct", vector<*type>()))
call_string.post += generate_statement(ast_statement_ptr(make_method_call(temp_ident, "destruct", vector<*ast_node>())), enclosing_object, enclosing_func, null<stack<pair<bool,stack<*ast_node>>>>()).one_string() call_string.post += generate_statement(ast_statement_ptr(make_method_call(temp_ident, "destruct", vector<*ast_node>())), enclosing_object, enclosing_func, null<stack<pair<bool,stack<*ast_node>>>>()).one_string()
} }
var ref_pre = code_triple() var ref_pre = string()
if (func_return_type->is_ref) var ref_post = string()
ref_pre += "*" if (func_return_type->is_ref) {
ref_pre += "(*"
ref_post += ")"
}
if (!is_function(node->function_call.func) || node->function_call.func->function.closed_variables.size()) { if (!is_function(node->function_call.func) || node->function_call.func->function.closed_variables.size()) {
// not function, so we must be an identifier or function call return or something // not function, so we must be an identifier or function call return or something
if (!dot_style_method_call) { if (!dot_style_method_call) {
@@ -675,7 +678,8 @@ obj c_generator (Object) {
call_string.pre += string("else ") + pre_call + " = ((" + type_to_c(func_type) + "_without_data) " + func_name+".func)(" + call_string.value + ");\n" call_string.pre += string("else ") + pre_call + " = ((" + type_to_c(func_type) + "_without_data) " + func_name+".func)(" + call_string.value + ");\n"
call_string.value = pre_call call_string.value = pre_call
} }
return ref_pre + call_string call_string.value = ref_pre + call_string.value + ref_post
return call_string
} }
} }
if (pre_call != "") { if (pre_call != "") {
@@ -684,7 +688,8 @@ obj c_generator (Object) {
} else { } else {
call_string.value = func_name + "(" + call_string.value + ")" call_string.value = func_name + "(" + call_string.value + ")"
} }
return ref_pre + call_string call_string.value = ref_pre + call_string.value + ref_post
return call_string
} }
// for now, anyway // for now, anyway