Skip to content

Commit

Permalink
- Renamed some old MetaModelica builtin functions (int_add) to the ne…
Browse files Browse the repository at this point in the history
…w ones (intAdd)

git-svn-id: https://openmodelica.org/svn/OpenModelica/branches/sjoelund-functiontree@6374 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Oct 14, 2010
1 parent 86165d7 commit 7dfedb7
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 89 deletions.
2 changes: 1 addition & 1 deletion Compiler/CevalScript.mo
Expand Up @@ -2740,7 +2740,7 @@ algorithm
cdef = Interactive.getPathedClassInProgram(p_class, p);
filename = Absyn.classFilename(cdef);
pd = System.pathDelimiter();
(pd_1 :: _) = string_list_string_char(pd);
(pd_1 :: _) = stringListStringChar(pd);
filename_1 = Util.stringSplitAtChar(filename, pd_1);
dir = Util.listStripLast(filename_1);
dir_1 = Util.stringDelimitList(dir, pd);
Expand Down
2 changes: 1 addition & 1 deletion Compiler/CevalScript_stub.mo
Expand Up @@ -735,7 +735,7 @@ algorithm
cdef = Interactive.getPathedClassInProgram(p_class, p);
filename = Absyn.classFilename(cdef);
pd = System.pathDelimiter();
(pd_1 :: _) = string_list_string_char(pd);
(pd_1 :: _) = stringListStringChar(pd);
filename_1 = Util.stringSplitAtChar(filename, pd_1);
dir = Util.listStripLast(filename_1);
dir_1 = Util.stringDelimitList(dir, pd);
Expand Down
2 changes: 1 addition & 1 deletion Compiler/DAELow.mo
Expand Up @@ -7547,7 +7547,7 @@ algorithm
case ({}) then 0;
case ((c :: cs))
equation
c2 = string_char_int(c);
c2 = stringCharInt(c);
c1 = hashChars(cs);
then
c1 + c2;
Expand Down
14 changes: 7 additions & 7 deletions Compiler/Exp.mo
Expand Up @@ -9267,28 +9267,28 @@ algorithm
(e1_1,c1) = replaceExp(e1, source, target);
(e2_1,c2) = replaceExp(e2, source, target);
(e3_1,c3) = replaceExp(e3, source, target);
c = Util.listReduce({c1,c2,c3}, int_add);
c = Util.listReduce({c1,c2,c3}, intAdd);
then
(DAE.IFEXP(e1_1,e2_1,e3_1),c);
case (DAE.CALL(path = path,expLst = expl,tuple_ = t,builtin = c,ty=tp,inlineType=i),source,target)
local Boolean c;DAE.InlineType i; Type tp;
equation
(expl_1,cnt) = Util.listMap22(expl, replaceExp, source, target);
cnt_1 = Util.listReduce(cnt, int_add);
cnt_1 = Util.listReduce(cnt, intAdd);
then
(DAE.CALL(path,expl_1,t,c,tp,i),cnt_1);
case(DAE.PARTEVALFUNCTION(path = path, expList = expl, ty = tp),source,target)
local Type tp;
equation
(expl_1,cnt) = Util.listMap22(expl, replaceExp, source, target);
cnt_1 = Util.listReduce(cnt, int_add);
cnt_1 = Util.listReduce(cnt, intAdd);
then
(DAE.PARTEVALFUNCTION(path,expl_1,tp),cnt_1);
case (DAE.ARRAY(ty = tp,scalar = c,array = expl),source,target)
local Boolean c;
equation
(expl_1,cnt) = Util.listMap22(expl, replaceExp, source, target);
cnt_1 = Util.listReduce(cnt, int_add);
cnt_1 = Util.listReduce(cnt, intAdd);
then
(DAE.ARRAY(tp,c,expl_1),cnt_1);
case (DAE.MATRIX(ty = t,integer = b,scalar = expl),source,target)
Expand All @@ -9312,13 +9312,13 @@ algorithm
(e1_1,c1) = replaceExp(e1, source, target);
(e2_1,c2) = replaceExp(e2, source, target);
(e3_1,c3) = replaceExp(e3, source, target);
c = Util.listReduce({c1,c2,c3}, int_add);
c = Util.listReduce({c1,c2,c3}, intAdd);
then
(DAE.RANGE(tp,e1_1,SOME(e3_1),e2_1),c);
case (DAE.TUPLE(PR = expl),source,target)
equation
(expl_1,cnt) = Util.listMap22(expl, replaceExp, source, target);
cnt_1 = Util.listReduce(cnt, int_add);
cnt_1 = Util.listReduce(cnt, intAdd);
then
(DAE.TUPLE(expl_1),cnt_1);
case (DAE.CAST(ty = tp,exp = e1),source,target)
Expand All @@ -9332,7 +9332,7 @@ algorithm
equation
(e1_1,c) = replaceExp(e1, source, target);
(expl_1,cnt) = Util.listMap22(ae1, replaceExp, source, target);
cnt_1 = Util.listReduce(cnt, int_add);
cnt_1 = Util.listReduce(cnt, intAdd);
c = c+cnt_1;
then
(DAE.ASUB(e1_1,expl_1),c);
Expand Down
4 changes: 2 additions & 2 deletions Compiler/Main.mo
Expand Up @@ -132,9 +132,9 @@ algorithm
e.g typeOf function would be taken as a type definition otherwise */
equation
true = Util.strncmp(" ", str, 1);
clst = string_list_string_char(str);
clst = stringListStringChar(str);
clst_1 = listDelete(clst, 0);
str_1 = string_char_list_string(clst_1);
str_1 = stringCharListString(clst_1);
res = checkClassdef(str_1);
then
res;
Expand Down
4 changes: 2 additions & 2 deletions Compiler/Main_stub.mo
Expand Up @@ -82,9 +82,9 @@ algorithm
e.g typeOf function would be taken as a type definition otherwise */
equation
true = Util.strncmp(" ", str, 1);
clst = string_list_string_char(str);
clst = stringListStringChar(str);
clst_1 = listDelete(clst, 0);
str_1 = string_char_list_string(clst_1);
str_1 = stringCharListString(clst_1);
res = checkClassdef(str_1);
then
res;
Expand Down
2 changes: 1 addition & 1 deletion Compiler/Tpl.mo
Expand Up @@ -267,7 +267,7 @@ algorithm
case (txt, c :: chars )
equation
(lschars, chars, isline) = takeLineOrString(chars);
txt = writeLineOrStr(txt, string_char_list_string( c :: lschars), isline);
txt = writeLineOrStr(txt, stringCharListString( c :: lschars), isline);
//Error txt = writeLineOrStr(txt, stringCharListString( str :: lschars), isline);
then
writeChars(txt, chars);
Expand Down
56 changes: 28 additions & 28 deletions Compiler/TplMain.mo
Expand Up @@ -75,7 +75,7 @@ algorithm
print("\nWriting result to file '" +& destFile +& "'\n");

