aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/ParsingException.cs
blob: 1b59698156b063766e02503197b3162c333a3c66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;

namespace Crow.Coding
{
	public class ParserException : Exception
	{
		public int Line;
		public int Column;
		public string Source;
		public ParserException(int line, int column, string txt, string source = null)
			: base(txt)
		{
			Line = line;
			Column = column;
			Source = source;
		}
		public ParserException(int line, int column, string txt, Exception innerException, string source = null)
			: base(txt, innerException)
		{
			Line = line;
			Column = column;
			Source = source;
		}
		public override string ToString ()
		{
			return string.Format("{3}:({0},{1}): {2}", Line, Column, Message, Source);
		}
	}
}