Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dump annotation array elements separately (#12325)
- Dump elements of array expressions in annotations separately, to avoid e.g. an invalid graphical element invalidating the whole graphics arrays.
- Loading branch information
Showing
6 changed files
with
219 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
115 changes: 115 additions & 0 deletions
115
testsuite/openmodelica/instance-API/GetModelInstanceAnnotation12.mos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
// name: GetModelInstanceAnnotation12 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
// | ||
|
||
loadString(" | ||
model M | ||
annotation(Icon(graphics = {Rectangle(extent = {{1, 1}, {2, x}}), Text(textString = \"str\")})); | ||
end M; | ||
"); | ||
|
||
getModelInstance(M, prettyPrint=true); | ||
getErrorString(); | ||
|
||
// Result: | ||
// true | ||
// "{ | ||
// \"name\": \"M\", | ||
// \"restriction\": \"model\", | ||
// \"annotation\": { | ||
// \"Icon\": { | ||
// \"graphics\": [ | ||
// { | ||
// \"$error\": \"[<interactive>:3:21-3:96:writable] Error: Variable x not found in scope M.\\n\", | ||
// \"value\": { | ||
// \"$kind\": \"call\", | ||
// \"name\": \"Rectangle\", | ||
// \"namedArgs\": { | ||
// \"extent\": [ | ||
// [ | ||
// 1, | ||
// 1 | ||
// ], | ||
// [ | ||
// 2, | ||
// \"x\" | ||
// ] | ||
// ] | ||
// } | ||
// } | ||
// }, | ||
// { | ||
// \"$kind\": \"record\", | ||
// \"name\": \"Text\", | ||
// \"elements\": [ | ||
// true, | ||
// [ | ||
// 0, | ||
// 0 | ||
// ], | ||
// 0, | ||
// [ | ||
// 0, | ||
// 0, | ||
// 0 | ||
// ], | ||
// [ | ||
// 0, | ||
// 0, | ||
// 0 | ||
// ], | ||
// { | ||
// \"$kind\": \"enum\", | ||
// \"name\": \"LinePattern.Solid\", | ||
// \"index\": 2 | ||
// }, | ||
// { | ||
// \"$kind\": \"enum\", | ||
// \"name\": \"FillPattern.None\", | ||
// \"index\": 1 | ||
// }, | ||
// 0.25, | ||
// [ | ||
// [ | ||
// -10, | ||
// -10 | ||
// ], | ||
// [ | ||
// 10, | ||
// 10 | ||
// ] | ||
// ], | ||
// \"str\", | ||
// 0, | ||
// [ | ||
// -1, | ||
// -1, | ||
// -1 | ||
// ], | ||
// \"\", | ||
// [ | ||
// | ||
// ], | ||
// { | ||
// \"$kind\": \"enum\", | ||
// \"name\": \"TextAlignment.Center\", | ||
// \"index\": 2 | ||
// } | ||
// ] | ||
// } | ||
// ] | ||
// } | ||
// }, | ||
// \"source\": { | ||
// \"filename\": \"<interactive>\", | ||
// \"lineStart\": 2, | ||
// \"columnStart\": 3, | ||
// \"lineEnd\": 4, | ||
// \"columnEnd\": 8 | ||
// } | ||
// }" | ||
// "" | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters