Hash :
a1e595e7
Author :
Date :
2025-04-11T11:13:25
rules: Fix merging KcCGST values in layout order
When using layout index ranges (e.g. special indexes “any” or “later”),
the rules still match following the order in the rules file, so layout
indexes may match without following their natural order. So the resulting
KcCGST value should not be merged with the output until reaching the end
of the rule set.
Because the rule set may also involve options, it may match multiple
times for the *same* layout index. So these multiple matches should not
be merged together either, until reaching the end of the rule set.
When reaching the end of the rule set, for each KcCGST component the
pending values are then merged: for each layout, for each KcCGST value
in the corresponding sequence, merge with the output.
---
Example:
! model = symbols
* = pc
! layout[any] option = symbols
C 1 = +c1:%i
C 2 = +c2:%i
B 3 = skip
B 4 = +b:%i
The result of RMLVO
{layout: "A,B,C", options: "4,3,2,1"}
is:
symbols = pc+b:2+c1:3+c2:3
- `skip` was dropped because it has no explicit merge mode;
- although every rule was matched in order, the resulting order of the
symbols follows the order of the layouts, so `+b` appears before `+c1`
and `+c2`.
- the relative order of the options for layout C follows the order
within the rule set, not the order of RMLVO.
Before this commit, the result would have been:
symbols = pc+c1:3+c2:3+b:2