X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fsymtable.cc;h=ccf1eb16102584041048253f83486af0a9154f39;hb=refs%2Ftags%2Frelease%2F1.1.18;hp=5814d5294aa241920c14f5fae5aaf38767c2d5ca;hpb=1cf3d59c1559fb9774c4c1c8cae155cfe54a927c;p=lilypond.git diff --git a/lily/symtable.cc b/lily/symtable.cc index 5814d5294a..ccf1eb1610 100644 --- a/lily/symtable.cc +++ b/lily/symtable.cc @@ -7,12 +7,10 @@ */ #include "misc.hh" -#include "dimension.hh" #include "debug.hh" #include "real.hh" #include "atom.hh" -#include "assoc.hh" -#include "assoc-iter.hh" +#include "dictionary-iter.hh" #include "symtable.hh" Symtables::Symtables() @@ -23,7 +21,9 @@ Symtables::Symtables() Symtables::Symtables (Symtables const &s) : Dictionary (s) { - for (Assoc_iter i (s); i.ok(); i++) + font_name_ = s.font_name_; + + for (Dictionary_iter< Symtable*> i (s); i.ok(); i++) { add (i.key(), new Symtable (*i.val ())); } @@ -31,7 +31,7 @@ Symtables::Symtables (Symtables const &s) Symtables::~Symtables() { - for (Assoc_iter i (*this); i.ok(); i++) + for (Dictionary_iter i (*this); i.ok(); i++) { delete i.val(); } @@ -40,7 +40,7 @@ Symtables::~Symtables() Atom Symtable::lookup (String s) const { - if (elt_b (s)) + if (elem_b (s)) { Atom a (elem(s)); return a; @@ -56,21 +56,21 @@ Symtable::lookup (String s) const Symtable* Symtables::operator()(String s) { - if (!elt_b (s)) + if (!elem_b (s)) { error (_f ("Symtable `%s\' unknown", s)); /* - We can 't return, because we'll dump core anyway. + We can 't return, because we would dump core anyway. */ return 0; } else - return Dictionary::operator[](s); + return elem(s); } void Symtables::print() const { - for (Assoc_iter i (*this); i.ok(); i++) + for (Dictionary_iter i (*this); i.ok(); i++) { DOUT << "table \'" << i.key () << "\' {\n"; i.val()->print (); @@ -80,7 +80,7 @@ Symtables::print() const void Symtable::print() const { - for (Assoc_iter i (*this); i.ok(); i++) + for (Dictionary_iter i (*this); i.ok(); i++) { DOUT << "\'" << i.key() << "\'->" << i.val ().str () << '\n'; } @@ -90,5 +90,5 @@ void Symtables::add (String s, Symtable*p) { p-> id_str = s; - Dictionary::add (s,p); + Dictionary::elem (s) = p; }