@@ -748,9 +748,18 @@ algorithm
748748 SCode . Mod ann_mod;
749749
750750 case (SOME (SCode . COMMENT (annotation_ = SOME (SCode . ANNOTATION (ann_mod)))), _, _)
751- equation
752- true = Config . showAnnotations();
753- ann = inPrefix + "annotation" + SCodeDump . printModStr(ann_mod,SCodeDump . defaultOptions) + inSuffix;
751+ algorithm
752+ if Config . showAnnotations() then
753+ ann := inPrefix + "annotation" + SCodeDump . printModStr(ann_mod, SCodeDump . defaultOptions) + inSuffix;
754+ elseif Config . showStructuralAnnotations() then
755+ ann_mod := filterStructuralMods(ann_mod);
756+
757+ if not SCode . isEmptyMod(ann_mod) then
758+ ann := inPrefix + "annotation" + SCodeDump . printModStr(ann_mod, SCodeDump . defaultOptions) + inSuffix;
759+ end if ;
760+ else
761+ ann := "" ;
762+ end if ;
754763 then
755764 ann;
756765
@@ -759,6 +768,27 @@ algorithm
759768 end matchcontinue;
760769end dumpAnnotationStr;
761770
771+ public function filterStructuralMods
772+ input output SCode . Mod mod;
773+ algorithm
774+ mod := SCode . filterSubMods(mod, filterStructuralMod);
775+ end filterStructuralMods;
776+
777+ public function filterStructuralMod
778+ input SCode . SubMod mod;
779+ output Boolean keep;
780+ algorithm
781+ keep := match mod. ident
782+ case "Evaluate" then true ;
783+ case "Inline" then true ;
784+ case "LateInline" then true ;
785+ case "derivative" then true ;
786+ case "inverse" then true ;
787+ case "smoothOrder" then true ;
788+ else false ;
789+ end match;
790+ end filterStructuralMod;
791+
762792public function dumpCommentAnnotationStr
763793 input Option < SCode . Comment > inComment;
764794 output String outString;
0 commit comments