Skip to content

Commit

Permalink
ticket:3488
Browse files Browse the repository at this point in the history
Read the __OpenModelica_commandLineOptions annotation and apply it.
  • Loading branch information
adeas31 authored and OpenModelica-Hudson committed May 12, 2016
1 parent 018590e commit 28c405d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Compiler/Script/CevalScriptBackend.mo
Expand Up @@ -2689,9 +2689,19 @@ algorithm
list<String> libs;
String file_dir, fileNamePrefix;
Absyn.Program p;
String commandLineOptions;
list<String> args;

case (cache,env,_,st as GlobalScript.SYMBOLTABLE(),fileNamePrefix,_,_)
equation
// read the __OpenModelica_commandLineOptions
Absyn.STRING(commandLineOptions) = Interactive.getNamedAnnotation(className, st.ast, Absyn.IDENT("__OpenModelica_commandLineOptions"), SOME(Absyn.STRING("")), Interactive.getAnnotationExp);
// apply if there are any new flags
if boolNot(stringEq(commandLineOptions, "")) then
args = System.strtok(commandLineOptions, " ");
_ = Flags.readArgs(args);
end if;

(cache, st, indexed_dlow, libs, file_dir, resultValues) =
SimCodeMain.translateModel(cache,env,className,st,fileNamePrefix,addDummy,inSimSettingsOpt,Absyn.FUNCTIONARGS({},{}));
then
Expand Down

0 comments on commit 28c405d

Please sign in to comment.