Skip to content

Commit

Permalink
- Using Ceval.cevalCallFunction record constructor instead of cevalFu…
Browse files Browse the repository at this point in the history
…nction

- Enabled testsuite/records as a default test to run as it now works

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@4393 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Oct 26, 2009
1 parent a0b6f70 commit 31de232
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Compiler/Ceval.mo
Expand Up @@ -87,6 +87,7 @@ protected import Dump;
protected import DAE;
protected import Prefix;
protected import Connect;
protected import ClassInf;

public function ceval
"function: ceval
Expand Down Expand Up @@ -1080,22 +1081,24 @@ algorithm
fail();

/* Record constructors */
/*
case(cache,env,(e as Exp.CALL(path = funcpath,ty = Exp.COMPLEX(name = "", varLst=varLst))),vallst,msg,st)
case(cache,env,(e as Exp.CALL(path = funcpath,ty = Exp.COMPLEX(complexClassType = ClassInf.RECORD(_), varLst=varLst))),vallst,msg,st)
local
list<Exp.Var> varLst; list<String> varNames; String complexName, lastIdent;
equation
varNames = Util.listMap(varLst,Exp.varName);
then (cache,Values.RECORD(funcpath,vallst,varNames),st);
then (cache,Values.RECORD(funcpath,vallst,varNames,-1),st);

/*
case(cache,env,(e as Exp.CALL(path = funcpath,ty = Exp.COMPLEX(name = complexName, varLst=varLst))),vallst,msg,st)
local
list<Exp.Var> varLst; list<String> varNames; String complexName, lastIdent;
equation
true = complexName ==& Absyn.pathLastIdent(funcpath);
varNames = Util.listMap(varLst,Exp.varName);
then (cache,Values.RECORD(funcpath,vallst,varNames),st);
*/

/*
case (cache,env,(e as Exp.CALL(path = funcpath,expLst = expl,builtin = builtin)),vallst,msg,st)
local
Absyn.Path p2;
Expand Down Expand Up @@ -1401,7 +1404,8 @@ algorithm
String s;
Env.Cache cache;
Env.Env env_2;
// Not working properly ! /sjoelund
// Not working properly (only non-nested records)! /sjoelund
/*
case (cache,env,funcname,vallst,impl,msg) "For record constructors"
equation
(_,_) = Lookup.lookupRecordConstructorClass(env, funcname);
Expand All @@ -1413,12 +1417,13 @@ algorithm
(cache, value) = DAE.daeToRecordValue(cache, env_2, funcname, dae, impl) "adrpo: We need the env here as we need to do variable Lookup!";
then
(cache,value);
*/

case (cache,env,funcname,vallst,(impl as true),msg)
equation
Debug.fprint("failtrace", "- Ceval.cevalFunction: Don't know what to do. impl was always false before:");
/*Debug.fprint("failtrace", "- Ceval.cevalFunction: Don't know what to do. impl was always false before:");
s = Absyn.pathString(funcname);
Debug.fprintln("failtrace", s);
Debug.fprintln("failtrace", s);*/
then
fail();
end matchcontinue;
Expand Down

0 comments on commit 31de232

Please sign in to comment.