Commit 579e5bd
committed
Split megatables with subtables into linear order
Because of megatables with subtables we've previously had to do a lot of
"flattening" so that table-parsing happens in a reasonable "human-readable
order": that is, parsing should not be depth-first or some kind of tree
traversing thing that handles things in an order where pieces of the whole
table are parsed out of order.
The last attempt actually stopped a bit early, because it was sufficient:
first parse the higher tables, then the subtables so that data from the
higher level tables can propagate down.
The trouble is (which was not relevant then, but is now with the new and
improved Swahili tables after the megatable monstrosity was pared down
something more manageable on Wiktionary) that the top level table is parsed
completely, and you could get garbage data from portions of it that were in
reading-order after a subtable.
+-------------------+
| Main Data 1 |
+--+-------------+--|
| | Subtable 1 |--|
+--+-------------+--|
| Main Data 2 |
+--+-------------+--|
| | Subtable 2 |--|
+--+-------------+--+
Main Data 1 and Main Data 2 would be parsed both before Subtable 1 and
Subtable 2, so if there is something that affects subtables in Main Data 2
(like the new "dummy-section-header" inflmap trigger) then Subtable 1 would
be affected by Main Data 2 when it shouldn't.
This has now been changed so that that the higher-level table is now
split into separate pieces:
[Main Data 1, Main Data 2], [Subtable 1], [Subtable 2]
=====>
[Main Data 1], [Subtable 1], [Main Data 2], [Subtable 2]
The split pieces of the higher-level table are parsed as new "tables", so
they get separate in the data with table-separator entries etc.1 parent 4a89c21 commit 579e5bd
1 file changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2748 | 2748 | | |
2749 | 2749 | | |
2750 | 2750 | | |
| 2751 | + | |
| 2752 | + | |
| 2753 | + | |
| 2754 | + | |
2751 | 2755 | | |
2752 | 2756 | | |
2753 | 2757 | | |
| |||
2839 | 2843 | | |
2840 | 2844 | | |
2841 | 2845 | | |
2842 | | - | |
2843 | 2846 | | |
2844 | | - | |
| 2847 | + | |
| 2848 | + | |
| 2849 | + | |
| 2850 | + | |
2845 | 2851 | | |
2846 | 2852 | | |
2847 | 2853 | | |
| |||
0 commit comments