]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/translator-group.cc
Doc: CG - Compile.itexi - fix typographic error
[lilypond.git] / lily / translator-group.cc
index 99026ca051c48b3b1c9b2a66983dc6568376f19e..e3f8cba3e8c7393b6a0ed493164c231842fb2541 100644 (file)
@@ -35,8 +35,6 @@
 #include "scm-hash.hh"
 #include "warn.hh"
 
-using std::vector;
-
 void
 translator_each (SCM list, Translator_method method)
 {
@@ -172,7 +170,6 @@ Translator_group::create_child_translator (SCM sev)
         type = get_translator (definition);
       else if (ly_is_pair (definition))
         {
-          type = get_translator (ly_symbol2scm ("Scheme_engraver"));
           is_scheme = true;
         }
       else if (ly_is_procedure (definition))
@@ -181,17 +178,15 @@ Translator_group::create_child_translator (SCM sev)
           // an argument and evaluates to an a-list scheme engraver
           // definition.
           definition = scm_call_1 (definition, cs);
-          type = get_translator (ly_symbol2scm ("Scheme_engraver"));
           is_scheme = true;
         }
 
-      if (!type)
+      if (!is_scheme && !type)
         warning (_f ("cannot find: `%s'", ly_symbol2string (scm_car (s)).c_str ()));
       else
         {
-          Translator *instance = type->clone ();
-          if (is_scheme)
-            dynamic_cast<Scheme_engraver *> (instance)->init_from_scheme (definition);
+          Translator *instance = is_scheme ? new Scheme_engraver (definition)
+            : type->clone ();
 
           SCM str = instance->self_scm ();