public void forwardReferencing_ErrorDetectedCorrectly() { var parsingTask = _parsingPipeline.Process(new ParsingTask(TestDataResolver.LoadTestFile("forwardReferencing.ql"))); var ReferenceErrorExtractor = new ReferenceCheckingVisitor(); parsingTask.Ast.Accept(ReferenceErrorExtractor); Assert.AreEqual(1, ReferenceErrorExtractor.ReferencingErrors.Count); }
public ParsingTask Process(ParsingTask input) { var referenceErrorExtractor = new ReferenceCheckingVisitor(); input.Ast.Accept(referenceErrorExtractor); referenceErrorExtractor.ReferencingErrors.ForEach(x => input.Errors.Add(x.ToString())); return(input); }