Skip to content

Commit a84ef06

Browse files
committed
+ revert 15132
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@15133 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 3dc277f commit a84ef06

File tree

3 files changed

+25
-46
lines changed

3 files changed

+25
-46
lines changed

Compiler/FrontEnd/Absyn.mo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3369,20 +3369,20 @@ algorithm
33693369
Ident ident;
33703370
Path newPath,newSubPath;
33713371
// A suffix, e.g. C.D in A.B.C.D
3372-
case (_,_)
3372+
case (subPath,path)
33733373
equation
33743374
true=pathSuffixOf(subPath,path);
33753375
then path;
33763376
// strip last ident of path and recursively check if suffix.
3377-
case (_,_)
3377+
case (subPath,path)
33783378
equation
33793379
ident = pathLastIdent(path);
33803380
newPath = stripLast(path);
33813381
newPath=pathContainedIn(subPath,newPath);
33823382
then joinPaths(newPath,IDENT(ident));
33833383

33843384
// strip last ident of subpath and recursively check if suffix.
3385-
case (_,_)
3385+
case (subPath,path)
33863386
equation
33873387
ident = pathLastIdent(subPath);
33883388
newSubPath = stripLast(subPath);

Compiler/FrontEnd/Inst.mo

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18585,8 +18585,7 @@ algorithm
1858518585

1858618586
case(_, _, _)
1858718587
equation
18588-
true = Flags.isSet(Flags.FAILTRACE);
18589-
Debug.fprint(Flags.FAILTRACE, "Inst.getRecordConstructorFunction failed for " +& Absyn.pathString(inPath) +& "\n");
18588+
print("Inst.getRecordConstructorFunction failed for " +& Absyn.pathString(inPath) +& "\n");
1859018589
then
1859118590
fail();
1859218591

Compiler/FrontEnd/Static.mo

Lines changed: 21 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7291,7 +7291,6 @@ algorithm
72917291

72927292
operNames = SCodeUtil.getListofQualOperatorFuncsfromOperator(recordCl);
72937293
(cache,typelist as _::_) = Lookup.lookupFunctionsListInEnv(cache, recordEnv, operNames, info, {});
7294-
typelist = List.map1(typelist, joinSourcePath, fn);
72957294

72967295
Util.setStatefulBoolean(stopElab,true);
72977296
(cache,expProps) = elabCallArgs3(cache,env,typelist,fn_1,args,nargs,impl,st,pre,info);
@@ -12668,8 +12667,8 @@ algorithm
1266812667
outPath := match(inType1)
1266912668
local
1267012669
Absyn.Path path;
12671-
case (DAE.T_COMPLEX(ClassInf.RECORD(_),_, _,{path})) then path;
12672-
case (DAE.T_ARRAY(DAE.T_COMPLEX(ClassInf.RECORD(_),_, _,{path}),_,_)) then path;
12670+
case (DAE.T_COMPLEX(ClassInf.RECORD(path),_, _,_)) then path;
12671+
case (DAE.T_ARRAY(DAE.T_COMPLEX(ClassInf.RECORD(path),_, _,_),_,_)) then path;
1267312672
else fail();
1267412673
end match;
1267512674

@@ -12864,7 +12863,7 @@ algorithm
1286412863
local
1286512864
Boolean bool1,bool2;
1286612865
String str1;
12867-
Absyn.Path path,path2,recpath;
12866+
Absyn.Path path,path2;
1286812867
list<Absyn.Path> operNames;
1286912868
Env.Env recordEnv,operatorEnv,env;
1287012869
SCode.Element operatorCl;
@@ -12882,11 +12881,12 @@ algorithm
1288212881

1288312882
// prepare the call path for the operator.
1288412883
// if * => recordPath.'*' , !!also if .* => recordPath.'*'
12885-
recpath = getRecordPath(type1);
12886-
(cache,_,recordEnv) = Lookup.lookupClass(cache,env,recpath, false);
12884+
path = getRecordPath(type1);
12885+
path = Absyn.makeFullyQualified(path);
12886+
(cache,_,recordEnv) = Lookup.lookupClass(cache,env,path, false);
1288712887

