Skip to content

Commit

Permalink
Fixed bug #36: merging of modifiers in redeclare. Testcases: Redeclar…
Browse files Browse the repository at this point in the history
…e4.mo Redeclare5.mo.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@1922 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Peter Aronsson committed Oct 18, 2005
1 parent e89f83f commit 8a91282
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 15 deletions.
11 changes: 0 additions & 11 deletions Compiler/Dump.rml
Expand Up @@ -2085,17 +2085,6 @@ relation unparse_algorithm_str_lst: (int, Absyn.AlgorithmItem list,string)

axiom unparse_algorithm_str_lst (_,[],_) => ""

rule unparse_algorithm_str(i,x) => s1 &
string_append(s1,sep) => res
------------------------------------
unparse_algorithm_str_lst(i, [x], sep) => res

rule unparse_algorithm_str(i,x1) => s1 &
unparse_algorithm_str(i,x2) => s2 &
Util.string_append_list([s1,sep,s2]) => res
------------------------------------
unparse_algorithm_str_lst(i, [x1,x2], sep) => res

rule unparse_algorithm_str(i,x) => s1 &
unparse_algorithm_str_lst(i,xs,sep) => s2 &
Util.string_append_list([s1,sep,s2]) => res
Expand Down
6 changes: 4 additions & 2 deletions Compiler/Inst.rml
Expand Up @@ -2021,10 +2021,12 @@ relation redeclare_type: (Types.Mod,
get_cref_from_mod(mod) => crefs &
update_components_in_env(Types.NOMOD (* m *),crefs,env,ci_state,impl) => env' &
Mod.elab_mod(env',pre,mod,impl) => m' &
Mod.merge(rmod,m',env',pre) => m''
Mod.elab_mod(env',pre,old_mod,impl) => old_m' &
Mod.merge(rmod,m',env',pre) => m'' &
Mod.merge(m'',old_m',env',pre) => m'''
--------------------------------
redeclare_type ((m as Types.REDECL(_,((redecl as SCode.COMPONENT(n1,final,repl,prot,_,t,mod,bc,comment)),rmod)::rest)),
SCode.COMPONENT(n2,false,repl2,prot2,_,t2,_,_,_),env,pre,ci_state,impl) => (redecl,m'',env')
SCode.COMPONENT(n2,false,repl2,prot2,_,t2,old_mod,_,_),env,pre,ci_state,impl) => (redecl,m''',env')

rule not n1=n2 &
redeclare_type(Types.REDECL(redfin,rest),comp,env,pre,ci_state,impl)
Expand Down
1 change: 0 additions & 1 deletion Compiler/Mod.rml
Expand Up @@ -172,7 +172,6 @@ relation unelab_mod: Types.Mod => SCode.Mod =
=> SCode.MOD(final,subs',SOME(e))

rule Exp.print_exp_str e => es &
print "unelab typed mod... = " & print es & print "\n" &
unelab_submods (subs) => subs' &
Exp.unelab_exp(e) => e'
------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion flat_modelica_parser/src/flatmodelicaTokenTypes.txt
@@ -1,4 +1,4 @@
// $ANTLR 2.7.4: flat_modelica_lexer.g -> flatmodelicaTokenTypes.txt$
// $ANTLR 2.7.5 (20050213): flat_modelica_lexer.g -> flatmodelicaTokenTypes.txt$
flatmodelica // output token vocab name
ALGORITHM="algorithm"=4
AND="and"=5
Expand Down

0 comments on commit 8a91282

Please sign in to comment.