Split bidi-level-processing into preprocessing and line step
The bidirectional algorithm is a bit convoluted in this regard,
but the canonical choice for the implementation is to do
preprocessing on all paragraphs first (applying all rules up to
L1.3) and applying rule L1.4 separately.
The reason for this is that rule L1.4 requires the knowledge
about line break positions, which we don't have (yet). We could
take it as a parameter for the preprocessing-function, however,
line breaks may change often (think of an ncurses-context with
window resizes), making constant complete reprocessings very
wasteful.
Thus, the line-specific processing is put into a separate
function. This way, the user passes each individual line together
with its preprocessing data.
Rule L1.4 will be implemented in a later commit.
3 files changed