1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5

6
namespace TurnerSoftware.RobotsExclusionTools.Tokenization
7
{
8
	public class TokenValidationResult
9
	{
10 1
		public bool IsValid { get; }
11 1
		public IEnumerable<TokenValidationError> Errors { get; }
12

13 1
		public TokenValidationResult(IEnumerable<TokenValidationError> errors)
14 1
		{
15 1
			Errors = errors;
16 1
			IsValid = !errors.Any();
17 1
		}
18
	}
19

20
	public class TokenValidationError
21
	{
22 0
		public int Line { get; }
23 0
		public string Message { get; }
24 1
		public IEnumerable<TokenType> Expected { get; }
25 1
		public IEnumerable<TokenType> Actual { get; }
26

27 1
		public TokenValidationError(int line, string message, IEnumerable<TokenType> expected, IEnumerable<TokenType> actual)
28 1
		{
29 1
			Line = line;
30 1
			Message = message;
31 1
			Expected = expected;
32 1
			Actual = actual.Take(Math.Min(actual.Count(), expected.Count())).ToArray();
33 1
		}
34
	}
35
}

Read our documentation on viewing source code .

Loading