X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fcontext-def.cc;h=0af5fabf4fdef003342bc705ffe19797b642be15;hb=d6a70b0d29c31d0b24a53c978c8844bbb640cdbd;hp=f4ee43b1608fbfda98e673b9f648601ada5d3795;hpb=b3cf2199183a184c7eef9a9f8f3c9a691db1f0ad;p=lilypond.git diff --git a/lily/context-def.cc b/lily/context-def.cc index f4ee43b160..0af5fabf4f 100644 --- a/lily/context-def.cc +++ b/lily/context-def.cc @@ -11,9 +11,9 @@ #include "context-def.hh" +#include "context.hh" #include "international.hh" #include "output-def.hh" -#include "score-context.hh" #include "translator.hh" #include "warn.hh" @@ -27,14 +27,21 @@ Context_def::Context_def () context_name_ = SCM_EOL; default_child_ = SCM_EOL; description_ = SCM_EOL; + input_location_ = SCM_EOL; smobify_self (); + input_location_ = make_input (Input ()); context_name_ = ly_symbol2scm (""); } +Input * +Context_def::origin () const +{ + return unsmob_input (input_location_); +} + Context_def::Context_def (Context_def const &s) - : Input (s) { context_aliases_ = SCM_EOL; translator_group_type_ = SCM_EOL; @@ -44,10 +51,11 @@ Context_def::Context_def (Context_def const &s) context_name_ = SCM_EOL; description_ = SCM_EOL; default_child_ = SCM_EOL; - + input_location_ = SCM_EOL; smobify_self (); - description_ = s.description_; + description_ = s.description_; + input_location_ = make_input (*s.origin ()); default_child_ = s.default_child_; accept_mods_ = s.accept_mods_; property_ops_ = s.property_ops_; @@ -88,6 +96,7 @@ Context_def::mark_smob (SCM smob) scm_gc_mark (me->property_ops_); scm_gc_mark (me->translator_group_type_); scm_gc_mark (me->default_child_); + scm_gc_mark (me->input_location_); return me->context_name_; } @@ -252,12 +261,7 @@ Context_def::get_translator_names (SCM user_mod) const Context * Context_def::instantiate (SCM ops, Object_key const *key) { - Context *context = 0; - - if (context_name_ == ly_symbol2scm ("Score")) - context = new Score_context (key); - else - context = new Context (key); + Context *context = new Context (key); context->definition_ = self_scm (); context->definition_mods_ = ops; @@ -267,13 +271,6 @@ Context_def::instantiate (SCM ops, Object_key const *key) return context; } -SCM -Context_def::clone_scm () const -{ - Context_def *t = new Context_def (*this); - return t->unprotect (); -} - SCM Context_def::make_scm () {