source file of the GNU LilyPond music typesetter
- (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>,
+ (c) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>,
Erik Sandberg <mandolaerik@gmail.com>
*/
#include "scm-hash.hh"
#include "warn.hh"
-Translator_group *
-Translator_group::get_daddy_translator () const
-{
- return context ()->get_parent_context ()->implementation ();
-}
void
translator_each (SCM list, Translator_method method)
for (SCM s = trans_names; scm_is_pair (s); s = scm_cdr (s))
{
- Translator *type = get_translator (scm_car (s));
+ SCM definition = scm_car (s);
+
+ Translator *type = 0;
+ if (ly_is_symbol (definition))
+ type = get_translator (definition);
+
if (!type)
warning (_f ("cannot find: `%s'", ly_symbol2string (scm_car (s)).c_str ()));
else
{
- Translator *tr = type->clone ();
- SCM str = tr->self_scm ();
+ Translator *instance = type->clone ();
+
+ SCM str = instance->self_scm ();
- if (tr->must_be_last ())
+ if (instance->must_be_last ())
{
SCM cons = scm_cons (str, SCM_EOL);
if (scm_is_pair (trans_list))
else
trans_list = scm_cons (str, trans_list);
- tr->daddy_context_ = new_context;
- tr->unprotect ();
+ instance->daddy_context_ = new_context;
+ instance->unprotect ();
}
}
}
void
-recurse_over_translators (Context *c, Translator_method ptr, Translator_group_method tg_ptr, Direction dir)
+recurse_over_translators (Context *c, Translator_method ptr,
+ Translator_group_method tg_ptr, Direction dir)
{
Translator_group *tg
= dynamic_cast<Translator_group *> (c->implementation ());