@@ -1384,30 +1384,18 @@ end unparseAnnotationOptionSemi;
13841384
13851385public function unparseAnnotation
13861386"Prettyprint an annotation."
1387- input Absyn . Annotation inAbsynAnnotation ;
1388- input Integer inInteger ;
1387+ input Absyn . Annotation inAnnotation ;
1388+ input Integer inIndent ;
13891389 output String outString;
1390- algorithm
1391- outString := matchcontinue (inAbsynAnnotation,inInteger)
1392- local
1393- String s1,s2,str,is;
1394- list< Absyn . ElementArg > mod;
1395- Integer i;
1396- case (Absyn . ANNOTATION (mod),0 )
1397- equation
1398- s1 = unparseClassModificationStr(Absyn . CLASSMOD (mod,Absyn . NOMOD ()));
1399- s2 = stringAppend(" annotation" , s1);
1400- str = s2;
1401- then
1402- str;
1403- case (Absyn . ANNOTATION (mod),i)
1404- equation
1405- s1 = unparseClassModificationStr(Absyn . CLASSMOD (mod,Absyn . NOMOD ()));
1406- is = indentStr(i);
1407- str = stringAppendList({is,"annotation" ,s1});
1408- then
1409- str;
1410- end matchcontinue;
1390+ protected
1391+ list< Absyn . ElementArg > mods;
1392+ String indent, mods_str, ann_str;
1393+ algorithm
1394+ Absyn . ANNOTATION (elementArgs = mods) := inAnnotation;
1395+ ann_str := Util . if_(intEq(inIndent, 0 ), " annotation" , "annotation" );
1396+ mods_str := List . toString(mods, unparseElementArgStr, ann_str, "(" , ", " , ")" , true );
1397+ indent := indentStr(inIndent);
1398+ outString := stringAppend(indent, mods_str);
14111399end unparseAnnotation;
14121400
14131401public function unparseAnnotationOption
0 commit comments