generate method
Generates source code for binary matching.
Implementation
String generate() {
final normalized = normalizeRanges(ranges);
final map = <Range, bool>{};
for (var i = 0; i < normalized.length; i++) {
final range = normalized[i];
map[range] = true;
}
final branches = _BinarySearchBranchesBuilder(
callback: (entry) => 'true',
map: map,
name: name,
).build();
final source =
_BranchesToMatchExpressionConverter(branches: branches).convert();
return source;
}