Exemplo n.º 1
0
        /// <summary>
        /// Visits the machine context of a test set
        /// </summary>
        /// <param name="plan">Test file plan</param>
        /// <param name="testSetPlan">TestSetPlan to visit</param>
        /// <param name="machineContext">machine context</param>
        private void VisitMachineContext(TestFilePlan plan, TestSetPlan testSetPlan, MachineContextNode machineContext)
        {
            if (machineContext == null)
            {
                return;
            }
            switch (machineContext.Id.ToUpper())
            {
            case "SPECTRUM48":
                testSetPlan.MachineType = MachineType.Spectrum48;
                return;

            case "SPECTRUM128":
                testSetPlan.MachineType = MachineType.Spectrum128;
                return;

            case "SPECTRUMP3":
                testSetPlan.MachineType = MachineType.SpectrumP3;
                return;

            case "NEXT":
                testSetPlan.MachineType = MachineType.Next;
                return;
            }
            ReportError(Errors.T0002, plan, machineContext.IdSpan);
        }
 /// <summary>
 /// Visits the test set
 /// </summary>
 /// <param name="line">Line to add the tag for</param>
 /// <param name="context">MachineContextNode to visit</param>
 /// <param name="lineNo">Current line numer</param>
 /// <param name="collectedSpans">Collection of spancs found</param>
 private void Visit(ITextSnapshotLine line, MachineContextNode context, int lineNo,
                    List <TagSpan <Z80TestTokenTag> > collectedSpans)
 {
     if (context == null ||
         lineNo < context.Span.StartLine ||
         lineNo > context.Span.EndLine)
     {
         return;
     }
     Visit(line, context.MachineKeywordSpan, lineNo, collectedSpans, Z80TestTokenType.Keyword);
     Visit(line, context.IdSpan, lineNo, collectedSpans, Z80TestTokenType.Identifier);
 }