// cooked_from_ is the value of alist_ from which the expansion has
// been done
SCM cooked_from_;
- // nested_ is a count of nested overrides in alist_
+ // nested_ is a count of nested overrides in alist_ Or rather: of
+ // entries that must not appear in the cooked list and are
+ // identified by having a "key" that is not a symbol. Temporary
+ // overrides and reverts also meet that description and have a
+ // nominal key of #t/#f and a value of the original cons cell.
int nested_;
Grob_properties (SCM alist, SCM based_on) :
{
if (scm_is_eq (scm_car (p), cell))
{
- if (scm_is_pair (scm_car (cell)))
+ if (!scm_is_symbol (key))
props_->nested_--;
props_->alist_ = partial_list_copy (current_alist, p, scm_cdr (p));
return;
SCM copied = SCM_EOL;
SCM partials = SCM_EOL;
// partials is a alist of partial overrides
- for (;;)
+ while (nested)
{
SCM elt = scm_car (nalist);
nalist = scm_cdr (nalist);
SCM key = scm_car (elt);
+ if (!scm_is_symbol (key))
+ --nested;
+ if (scm_is_bool (key))
+ {
+ if (scm_is_false (key))
+ continue;
+ elt = scm_cdr (elt);
+ key = scm_car (elt);
+ }
if (scm_is_pair (key))
// nested override: record for key in partial
{
partials);
else
scm_set_cdr_x (pair, scm_cons (elt, scm_cdr (pair)));
- if (!--nested)
- break;
+ continue;
}
- else
- // plain override: apply any known corresponding partials
+
+ // plain override: apply any known corresponding partials
+ SCM pair = assq_pop_x (key, &partials);
+ if (scm_is_true (pair))
{
- SCM pair = assq_pop_x (key, &partials);
- if (scm_is_true (pair))
- {
- SCM value = scm_cdr (elt);
- for (SCM pp = scm_cdr (pair); scm_is_pair (pp); pp = scm_cdr (pp))
- value = nested_property_alist (value, scm_cdaar (pp), scm_cdar (pp));
- copied = scm_acons (key, value, copied);
- }
- else
- copied = scm_cons (elt, copied);
+ SCM value = scm_cdr (elt);
+ for (SCM pp = scm_cdr (pair); scm_is_pair (pp); pp = scm_cdr (pp))
+ value = nested_property_alist (value, scm_cdaar (pp), scm_cdar (pp));
+ copied = scm_acons (key, value, copied);
}
+ else
+ copied = scm_cons (elt, copied);
}
// Now need to work off the remaining partials. All of them are
// unique, so we can push them to `copied' after resolving without