-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathParseException.cs
More file actions
30 lines (28 loc) · 1.05 KB
/
ParseException.cs
File metadata and controls
30 lines (28 loc) · 1.05 KB
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
namespace BytecodeApi.Lexer;
/// <summary>
/// The exception that is thrown when lexing fails.
/// </summary>
public sealed class ParseException : Exception
{
/// <summary>
/// Gets the one-based line number of the line at which lexing failed, or -1, if there is no line number in this context.
/// </summary>
public int LineNumber { get; }
/// <summary>
/// Initializes a new instance of the <see cref="ParseException" /> class.
/// </summary>
/// <param name="message">The message that describes the error.</param>
public ParseException(string message) : base(message)
{
LineNumber = -1;
}
/// <summary>
/// Initializes a new instance of the <see cref="ParseException" /> class.
/// </summary>
/// <param name="lineNumber">The one-based line number of the line at which lexing failed, or -1, if there is no line number in this context.</param>
/// <param name="message">The message that describes the error.</param>
public ParseException(int lineNumber, string message) : this(message)
{
LineNumber = lineNumber;
}
}