return Check_Success;
}
- if ((*expected_return_type)->Basic.size > 0) {
+ if ((*expected_return_type) != &basic_types[Basic_Kind_Void]) {
ERROR_(retnode->token->pos,
"Returning from non-void function without a value. Expected a value of type '%s'.",
type_get_name(*expected_return_type));
if (context.options->documentation_file != NULL) {
OnyxDocumentation docs = onyx_docs_generate();
- docs.format = Doc_Format_Human;
+ docs.format = Doc_Format_Tags;
onyx_docs_emit(&docs, context.options->documentation_file);
}
expect_token(parser, '(');
cast_node->type_node = parse_type(parser);
- expect_token(parser, ')');
- cast_node->expr = parse_factor(parser);
+ if (peek_token(0)->type == ',') {
+ expect_token(parser, ',');
+ cast_node->expr = parse_factor(parser);
+ expect_token(parser, ')');
+
+ } else {
+ expect_token(parser, ')');
+ cast_node->expr = parse_factor(parser);
+ }
retval = (AstTyped *) cast_node;
break;
case Token_Type_Literal_Integer:
case Token_Type_Literal_Float:
case Token_Type_Literal_String:
+ case Token_Type_Keyword_Cast:
retval = (AstNode *) parse_compound_expression(parser, 1);
if (retval->kind == Ast_Kind_Call || retval->kind == Ast_Kind_Method_Call) {
if (parser->curr->type == '{') {