summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Sorensen <c_sorensen@byu.edu>2010-05-28 15:10:23 -0600
committerCarl Sorensen <c_sorensen@byu.edu>2010-05-28 15:10:23 -0600
commitf33b69c6071826d4fea1dac1f13bcb87f9dd1ece (patch)
tree692f0b22c82a84e711277652fa67a60da177614a
parent7aca33f5805fcf6af6ccc1fa722abbfbb9b26ee6 (diff)
Revert "don't segfault on invalid engraver names"
This reverts commit 7aca33f5805fcf6af6ccc1fa722abbfbb9b26ee6.
-rw-r--r--input/regression/invalid-engraver.ly20
-rw-r--r--lily/translator-group.cc12
2 files changed, 6 insertions, 26 deletions
diff --git a/input/regression/invalid-engraver.ly b/input/regression/invalid-engraver.ly
deleted file mode 100644
index ecead3955d..0000000000
--- a/input/regression/invalid-engraver.ly
+++ /dev/null
@@ -1,20 +0,0 @@
-\version "2.12.0"
-
-\header {
- texidoc="Engravers which do not exist are simply ignored"
-}
-
-\layout { \context {
- \name ImproVoice
- \type "Engraver_group"
- \consists "Rhythmic_column_engraver_foo" % "typo" here
-}
-\context { \Staff
- \accepts "ImproVoice"
-}}
-
-\relative c'' {
- a4 d8 bes8 \new ImproVoice { c4^"ad lib" c
- c4 c^"undress" c_"while playing :)" c }
- a1
-} \ No newline at end of file
diff --git a/lily/translator-group.cc b/lily/translator-group.cc
index 7d7847743c..dc2b772428 100644
--- a/lily/translator-group.cc
+++ b/lily/translator-group.cc
@@ -153,17 +153,19 @@ Translator_group::create_child_translator (SCM sev)
for (SCM s = trans_names; scm_is_pair (s); s = scm_cdr (s))
{
SCM definition = scm_car (s);
- bool is_scheme = true;
Translator *type = 0;
+ Translator *instance = type;
if (ly_is_symbol (definition))
{
type = get_translator (definition);
- is_scheme = false;
+ instance = type->clone ();
}
else if (ly_is_pair (definition))
{
type = get_translator (ly_symbol2scm ("Scheme_engraver"));
+ instance = type->clone ();
+ dynamic_cast<Scheme_engraver*> (instance)->init_from_scheme (definition);
}
else if (ly_is_procedure (definition))
{
@@ -172,16 +174,14 @@ Translator_group::create_child_translator (SCM sev)
// definition.
SCM def = scm_call_1 (definition, cs);
type = get_translator (ly_symbol2scm ("Scheme_engraver"));
+ instance = type->clone ();
+ dynamic_cast<Scheme_engraver*> (instance)->init_from_scheme (def);
}
if (!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);
-
SCM str = instance->self_scm ();
if (instance->must_be_last ())