* [#16160](http://bugzilla.scilab.org/show_bug.cgi?id=16160): `ppol` changed values of third input variable.
* [#16164](http://bugzilla.scilab.org/show_bug.cgi?id=16164): Help pages in elementary_functions/signal_processing were mislocated.
* [#16174](http://bugzilla.scilab.org/show_bug.cgi?id=16174): `libraryinfo` yielded 0x0 matrix of strings for libs without macro
+* [#16178](http://bugzilla.scilab.org/show_bug.cgi?id=16178): `sci2exp` yielded an error for any input macro without output argument.
* [#16197](http://bugzilla.scilab.org/show_bug.cgi?id=16197): result of extraction was not decomplexified when applicable.
* [#16200](http://bugzilla.scilab.org/show_bug.cgi?id=16200): Concatenation of transposed cells crashed Scilab.
* [#16208](http://bugzilla.scilab.org/show_bug.cgi?id=16208): Using 3D string matrix with old C-api gateways may crash Scilab.
* [#16293](http://bugzilla.scilab.org/show_bug.cgi?id=16293): Some demos run in step-by-step console mode(4) did not focus user's attention to the console to proceed.
* [#16299](http://bugzilla.scilab.org/show_bug.cgi?id=16299): After `graypolarplot()`, `colorbar()` displayed an empty ungraduated color bar.
* [#16303](http://bugzilla.scilab.org/show_bug.cgi?id=16303): log10(x) had wrong dimensions when x is an hypermatrix.
-
-
end
h=t(1)
k=strindex(h,"=")
- if k==[] then k1=1,else k1=k(1),end
+ if k==[] then k1=0,else k1=k(1),end
k=strindex(h,"(")
if k==[] then k2=length(h),else k2=k(1),end
h=part(h,1:k1)+"%fun"+part(h,k2:length(h))
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) INRIA -
// Copyright (C) 2012 - 2016 - Scilab Enterprises
-// Copyright (C) 2016, 2017 - Samuel GOUGEON
+// Copyright (C) 2016, 2017, 2019 - Samuel GOUGEON
//
// This file is hereby licensed under the terms of the GNU GPL v2.0,
// pursuant to article 5.3.4 of the CeCILL v.2.1.
if named then
name=nom;
end
- idx=strindex(strfun(1), "=");
- idx2=strindex(part(strfun(1), idx:$), "(") + idx - 1;
- str=part(strfun(1), 1:idx) + " "+ name + part(strfun(1), idx2:length(strfun(1)));
- strfun(1)=str;
+ strfun(1) = strsubst(strfun(1), tree.name+"(", name+"(");
strfun($)=[];
t=strfun;
t(1) = part(t(1),10:length(t(1)))
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2019 - Samuel GOUGEON
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+// <-- NO CHECK REF -->
+
+// <-- Non-regression test for bug 16178 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/16178
+//
+// <-- Short Description -->
+// sci2exp() yielded an error for any input macro without argout
+// -------------------------------------------------------------
+
+function Q1()
+ a.b
+endfunction
+assert_checkequal(sci2exp(Q1), "createfun([""%fun()"";""a.b""])");
+assert_checkequal(sci2exp(Q1,"Q"), "createfun([""Q()"";""a.b""])");
+
+
+// The used internal createfun() failed for a function returning nothing:
+// ---------------------------------------------------------------------
+//--> f=createfun(["b=fun(a)";"b=a.b"])
+// f =
+// [b]=f(a) // OK
+//
+//--> f=createfun(["fun(a)";"b=a.b"])
+// at line 1 of executed string
+// at line 10 of function deff ( SCI\modules\functions\macros\deff.sci line 10 )
+// at line 15 of function createfun ( SCI\modules\functions\macros\createfun.sci line 27 )
+//
+// function f%fun(a)
+// ^~~~^
+// Error: syntax error, unexpected identifier, expecting end of line or "," or ; or line comment
+
+// NR Test:
+
+%fghw = createfun(["fun(a)";"b=a.b"]); // without output
+assert_checkequal(type(%fghw), 13)
+
+%fghw2 = createfun(["b=fun(a)";"b=a.b"]); // with output
+assert_checkequal(type(%fghw2), 13)
+s.b = %pi;
+assert_checkequal(%fghw2(s), %pi)