output_def_ = o;
final_mom_ = final;
definition_ = find_context_def (o, ly_symbol2scm ("Global"));
- unsmob_context_def (definition_)->apply_default_property_operations (this);
+
+ Context_def *globaldef = unsmob_context_def (definition_);
+ if (!globaldef)
+ {
+ programming_error ("No `Global' context found.");
+ }
+ else
+ globaldef->apply_default_property_operations (this);
accepts_list_ = scm_list_1 (ly_symbol2scm ("Score"));
}
$$->header_ = $2;
}
| score_body output_def {
- $$->defs_.push ($2);
+ if ($2->lookup_variable (ly_symbol2scm ("is-bookpaper")) = SCM_BOOL_T)
+ {
+ THIS->parser_error (_("\\bookpaper cannot be in \\score. Use \\paper instead"));
+
+ }
+ else
+ {
+ $$->defs_.push ($2);
+ }
scm_gc_unprotect_object ($2->self_scm ());
}
| score_body error {