MCPcopy Index your code
hub / github.com/csev/py4e / iterateBidiSections

Function iterateBidiSections

tools/pythonauto/static/codemirror/codemirror.js:5818–5829  ·  view source on GitHub ↗
(order, from, to, f)

Source from the content-addressed store, hash-verified

5816 // BIDI HELPERS
5817
5818 function iterateBidiSections(order, from, to, f) {
5819 if (!order) return f(from, to, "ltr");
5820 var found = false;
5821 for (var i = 0; i < order.length; ++i) {
5822 var part = order[i];
5823 if (part.from < to && part.to > from || from == to && part.to == from) {
5824 f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr");
5825 found = true;
5826 }
5827 }
5828 if (!found) f(from, to, "ltr");
5829 }
5830
5831 function bidiLeft(part) { return part.level % 2 ? part.to : part.from; }
5832 function bidiRight(part) { return part.level % 2 ? part.from : part.to; }

Callers 1

drawForLineFunction · 0.70

Calls 1

fFunction · 0.50

Tested by

no test coverage detected