From 1e58316a14b50732ef7e6c3e85f39fe6e64f5803 Mon Sep 17 00:00:00 2001 From: Adrian Pop Date: Thu, 18 Feb 2010 01:05:19 +0000 Subject: [PATCH] - added a new function - use dummyInfo constant rather than construct it on the fly git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@4984 f25d12d1-65f4-0310-ae8a-bbce733d8d8e --- Compiler/Absyn.mo | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/Compiler/Absyn.mo b/Compiler/Absyn.mo index 582ca02cd9c..5d1b7e6fb80 100644 --- a/Compiler/Absyn.mo +++ b/Compiler/Absyn.mo @@ -668,12 +668,9 @@ end Variability; public uniontype Direction "Direction" - record INPUT end INPUT; - - record OUTPUT end OUTPUT; - - record BIDIR end BIDIR; - + record INPUT "direction is input" end INPUT; + record OUTPUT "direction is output" end OUTPUT; + record BIDIR "direction is not specified, neither input nor output" end BIDIR; end Direction; public @@ -2693,6 +2690,21 @@ algorithm end matchcontinue; end joinPathsOpt; +public function selectPathsOpt "function: selectPathsOpt + This function selects the second path when the first one + is NONE otherwise it will select the first one." + input Option inPath1; + input Path inPath2; + output Path outPath; +algorithm + outPath := matchcontinue (inPath1,inPath2) + local + Path p; + case (NONE(), p) then p; + case (SOME(p),_) then p; + end matchcontinue; +end selectPathsOpt; + public function optPathAppend " Author BZ, 2009-01 Appends a path to optional 'base'-path. @@ -3160,7 +3172,7 @@ end setClassFilename; public function emptyClassInfo "" output Info info; algorithm - info := INFO("",false,0,0,0,0,TIMESTAMP(0.0,0.0)); + info := dummyInfo; //INFO("",false,0,0,0,0,TIMESTAMP(0.0,0.0)); end emptyClassInfo; public function setClassName "function setClassFilename