예제 #1
0
 private static void AddNullActualError(ErrorCollector collector, SyntaxTreeNode actual, SyntaxTreeNode expected)
 {
     collector.AddError("{0} - FAILED :: Actual: << Null >>", expected);
 }
예제 #2
0
 private static void AddPassedMessage(ErrorCollector collector, SyntaxTreeNode expected)
 {
     collector.AddMessage("{0} - PASSED", expected);
 }
예제 #3
0
 private static void AddMismatchError(ErrorCollector collector, SyntaxTreeNode actual, SyntaxTreeNode expected)
 {
     collector.AddError("{0} - FAILED :: Actual: {1}", expected, actual);
 }
예제 #4
0
        private static void EvaluateSyntaxTreeNode(ErrorCollector collector, SyntaxTreeNode actual, SyntaxTreeNode expected)
        {
            if (actual == null)
            {
                AddNullActualError(collector, actual, expected);
                return;
            }

            if (actual.IsBlock != expected.IsBlock)
            {
                AddMismatchError(collector, actual, expected);
            }
            else
            {
                if (expected.IsBlock)
                {
                    EvaluateBlock(collector, (Block)actual, (Block)expected);
                }
                else
                {
                    EvaluateSpan(collector, (Span)actual, (Span)expected);
                }
            }
        }