Skip to content

Commit

Permalink
Fix bug: #3254
Browse files Browse the repository at this point in the history
- return component annotations that are not graphical classes also
- added test: testsuite/openmodelica/interactive-API/choicesAllMatching.mos


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25345 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Mar 31, 2015
1 parent ca0f0dc commit 16830d3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Compiler/Script/Interactive.mo
Expand Up @@ -12584,10 +12584,31 @@ algorithm
list<Absyn.ElementArg> mod, rest;
FCore.Cache cache;
SourceInfo info;
Absyn.Exp expAbsyn;
DAE.Exp expDae;
DAE.Properties prop;

// handle empty
case ({},_,_,_,_) then {};

// handle non-classes annotations
case (Absyn.MODIFICATION(path = Absyn.IDENT(annName),
modification = SOME(Absyn.CLASSMOD({},Absyn.EQMOD(expAbsyn))), info = info) :: rest,env,_,_,_)
equation
(cache, env, _) = buildEnvForGraphicProgram(inFullProgram, inModelPath, {}, annName);

(_,expDae,prop) = StaticScript.elabGraphicsExp(cache, env, expAbsyn, false, Prefix.NOPRE(), Absyn.dummyInfo); // TODO: FIXME: Someone forgot to add SourceInfo to this function's input
(cache, expDae, prop) = Ceval.cevalIfConstant(cache, env, expDae, prop, false, Absyn.dummyInfo);
(expDae,_) = ExpressionSimplify.simplify1(expDae);
Print.clearErrorBuf() "this is to clear the error-msg generated by the annotations.";

gexpstr = ExpressionDump.printExpStr(expDae);

gexpstr_1 = stringAppendList({annName,"=",gexpstr});
res = getComponentitemsAnnotationsElArgs(rest, env, inClass,inFullProgram,inModelPath);
then
(gexpstr_1 :: res);

case (Absyn.MODIFICATION(path = Absyn.IDENT(annName),
modification = SOME(Absyn.CLASSMOD(mod,Absyn.NOMOD())), info = info) :: rest,env,_,_,_)
equation
Expand Down

0 comments on commit 16830d3

Please sign in to comment.