Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- Enabled check for assignment to inputs
- Fix remaining testcases


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13059 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Sep 26, 2012
1 parent aafa18c commit 03d92f7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Compiler/FrontEnd/Dependency.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1157,8 +1157,8 @@ algorithm
HashTable2.HashTable ht;
Absyn.ArrayDim ad;

case({},optPath,cname,(d,p,env,ht)) then d;
case(Absyn.NOSUB()::ad,optPath,cname,(d,p,env,ht)) then buildClassDependsinArrayDim(ad,optPath,cname,(d,p,env,ht));
case({},_,_,(d,p,env,ht)) then d;
case(Absyn.NOSUB()::ad,_,_,(d,p,env,ht)) then buildClassDependsinArrayDim(ad,optPath,cname,(d,p,env,ht));
case(Absyn.SUBSCRIPT(e)::ad,_,_,(d,p,env,ht)) equation
d = buildClassDependsInExp(e,optPath,cname,(d,p,env,ht));
d = buildClassDependsinArrayDim(ad,optPath,cname,(d,p,env,ht));
Expand Down
6 changes: 3 additions & 3 deletions Compiler/FrontEnd/Inst.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2121,7 +2121,7 @@ algorithm
then fail();
case (_,_,DAE.MOD(_,_,{},_),_,_) then {};
case (_,_,DAE.NOMOD(),_,_) then {};
case (_,_,DAE.REDECL(_,_,_),pre,ty) then fail(); /*TODO, report error when redeclaring in Real*/
case (_,_,DAE.REDECL(_,_,_),_,_) then fail(); /*TODO, report error when redeclaring in Real*/
end matchcontinue;
end instRealClass;

Expand Down Expand Up @@ -2447,7 +2447,7 @@ algorithm
Error.addMessage(Error.TYPE_ERROR,{s1,s2});
then fail();

case(cache,env,id,SOME(v),_,expectedTp,_) equation
case(cache,env,_,SOME(v),_,expectedTp,_) equation
true = Flags.isSet(Flags.FAILTRACE);
Debug.fprintln(Flags.FAILTRACE, "instBuiltinAttribute failed for: " +& id +&
" value binding: " +& ValuesUtil.printValStr(v) +&
Expand Down Expand Up @@ -15010,7 +15010,7 @@ algorithm
(cache, inEquations, {});

// handle empty case
case (cache, inEnv, inIH, inPre, {}, _, eEq, nEq) then (cache, listReverse(eEq), listReverse(nEq));
case (cache, _, _, _, {}, _, eEq, nEq) then (cache, listReverse(eEq), listReverse(nEq));

// connect, both expandable
case (cache, env, _, _, (eq as SCode.EQUATION(SCode.EQ_CONNECT(crefLeft, crefRight, _, info)))::rest, _, eEq, nEq)
Expand Down
8 changes: 4 additions & 4 deletions Compiler/FrontEnd/Patternm.mo
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function elabPattern
output Env.Cache outCache;
output DAE.Pattern pattern;
algorithm
(outCache,pattern) := elabPattern2(cache,env,lhs,ty,info,Error.getNumErrorMessages(),allowTopLevelInputs);
(outCache,pattern) := elabPattern2(cache,env,lhs,ty,info,Error.getNumErrorMessages(),false);
end elabPattern;

protected function elabPattern2
Expand Down Expand Up @@ -1625,7 +1625,7 @@ algorithm
list<DAE.Exp> accExps;
list<DAE.Type> accTypes;

case (cache,env,{},_,_,st,performVectorization,pre,accExps,accTypes) then (cache,{},listReverse(accExps),listReverse(accTypes),st);
case (cache,env,{},_,_,st,_,_,accExps,accTypes) then (cache,{},listReverse(accExps),listReverse(accTypes),st);
case (cache,env,case_::rest,_,_,st,_,_,accExps,accTypes)
equation
(cache,elabCase,optExp,optType,st) = elabMatchCase(cache,env,case_,tys,impl,st,performVectorization,pre);
Expand Down Expand Up @@ -1669,7 +1669,7 @@ algorithm
Env.Env env;
Option<Interactive.SymbolTable> st;

case (cache,env,Absyn.CASE(pattern=pattern,patternGuard=patternGuard,patternInfo=patternInfo,localDecls=decls,equations=eq1,result=result,resultInfo=resultInfo,info=info),_,_,st,performVectorization,pre)
case (cache,env,Absyn.CASE(pattern=pattern,patternGuard=patternGuard,patternInfo=patternInfo,localDecls=decls,equations=eq1,result=result,resultInfo=resultInfo,info=info),_,_,st,_,_)
equation
(cache,SOME((env,DAE.DAE(caseDecls)))) = addLocalDecls(cache,env,decls,Env.caseScopeName,impl,info);
patterns = MetaUtil.extractListFromTuple(pattern, 0);
Expand All @@ -1683,7 +1683,7 @@ algorithm
then (cache,DAE.CASE(elabPatterns, dPatternGuard, caseDecls, body, elabResult, resultInfo, 0, info),elabResult,resType,st);

// ELSE is the same as CASE, but without pattern
case (cache,env,Absyn.ELSE(localDecls=decls,equations=eq1,result=result,resultInfo=resultInfo,info=info),_,_,st,performVectorization,pre)
case (cache,env,Absyn.ELSE(localDecls=decls,equations=eq1,result=result,resultInfo=resultInfo,info=info),_,_,st,_,_)
equation
// Needs to be same length as any other pattern for the simplification algorithms, etc to work properly
len = listLength(tys);
Expand Down
4 changes: 2 additions & 2 deletions Compiler/Util/BaseHashTable.mo
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ algorithm
array<list<tuple<Key,Integer>>> hashvec;
FuncsTuple fntpl;
/* adding when already present => Updating value */
case (key,(hashvec,varr,bsize,n,fntpl))
case (_,(hashvec,varr,bsize,n,fntpl))
equation
(_,indx) = get1(key, hashTable);
indx_1 = indx - 1;
Expand Down Expand Up @@ -563,7 +563,7 @@ algorithm
local
array<Option<tuple<Key,Value>>> arr_1,arr;
Integer n,size;
case ((n,size,arr),pos)
case ((n,size,arr),_)
equation
(pos < size) = true;
arr_1 = arrayUpdate(arr, pos + 1,NONE());
Expand Down

0 comments on commit 03d92f7

Please sign in to comment.