Skip to content

Commit

Permalink
Improve getModelInstance (#10243)
Browse files Browse the repository at this point in the history
- Unify class elements into one array instead of dumping component and
  extends separately, to get the correct ordering of them.
- Dump information about replaceable class elements.
- Remove the array of replaceable names since it's not used.
- Update OMEdit to handle the new JSON structure.
  • Loading branch information
perost committed Feb 21, 2023
1 parent 467e0c0 commit fbe0da1
Show file tree
Hide file tree
Showing 37 changed files with 670 additions and 339 deletions.
8 changes: 8 additions & 0 deletions OMCompiler/Compiler/Parsers/JSON.mo
Expand Up @@ -153,6 +153,14 @@ algorithm
end match;
end addElement;

function addElementNotNull
input JSON value;
input JSON obj;
output JSON outObj;
algorithm
outObj := if isNull(value) then obj else addElement(value, obj);
end addElementNotNull;

function addPair
"Adds a key-value pair to a JSON object, or returns a new object with the
key-value pair if the JSON is null."
Expand Down

0 comments on commit fbe0da1

Please sign in to comment.