Skip to content

Commit 8af57bb

Browse files
committed
Fixes compilation
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@22359 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 162383d commit 8af57bb

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

Compiler/Makefile.common

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ VarTransform.mo \
256256
# HashTable6.mo \
257257

258258
SCRIPT = \
259+
BlockCallRewrite.mo \
259260
CevalScript.mo \
260261
Interactive.mo \
261262
GlobalScript.mo \
Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11

2-
encapsulated package BlockCallRewrite
2+
encapsulated package BlockCallRewrite
33
" file: BlockCallRewrite.mo
44
package: BlockCallRewrite
55
description: This module implements an extension for properties modelling for calling blocks as functions.
6-
It rewrites block calls into block instantiations.
6+
It rewrites block calls into block instantiations.
77
"
88

9-
end BlockCallRewrite;
9+
public import Absyn;
10+
protected import Error;
11+
12+
public function rewriteBlockCall
13+
input Absyn.Program inPg "Model containing block calls";
14+
input Absyn.Program inDefs "Block definitions";
15+
output Absyn.Program newOut "Standard Modelica output";
16+
algorithm
17+
(newOut) := match(inPg, inDefs)
18+
case (_, _)
19+
equation
20+
Error.addMessgae(Error.INTERNAL_ERROR,{"rewriteBlockCall is not implemented in RML; use the bootstrapped omc to use BlockCallRewrite.mo"});
21+
then fail();
22+
end match;
23+
end rewriteBlockCall;
24+
25+
end BlockCallRewrite;

Compiler/Script/CevalScript.mo

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,13 +1184,14 @@ algorithm
11841184
p as Absyn.PROGRAM(globalBuildTimes=ts),instClsLst = ic, lstVarVal = iv,compiledFunctions = cf,
11851185
loadedFiles = lf)),_)
11861186
equation
1187+
absynClass = Interactive.getPathedClassInProgram(path, p);
1188+
classes = {absynClass};
11871189
absynClass = Interactive.getPathedClassInProgram(classpath, p);
1188-
classes = {Interactive.getPathedClassInProgram(path, p)};
11891190
within_ = Interactive.buildWithin(classpath);
11901191
pnew = BlockCallRewrite.rewriteBlockCall(Absyn.PROGRAM({absynClass}, within_,ts), (Absyn.PROGRAM(classes, within_,ts)));
11911192
newp = Interactive.updateProgram(pnew, p);
11921193
then
1193-
(cache,Values.BOOL(true),GlobalScript.SYMBOLTABLE(newp,NONE(),ic,iv,cf,lf));
1194+
(cache,Values.BOOL(true),GlobalScript.SYMBOLTABLE(newp,NONE(),ic,iv,cf,lf));
11941195

11951196
case (cache, _, "rewriteBlockCall", _, st, _)
11961197
then (cache, Values.BOOL(false), st);

Compiler/boot/LoadCompilerSources.mos

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ if true then /* Suppress output */
172172
"../Script/Interactive.mo",
173173
"../Script/Refactor.mo",
174174
"../Script/RewriteRules.mo",
175-
"../Script/Figaro.mo",
176-
"../Script/BlockCallRewrite.mo",
175+
"../Script/Figaro.mo",
176+
"../Script/BlockCallRewrite.bootstrapped.mo",
177177

178178
// "Template";
179179
"../Template/AbsynDumpTpl.mo",

0 commit comments

Comments
 (0)