System.writeFile(destFile, res);
//print("\nReamining characters:\n" +& string_char_list_string(chars) +& "\n<<");
//print("\nReamining characters:\n" +& stringCharListString(chars) +& "\n<<");
then ();

case (file)
Expand Down Expand Up @@ -628,7 +628,7 @@ end Susan;", false, false, "transformAST - pathIdent() + typedIdents()", notPass
chars = stringListStringChar( str );

(chars, _) = TplParser.interleave(chars, TplParser.makeStartLineInfo(chars, "in memory test"));
strOut = string_char_list_string(chars);
strOut = stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"Susan lives!", true, true, "TplParser.interleave \n\""+& str +&"\"\n", notPassedCnt);

Expand All @@ -637,7 +637,7 @@ end Susan;", false, false, "transformAST - pathIdent() + typedIdents()", notPass
chars = stringListStringChar( str );

TplParser.afterKeyword(chars); //not fail
strOut = string_char_list_string(chars);
strOut = stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"(Susan)", true, true, "TplParser.afterKeyword \n\""+& str +&"\"\n", notPassedCnt);

Expand All @@ -646,7 +646,7 @@ end Susan;", false, false, "transformAST - pathIdent() + typedIdents()", notPass
chars = stringListStringChar( str );

(chars, ident) = TplParser.identifier(chars);
strOut = "*" +& ident +& "*" +& string_char_list_string(chars);
strOut = "*" +& ident +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"*Susan2*:)", true, true, "TplParser.identifier \n\""+& str +&"\"\n", notPassedCnt);

