Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmaxwell3 committed Sep 13, 2024
1 parent b74c63f commit 08751d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/SIL.Machine.Morphology.HermitCrab/Morpher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,7 @@ public IEnumerable<List<ShapeNode>> MatchNodesWithPattern(
// We fail because the pattern didn't match the node here.
return results;
// Make a copy of prefix to avoid crosstalk and add newNode.
prefix = new List<ShapeNode>(prefix)
{
newNode
};
prefix = new List<ShapeNode>(prefix) { newNode };
if (pattern[p].Annotation.Iterative)
// Try using this item in the pattern again.
results.AddRange(MatchNodesWithPattern(nodes, pattern, n + 1, p, true, prefix));
Expand Down
6 changes: 4 additions & 2 deletions tests/SIL.Machine.Morphology.HermitCrab.Tests/MorpherTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,13 @@ public void TestMatchNodesWithPattern()
starNode.Annotation.Optional = true;
starNode.Annotation.Iterative = true;
List<ShapeNode> starPattern = new List<ShapeNode> { starNode };
Assert.That(morpher.MatchNodesWithPattern(noNodes, starPattern),
Assert.That(
morpher.MatchNodesWithPattern(noNodes, starPattern),
Is.EquivalentTo(new List<List<ShapeNode>> { noNodes })
);
var result = morpher.MatchNodesWithPattern(oneNode, starPattern);
Assert.That(morpher.MatchNodesWithPattern(oneNode, starPattern),
Assert.That(
morpher.MatchNodesWithPattern(oneNode, starPattern),
Is.EquivalentTo(new List<List<ShapeNode>> { oneNode })
);
Assert.That(
Expand Down

0 comments on commit 08751d2

Please sign in to comment.