Skip to content

Commit

Permalink
Update DecisionTree.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
LPeter1997 committed Oct 5, 2023
1 parent 031cace commit b3df53d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Draco.Compiler/Internal/FlowAnalysis/DecisionTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ private void Build(MutableNode node)
.ToHashSet(SpecializationComparer.Instance);

// Track if there are any uncovered values in this domain
// TODO
var uncoveredDomain = ValueDomain.CreateDomain(this.intrinsicSymbols, node.PatternMatrix[0][0].Type);

// Specialize for each of these cases
Expand Down Expand Up @@ -292,4 +291,12 @@ private static int FirstColumnWithRefutableEntry(MutableNode node)
BoundDiscardPattern => true,
_ => false,
};

private static ImmutableArray<BoundPattern>? TryExplode(BoundPattern specializer, BoundPattern toExplode) => (specializer, toExplode) switch
{
(BoundDiscardPattern, _) => throw new ArgumentOutOfRangeException(nameof(specializer)),
(BoundLiteralPattern, BoundDiscardPattern) => ImmutableArray<BoundPattern>.Empty,
(BoundLiteralPattern lit1, BoundLiteralPattern lit2) when Equals(lit1.Value, lit2.Value) => ImmutableArray<BoundPattern>.Empty,
_ => null,
};
}

0 comments on commit b3df53d

Please sign in to comment.