Expand All @@ -658,7 +658,7 @@ end Susan;", false, false, "transformAST - pathIdent() + typedIdents()", notPass
txt = emptyTxt;
txt = TplCodegen.pathIdent(txt, pid);
ident = Tpl.textString(txt);
strOut = "*" +& ident +& "*" +& string_char_list_string(chars);
strOut = "*" +& ident +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"*Susan*:)", true, true, "TplParser.pathIdent \n\""+& str +&"\"\n", notPassedCnt);

Expand All @@ -670,7 +670,7 @@ end Susan;", false, false, "transformAST - pathIdent() + typedIdents()", notPass
txt = emptyTxt;
txt = TplCodegen.pathIdent(txt, pid);
ident = Tpl.textString(txt);
strOut = "*" +& ident +& "*" +& string_char_list_string(chars);
strOut = "*" +& ident +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"*Susan.Susan2.tpl3_h4*:)", true, true, "TplParser.pathIdent \n\""+& str +&"\"\n", notPassedCnt);

Expand All @@ -683,7 +683,7 @@ end Susan;", false, false, "transformAST - pathIdent() + typedIdents()", notPass
txt = emptyTxt;
txt = TplCodegen.typeSig(txt, ts);
ident = Tpl.textString(txt);
strOut = Tpl.booleanString(tequal) +& "*" +& ident +& "*" +& string_char_list_string(chars);
strOut = Tpl.booleanString(tequal) +& "*" +& ident +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"true*Tpl.Susan*:)", true, true, "TplParser.typeSig \n\""+& str +&"\"\n", notPassedCnt);

Expand All @@ -699,7 +699,7 @@ end Susan;", false, false, "transformAST - pathIdent() + typedIdents()", notPass
txt = emptyTxt;
txt = TplCodegen.typeSig(txt, ts);
ident = Tpl.textString(txt);
strOut = Tpl.booleanString(tequal) +&"*" +& ident +& "*" +& string_char_list_string(chars);
strOut = Tpl.booleanString(tequal) +&"*" +& ident +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"true*list<tuple<Hej.Susan, list<String>, Option<Integer>>>*:)", true, true, "TplParser.typeSig \n\""+& str +&"\"\n", notPassedCnt);

Expand Down Expand Up @@ -750,7 +750,7 @@ end Susan;:)";
txt = emptyTxt;
txt = TplCodegen.pathIdent(txt, pid);
ident = Tpl.textString(txt);
strOut = Tpl.booleanString(tequal) +&"*" +& ident +& "*" +& string_char_list_string(chars);
strOut = Tpl.booleanString(tequal) +&"*" +& ident +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"true*Susan*:)", true, true, "TplParser.templPackage - absyn - type Ident, TypedIdents, PathIdent \n", notPassedCnt);

Expand Down Expand Up @@ -786,7 +786,7 @@ end Susan;:)";
txt = emptyTxt;
txt = TplCodegen.pathIdent(txt, pid);
ident = Tpl.textString(txt);
strOut = Tpl.booleanString(tequal) +&"*" +& string_char_list_string(chars);
strOut = Tpl.booleanString(tequal) +&"*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"true*:)", true, true, "TplParser.templPackage - function stringListStringChar\n", notPassedCnt);

Expand Down Expand Up @@ -1001,7 +1001,7 @@ end Susan;:)";
txt = emptyTxt;
txt = TplCodegen.pathIdent(txt, pid);
ident = Tpl.textString(txt);
strOut = "parsed*" +& string_char_list_string(chars);
strOut = "parsed*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"parsed*:)", true, true, "TplParser.templPackage - all types for Susan's backend\n", notPassedCnt);

