Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow returning parallel variants from addVariant or matchVariant callback functions #8455

Merged
merged 9 commits into from
May 31, 2022
Prev Previous commit
Next Next commit
add little warning regarding potential clashes
  • Loading branch information
RobinMalfait committed May 27, 2022
commit dae24b7f4ea0557fb476d1911be6990f9cbf6e77
4 changes: 4 additions & 0 deletions src/lib/generateRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ function applyVariant(variant, matches, context) {
// where you keep handling jobs until everything is done and each job can queue more
// jobs if needed.
variantFunctionTuples.push([
// TODO: This could have potential bugs if we shift the sort order from variant A far
// enough into the sort space of variant B. The chances are low, but if this happens
// then this might be the place too look at. One potential solution to this problem is
// reserving additional X places for these 'unknown' variants in between.
variantSort | BigInt(idx << ruleWithVariant.length),
variantFunction,
])
Expand Down