Skip to content

Commit

Permalink
- getPathedClassInProgram now also looks for builtin classes (making …
Browse files Browse the repository at this point in the history
…MDT display builtin functions in any project)

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@9866 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Sep 18, 2011
1 parent ac416a7 commit 5e18b95
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions Compiler/Script/Interactive.mo
Expand Up @@ -59,6 +59,7 @@ public import Settings;
public import Values;

// protected imports
protected import Builtin;
protected import Ceval;
protected import ClassInf;
protected import ClassLoader;
Expand Down Expand Up @@ -16462,6 +16463,25 @@ public function getPathedClassInProgram
input Absyn.Path inPath;
input Absyn.Program inProgram;
output Absyn.Class outClass;
algorithm
outClass := matchcontinue (inPath,inProgram)
local
Absyn.Program p;
Absyn.Path path;

case (path,p) then getPathedClassInProgramWork(path, p);
case (path,p) then getPathedClassInProgramWork(path,Builtin.getInitialFunctions());

end matchcontinue;
end getPathedClassInProgram;

public function getPathedClassInProgramWork
"function: getPathedClassInProgramWork
This function takes a Path and a Program and retrieves the
class definition referenced by the Path from the Program."
input Absyn.Path inPath;
input Absyn.Program inProgram;
output Absyn.Class outClass;
algorithm
outClass := match (inPath,inProgram)
local
Expand All @@ -16487,11 +16507,11 @@ algorithm
equation
c1def = getClassInProgram(str, p);
classes = getClassesInClass(Absyn.IDENT(str), p, c1def);
res = getPathedClassInProgram(prest, Absyn.PROGRAM(classes,w,ts));
res = getPathedClassInProgramWork(prest, Absyn.PROGRAM(classes,w,ts));
then
res;
end match;
end getPathedClassInProgram;
end getPathedClassInProgramWork;

protected function getClassesInClass
"function: getClassesInClass
Expand Down

0 comments on commit 5e18b95

Please sign in to comment.