Expand All @@ -1020,7 +1020,7 @@ end Susan;:)";
txt = emptyTxt;
txt = Tpl.writeTok(txt, tok);
strOut = Tpl.textString(txt);
strOut = Tpl.booleanString(tequal) +& "*" +& strOut +& "*" +& string_char_list_string(chars);
strOut = Tpl.booleanString(tequal) +& "*" +& strOut +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"true*Susan*~:)", true, true, "TplParser.expression \n>"+& str +&"<\n", notPassedCnt);

Expand All @@ -1040,7 +1040,7 @@ end Susan;:)";
txt = emptyTxt;
txt = Tpl.writeTok(txt, tok);
strOut = Tpl.textString(txt);
strOut = Tpl.booleanString(tequal) +& "*" +& strOut +& "*" +& string_char_list_string(chars);
strOut = Tpl.booleanString(tequal) +& "*" +& strOut +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"true*\n*~:)", true, true, "TplParser.expression \n>"+& str +&"<\n", notPassedCnt);

Expand All @@ -1060,7 +1060,7 @@ end Susan;:)";
txt = emptyTxt;
txt = Tpl.writeTok(txt, tok);
strOut = Tpl.textString(txt);
strOut = Tpl.booleanString(tequal) +& "*" +& strOut +& "*" +& string_char_list_string(chars);
strOut = Tpl.booleanString(tequal) +& "*" +& strOut +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"true*,\n*~:)", true, true, "TplParser.expression \n>"+& str +&"<\n", notPassedCnt);

Expand All @@ -1080,7 +1080,7 @@ is\\nfantastic!\"~:)";
txt = emptyTxt;
txt = Tpl.writeTok(txt, tok);
strOut = Tpl.textString(txt);
strOut = Tpl.booleanString(tequal) +& "*" +& strOut +& "*" +& string_char_list_string(chars);
strOut = Tpl.booleanString(tequal) +& "*" +& strOut +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"true*Susan\nis\nfantastic!*~:)", true, true, "TplParser.expression \n>"+& str +&"<\n", notPassedCnt);

Expand All @@ -1102,7 +1102,7 @@ is\\n new lined!
txt = emptyTxt;
txt = Tpl.writeTok(txt, tok);
strOut = Tpl.textString(txt);
strOut = Tpl.booleanString(tequal) +& "*" +& strOut +& "*" +& string_char_list_string(chars);
strOut = Tpl.booleanString(tequal) +& "*" +& strOut +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"true*\nSusan\nis\n new lined!\n*~:)", true, true, "TplParser.expression \n>"+& str +&"<\n", notPassedCnt);

Expand All @@ -1122,7 +1122,7 @@ is\\n new lined!
txt = emptyTxt;
txt = Tpl.writeTok(txt, tok);
strOut = Tpl.textString(txt);
strOut = Tpl.booleanString(tequal) +& "*" +& strOut +& "*" +& string_char_list_string(chars);
strOut = Tpl.booleanString(tequal) +& "*" +& strOut +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"true*Susan*~:)", true, true, "TplParser.expression \n\""+& str +&"\"\n", notPassedCnt);
*/
Expand All @@ -1145,7 +1145,7 @@ is\\n verbatim!
txt = emptyTxt;
txt = Tpl.writeTok(txt, tok);
strOut = Tpl.textString(txt);
strOut = Tpl.booleanString(tequal) +& "*" +& strOut +& "*" +& string_char_list_string(chars);
strOut = Tpl.booleanString(tequal) +& "*" +& strOut +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"true*Susan\nis\\n verbatim!*~:)", true, true, "TplParser.expression \n\""+& str +&"\"\n", notPassedCnt);
*/
Expand All @@ -1161,7 +1161,7 @@ is\\n verbatim!
);

TplAbsyn.LITERAL(cval,_) = exp;
strOut = Tpl.booleanString(tequal) +& "*" +& cval +& "*" +& string_char_list_string(chars);
strOut = Tpl.booleanString(tequal) +& "*" +& cval +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"true*1234567*~:)", true, true, "TplParser.expression \n\""+& str +&"\"\n", notPassedCnt);

