+ /* return assignments */
+ if (parser->tok == '=') {
+ if (!OPTS_FLAG(RETURN_ASSIGNMENTS)) {
+ parseerror(parser, "return assignments not activated, try using -freturn-assigments");
+ return false;
+ }
+
+ if (!parser_next(parser)) {
+ parseerror(parser, "expected return assignment expression");
+ return false;
+ }
+
+ if (!(exp = parse_expression_leave(parser, false, false, false)))
+ return false;
+
+ if (exp->vtype != TYPE_NIL &&
+ exp->vtype != ((ast_expression*)expected)->next->vtype)
+ {
+ parseerror(parser, "return assignment with invalid expression");
+ }
+
+ /* store to 'return' local variable */
+ var = (ast_expression*)ast_store_new(
+ ctx,
+ type_store_instr[exp->vtype],
+ (ast_expression*)parser_find_returnvalue(parser, exp->vtype),
+ (ast_expression*)exp
+ );
+
+ if (!var) {
+ ast_unref(exp);
+ return false;
+ }
+
+ *out = var;
+ return true;
+ }
+