1288812888
str1 = "'" +& Dump.opSymbolCompact(op) +& "'";
12889-
path = Absyn.joinPaths(recpath, Absyn.IDENT(str1));
12889+
path = Absyn.joinPaths(path, Absyn.IDENT(str1));
1289012890

1289112891

1289212892
// check if the operator is defined. i.e overloaded
@@ -12897,7 +12897,6 @@ algorithm
1289712897
// get the list of functions in the operator. !! there can be multiple options
1289812898
operNames = SCodeUtil.getListofQualOperatorFuncsfromOperator(operatorCl);
1289912899
(cache,types) = Lookup.lookupFunctionsListInEnv(cache, operatorEnv, operNames, inInfo, {});
12900-
types = List.map1(types, joinSourcePath, recpath);
1290112900

1290212901
// Apply operation according to the Specifications.See the function.
1290312902
bool1 = Types.arrayType(type1);
@@ -12912,18 +12911,18 @@ algorithm
1291212911
case (cache, env, op, exp1, exp2, type1, type2, _, _, _, _,_)
1291312912
equation
1291412913

12915-
recpath = getRecordPath(type1);
12916-
(cache,_,recordEnv) = Lookup.lookupClass(cache,env,recpath, false);
12914+
path = getRecordPath(type1);
12915+
path = Absyn.makeFullyQualified(path);
12916+
(cache,_,recordEnv) = Lookup.lookupClass(cache,env,path, false);
1291712917

1291812918
str1 = "'constructor'";
12919-
path2 = Absyn.joinPaths(recpath, Absyn.IDENT(str1));
12919+
path2 = Absyn.joinPaths(path, Absyn.IDENT(str1));
1292012920

1292112921
(cache,operatorCl,operatorEnv) = Lookup.lookupClass(cache,recordEnv,path2, false);
1292212922
true = SCode.isOperator(operatorCl);
1292312923

1292412924
operNames = SCodeUtil.getListofQualOperatorFuncsfromOperator(operatorCl);
1292512925
(cache,types) = Lookup.lookupFunctionsListInEnv(cache, operatorEnv, operNames, inInfo, {});
12926-
types = List.map1(types, joinSourcePath, recpath);
1292712926

1292812927
(cache,SOME((daeExp, DAE.PROP(type2,_)))) = elabCallArgs3(cache,env,types,path2,{exp2},{},inImpl,inSyTabOpt,inPre,inInfo);
1292912928

@@ -12941,25 +12940,6 @@ algorithm
1294112940

1294212941
end userDefOperatorDeoverloadBinary;
1294312942

12944-
protected function joinSourcePath
12945-
input DAE.Type inType;
12946-
input Absyn.Path inPath;
12947-
output DAE.Type outType;
12948-
protected
12949-
list<DAE.FuncArg> args "funcArg" ;
12950-
DAE.Type rest "funcResultType ; Only single-result" ;
12951-
DAE.FunctionAttributes attrs;
12952-
DAE.TypeSource source;
12953-
Absyn.Path path1,path2;
12954-
algorithm
12955-
DAE.T_FUNCTION(args, rest, attrs, {path1}) := inType;
12956-
// print("inPath " +& Absyn.pathString(inPath) +& " src path " +& Absyn.pathString(path1) +& "\n");
12957-
path1 := Absyn.pathContainedIn(path1,inPath);
12958-
// print("new path " +& Absyn.pathString(path1) +& " \n");
12959-
outType := DAE.T_FUNCTION(args, rest, attrs, {path1});
12960-
12961-
end joinSourcePath;
12962-
1296312943
protected function userDefOperatorDeoverloadString
1296412944
"This functions checks if the builtin function string is overloaded for opertor records"
1296512945
input Env.Cache inCache;
@@ -12981,7 +12961,7 @@ algorithm
1298112961
match (inCache, inEnv,inExp1,inImpl,inSyTabOpt,inDoVect,inPre,inInfo)
1298212962
local
1298312963
String str1;
12984-
Absyn.Path path,recpath;
12964+
Absyn.Path path;
1298512965
Option<Interactive.SymbolTable> st_1;
1298612966
list<Absyn.Path> operNames;
1298712967
Env.Env recordEnv,operatorEnv,env;
@@ -12999,18 +12979,18 @@ algorithm
1299912979
equation
1300012980
(cache,_,DAE.PROP(type1,_),st_1) = elabExp(cache,env,exp1,inImpl,inSyTabOpt,inDoVect,inPre,inInfo);
1300112981

