definition_mods_ = SCM_EOL;
event_source_ = 0;
events_below_ = 0;
+ ancestor_lookup_ = SCM_UNDEFINED;
smobify_self ();
// The 'accepts elements in definition_mods_ is a list of ('accepts string),
// but the Context_def expects to see elements of the form ('accepts symbol).
SCM accepts = SCM_EOL;
- for (SCM s = scm_reverse (definition_mods_); scm_is_pair (s); s = scm_cdr (s))
+ for (SCM s = definition_mods_; scm_is_pair (s); s = scm_cdr (s))
if (scm_caar (s) == ly_symbol2scm ("accepts"))
{
SCM elt = scm_list_2 (scm_caar (s), scm_string_to_symbol (scm_cadar (s)));
return unsmob_context_def (definition_)->path_to_acceptable_context (name,
get_output_def (),
- accepts);
+ scm_reverse_x (accepts, SCM_EOL));
}
void
Context::internal_send_stream_event (SCM type, Input *origin, SCM props[])
{
- Stream_event *e = new Stream_event (type, origin);
+ Stream_event *e = new Stream_event (make_event_class (type), origin);
for (int i = 0; props[i]; i += 2)
{
e->set_property (props[i], props[i + 1]);
return 0;
}
+SCM
+Context::make_event_class (SCM event_type)
+{
+ if (SCM_UNBNDP (ancestor_lookup_))
+ ancestor_lookup_ = get_global_context ()->ancestor_lookup_;
+ return scm_hashq_ref (ancestor_lookup_, event_type, SCM_EOL);
+}
+
Output_def *
Context::get_output_def () const
{
if (me->events_below_)
scm_gc_mark (me->events_below_->self_scm ());
+ scm_gc_mark (me->ancestor_lookup_);
+
return me->properties_scm_;
}