Skip to content

Commit

Permalink
Moved getVersionNr function to Settings.mo
Browse files Browse the repository at this point in the history
Fixed ExtObj.mos testcase (added missing file)

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@2421 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Peter Aronsson committed Jun 12, 2006
1 parent 98ae67f commit b68dd14
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
4 changes: 1 addition & 3 deletions Compiler/Interactive.mo
Expand Up @@ -201,8 +201,6 @@ protected import OpenModelica.Compiler.Ceval;

protected import OpenModelica.Compiler.Error;

protected import OpenModelica.Compiler.Main;

public constant InteractiveSymbolTable emptySymboltable=SYMBOLTABLE(Absyn.PROGRAM({},Absyn.TOP()),{},{},
{},{}) "Empty Interactive Symbol Table" ;

Expand Down Expand Up @@ -987,7 +985,7 @@ algorithm

case (ISTMTS(interactiveStmtLst = {IEXP(exp = Absyn.CALL(function_ = Absyn.CREF_IDENT(name = "getVersion"),functionArgs = Absyn.FUNCTIONARGS(args = {},argNames = {})))}),(st as SYMBOLTABLE(ast = p,explodedAst = s,instClsLst = ic,lstVarVal = iv,compiledFunctions = cf)))
equation
resstr = Main.getVersionNr();
resstr = Settings.getVersionNr();
then
(resstr,SYMBOLTABLE(p,s,ic,iv,cf));
case (ISTMTS(interactiveStmtLst = {IEXP(exp = Absyn.CALL(function_ = Absyn.CREF_IDENT(name = "setExtendsModifierValue"),functionArgs = Absyn.FUNCTIONARGS(args = {Absyn.CREF(componentReg = class_),Absyn.CREF(componentReg = Absyn.CREF_QUAL(name = ident,componentRef = subident)),Absyn.CODE(code = Absyn.C_MODIFICATION(modification = mod))},argNames = {})))}),(st as SYMBOLTABLE(ast = p,explodedAst = s,instClsLst = ic,lstVarVal = iv,compiledFunctions = cf)))
Expand Down
14 changes: 5 additions & 9 deletions Compiler/Main.mo
Expand Up @@ -96,17 +96,13 @@ protected import OpenModelica.Compiler.Error;
protected import OpenModelica.Compiler.Types;

protected import OpenModelica.Compiler.Ceval;

protected import OpenModelica.Compiler.Env;

protected import OpenModelica.Compiler.Settings;



public function getVersionNr "Returns the version number of this release"
output String outString;
algorithm
outString:=
matchcontinue ()
case () then "1.4.1";
end matchcontinue;
end getVersionNr;

protected function serverLoop "adrpo -- not used
with \"ModUtil.rml\"
Expand Down Expand Up @@ -413,7 +409,7 @@ algorithm
case (_)
equation
versionRequest();
print(getVersionNr());
print(Settings.getVersionNr());
then ();

case {f} /* A Modelica file .mo */
Expand Down
6 changes: 6 additions & 0 deletions Compiler/Settings.mo
Expand Up @@ -50,6 +50,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"

public function getVersionNr "Returns the version number of this release"
output String outString;

external "C";
end getVersionNr;

public function setCompileCommand
input String inString;

Expand Down
7 changes: 7 additions & 0 deletions Compiler/runtime/settingsimpl.c
Expand Up @@ -16,6 +16,13 @@ void Settings_5finit(void)

}

RML_BEGIN_LABEL(Settings__getVersionNr)
{
rmlA0 = (void*) mk_scon("1.4.1");
RML_TAILCALLK(rmlSC);
}
RML_END_LABEL

RML_BEGIN_LABEL(Settings__setCompileCommand)
{
char* command = RML_STRINGDATA(rmlA0);
Expand Down

0 comments on commit b68dd14

Please sign in to comment.