Expand All @@ -1177,7 +1177,7 @@ is\\n verbatim!
);

TplAbsyn.LITERAL(cval,_) = exp;
strOut = Tpl.booleanString(tequal) +& "*" +& cval +& "*" +& string_char_list_string(chars);
strOut = Tpl.booleanString(tequal) +& "*" +& cval +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"true*-1234567*~:)", true, true, "TplParser.expression \n\""+& str +&"\"\n", notPassedCnt);

Expand All @@ -1193,7 +1193,7 @@ is\\n verbatim!
);

TplAbsyn.LITERAL(cval,_) = exp;
strOut = Tpl.booleanString(tequal) +& "*" +& cval +& "*" +& string_char_list_string(chars);
strOut = Tpl.booleanString(tequal) +& "*" +& cval +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"true*-1234567.0123e-12*~:)", true, true, "TplParser.expression \n\""+& str +&"\"\n", notPassedCnt);

Expand All @@ -1209,7 +1209,7 @@ is\\n verbatim!
);

TplAbsyn.LITERAL(cval,_) = exp;
strOut = Tpl.booleanString(tequal) +& "*" +& cval +& "*" +& string_char_list_string(chars);
strOut = Tpl.booleanString(tequal) +& "*" +& cval +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"true*.0123E12*~:)", true, true, "TplParser.expression \n\""+& str +&"\"\n", notPassedCnt);

Expand All @@ -1225,7 +1225,7 @@ is\\n verbatim!
);

TplAbsyn.LITERAL(cval,_) = exp;
strOut = Tpl.booleanString(tequal) +& "*" +& cval +& "*" +& string_char_list_string(chars);
strOut = Tpl.booleanString(tequal) +& "*" +& cval +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"true*true*~:)", true, true, "TplParser.expression \n\""+& str +&"\"\n", notPassedCnt);

Expand All @@ -1241,7 +1241,7 @@ is\\n verbatim!
);

TplAbsyn.LITERAL(cval,_) = exp;
strOut = Tpl.booleanString(tequal) +& "*" +& cval +& "*" +& string_char_list_string(chars);
strOut = Tpl.booleanString(tequal) +& "*" +& cval +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"true*false*~:)", true, true, "TplParser.expression \n\""+& str +&"\"\n", notPassedCnt);

Expand All @@ -1261,7 +1261,7 @@ is\\n verbatim!
txt = emptyTxt;
txt = Tpl.writeTok(txt, tok);
strOut = Tpl.textString(txt);
strOut = Tpl.booleanString(tequal) +& "*" +& strOut +& "*" +& string_char_list_string(chars);
strOut = Tpl.booleanString(tequal) +& "*" +& strOut +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"true*\n*~:)", true, true, "TplParser.expression \n\""+& str +&"\"\n", notPassedCnt);

Expand All @@ -1280,7 +1280,7 @@ is\\n verbatim!
txt = emptyTxt;
txt = Tpl.writeTok(txt, tok);
strOut = Tpl.textString(txt);
strOut = Tpl.booleanString(tequal) +& "*" +& strOut +& "*" +& string_char_list_string(chars);
strOut = Tpl.booleanString(tequal) +& "*" +& strOut +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"true*\"\n\n *~:)", true, true, "TplParser.expression \n\""+& str +&"\"\n", notPassedCnt);

Expand All @@ -1299,7 +1299,7 @@ is\\n verbatim!
txt = emptyTxt;
txt = Tpl.writeTok(txt, tok);
strOut = Tpl.textString(txt);
strOut = Tpl.booleanString(tequal) +& "*" +& strOut +& "*" +& string_char_list_string(chars);
strOut = Tpl.booleanString(tequal) +& "*" +& strOut +& "*" +& stringCharListString(chars);
notPassedCnt = testStringEquality(strOut,
"true*Susan*~:)", true, true, "TplParser.expression \n\""+& str +&"\"\n", notPassedCnt);

Expand Down Expand Up @@ -1711,4 +1711,4 @@ txt := 1;
end MuchFun2;


end TplMain;
end TplMain;

0 comments on commit 7dfedb7

Please sign in to comment.