From 1b71caa1fe1807f70debf7a555344cf6b9fc4961 Mon Sep 17 00:00:00 2001 From: Dale Weiler Date: Wed, 29 May 2013 11:29:52 +0000 Subject: [PATCH] Update man page --- doc/gmqcc.1 | 12 ++++++++++++ tests/rassign.qc | 8 ++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/doc/gmqcc.1 b/doc/gmqcc.1 index 60257dc..6ede944 100644 --- a/doc/gmqcc.1 +++ b/doc/gmqcc.1 @@ -506,6 +506,18 @@ Example: void printA() = #1; // the usual way void printB() = #2-1; // with a constant expression .Ed +.It Fl f Ns Cm return-assignments +Enabiling this option will allow assigning values or expressions to the +return keyword as if it were a local variable of the same type as the +function's signature's return type. +.Pp +Example: +.Bd -literal -offset indent +float bar() { return 1024; } +float fun() { + return = bar(); + return; // returns value of bar +} .El .Sh OPTIMIZATIONS .Bl -tag -width Ds diff --git a/tests/rassign.qc b/tests/rassign.qc index f734e7e..7e3d0e6 100644 --- a/tests/rassign.qc +++ b/tests/rassign.qc @@ -5,8 +5,12 @@ float f_float() { } vector f_vector() { - return = '1 2 3'; - return = '2 3 4'; + vector foo; + foo.x = f_float(); + foo.y = f_float(); + foo.z = f_float(); + + return = foo; return; } -- 2.39.2