vhdlpp: Typedefs in packages are emitted before constants.

This commit is contained in:
Maciej Suminski 2014-09-15 10:57:08 +02:00
parent c98c3e5d14
commit 22d18cb28d
1 changed files with 15 additions and 15 deletions

View File

@ -66,21 +66,6 @@ void Package::write_to_stream(ostream&fd) const
fd << "type " << cur->first << ";" << endl;
}
for (map<perm_string,struct const_t*>::const_iterator cur = cur_constants_.begin()
; cur != cur_constants_.end() ; ++ cur) {
if (cur->second==0 || cur->second->typ==0) {
fd << "-- const " << cur->first
<< " has errors." << endl;
continue;
}
fd << "constant " << cur->first << ": ";
cur->second->typ->write_to_stream(fd);
fd << " := ";
cur->second->val->write_to_stream(fd);
fd << ";" << endl;
}
for (map<perm_string,const VType*>::const_iterator cur = use_types_.begin()
; cur != use_types_.end() ; ++cur) {
@ -108,6 +93,21 @@ void Package::write_to_stream(ostream&fd) const
fd << ";" << endl;
}
for (map<perm_string,struct const_t*>::const_iterator cur = cur_constants_.begin()
; cur != cur_constants_.end() ; ++ cur) {
if (cur->second==0 || cur->second->typ==0) {
fd << "-- const " << cur->first
<< " has errors." << endl;
continue;
}
fd << "constant " << cur->first << ": ";
cur->second->typ->write_to_stream(fd);
fd << " := ";
cur->second->val->write_to_stream(fd);
fd << ";" << endl;
}
for (map<perm_string,Subprogram*>::const_iterator cur = cur_subprograms_.begin()
; cur != cur_subprograms_.end() ; ++cur) {
cur->second->write_to_stream(fd);