From: Dale Weiler Date: Wed, 29 May 2013 11:29:52 +0000 (+0000) Subject: Update man page X-Git-Tag: v0.3.0~151^2~39 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1b71caa1fe1807f70debf7a555344cf6b9fc4961;p=xonotic%2Fgmqcc.git Update man page --- 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; }