示例#1
0
        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;
        }
示例#2
0
 public static void CheckForParseErrors(SyntaxTree syntaxTree)
 {
     foreach (var diagnostic in syntaxTree.GetDiagnostics())
         Debug.WriteLine(diagnostic.ToString());
     Assert.That(syntaxTree.GetDiagnostics().Count(), Is.EqualTo(0));
 }
示例#3
0
 public void ClassifySyntax(SyntaxTree syntaxTree)
 {
     ClassifyNode(syntaxTree.Root);
 }