diff --git a/vhdlpp/package.cc b/vhdlpp/package.cc index d3d4a8b06..68c8acee1 100644 --- a/vhdlpp/package.cc +++ b/vhdlpp/package.cc @@ -66,21 +66,6 @@ void Package::write_to_stream(ostream&fd) const fd << "type " << cur->first << ";" << endl; } - for (map::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::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::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::const_iterator cur = cur_subprograms_.begin() ; cur != cur_subprograms_.end() ; ++cur) { cur->second->write_to_stream(fd);