]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/context-def.cc
Merge branch 'master' into dev/texi2html
[lilypond.git] / lily / context-def.cc
index a5c13305d42f574c48e561cb6c81c601c4ec9867..a810159aa326d601cb75f950f9f7e4e3c0e0a3a3 100644 (file)
@@ -87,7 +87,7 @@ Context_def::print_smob (SCM smob, SCM port, scm_print_state*)
 SCM
 Context_def::mark_smob (SCM smob)
 {
-  ASSERT_LIVE_IS_ALLOWED();
+  ASSERT_LIVE_IS_ALLOWED ();
   
   Context_def *me = (Context_def *) SCM_CELL_WORD_1 (smob);
 
@@ -193,12 +193,24 @@ Context_def::get_default_child (SCM user_mod) const
   return name;
 }
 
+/*
+  Given a name of a context that we want to create, finds a list of context
+  definitions such that:
+   - the first element in the list defines a context that is a valid child of
+     the context defined by this Context_def
+   - each subsequent element in the list defines a context that is a valid child
+     of the the context defined by the preceding element in the list
+   - the last element in the list defines a context with the given name
+
+  The ADDITIONAL_ACCEPTS parameter is a list of additional contexts that this
+  specific context def (but not any of the child context defs) should accept.
+*/
 vector<Context_def*>
-Context_def::path_to_acceptable_context (SCM type_sym, Output_def *odef) const
+Context_def::path_to_acceptable_context (SCM type_sym, Output_def *odef, SCM additional_accepts) const
 {
   assert (scm_is_symbol (type_sym));
 
-  SCM accepted = get_accepted (SCM_EOL);
+  SCM accepted = get_accepted (additional_accepts);
 
   vector<Context_def*> accepteds;
   for (SCM s = accepted; scm_is_pair (s); s = scm_cdr (s))
@@ -224,7 +236,7 @@ Context_def::path_to_acceptable_context (SCM type_sym, Output_def *odef) const
       Context_def *g = accepteds[i];
 
       vector<Context_def*> result
-       = g->path_to_acceptable_context (type_sym, odef);
+       = g->path_to_acceptable_context (type_sym, odef, SCM_EOL);
       if (result.size () && result.size () < best_depth)
        {
          best_depth = result.size ();