13002-
recpath = getRecordPath(type1);
13003-
(cache,_,recordEnv) = Lookup.lookupClass(cache,env,recpath, false);
12982+
path = getRecordPath(type1);
12983+
path = Absyn.makeFullyQualified(path);
12984+
(cache,_,recordEnv) = Lookup.lookupClass(cache,env,path, false);
1300412985

1300512986
str1 = "'String'";
13006-
path = Absyn.joinPaths(recpath, Absyn.IDENT(str1));
12987+
path = Absyn.joinPaths(path, Absyn.IDENT(str1));
1300712988

1300812989
(cache,operatorCl,operatorEnv) = Lookup.lookupClass(cache,recordEnv,path, false);
1300912990
true = SCode.isOperator(operatorCl);
1301012991

1301112992
operNames = SCodeUtil.getListofQualOperatorFuncsfromOperator(operatorCl);
1301212993
(cache,types as _::_) = Lookup.lookupFunctionsListInEnv(cache, operatorEnv, operNames, inInfo, {});
13013-
types = List.map1(types, joinSourcePath, recpath);
1301412994

1301512995
(cache,SOME((daeExp,prop))) = elabCallArgs3(cache,env,types,path,exp1::restargs,nargs,inImpl,st_1,inPre,inInfo);
1301612996
then
@@ -13147,7 +13127,7 @@ algorithm
1314713127
String str1;
1314813128
Env.Cache cache;
1314913129
list<Absyn.Path> operNames;
13150-
Absyn.Path path, recpath;
13130+
Absyn.Path path;
1315113131
Env.Env operatorEnv,recordEnv;
1315213132
SCode.Element operatorCl;
1315313133
list<DAE.Type> types;
@@ -13186,18 +13166,18 @@ algorithm
1318613166
case(cache, env, aboper, DAE.PROP(type1,const) , _, _, absexp1, _, _, _, _)
1318713167
equation
1318813168

13189-
recpath = getRecordPath(type1);
13190-
(cache,_,recordEnv) = Lookup.lookupClass(cache,env,recpath, false);
13169+
path = getRecordPath(type1);
13170+
path = Absyn.makeFullyQualified(path);
13171+
(cache,_,recordEnv) = Lookup.lookupClass(cache,env,path, false);
1319113172

1319213173
str1 = "'" +& Dump.opSymbolCompact(aboper) +& "'";
13193-
path = Absyn.joinPaths(recpath, Absyn.IDENT(str1));
13174+
path = Absyn.joinPaths(path, Absyn.IDENT(str1));
1319413175

1319513176
(cache,operatorCl,operatorEnv) = Lookup.lookupClass(cache,recordEnv,path, false);
1319613177
true = SCode.isOperator(operatorCl);
1319713178

1319813179
operNames = SCodeUtil.getListofQualOperatorFuncsfromOperator(operatorCl);
1319913180
(cache,types as _::_) = Lookup.lookupFunctionsListInEnv(cache, operatorEnv, operNames, inInfo, {});
13200-
types = List.map1(types, joinSourcePath, recpath);
1320113181

1320213182
(cache,SOME((exp,prop))) = elabCallArgs3(cache,env,types,path,{absexp1},{},inImpl,inSymTab,inPre,inInfo);
1320313183

0 commit comments

Comments
 (0)