Skip to content

Commit

Permalink
- getDocumentationAnnotation returns {"info","revision"} with info as…
Browse files Browse the repository at this point in the history
… the first element and revision as the second always.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10520 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Nov 15, 2011
1 parent 9cfa56c commit b61ff1e
Showing 1 changed file with 35 additions and 24 deletions.
59 changes: 35 additions & 24 deletions Compiler/Script/Interactive.mo
Expand Up @@ -12995,62 +12995,73 @@ algorithm
docStr := match (mod)
local
list<Absyn.ElementArg> arglst;
list<String> strs;
String info, revisions;
String s;

case (SOME(Absyn.CLASSMOD(elementArgLst = arglst)))
equation
strs = getDocumentationAnnotationString2(arglst);
s = stringDelimitList(strs,",");
s = stringAppendList({"{", s, "}"});
info = getDocumentationAnnotationInfo(arglst);
revisions = getDocumentationAnnotationRevision(arglst);
s = stringAppendList({"{",info,",",revisions,"}"});
then
s;

// adrpo: fail if we don't find it!
// case (_)
// then
// "";
end match;
end getDocumentationAnnotationString;

protected function getDocumentationAnnotationString2
"function getDocumentationAnnotationString2
protected function getDocumentationAnnotationInfo
"function getDocumentationAnnotationInfo
Helper function to getDocumentationAnnotationString"
input list<Absyn.ElementArg> eltArgs;
output list<String> strs;
output String str;
algorithm
strs := matchcontinue (eltArgs)
str := matchcontinue (eltArgs)
local
Absyn.Exp exp;
list<Absyn.ElementArg> xs;
String s;
list<String> ss;

case ({}) then {};

String ss;
case ({}) then "";
case (Absyn.MODIFICATION(componentRef = Absyn.CREF_IDENT(name = "info"),
modification=SOME(Absyn.CLASSMOD(eqMod=Absyn.EQMOD(exp=exp))))::xs)
equation
s = Dump.printExpStr(exp);
s = stringAppendList({"{","info","(",s,")","}"});
ss = getDocumentationAnnotationString2(xs);
then s::ss;
ss = getDocumentationAnnotationInfo(xs);
then s;
case (_::xs)
equation
ss = getDocumentationAnnotationInfo(xs);
then ss;
end matchcontinue;
end getDocumentationAnnotationInfo;

protected function getDocumentationAnnotationRevision
"function getDocumentationAnnotationRevision
Helper function to getDocumentationAnnotationString"
input list<Absyn.ElementArg> eltArgs;
output String str;
algorithm
str := matchcontinue (eltArgs)
local
Absyn.Exp exp;
list<Absyn.ElementArg> xs;
String s;
String ss;
case ({}) then "";
case (Absyn.MODIFICATION(componentRef = Absyn.CREF_IDENT(name = "revisions"),
modification=SOME(Absyn.CLASSMOD(eqMod=Absyn.EQMOD(exp=exp))))::xs)
equation
s = Dump.printExpStr(exp);
s = stringAppendList({"{","revisions","(",s,")","}"});
ss = getDocumentationAnnotationString2(xs);
then s::ss;

ss = getDocumentationAnnotationRevision(xs);
then s;
case (_::xs)
equation
ss = getDocumentationAnnotationString2(xs);
ss = getDocumentationAnnotationRevision(xs);
then ss;

end matchcontinue;
end getDocumentationAnnotationString2;
end getDocumentationAnnotationRevision;

protected function getNthPublicConnectorStr
"function: getNthPublicConnectorStr
Expand Down

0 comments on commit b61ff1e

Please sign in to comment.