private static SyntaxTree Parse(SourceText sourceText, Func<UnityParser, SyntaxNode> parseFunc) { var lexer = new UnityLexer(sourceText); var parser = new UnityParser(lexer); var result = new SyntaxTree(sourceText, syntaxTree => parseFunc(parser)); Debug.WriteLine(DateTime.Now + " - Finished parsing"); return result; }
public static void CheckForParseErrors(SyntaxTree syntaxTree) { foreach (var diagnostic in syntaxTree.GetDiagnostics()) Debug.WriteLine(diagnostic.ToString()); Assert.That(syntaxTree.GetDiagnostics().Count(), Is.EqualTo(0)); }
public void ClassifySyntax(SyntaxTree syntaxTree) { ClassifyNode(syntaxTree.Root); }