Skip to content

Commit 326421d

Browse files
committed
- renamed fcallret to fcallret1
- added fcallret0 to be used when only printing and not returning values. - the new function is used in package Main for printing to standard output based on a debug flag. git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@5608 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent fbf1fdc commit 326421d

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

Compiler/Debug.mo

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,40 @@ algorithm
212212
end matchcontinue;
213213
end fcall0;
214214

215-
public function fcallret
216-
"function: fcallret
215+
public function fcallret0
216+
"function: fcallret0
217217
Flag controlled calling of given function (2nd arg).
218-
The passed functions return value is returned."
218+
The passed function gets 0 arguments.
219+
The last parameter is returned if the given flag is not set."
220+
input String inString;
221+
input FuncTypeToType_b inFuncTypeTypeB;
222+
input Type_b inTypeB;
223+
output Type_b outTypeB;
224+
partial function FuncTypeToType_b
225+
output Type_b outTypeB;
226+
end FuncTypeToType_b;
227+
replaceable type Type_b subtypeof Any;
228+
algorithm
229+
outTypeB := matchcontinue (inString,inFuncTypeTypeB,inTypeB)
230+
local
231+
Type_b res,def;
232+
String flag;
233+
FuncTypeToType_b func;
234+
case (flag,func,def)
235+
equation
236+
true = RTOpts.debugFlag(flag);
237+
res = func();
238+
then
239+
res;
240+
case (_,_,def) then def;
241+
end matchcontinue;
242+
end fcallret0;
243+
244+
public function fcallret1
245+
"function: fcallret1
246+
Flag controlled calling of given function (2nd arg).
247+
The passed function gets 1 arguments.
248+
The last parameter is returned if the given flag is not set."
219249
input String inString;
220250
input FuncTypeType_aToType_b inFuncTypeTypeAToTypeB;
221251
input Type_a inTypeA;
@@ -242,7 +272,7 @@ algorithm
242272
res;
243273
case (_,_,_,def) then def;
244274
end matchcontinue;
245-
end fcallret;
275+
end fcallret1;
246276

247277
public function bcall
248278
"function: bcall

0 commit comments

Comments
 (0)