-
Notifications
You must be signed in to change notification settings - Fork 297
/
GetModelInstanceFunction1.mos
58 lines (55 loc) · 1.04 KB
/
GetModelInstanceFunction1.mos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// name: GetModelInstanceFunction1
// keywords:
// status: correct
// cflags: -d=newInst
//
//
loadString("
function f
input Integer N;
output Real y[N];
algorithm
y := fill(1.0, N);
end f;
");
getModelInstance(f, prettyPrint = true);
// Result:
// true
// "{
// \"name\": \"f\",
// \"restriction\": \"function\",
// \"elements\": [
// {
// \"$kind\": \"component\",
// \"name\": \"N\",
// \"type\": \"Integer\",
// \"prefixes\": {
// \"direction\": \"input\"
// }
// },
// {
// \"$kind\": \"component\",
// \"name\": \"y\",
// \"type\": \"Real\",
// \"dims\": {
// \"absyn\": [
// \"N\"
// ],
// \"typed\": [
// \"N\"
// ]
// },
// \"prefixes\": {
// \"direction\": \"output\"
// }
// }
// ],
// \"source\": {
// \"filename\": \"<interactive>\",
// \"lineStart\": 2,
// \"columnStart\": 3,
// \"lineEnd\": 7,
// \"columnEnd\": 8
// }
// }"
// endResult