It is one of the core pieces of Tangent though, and over all of its iterations, the implementation has gotten far cleaner and robust. This time though, things are broken up enough to make testing at least mildly sane:
[TestMethod]
public void ComplexExample() {
var parsedSource = Parser.Parse(
"test",
@"(param b:int) (T: kind of any) ++foo (c:string) bar baz (x:int)
:: module {};"
);
var analyzer = new TypeAnalysis_Accessor(
new List<TypeDefinition>() { parsedSource });
var anchor = analyzer.FindAnchorIn(parsedSource.Phrase);
var result = analyzer.DeterminePhraseOrder(
parsedSource.Phrase,
anchor.Value
);
Assert.IsTrue(
new List<int>() { 2,3,4,1,0,5,6,7,8 }
.SequenceEqual(result));
}
No comments:
Post a Comment